Get swap route
Returns a swap route between two tokens, including amounts, path data, and optional transaction data.
Provide exactly one of amountIn (forward quote) or amountOut (reverse quote). When from equals to, the API switches to arbitrage detection mode.
Pass a sender address to receive a fully-built transaction object ready for signing, instead of raw txData.
Query Parameters
Input token identifier (e.g., WEGLD-bd4d79).
Output token identifier (e.g., USDC-c76f1f).
Amount to swap in smallest units. Returns maximum achievable output. Mutually exclusive with amountOut.
Desired output amount in smallest units. Returns required input. Mutually exclusive with amountIn.
Slippage tolerance as a decimal (0.01 = 1%).
Maximum number of route splits for the optimizer.
Maximum swaps per individual route path.
Include detailed path breakdown in response. Set to true when you need route details; defaults to false to reduce response size.
Split allocation algorithm. greedy allocates chunks by marginal output, lagrangian balances marginal rates across convex AMM paths, and hybrid runs both and returns the larger output.
greedy, lagrangian, hybrid Sender bech32 address. When provided, the API returns a complete transaction object ready for signing (fetches nonce, simulates gas).
Referral ID for fee sharing.
Cap on smart contract calls per transaction (gas optimization).
Allow LP tokens as intermediate hops. Auto-enabled when from or to is an LP token.
Arbitrage mode only: when true, applies stricter profitability filters. Set to false for a broader but noisier cycle search. Only used when from equals to.
Response
Swap route found.
Swap route and execution details.
Input token identifier.
Output token identifier.
Input amount in smallest units.
Output amount in smallest units.
Human-readable input amount (divided by token decimals).
Human-readable output amount.
Minimum output after slippage, in smallest units. Present for forward quotes.
Human-readable minimum output. Present for forward quotes.
Maximum input after slippage, in smallest units. Present for reverse quotes only.
Human-readable maximum input. Present for reverse quotes only.
USD value of input amount. Omitted if price unavailable.
USD value of output amount. Omitted if price unavailable.
USD value of minimum output after slippage. Omitted if price unavailable.
Applied slippage tolerance.
Estimated price impact as a decimal (0.01 = 1%).
Exchange rate: output units per input unit.
Inverse rate: input units per output unit.
Detailed route breakdown. Present when includePaths=true.
Hex-encoded transaction data for the aggregator endpoint call. Omitted when transaction is present.
Protocol fee in basis points.
Fee amount in smallest units.
Human-readable fee amount.
Token identifier the fee is charged on.
Complete transaction ready for signing. Present only when sender is provided.
Arbitrage metadata. Present only for same-token (from == to) forward quotes.

