
Bankr X402 SDK Token Swaps
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.
- GitHub stars
- 80
- last updated
- Aug 21, 2026
Install
$ npx -y skills add bankrbot/claude-plugins --skill 'Bankr x402 SDK - Token Swaps' --agent claude-codeInstalls into .claude/skills of the current project.
Files
SDK Token Swaps
Build and execute token swaps with AI-powered 0x routing.
Prompt Patterns
| 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"
ERC20 Approval Handling
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
Details
- Repository
- github.com/bankrbot/claude-plugins
- Categories
- Finance & Trading, Web3 & Blockchain
- First seen
- Jun 3, 2026
More from bankrbot/claude-plugins
All 36- Bankr X402 SDK Transaction Builder
- Bankr X402 SDK Wallet Operations
- Bankr Agent Agent Profiles
- Bankr Agent Arbitrary Transactions
- Bankr Agent Automation
- Bankr Agent Error Handling
- Bankr Agent Job Workflow
- Bankr Agent Leverage Trading
- Bankr Agent LLM Gateway
- Bankr Agent Market Research
- Bankr Agent NFT Operations
- Bankr Agent Polymarket
- Bankr Agent Portfolio
- Bankr Agent Token Deployment
- Bankr Agent Token Trading
- Bankr Agent Transfers
- Bankr Dev API Basics
- Bankr Dev API Workflow
- Bankr Dev Arbitrary Transactions
- Bankr Dev Automation
- Bankr Dev Client Patterns
- Bankr Dev Leverage Trading
- Bankr Dev Market Research
- Bankr Dev NFT Operations