> For the complete documentation index, see [llms.txt](https://dirolprotocols-organization.gitbook.io/dirol/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dirolprotocols-organization.gitbook.io/dirol/api/overview.md).

# Overview

Integrate Dirol routing on Monad Mainnet.

### Dirol API

Use the Dirol API to price and execute swaps on **Monad Mainnet**.

**Base URL:** `https://api.dirol.io/api/v1`

**Chain ID:** `143`

**Aggregator contract:** [`0x646462f4d0168A94fE1884c8ae82148a3618A18d`](https://monadexplorer.com/address/0x646462f4d0168A94fE1884c8ae82148a3618A18d)

### Endpoints

* [`GET /quote`](/dirol/api/get-quote.md) returns the best route and expected output.
* [`GET /swap`](/dirol/api/get-swap.md) returns the best route and a ready-to-sign transaction.
* [`GET /tokens`](/dirol/api/tokens.md) returns supported tokens.
* [`GET /liquidity-sources`](/dirol/api/liquidity-sources.md) returns routing sources.

### Quick start

{% stepper %}
{% step %}

### Pick your tokens

Use `GET /tokens` to search by symbol or address.

You can also start with common pairs like `WMON` and `USDC`.
{% endstep %}

{% step %}

### Request a quote

Call `GET /quote` with `tokenIn`, `tokenOut`, and `amount`.

Use raw token units. `1 WMON` is `1000000000000000000`.
{% endstep %}

{% step %}

### Build the executable swap

Call `GET /swap` with the same inputs and add `recipient`.

The response includes `tx.to`, `tx.data`, `tx.value`, and `tx.estimatedGas`.
{% endstep %}

{% step %}

### Approve and send

Approve the aggregator for ERC-20 inputs before sending the transaction.

For native `MON`, use the `WMON` address as `tokenIn`, skip approval, and send `value = amountIn`.
{% endstep %}
{% endstepper %}

### Example quote request

```bash
curl "https://api.dirol.io/api/v1/quote?tokenIn=0x3bd359C1119dA7Da1D913D1C4D2B7c461115433A&tokenOut=0x754704Bc059F8C67012fEd69BC8A327a5aafb603&amount=1000000000000000000"
```

### Current liquidity sources

```json
{
  "sources": [
    { "id": "UniswapV2", "type": "V2" },
    { "id": "UniswapV3", "type": "V3" },
    { "id": "UniswapV4", "type": "V4" },
    { "id": "PancakeSwapV2", "type": "V2" },
    { "id": "PancakeSwapV3", "type": "V3" },
    { "id": "Purps", "type": "V2" },
    { "id": "DYOR", "type": "V2" },
    { "id": "SwyrlFinanceV2", "type": "V2" },
    { "id": "Kansei", "type": "V2" },
    { "id": "PinotV2", "type": "V2" },
    { "id": "Taya", "type": "V2" },
    { "id": "LFJ", "type": "V2" },
    { "id": "SwyrlFinanceV3", "type": "V3" },
    { "id": "MondayTrade", "type": "V3" },
    { "id": "OctoSwapV3", "type": "V3" },
    { "id": "PinotV3", "type": "V3" },
    { "id": "NoxaV3", "type": "V3" },
    { "id": "PangolinV3", "type": "V3" },
    { "id": "CapricornV3", "type": "V3" },
    { "id": "UniswapV4", "type": "V4" },
    { "id": "BalancerV3", "type": "Balancer" },
    { "id": "Kuru", "type": "CLOB" },
    { "id": "Hanji", "type": "CLOB" },
    { "id": "NadFun", "type": "BondingCurve" }
  ]
}

```

### Integration notes

* `slippageBps` defaults to `50`.
* `excludeSources` accepts comma-separated source IDs.
* `/quote` does not return calldata.
* No rate limits are enforced right now. Keep request volume reasonable.

See [Errors](/dirol/api/errors.md) for status codes and fixes.
