Skip to main content
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.
Missing, malformed, or incompatible values return a 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’s data 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.
Submit the steps in their returned order and wait for each transaction to confirm before submitting the next one. Before asking the user to sign, verify that:
  • the wallet is connected to the step’s chainId;
  • the connected account matches from;
  • the quote’s deadline has not passed; and
  • the transaction includes value when one is provided.
Treat every step as an untrusted transaction request: show the destination, value, and action to the user before signing. uatu never signs or broadcasts transactions.

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 a deadline Unix timestamp, currently set five minutes after the quote is created. If the deadline has passed, discard the steps and request a fresh quote.
Always read deadline from the response instead of hard-coding the quote lifetime.

Create your first quote

Request a quote and execute its transaction steps.