Documentation Index
Fetch the complete documentation index at: https://docs.o1.exchange/llms.txt
Use this file to discover all available pages before exploring further.
The DEX Aggregator API is currently Base mainnet only (
chainId: 8453). Multi-chain support is on the roadmap.O1Router contract.
Multi-venue routing
Quotes pulled from Uniswap V2/V3/V4, Aerodrome, PancakeSwap, Curve, DODO, WooFi, Hydrex, and proprietary on-chain PMMs.
Split optimization
A convex solver allocates input across multiple paths when the marginal output beats a single-route quote.
Permit-enabled swaps
Optional EIP-2612 permit payload lets the router pull tokens in the same transaction as the swap, no separate approval needed.
How it works
POST /quote
Send
chainId, tokenIn, tokenOut, amountIn, and slippageBps. Receive a quoteId, an expectedAmountOut, and a routePlan describing which venues will be used.POST /submit
Echo the
quoteId plus the user’s wallet address. Receive { to, data, value }, ready to hand to any EVM signer.POST /execute collapses quote and submit into one call.
What you get
Atomic split routes
Up to 3 hops per route, multiple routes per swap. Slippage is checked per-leg and globally inside the router contract.
Native ETH support
Use
0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE (or the zero address) as the tokenIn / tokenOut to swap raw ETH; the router handles the wrap and unwrap automatically.Integrator fees
Pass
feeBps on the quote request to take a cut of the output. The fee is enforced inside the router contract, not the API.Architecture at a glance
The aggregator has three layers:- Routing engine —
packages/sdk/src/routerruns beam-search path finding plus split optimization. It calls a pool repository (live Codex queries by default) to fetch reserves and tick state. - HTTP API — exposed by Convex HTTP actions in production and a Fastify service for self-hosting. Handles auth, rate limiting, quote storage, and calldata assembly.
- On-chain layer —
O1Router.swapExactIn(...)dispatches each leg to a venue adapter, enforces slippage, and optionally wraps or unwraps native ETH.
docs/ALGORITHM.md in the source repo.
Choose your integration pattern
- Two-step (recommended for swap UIs)
- One-step (instant swap)
Next steps
Quickstart
Your first quote and swap in 30 lines of TypeScript.
Authentication
How to obtain and use an API key.
Endpoint reference
Request and response schemas for every endpoint.
Supported DEXes
The full list of venues in the routing graph.
