Compare routes
compare_routesCompare every route SwapChan found, ranked best-first by net USD received, across aggregators and bridges. Pass extra destination chains in alsoToChainIds to compare same-chain vs cross-chain outcomes side by side. Swap-chan lines up the whole cast. Result includes display markdown with chan images and a swapchan.com link: show it to the user. How to combine this with the other tools: swapchan_playbook (workflows: find-money, best-swap, rebalance, revoke-approvals, bridge-stuck, token-safety, recover-old-wallet).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"fromChainId": "<fromChainId>",
"toChainId": "<toChainId>",
"fromToken": "<fromToken>",
"toToken": "<toToken>"
},
"name": "compare_routes"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | No | Alias of `partner`. | |
| limit | No | ||
| amount | No | Human-readable amount of fromToken to sell, e.g. "1.5". Provide this OR amountBaseUnits. | |
| partner | No | Optional SwapChan partner/affiliate id (from swapchan.com/partners). Quotes are attributed to it and the swapUrl carries ?ref= so the partner earns 5 bp (half of SwapChan's fee). Agent builders: register via POST https://api.swapchan.com/partners with the operator's payout address. | |
| toToken | Yes | Token address. Native gas token: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE on EVM chains (ETH, POL...), 11111111111111111111111111111111 for SOL, bc1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqmql8k8 for BTC, T9yD14Nj9j7xAB4dbGeiX9h8unkKHxuWwb for TRX, ltc1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqp9ysmq for LTC, D596YFweJQuHY1BbjazZYmAbt8jJPbKehC for DOGE, qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqfnhks603 for BCH. SPL mints and TRC-20 addresses work as-is (e.g. Solana USDC EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v, Tron USDT TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t). | |
| fromToken | Yes | Token address. Native gas token: 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE on EVM chains (ETH, POL...), 11111111111111111111111111111111 for SOL, bc1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqmql8k8 for BTC, T9yD14Nj9j7xAB4dbGeiX9h8unkKHxuWwb for TRX, ltc1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqp9ysmq for LTC, D596YFweJQuHY1BbjazZYmAbt8jJPbKehC for DOGE, qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqfnhks603 for BCH. SPL mints and TRC-20 addresses work as-is (e.g. Solana USDC EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v, Tron USDT TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t). | |
| recipient | No | Address that receives the output on toChainId. Required for real execution when the destination is a different VM (e.g. EVM -> Solana/Bitcoin/Tron); omitted = indicative quote only. | |
| toChainId | Yes | Destination chain id. Same as fromChainId for a same-chain swap; different for a cross-chain route. | |
| fromChainId | Yes | Chain id: 1 Ethereum, 8453 Base, 42161 Arbitrum, 10 Optimism, 137 Polygon, 56 BNB Chain, 43114 Avalanche, 59144 Linea, 534352 Scroll, 792703809 Solana, 8253038 Bitcoin, 728126428 Tron, plus THORChain-only 2000000002 Litecoin, 2000000003 Dogecoin, 2000000145 Bitcoin Cash (either side, THORChain only; sending them needs the native coin and returns an unsigned PSBT on /build or a deposit address from POST /utxo/deposit with the required memo). Non-EVM chains route via Relay, LI.FI and THORChain. | |
| slippageBps | No | Max slippage in basis points (50 = 0.5%). Default 50, cap 300. | |
| alsoToChainIds | No | Extra destination chains to compare. toToken must then be valid on each (e.g. native token). | |
| amountBaseUnits | No | Exact amount in the token's smallest unit (wei). Provide this OR amount. |