Every transaction the API produces calls the same canonical router contract on Base.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.
O1Router on Base
- Address:
0xe56e22354DDdc07cF2dfbCFb53a90fB0a56E50D5 - Chain ID:
8453 - Source:
contracts/src/O1Router.sol
This is the only address you should ever approve as a spender for swaps via this API. If a
/submit response returns a different to address, abort and report it.What it does
TheO1Router is a thin orchestrator that:
- Pulls
tokenInfrom the user (viatransferFromor, if apermitis supplied, viapermit + transferFromin the same tx). - Optionally wraps
msg.valueto WETH whenuseNativeInis set. - Dispatches each route leg to the corresponding venue adapter (Uniswap V2/V3/V4, Aerodrome, Pancake, Curve, DODO, WooFi, Hydrex, etc.).
- Aggregates outputs from all routes.
- Optionally unwraps WETH to native ETH when
unwrapNativeOutis set. - Sends final
tokenOutto the user. - Reverts if
actualOutput < minAmountOut(slippage check), per-leg or globally.
Public function signature
SwapParams is constructed by the API; you don’t need to encode it yourself. Just send submit.data as the data field of your transaction.
Slippage and safety
The router enforces three layers of protection:Per-leg minOut
Each leg has its own
minOut checked by the corresponding adapter.Global minAmountOut
The aggregate output is checked against
routePlan.minAmountOut. The whole tx reverts if it’s lower.Permit deadline
If a
permit payload is supplied, the EIP-712 deadline is enforced before the swap proceeds.Native wrapping
The router uses a configured wrapped-native token address. On Base that’s WETH at0x4200000000000000000000000000000000000006.
useNativeIn: true→ router callsWETH.deposit{value: msg.value}()before dispatching legs.unwrapNativeOut: true→ router callsWETH.withdraw(amount)after legs settle, then forwards ETH to the user.
Verifying on-chain
Before integrating, verify the deployment:- Contract is verified.
- Source matches
contracts/src/O1Router.solin the public repo. - Constructor args set
WETH, the fee recipient, and the venue adapter allowlist.
