How It Works
OpenOcean is a modular, high-performance aggregation layer connecting your application to the deepest liquidity across 40+ chains.
The Aggregation Pipeline
1. Aggregate
Connect to 1,000+ liquidity sources across all supported chains. This includes AMM, propAMM, RFQ, Staking Vault, Launchpad bonding curve etc.
2. Route
Compute the optimal swap path considering price, gas costs, and slippage. The routing engine evaluates thousands of possible paths in milliseconds.
3. Quote
Return the best price, estimated output amount, and transaction calldata. All quote responses include detailed routing information.
4. Execute
User signs the transaction and broadcasts to the network. The swap executes atomically on-chain with built-in slippage protection.
System Architecture
Client Layer
Your application interfaces with OpenOcean via REST API, TypeScript SDK, or embedded Widget. Choose the integration method that fits your needs.
Routing Engine
The core intelligence layer that handles path optimization and price discovery. It considers liquidity depth, gas efficiency, and execution success rates.
Liquidity Layer
500+ DEXs, AMMs, and RFQ providers including Uniswap, Curve, Balancer, and chain-specific protocols. New sources are added continuously.
Smart Order Routing
The routing engine evaluates thousands of possible paths in milliseconds. Key factors include:
- Price Discovery — Query all liquidity sources simultaneously to find the best rate.
- Split Routes — Distribute large orders across multiple DEXs when it improves execution.
- Gas Optimization — Factor in gas costs to calculate true output after fees.
- Multi-hop Routing — Find efficient paths through intermediate tokens when direct pairs lack liquidity.
Integration Flow
1 // 1. Get quote for best route 2 GET /v4/{chain}/quote?inToken=USDT&outToken=USDC&amount=1000 3
4 // 2. Get swap transaction data 5 GET /v4/{chain}/swap?inToken=USDT&outToken=USDC&amount=1000&account=0x... 6
7 // 3. User signs and broadcasts 8 // → Transaction executes on-chain