Skip to main content
Without recipient, this returns a quote. With recipient, it also returns tx and swap: the quote and the transaction come from one request. The transaction is only returned after the route has been run through the executor at the quote block and delivered exactly the quoted output less the fee.

Headers

string
required
Bearer rk_.... Your partner key. Get one.
string
Optional trace ID, echoed back in the response header and in requestId.

Query parameters

address
required
Input token. Use 0x0000000000000000000000000000000000000000 for native ETH.
address
required
Output token. Use the zero address for native ETH.
string
required
Exact input amount in raw token units, as a decimal integer with no leading zeros.

Transaction parameters

These need a key with swap permission.
address
Address that receives the output. Setting it returns tx and swap. Cannot be the zero address.
integer
default:"50"
Allowed slippage from swap.netOut, 0 to 500.
string
Your own minimum output after fees, in raw units. Overrides slippageBps. Must not exceed swap.netOut.
integer
default:"now + 600"
Unix time in seconds. Must be between now and one hour from now.
Any other parameter returns 400.

Response

string
Trace ID for this request.
boolean
true when a route was found (and built, if requested).
string
Present when ok is false. See errors.
object
The block the quote is exact at: number and hash.
address
address
string
Input amount, raw units.
string
Output before the Route fee, raw units.
string
Estimated gas for the swaps.
string
Estimated gas cost, converted to output-token units.
string
amountOut − gasCostOut. A ranking figure; it does not include the Route fee.
object
Only with recipient. The unsigned transaction.
object
Only with recipient. The terms the transaction enforces.
object[]
The route, one entry per pool swap in execution order: pool, source, kind, tokenIn, tokenOut, amountIn, amountOut. Native ETH legs show WETH.

Examples

Response: 0.01 ETH to USDG, with transaction