DCA API
Reference for DCA API endpoints. View Github examples for Backend and Frontend. Use Swagger UI for full request/response schemas.
1.Create DCA order
POST https://open-api.openocean.finance/v2/:chainId/dca/swap
Path Parameters
| Name | Type | Description |
|---|---|---|
| chainId * | number | 8453, 146, 80094, 1, 999 — Chain name or Chain ID (supported chains) |
Example
url: https://open-api.openocean.finance/v2/8453/dca/swap
body:
1 { 2 "makerAmount": "20000000", // total amount with decimals, there's min. amt requirements for each swap set. 3 "signature": "0x37e6...", // user sign message, wallet.signMessage(message) 4 "orderMaker": "0xB3cb...", // wallet address 5 "makerAsset": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913", // token address 6 "takerAsset": "0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA", // token address 7 "time": 300, // interval time, s 8 "times": 2, // frequency 9 "minPrice": "0.9", // optional, price range 10 "maxPrice": "1.1", // optional, price range 11 "referrer": "0xxxxxxxxxxxxxxxxxxx", // optional. EOA address to set up fees and track data from your end. 12 "referrerFee": "1", // optional. "1"=1%. Platform fee on your end. Range 0-5% 13 "enabledDexIds": "", // optional. 'index' from dexList. enabledDexIds has higher priority than disabledDexIds 14 "disabledDexIds": "12,49,51,52" // optional. 'index' from dexList to disable, comma-separated e.g. "2,6,9" 15 }
Platform fee
If you are willing to set a platform fee on your end, you could include the params of referrer and referrerFee shown in the example above.
referrer is an EOA address to add. It is used to collect the fee you charged. Meanwhile, it could help us to track data flow from your end.
referrerFee is the number set to charge, e.g. "1" is equal to "1%". OpenOcean will take 20% of the platform fee as default. If you are not willing to charge, you could either set it as 0 or not include the params.
Min amount and interval
Please note there's a min. required amount for the supported chains below, per transaction:
- Ethereum: at least $30
- Other EVM Chains: at least $5
E.g. If you set times (frequency) as 2, makerAmount must be at least $10 to ensure each swap is executed over $5.
Time interval must be at least 60s.
response
1 { 2 code: 200 3 }
2.Cancel DCA order
POST https://open-api.openocean.finance/v2/:chainId/dca/cancel
Path Parameters
| Name | Type | Description |
|---|---|---|
| chainId * | number | 8453, 146, 80094, 1, 999 |
Request Body
| Name | Type | Description |
|---|---|---|
| orderHash * | string | orderHash from response |
| signature * | string | signature orderHash |
Example
url: https://open-api.openocean.finance/v2/8453/dca/cancel
body:
1 { 2 "orderHash": "0x1e48...", 3 "signature": "0xy23d43..." 4 }
response
1 { 2 code: 200, 3 }
3.Get DCA order by address
GET https://open-api.openocean.finance/v2/:chainId/dca/address/:address
Path Parameters
| Name | Type | Description |
|---|---|---|
| chainId * | number | 8453, 146, 80094, 1, 999 |
| address * | string | wallet address |
Query Parameters
| Name | Type | Description |
|---|---|---|
| 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 |
200 OK
1 { 2 "code": 200, 3 "data": [ 4 { 5 "chainId": 8453, 6 "makerAmount": "100000000", 7 "takerAmount": "200000000000000000000", 8 "orderHash": "0x......", 9 "createDateTime": "2025-04-09T00:19:52.000Z", 10 "orderMaker": "0x......", 11 "expireTime": "2025-04-17T00:19:53.000Z", 12 "statuses": 1, 13 "time": 86400, 14 "times": 8, 15 "haveFilled": null, 16 "minPrice": null, 17 "maxPrice": null, 18 "data": { 19 "makerAsset": "0x.....", 20 "makerAssetSymbol": "USDC", 21 "makerAssetDecimals": 6, 22 "makerAssetIcon": "https://s3.openocean.finance/token_logos/logos/1697507306331_35406629884386076.png", 23 "takerAsset": "0x.....", 24 "takerAssetSymbol": "ALB", 25 "takerAssetDecimals": 18, 26 "takerAssetIcon": "https://s3.openocean.finance/token_logos/logos/1693363980475_12272411021892027.png" 27 } 28 } 29 ] 30 }
4.Get all chain DCA order by address
GET https://open-api.openocean.finance/v2/dca/address/:address
Path Parameters
| Name | Type | Description |
|---|---|---|
| address * | string | wallet address |
Query Parameters
| Name | Type | Description |
|---|---|---|
| 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 |
200 OK
1 { 2 "code": 200, 3 "data": [ 4 { 5 "chainId": 8453, 6 "makerAmount": "100000000", 7 "takerAmount": "200000000000000000000", 8 "orderHash": "0x......", 9 "createDateTime": "2025-04-09T00:19:52.000Z", 10 "orderMaker": "0x......", 11 "expireTime": "2025-04-17T00:19:53.000Z", 12 "statuses": 1, 13 "time": 86400, 14 "times": 8, 15 "haveFilled": null, 16 "minPrice": null, 17 "maxPrice": null, 18 "data": { 19 "makerAsset": "0x.....", 20 "makerAssetSymbol": "USDC", 21 "makerAssetDecimals": 6, 22 "makerAssetIcon": "https://s3.openocean.finance/token_logos/logos/1697507306331_35406629884386076.png", 23 "takerAsset": "0x.....", 24 "takerAssetSymbol": "ALB", 25 "takerAssetDecimals": 18, 26 "takerAssetIcon": "https://s3.openocean.finance/token_logos/logos/1693363980475_12272411021892027.png" 27 } 28 } 29 ] 30 }
5.Get DCA order execution details
GET https://open-api.openocean.finance/v2/:chainId/dca/fill/:orderHash
Path Parameters
| Name | Type | Description |
|---|---|---|
| chainId | number | 8453, 146, 80094, 1, 999 |
| orderHash | string | order hash |
200 OK
1 { 2 "code": 200, 3 "data": [ 4 { 5 "orderHash": "0x....", 6 "txHash": "0x....", 7 "filledOrderTime": "2025-08-06T15:13:00.000Z", 8 "payment": "0", 9 "paymentValue": "0", 10 "status": "success", 11 "reason": "" 12 }, 13 { 14 "orderHash": "0x....", 15 "txHash": "0x....", 16 "filledOrderTime": "2025-08-05T14:15:24.000Z", 17 "payment": "0", 18 "paymentValue": "0", 19 "status": "success", 20 "reason": "" 21 } 22 ] 23 }