POST /quotes finds the best available DEX route when the origin and destination
chain IDs match, or a bridge route when they differ. It returns the transactions
needed to execute the quote. uatu prepares the route and calldata; your wallet signs
and broadcasts each transaction.
A quote does not reserve liquidity. Use it promptly and request a new one after its
deadline passes.
Request a quote
integer
required
Chain ID of the input token, for example
1 for Ethereum.integer
required
Chain ID of the output token. Use the same value as
originChainId for a swap
on one chain, or a different value to request a bridge route.string
required
Address of the token being sold on the origin chain.
string
required
Address of the token being received on the destination chain.
string
required
Amount of
tokenIn to sell, supplied as a decimal string in display units,
such as "1.5".string
required
Address that receives
tokenOut.integer
Maximum price movement you will accept, in basis points. If omitted, the
server default applies. See Slippage.
400 response. See
Errors for the response format.
Quote requests use originChainId and destinationChainId in place of chain and
chainId. The catalogue endpoints still use chainId as a query filter.
POST /quotes/routes accepts the same request fields, but both chain IDs must match.
Read the response
The quote is returned in the response’sdata object. These are the fields most
integrations use:
Amounts
Input and output amounts are each represented in two forms:
Keep both forms as strings. Token amounts can exceed JavaScript’s safe integer range,
and converting them to JSON numbers can silently lose precision.
Execute the steps
steps contains the transactions required to execute the quote. Depending on the
input token and its existing allowances, a quote can include token approval, Permit2
approval, and swap steps.
string
Human-readable description of the step, such as a token approval.
string
Address that initiates the transaction.
string
Exexuting address/contract.
string
encoded calldata for the transaction.
string
Native-token value to attach to the transaction, when required.
string
Amount moved or approved by the step, in the token’s smallest unit.
string
Contract receiving an allowance on approval steps, when provided.
integer
Chain on which the transaction must be submitted.
- the wallet is connected to the step’s
chainId; - the connected account matches
from; - the quote’s
deadlinehas not passed; and - the transaction includes
valuewhen one is provided.
Slippage
Pool prices can change between quote creation and execution.slippageBps controls
how much movement the swap accepts, where 100 basis points equals 1%.
The swap calldata enforces
amountOutMinimum. If the available output falls below
that value, the transaction reverts instead of completing at a worse price.
The default tolerance and maximum accepted value are configured per
deployment. A request above the configured maximum is rejected.
Expiration
Each quote includes adeadline Unix timestamp, currently set five minutes after the
quote is created. If the deadline has passed, discard the steps and request a fresh
quote.
Create your first quote
Request a quote and execute its transaction steps.