# Quote API

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.

## Quote: `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.

**Parameters**

| Name | In | Type | Default | Allowed values |
|---|---|---|---|---|
| `chain` | query | string | required | `evm:56` (BSC), `solana`, `evm:8453` (Base), `evm:4663` (Robinhood Chain) or `evm:1` (Ethereum) |
| `tokenIn` | query | string | required | The token sold: an address or mint, or `native` (also KyberSwap's `0xeeee…`) |
| `tokenOut` | query | string | required | The token bought, likewise |
| `amountIn` | query | string | required | What is sold, in raw units |
| `maxHops` | query | integer | `3` | 1–4 |
| `onlySinglePath` | query | boolean | `false` | `true`: one path, never split |
| `onlyDirectPools` | query | boolean | `false` | `true`: pools holding both tokens only |
| `gasInclude` | query | boolean | `true` | `false`: rank routes by output alone, not output after gas |
| `includedSources` | query | string | all | Protocols to use, comma-separated: `uniswap-v3,aerodrome` |
| `excludedSources` | query | string | none | Protocols to leave out, comma-separated |

**Response**

| Field | Type | Meaning |
|---|---|---|
| `chain`, `tokenIn`, `amountIn`, `tokenOut` | string | The request, echoed, addresses in stored form. |
| `amountOut` | string | What the route pays, in raw units, before slippage: the pools' output at the state in each hop's `extra`. |
| `priceImpactBps` | number | How far `amountOut` is below what the same input would pay at the pools' current prices, in basis points. |
| `gas`, `gasPrice` | number | Gas 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[][]` | array | Parallel 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. |
| `pool` | string | The pool: an address, or a 32-byte id on Uniswap V4 and PancakeSwap Infinity; `poolType` `wrap` is the wrapped token's contract. |
| `tokenIn`, `tokenOut` | string | What this hop sells and buys. |
| `swapAmount`, `amountOut` | string | What goes into this hop and comes out of it, in raw units. A hop's `swapAmount` is the `amountOut` of the hop before it. |
| `exchange` | string | The protocol: `uniswap-v3`, `aerodrome`… |
| `poolType` | string | How 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). |
| `poolExtra` | object | The pool's facts as stated on chain, for building the call: fee tier, `tickSpacing`, `hooks`, `stable`, vault accounts on Solana. |
| `extra.zeroForOne` | boolean | Whether this hop sells the pool's token0. |
| `extra.feePpm` | number | The 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.preconfirmed` | boolean | That state comes from a block not sealed yet (a Solana transaction at `processed`, a Base flashblock). The seal replaces it. |
| `taxed` | string[] | Of `tokenIn` and `tokenOut`, those seen taking a tax on transfer: the amounts are what the pools pay, before that tax. |
| `block` | number | The latest sealed block the engine has for this chain. |
| `poolsPending` | number | Pools left out of this search because their liquidity is still being read from the chain. They were asked for, and join soon after. |
| `tookUs` | number | Microseconds the engine took. |

**Example** (captured 2026-11-05 14:51 UTC on a test instance)

```bash
curl -s -H 'Authorization: Bearer <key>' 'https://app.aurelia.build/api/quote?chain=evm:8453&tokenIn=0x4200000000000000000000000000000000000006&tokenOut=0x833589fcd6edb6e08f4c7c32d4f71b54bda02913&amountIn=1000000000000000000'
```

```json
{
  "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.
