Use the fdx call swapTokens command to swap between tokens via decentralized exchanges on any supported chain. Unlike centralized exchange swaps, these execute directly on-chain through DEX protocols.
If the wallet is not authenticated, refer to the authenticate skill.
| --chainKey | Yes | Blockchain to swap on (e.g. ethereum, polygon, base, solana) | | --tokenIn | Yes | Source token — symbol (e.g. USDC, ETH) or contract address | | --tokenOut | Yes | Destination token — symbol or contract address | | --amount | Yes | Amount of tokenIn to swap (human-readable) | | --mode | No | Swap mode (e.g. exact input, exact output) |
Swap or trade tokens via decentralized exchanges on any supported chain. Use when you or the user want to trade, swap, exchange, buy, sell, or convert between tokens like USDC, ETH, WETH, SOL, or any other token. Covers phrases like "buy ETH with USDC", "sell ETH for USDC", "convert USDC to ETH", "swap tokens", "get some ETH". Source: financedistrict-platform/fd-agent-wallet-skills.