How it works
Functionality and how OpenOcean works under the hood

How OpenOcean finds the best prices

To get the best trade, it is crucial to access exchanges with the best prices and deep liquidity. OpenOcean helps users by searching several DEXes and CEXes for prices and liquidity, then splits the order into different routes to get the best trade.
DeFi has given rise to a lot of DEXes such as Uniswap and PancakeSwap. Each DEX has its own separate pools and liquidity that cannot conveniently be accessed at the same time. The problem is that each pool has different prices and not always deep enough liquidity to provide low slippage, especially when users are making large volume trades. The OpenOcean protocol solves this by sourcing, prioritizing/optimizing, and splitting liquidity routes across different DEXes to maximize overall returns on your trade.
Usually when making a trade on OpenOcean, the protocol will execute these three steps:
  1. 1.
    Price quotation from DEXes and CEXes
  2. 2.
    Optimize and find the best trading routes for the best price with low slippage
  3. 3.
    Communicate the prices to the user and execute trades

Protocol algorithms and smart contracts

The OpenOcean protocol consists of public smart contracts deployed on each aggregated public chain and proprietary technology such as discovery and routing algorithms. OpenOcean utilizes an optimized version of the Dijkstra algorithm (D-star) which then splits routing between different protocols for better transaction rates. This ensures that users get the best price on the market with less gas consumption and lower slippage.
  • Applies an optimizing algorithm based on Dijkstra and D-star to get the initial best route
  • Optimizes the routes based on machine learning using platform data
  • Offers the best price to users by comparing the prices on aggregated DEXes with the best price on CEXes
  • Protects user interests by subsidizing slippage losses with OOE tokens
  • Utilizes transparent pricing mechanisms without charging additional protocol transaction fees
The public smart contracts facilitate transactions between users and exchanges through an API, which is either accessed via the OpenOcean interface or the user’s API setup. The contracts include several inner contracts that each perform a specific function such as swap, price quote, route, calculate, optimize, and communicate with the algorithms.
Below are the public addresses:
ETH V1: 0x26d26b1a0243566d1cd38ff9afd5fd3f0fb6cbb4
ETH V2: 0x6352a56caadC4F1E25CD6c75970Fa768A3304e64 Arbitrum: 0x6352a56caadc4f1e25cd6c75970fa768a3304e64
BSC V1: 0x6679800c37e2f7eb072a7af3fb3b81b17a0af153
BSC V2:0x6352a56caadC4F1E25CD6c75970Fa768A3304e64
Polygon V1: 0x042AF448582d0a3cE3CFa5b65c2675e88610B18d
Polygon V2: 0x6352a56caadc4f1e25cd6c75970fa768a3304e64
Fantom V2: 0x6352a56caadC4F1E25CD6c75970Fa768A3304e64
Solana: 2mJZ38dRtFLyzwdAmWy5iZjeXkmERX5jJdWQ3Lo5JwBd
HECO: 0x6352a56caadC4F1E25CD6c75970Fa768A3304e64
At the time of writing, the protocol has implemented swap, manual arbitrage, liquidity mining, and governance. Automated arbitrage SaaS, combined margin pool, and cross-chain swap are currently in development.