Aurelia

Swap quote and routing API

GET/quote

The route that pays most for a swap and its exact amounts, hop by hop, from every routable pool in memory. In KyberSwap's route shape: execute it through your own contract, or rebuild it your way.

A quote is a route and its amounts, and nothing here sends a transaction: run the route through your own contract, or rebuild it your way, and ask again right before you send.

Parameters

NameInTypeDefaultAllowed values
chainquerystringrequiredevm:56 (BSC), solana, evm:8453 (Base), evm:4663 (Robinhood Chain) or evm:1 (Ethereum)
tokenInquerystringrequiredThe token sold: an address or mint, or native (also KyberSwap's 0xeeee…)
tokenOutquerystringrequiredThe token bought, likewise
amountInquerystringrequiredWhat is sold, in raw units
maxHopsqueryinteger31–4
onlySinglePathquerybooleanfalsetrue: one path, never split
onlyDirectPoolsquerybooleanfalsetrue: pools holding both tokens only
gasIncludequerybooleantruefalse: rank routes by output alone, not output after gas
includedSourcesquerystringallProtocols to use, comma-separated: uniswap-v3,aerodrome
excludedSourcesquerystringnoneProtocols to leave out, comma-separated

Response

FieldTypeMeaning
chain, tokenIn, amountIn, tokenOutstringThe request, echoed, addresses in stored form.
amountOutstringWhat the route pays, in raw units, before slippage: the pools' output at the state in each hop's extra.
priceImpactBpsnumberHow far amountOut is below what the same input would pay at the pools' current prices, in basis points.
gas, gasPricenumberGas the route is estimated to use, and the median gas price of the latest block in wei. An estimate for ranking routes, not a limit to send with.
route[][]arrayParallel paths. Each is a list of hops executed in order, and the paths execute in the order given: each amount assumes the ones before it ran.
poolstringThe pool: an address, or a 32-byte id on Uniswap V4 and PancakeSwap Infinity; poolType wrap is the wrapped token's contract.
tokenIn, tokenOutstringWhat this hop sells and buys.
swapAmount, amountOutstringWhat goes into this hop and comes out of it, in raw units. A hop's swapAmount is the amountOut of the hop before it.
exchangestringThe protocol: uniswap-v3, aerodrome…
poolTypestringHow it prices: cpmm (constant product), clmm (concentrated liquidity), stable (Solidly's stable curve), curve (a launchpad's bonding curve), pumpswap, wrap (native and its wrapped token, one for one).
poolExtraobjectThe pool's facts as stated on chain, for building the call: fee tier, tickSpacing, hooks, stable, vault accounts on Solana.
extra.zeroForOnebooleanWhether this hop sells the pool's token0.
extra.feePpmnumberThe fee this hop pays, in millionths of what it sells.
extra.stateAt[number, number](block, position) of the pool state this hop was priced on.
extra.preconfirmedbooleanThat state comes from a block not sealed yet (a Solana transaction at processed, a Base flashblock). The seal replaces it.
taxedstring[]Of tokenIn and tokenOut, those seen taking a tax on transfer: the amounts are what the pools pay, before that tax.
blocknumberThe latest sealed block the engine has for this chain.
poolsPendingnumberPools left out of this search because their liquidity is still being read from the chain. They were asked for, and join soon after.
tookUsnumberMicroseconds the engine took.

Example

Captured 2026-11-05 14:51 UTC on a test instance.

curl -s -H 'Authorization: Bearer <key>' 'https://app.aurelia.build/api/quote?chain=evm:8453&tokenIn=0x4200000000000000000000000000000000000006&tokenOut=0x833589fcd6edb6e08f4c7c32d4f71b54bda02913&amountIn=1000000000000000000'
{
  "chain": "evm:8453",
  "tokenIn": "0x4200000000000000000000000000000000000006",
  "amountIn": "1000000000000000000",
  "tokenOut": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
  "amountOut": "2351321001",
  "priceImpactBps": 3,
  "gas": 358000,
  "gasPrice": 8543404,
  "route": [
    [
      {
        "pool": "0xb4cb800910b228ed3d0834cf79d697127bbb00e5",
        "tokenIn": "0x4200000000000000000000000000000000000006",
        "tokenOut": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
        "swapAmount": "600000000000000000",
        "amountOut": "1411004740",
        "exchange": "uniswap-v3",
        "poolType": "clmm",
        "poolExtra": {
          "fee": 100,
          "tickSpacing": 1
        },
        "extra": {
          "zeroForOne": true,
          "feePpm": 100,
          "stateAt": [
            53550484,
            745
          ],
          "preconfirmed": false
        }
      }
    ],
    [
      {
        "pool": "0xd0b53d9277642d899df5c87a3966a349a798f224",
        "tokenIn": "0x4200000000000000000000000000000000000006",
        "tokenOut": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
        "swapAmount": "400000000000000000",
        "amountOut": "940316261",
        "exchange": "uniswap-v3",
        "poolType": "clmm",
        "poolExtra": {
          "fee": 500,
          "tickSpacing": 10
        },
        "extra": {
          "zeroForOne": true,
          "feePpm": 500,
          "stateAt": [
            53550484,
            1123
          ],
          "preconfirmed": false
        }
      }
    ]
  ],
  "taxed": [],
  "block": 53550484,
  "poolsPending": 16,
  "tookUs": 548
}

Notes

  • A pool is quoted only if its amounts are exact: every protocol's math reproduces real swaps to the unit. Quoted today: Uniswap V2, V3 and V4, PancakeSwap V2, V3 and Infinity CL, SushiSwap V2 and V3, Aerodrome and Slipstream, pump.fun, PumpSwap, Raydium AMM v4 and LaunchLab, flap.sh, Genius and Frontier.
  • Pools that cannot be priced exactly yet are left out rather than estimated: Uniswap V4 pools whose hooks can change a swap's amounts or its fee (Clanker, Zora, Flaunch among them), PancakeSwap Infinity pools with a hook, Slipstream pools with dynamic fees, Raydium CPMM and CLMM, Orca, Meteora, four.meme, Virtuals and other forks. A token that trades only there has no route yet.
  • amountOut is what the pools pay. A token that takes a tax on transfer delivers less, and selling one puts less into the pool: taxed names those the index has seen doing so, and a route never stops at one along the way. Absence from taxed is no guarantee: a token can tax in ways its transfers do not show.
  • A quote is no promise either: other trades land first, so set your own minimum from it. It is good for about a block: ask again right before you send.
  • Executing a route: run its paths in order, and in each path its hops in order, each with the hop's swapAmount, at your own contract's slippage check. Every exchange is a plain call to its pool: nothing here depends on a router of ours. Amounts are for selling an exact input, so use the venue's instruction for that: on pump.fun buy_exact_sol_in, on PumpSwap buy_exact_quote_in.
  • The route is found over the two tokens, the chain's stablecoins and native token, its most connected tokens and each token's deepest pairs. A hop tries the deepest pools of its pair. A large order is sold in chunks, each taking the best path on the pools as the earlier chunks left them, and the split is kept only if it pays more after gas.
  • 400 for a missing or malformed parameter or the same token twice. 404 when there is no route, with error saying so; no route yet means its pools' liquidity is being read, so ask again shortly. 503 when the quote engine is unavailable.

Free to start: 10,000 credits, with no card and no subscription.

Try it in the interactive docsCreate a free account