API
1.Create DCA order
POST https://open-api.openocean.finance/v2/:chainId/dca/swap
Path Parameters
Example
url:
https://open-api.openocean.finance/v2/8453/dca/swapbody
{
"makerAmount": "20000000", // total amount with decimals,there's min.amt requirements for each swap set.
"signature": "0x37e6...", // user sign messagae,wallet.signMessage(message)
"orderMaker": "0xB3cb...",// wallet address
"makerAsset": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913", // token address
"takerAsset": "0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA", // token address
"time": 300, // interval time, s
"times": 2, // frequency
"minPrice": "0.9", // optional, price range
"maxPrice": "1.1", // optional, price range
"referrer": "0xxxxxxxxxxxxxxxxxxx", // optional. It's the EOA address to set up fees and track data from your end.
"referrerFee": "1", // optional. "1"=1%. Enter the num to charge the platform fee on your end. The range will be 0-5%
"enabledDexIds":"", // optional. Enter the 'index' number of dexs through dexList. P.S. enableDexIds has higher priority compared with disabledDexIds
"disabledDexIds":"12,49,51,52", // optional. Enter the 'index' number of dexs through dexList endpoint to disable single or multiple dexs separated by commas, e.g. disabledDexIds: "2,6,9".
}response
2.Cancel DCA order
POST https://open-api.openocean.finance/v2/:chainId/dca/cancel
Path Parameters
chainId*
number
8453, 146, 80094,1,999
Request Body
orderHash*
string
orderHash from response
signature*
string
signature orderHash
Example
url:
https://open-api.openocean.finance/v2/8453/dca/cancelbody
response
3.Get DCA order by address
GET https://open-api.openocean.finance/v2/:chainId/dca/address/:address
Path Parameters
chainId*
number
8453, 146, 80094,1,999
address*
string
wallet address
Query Parameters
statuses
array
status code: 1-unfill, 3-cancel, 4-filled, 5-pending, 6- hash not exist, 7-expire, default [1,3,4]
limit
number
limit count
4.Get all chain DCA order by address
GET https://open-api.openocean.finance/v2/dca/address/:address
Path Parameters
address*
string
wallet address
Query Parameters
statuses
array
status code: 1-unfill, 3-cancel, 4-filled, 5-pending, 6- hash not exist, 7-expire, default [1,3,4]
limit
number
limit count
5.Get DCA order execution details
GET https://open-api.openocean.finance/v2/:chainId/dca/fill/:orderHash
Path Parameters
chainId
number
8453, 146, 80094,1,999
orderHash
string
order hash
Last updated