Type: DEX Aggregator | Docs: docs.openocean.finance
Overview
OpenOcean is a DEX aggregator that sources liquidity from all major DEXes on Monad to find the optimal swap route. The SDK integrates the OpenOcean REST API (https://open-api.openocean.finance/v4/monad) - no on-chain quote calls are needed. OpenOcean supports both single-path and multi-path split routing.
If the OpenOcean API is unavailable or returns an error, functions gracefully degrade:
getOpenOceanQuote returns amountOut: 0 and isOpenOceanAvailable returns false. Always check availability before building swap UIs.Functions
getOpenOceanQuote()
Returns an optimized swap quote via the OpenOcean routing API. Parameters
Returns
getOpenOceanPrice()
Returns the current spot price for a token pair via OpenOcean. Parameters
Returns
number. price of tokenIn in units of tokenOut. Returns 0 if API is unavailable.
isOpenOceanAvailable()
Checks whether the OpenOcean API is reachable on Monad. Returnsboolean. true if the API is live and responding.