What it offers
- swap: Execute aggregated swap via OpenOcean Exchange
Notes
- Same contract address across all 7 supported chains
- Route computation via OpenOcean API - calls parameter comes from API response
- Approve srcToken to exchangeV2 before swapping
- caller is typically msg.sender; srcReceiver receives tokens from the caller
Its names in a program
On Ethereum,Openocean is a namespace: its contracts need no import.
Deployments
ABI
OpenOceanExchangeV2ABI
import OpenOceanExchangeV2ABI from "./protocols/openocean/OpenOceanExchangeV2ABI.json"; Speaks for: exchangeV2.
swap(address caller, (address srcToken, address dstToken, address srcReceiver, address dstReceiver, uint256 amount, uint256 minReturnAmount, uint256 guaranteedAmount, uint256 flags, address referrer, bytes permit) desc, (uint256 target, uint256 gasLimit, uint256 value, bytes data)[] calls) payable returns (uint256 returnAmount)
Next steps
- Protocols: the other protocols, by what they do.
- Protocols and tokens: calling a contract by its namespace, or through its ABI.
- Glossary: the words these pages use, in plain terms.
