Get Dex Quote
get_dex_quoteGet the best Uniswap v3 swap quote on Ethereum (chain_id=1) or Base (chain_id=8453) via direct on-chain QuoterV2 calls. Queries all four fee tiers (100/500/3000/10000 bps) in parallel and returns the tier with the highest output amount, along with per-tier breakdown. Inputs are raw uint256 amounts and EIP-55 checksummed addresses; native ETH is not quoted directly — pass the WETH address. Returns no_liquidity=true when no pool exists for the pair. Point-in-time quote at the returned block_number; do not cache.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chain_id | No | 1 = Ethereum mainnet, 8453 = Base mainnet. Other chains unsupported. | |
| token_in | Yes | EIP-55 checksummed address of the token being sold. For native ETH, pass the WETH address (Ethereum: 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; Base: 0x4200000000000000000000000000000000000006). | |
| amount_in | Yes | Input amount in RAW uint256 units (e.g. '1000000' for 1 USDC, '1000000000000000000' for 1 WETH). Must be > 0 and < 2^128. Common token decimals: WETH/ETH/DAI/wstETH/cbETH/weETH 18, WBTC/cbBTC 8, USDC/USDT 6. Do not call read_contract to look up decimals — use these values directly. | |
| token_out | Yes | EIP-55 checksummed address of the token being bought. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chain_id | Yes | ||
| token_in | Yes | ||
| amount_in | Yes | ||
| token_out | Yes | ||
| amount_out | Yes | ||
| block_number | Yes | ||
| no_liquidity | Yes | ||
| fee_tier_used | Yes | ||
| effective_rate | Yes | ||
| quotes_per_tier | Yes | ||
| amount_out_human | Yes | ||
| amount_in_decimals | Yes | ||
| amount_out_decimals | Yes |