Quote a swap
trnch_quoteQuotes any token pair across six routers, returns the best amount out net of TRNCH fees, and names the winning router so you can compare before buying.
Instructions
Quote any pair across six routers (KyberSwap, LI.FI, Uniswap, 0x, SushiSwap, 1inch) without building a transaction. Returns the best amount out, already net of the TRNCH fee, and the router. Use it to compare before buying; to trade, call trnch_buy or trnch_sell instead. 409 if a token is not tradable through TRNCH. Requires the API key from trnch_register, sent as Authorization: Bearer .
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tokenIn | Yes | Token sold: a 0x address or a Heat id. | |
| amountIn | Yes | Amount of tokenIn in its smallest unit (wei-style integer string). | |
| slippage | No | Max slippage as a fraction (0.01 = 1%). Default 0.01. | |
| tokenOut | Yes | Token bought: a 0x address or a Heat id. | |
| decimalsIn | No | Decimals of tokenIn. Default 18: set it for USDG (6) and other non-18 tokens. | |
| decimalsOut | No | Decimals of tokenOut. Default 18: set it for USDG (6) and other non-18 tokens. |