get_quote
Best route and expected output for selling a specific amount of one token for another on one chain, priced from the pools LCX Liberty DEX indexes itself. Use it for what an amount would swap for; use get_price for a token's value, and search_tokens first to turn a ticker into an address. Read-only: it never executes a trade. Returns output.amount and output.minimumAmount (at 0.5% slippage) in tokenOut's base units, with output.decimals to scale them; priceImpactPct, gasFeeUSD, the venues and the per-hop routes; and blockNumber and expiresAt, since a quote is priced at one block and lives 120 seconds. When there is no quote, the result is an error that says why: no route between the two tokens, or liquidity too thin for this size, usually naming a size that would fill.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| amount | Yes | Positive human amount of tokenIn to sell, e.g. "1.5". Scaled by the token's own decimals, which the server knows: do not send decimals. | |
| chainId | Yes | 1 Ethereum, 8453 Base, 42161 Arbitrum One, 10 OP Mainnet, 4663 Robinhood Chain, 56 BNB Chain, 137 Polygon, 43114 Avalanche, 130 Unichain, 143 Monad, 5042 Arc, 999 HyperEVM | |
| tokenIn | Yes | Sell token address. Use the zero address for native ETH. | |
| decimals | No | Optional, and best left out. Only for a token the index holds no decimals for; a value that disagrees with the token's own is refused (decimals_mismatch). | |
| tokenOut | Yes | Buy token address. |