
This is a Claude skill that lets you execute token swaps using the 0x protocol through natural language. You can swap by amount ("0.1 ETH to USDC"), dollar value ("buy $100 of DEGEN"), percentage of holdings, or just tell it to sell everything. It handles cross-chain swaps too, so you can specify Polygon or other networks. The prompt patterns are straightforward and the AI routing happens behind the scenes. Useful if you're building trading bots or want to let users swap tokens conversationally without writing swap logic yourself. The repo has 78 stars, so it's got some traction but isn't battle tested at scale yet.
$ npx -y skills add bankrbot/claude-plugins --skill "Bankr x402 SDK - Token Swaps" --agent claude-codeInstalls into .claude/skills of the current project.
Build and execute token swaps with AI-powered 0x routing.
| Pattern | Example |
|---|---|
| Amount-based | "Swap 0.1 ETH to USDC" |
| Value-based | "Buy $100 worth of DEGEN" |
| Percentage | "Swap 50% of my ETH to USDC" |
| Sell all | "Sell all my DEGEN" |
| Chain-specific | "Swap ETH to USDC on Polygon" |
# Amount Swaps
"Swap 0.1 ETH to USDC"
"Exchange 100 USDC for WETH"
"Swap 1000 DEGEN to ETH"
# Value Swaps
"Buy $100 worth of DEGEN"
"Purchase $50 of ETH"
# Percentage Swaps
"Swap 50% of my ETH to USDC"
"Sell 25% of my DEGEN"
# Chain-Specific
"Swap 0.1 ETH to USDC on Base"
"Exchange 100 USDC for WETH on Ethereum"
For ERC20 swaps (selling tokens other than ETH), approval is required before the swap.
const result = await client.promptAndWait({
prompt: "Swap 100 USDC to WETH",
});
const swapTx = result.transactions?.find(tx => tx.type === "swap");
// Check if approval is needed
if (swapTx?.metadata.approvalRequired) {
// Execute pre-built approval transaction first
await wallet.sendTransaction(swapTx.metadata.approvalTx);
}
Sponsors