SDK
OpenOcean SDK Overview
The OpenOcean SDK provides a type-safe, modular interface for integrating DEX aggregation into your applications.
GitHub: openocean-api
Key Features
- Multi-chain support — Connect to 40+ chains including Ethereum, BSC, Polygon, Avalanche, and more
- Best price routing — Access OpenOcean's intelligent routing engine for optimal swap rates
- Wallet integration — Built-in support for MetaMask, TrustWallet, Coin98, and other popular wallets
- Type-safe API — Full TypeScript support with comprehensive type definitions
- Modular design — Use only the features you need: API calls, swap execution, or wallet management
SDK Modules
The SDK exposes three main modules:
api
REST API wrapper for quotes, token lists, gas prices, and balances.
swapSdk
Transaction building and execution: connect wallet, approve tokens, and swap.
config
Chain and wallet configurations, including supported networks and wallet providers.
Typical Workflow
- Choose a chain (e.g., BSC, Ethereum, Polygon)
- Connect your wallet
- Select the token pair
- Input the amount you want to trade
- Get a quote and execute the swap