> ## Documentation Index
> Fetch the complete documentation index at: https://docs.uatu.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Go from zero to an executable swap quote.

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](/self-hosting/configuration).

## 1. Find a chain

Start with the catalogue. `GET /blockchains` returns every chain uatu knows about,
each with its embedded token and DEX definitions.

```sh theme={null}
curl https://api.uatu.dev/blockchains
```

Responses are wrapped in a standard envelope:

```json theme={null}
{
  "code": 200,
  "message": "Blockchains fetched successfully",
  "data": [
    {
      "name": "Ethereum",
      "slug": "ethereum",
      "chainId": 1,
      "symbol": "ETH",
      "nativeToken": "ETH",
      "ecosystem": "evm",
      "blockExplorer": "https://etherscan.io",
      "tokens": [],
      "dex": []
    }
  ]
}
```

## 2. Find the tokens

Pull the tokens for that chain. Omitting `chainId` lists tokens across every chain.

```sh theme={null}
curl "https://api.uatu.dev/blockchains/tokens?chainId=1"
```

```json theme={null}
{
  "name": "Wrapped Ether",
  "symbol": "WETH",
  "address": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
  "decimals": 18,
  "slug": "weth"
}
```

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.

```sh theme={null}
curl "https://api.uatu.dev/blockchains/pools?chainId=1&dex=uniswap"
```

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.

```sh theme={null}
curl -X POST https://api.uatu.dev/quotes \
  -H "Content-Type: application/json" \
  -d '{
    "chain": "ethereum",
    "chainId": 1,
    "tokenIn": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
    "tokenOut": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
    "amount": "1.5",
    "recipientAddress": "0xYourRecipientAddress"
  }'
```

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](/concepts/quotes). The part your client acts on is
`steps`, an ordered list of transactions to submit, typically a Permit2 approval
followed by the swap itself.

```json theme={null}
{
  "quoteId": "…",
  "amountIn": "1500000000000000000",
  "amountOut": "5432100000",
  "amountInFloat": "1.5",
  "amountOutFloat": "5432.1",
  "route": { "dex": "uniswap", "name": "Uniswap", "fees": "…" },
  "steps": [
    {
      "message": "approve",
      "from": "0x…",
      "to": "0x…",
      "spender": "0x…",
      "amount": "…",
      "data": "0x…",
      "chainId": 1
    }
  ],
  "deadline": 1755400000,
  "status": "pending"
}
```

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.

```sh theme={null}
curl -X POST https://api.uatu.dev/quotes/routes \
  -H "Content-Type: application/json" \
  -d '{
    "chain": "ethereum",
    "chainId": 1,
    "tokenIn": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
    "tokenOut": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
    "amount": "1.5",
    "recipientAddress": "0xYourRecipientAddress"
  }'
```

<Card title="Full API reference" icon="code" href="/api-reference">
  Every parameter and response schema, generated from the service's OpenAPI spec.
</Card>
