dex-swap-quote
Get best-route DEX swap quotes across 20+ chains. Returns expected output, exchange rate, gas cost, and price impact for same-chain or cross-chain swaps.
Instructions
Best-route DEX swap quote across 20+ chains via Li.Fi aggregator. Returns expected output, exchange rate, gas cost, price impact, and route (DEX/bridge names). Works for same-chain and cross-chain swaps. Use ETH/USDC/WBTC symbols or ERC-20 addresses. Chains: ethereum, base, polygon, arbitrum, optimism, bsc, avalanche, and more. $0.012/call — free upstream.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| from_chain | No | Source chain — name (ethereum, base, polygon, arbitrum, optimism, bsc, avalanche) or chain ID integer. | |
| to_chain | No | Destination chain. Same as from_chain for same-chain swaps. Use chain name or ID. | |
| from_token | No | Source token — symbol (ETH, USDC, WBTC, USDT, MATIC, LINK) or ERC-20 contract address. | |
| to_token | No | Destination token — symbol or ERC-20 contract address. | |
| from_amount | No | Amount of source token to swap, in human-readable units (e.g. '0.1' for 0.1 ETH, '100' for 100 USDC). For unknown tokens, provide wei/smallest-unit string with '!' prefix (e.g. '!1000000'). | |
| slippage | No | Max slippage tolerance as a decimal (0.005 = 0.5%). Default 0.03 (3%). |