POST /quotes
resolves the pools for a token pair on a chain, prices the swap against each DEX’s
on-chain contracts concurrently, picks the best output, and persists the result with
a pending status.
The request
string
required
Chain slug, for example
ethereum.integer
required
EVM chain ID. Must agree with
chain.string
required
Contract address of the token being sold.
string
required
Contract address of the token being bought.
string
required
Amount of
tokenIn to swap, as a decimal string in display units.string
required
Address that receives
tokenOut.400
rather than reverting downstream.
Amounts come in two forms
Each side of the swap is reported twice:
Use the integer form for anything you send on-chain. Use the float form for display.
Both are strings, since these values exceed what a JSON number can hold safely.
Steps
steps is the executable part of the quote: an ordered list of transactions your
client submits with its own signer. A swap typically needs a Permit2 approval before
the swap call itself.
string
What this step does, for example
approve.string
Address that must send the transaction.
string
Contract the transaction targets.
string
ABI-encoded calldata.
string
Address being granted an allowance, on approval steps.
string
Native value to attach, when the input token is the chain’s native asset.
string
Amount this step moves or approves, in the token’s smallest unit.
integer
Chain the transaction belongs to.
Deadlines
Every quote carries adeadline, a Unix timestamp set one minute after the quote
is created. Past it the pricing is stale, so re-request the quote instead of
submitting its steps.
Status
A persisted quote carries astatus of pending, completed or failed, and gains
hash and explorerUrl once a transaction is associated with it.
Identity fields
quoteId identifies the persisted quote. originChain / originChainId and
destinationChain / destinationChainId record both sides of the route; for a
same-chain swap they match. pairAddress is the pool the swap was priced against.