Token swap

From TermiX-official/cryptoclaw · View interactive version

Token swap is an AI agent skill from the GitHub repository TermiX-official/cryptoclaw. Execute token swaps on Uniswap/PancakeSwap across multiple EVM chains.

How to use this skill

Skill file

Token Swap Skill

Execute token swaps on Uniswap (V2/V3) and PancakeSwap (V2/V3) across multiple EVM chains.

Overview

Swap tokens using dedicated DEX tools that automatically compare V2 and V3 quotes to find the best price. Uses the active wallet for signing transactions.

Supported DEXes

Tools Used

Workflow

  1. User requests a swap → call swap_get_quote with tokenIn, tokenOut, amountIn
  2. Present quote: input amount, estimated output, minimum output, slippage, DEX name, version
  3. If price impact is high or slippage > 1%, warn the user
  4. Ask user for explicit confirmation before proceeding
  5. Call swap_execute with same parameters

Security Rules

V3 Fee Tiers

When using V3, the fee tier affects which liquidity pool is used:

The tool auto-selects the best fee tier by default.

Example Interactions

User: "Swap 1 BNB for USDT on BSC"

→ Call swap_get_quote with tokenIn="native", tokenOut="0x55d398326f99059fF775485246999027B3197955", amountIn="1"

→ Show: "PancakeSwap V3: 1 BNB → ~590.23 USDT (min: 587.28 USDT, 0.5% slippage)"

→ After confirmation: call swap_execute

User: "What would I get for swapping 100 USDT to ETH on Ethereum?"

→ Call swap_get_quote only, display result without executing

User: "What DEXes work on Arbitrum?"

→ Call swap_supported_dexes with network="arbitrum"

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.