Skip to main content
This walks through the catalogue endpoints to find something swappable, then asks for a quote and reads the transactions it returns. The hosted API is at https://api.uatu.dev. Every example below uses it. Swap in your own address if you’re running your own instance.

1. Find a chain

Start with the catalogue. GET /blockchains returns every chain uatu knows about, each with its embedded token and DEX definitions.
Responses are wrapped in a standard envelope:

2. Find the tokens

Pull the tokens for that chain. Omitting chainId lists tokens across every chain.
Note each token’s address and decimals. You need the address for the quote request, and the decimals to interpret the amounts that come back.

3. Check there’s liquidity

Pools are what actually get priced. chainId is required here; dex is optional and narrows results to a single DEX slug.
If a pair has no pool on a chain, a quote for it will fail, because the seeder only persists pools it found on-chain.

4. Request a quote

POST /quotes prices the swap across every known pool for the pair and returns the best route.
All six fields are required. amount is a decimal string in the input token’s display units, not its smallest unit.

5. Execute the steps

The data payload is a quote. The part your client acts on is steps, an ordered list of transactions to submit, typically a Permit2 approval followed by the swap itself.
Submit each step in order with your own signer. Respect deadline: it is a Unix timestamp after which the quote is stale and should be re-requested.

Compare routes first

To see the options before committing, POST /quotes/routes takes the same request body and returns every valid route ordered by output amount, without persisting a quote.

Full API reference

Every parameter and response schema, generated from the service’s OpenAPI spec.