Limit Order API

View Github examples for Backend and Frontend. Check out the current supported chains here.

API Reference

By using the gasless limit order feature we provided, users can create orders by the price they expect. Now we have provided the quality into our API & SDK so developers can integrate it without installing other dependencies, you can get the limit order transaction information by our open API.

Create the limit order

POSThttps://open-api.openocean.finance/v2/:chainId/limit-order

Path Parameters

NameTypeDescription
chainId *Number1, 56, 146, 8453, 80094

Request Body

NameTypeDescription
takerAsset *Stringtoken address
makerAsset *Stringtoken address
expireTime *Stringlimit order expire time(ms)
orderMaker *Stringwallet address
signature *Stringwallet.signMessage(message)
takerAmount *Stringamount with decimals
makerAmount *Stringamount with decimals
referrerstring (Optional)An EOA wallet address used to identify partners and optionally receive a fee from users. If no fee is set up, it serves purely as a tracking tool to help our dev team provide better support and insights.
referrerFeenumber (Optional)Specify the percentage of in-token you wish to receive from the transaction, within the range of 0% to 5%, with 1% represented as '1', in the range of 0.01 to 5. e.g. 1.2% fee set as 1.2. By default, OpenOcean shares 20% of the fee. Please contact us if you wish to modify this rate.
enabledDexIdsstring (Optional)Enter the 'index' number of dexs through dexList. P.S. enableDexIds has higher priority compared with disabledDexIds
disabledDexIdsstring (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".

200 OK https://open-api.openocean.finance/v1/56/limit-order

Terminal
{}
1
{
2
"code": 200,
3
}

Cancel limit order

POSThttps://open-api.openocean.finance/v2/:chainId/limit-order/cancelLimitOrder

Path Parameters

NameTypeDescription
chainId *Number1, 56, 146, 8453, 80094

Request Body

NameTypeDescription
orderHash *Stringfrom response
signatureStringsignature orderHash

200 OK https://open-api.openocean.finance/v1/56/limit-order/cancelLimitOrder

Terminal
{}
1
{
2
"code": 200
3
}

Get limit order by address

GEThttps://open-api.openocean.finance/v2/:chainId/limit-order/address/:address

Path Parameters

NameTypeDescription
chainId *number1, 56, 146, 8453, 80094
address *Stringuser's wallet address

Query Parameters

NameTypeDescription
statusesStringeg: [1,2,3], 1-unfill, 2-fail, 3-cancel, 4-filled, 5-pending, 6- hash not exist, 7-expire
limitnumberlimit count

200 OK https://open-api.openocean.finance/v1/56/limit-order/address/0x9962962567200A590686Da7eb29933dB6711f0f2?statuses=[1,2,3]&limit=1

Terminal
{}
1
{
2
"code": 200,
3
"data": [
4
{
5
"chainId": 8453,
6
"makerAmount": "500000000000000000000",
7
"takerAmount": "2702702702702",
8
"signature": "0x000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000041661329add47ed0f9433375d8be1e1f4ec1ade1d39a77f88d92ccbed712e88c0b64f7f0bbcfd42e4eb62642351c5cb19599e0517d73e4dfb2850241e3d5e3be741c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000",
9
"orderHash": "0x3340338ac83a194cd6d2e7093d4e33c52357fc63cd52405cb0c6d9e512a508a5",
10
"createDateTime": "2022-10-18T14:21:35.000Z",
11
"orderMaker": "0x0000000000000000000000000000000000000001",
12
"remainingMakerAmount": "500000000000000000000",
13
"expireTime": "2022-10-19T14:21:36.000Z",
14
"statuses": 1,
15
"data": {
16
"makerAsset": "0xe9e7cea3dedca5984780bafc599bd69add087d56",
17
"makerAssetSymbol": "BUSD",
18
"makerAssetDecimals": 18,
19
"makerAssetIcon": "https://ethapi.openocean.finance/logos/bsc/0xe9e7cea3dedca5984780bafc599bd69add087d56.png",
20
"takerAsset": "0x156ab3346823b651294766e23e6cf87254d68962",
21
"takerAssetSymbol": "LUNA",
22
"takerAssetDecimals": 6,
23
"takerAssetIcon": "https://ethapi.openocean.finance/logos/bsc/0x9029fdfae9a03135846381c7ce16595c3554e10a1.png",
24
"getMakerAmount": "0xf4a215c300000000000000000000000000000000000000000000001b1ae4d6e2ef5000000000000000000000000000000000000000000000000000000000027545a2706e",
25
"getTakerAmount": "0x296637bf00000000000000000000000000000000000000000000001b1ae4d6e2ef5000000000000000000000000000000000000000027545a2706e",
26
"makerAssetData": "0x",
27
"takerAssetData": "0x",
28
"salt": "762950589674",
29
"permit": "0x",
30
"predicate": "0x961d5b1e000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000001000000000000000000000000a8a0213bb2ce671e457ec14d08eb9d40e6333e2d00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002463592c2b00000000000000000000000000000000000000000000000000000000635007eb00000000000000000000000000000000000000000000000000000000",
31
"interaction": "0x",
32
"makingAmount": "500000000000000000000",
33
"takingAmount": "2702702702702",
34
"maker": "0x0000000000000000000000000000000000000001",
35
"receiver": "0x0000000000000000000000000000000000000000",
36
"allowedSender": "0x0000000000000000000000000000000000000000"
37
},
38
"makerRate": null,
39
"takerRate": null,
40
"referrer": "",
41
"referrerFee": "0"
42
}
43
]
44
}

Get all chain limit order by address

GEThttps://open-api.openocean.finance/v2/limit-order/address/:address

Path Parameters

NameTypeDescription
address *Stringuser's wallet address

Query Parameters

NameTypeDescription
statusesStringeg: [1,2,3], 1-unfill, 2-fail, 3-cancel, 4-filled, 5-pending, 6- hash not exist, 7-expire
limitnumberlimit count

200 OK https://open-api.openocean.finance/v1/56/limit-order/address/0x9962962567200A590686Da7eb29933dB6711f0f2?statuses=[1,2,3]&limit=1

Terminal
{}
1
{
2
"code": 200,
3
"data": [
4
{
5
"chainId": 8453,
6
"makerAmount": "500000000000000000000",
7
"takerAmount": "2702702702702",
8
"signature": "0x000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000041661329add47ed0f9433375d8be1e1f4ec1ade1d39a77f88d92ccbed712e88c0b64f7f0bbcfd42e4eb62642351c5cb19599e0517d73e4dfb2850241e3d5e3be741c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000",
9
"orderHash": "0x3340338ac83a194cd6d2e7093d4e33c52357fc63cd52405cb0c6d9e512a508a5",
10
"createDateTime": "2022-10-18T14:21:35.000Z",
11
"orderMaker": "0x0000000000000000000000000000000000000001",
12
"remainingMakerAmount": "500000000000000000000",
13
"expireTime": "2022-10-19T14:21:36.000Z",
14
"statuses": 1,
15
"data": {
16
"makerAsset": "0xe9e7cea3dedca5984780bafc599bd69add087d56",
17
"makerAssetSymbol": "BUSD",
18
"makerAssetDecimals": 18,
19
"makerAssetIcon": "https://ethapi.openocean.finance/logos/bsc/0xe9e7cea3dedca5984780bafc599bd69add087d56.png",
20
"takerAsset": "0x156ab3346823b651294766e23e6cf87254d68962",
21
"takerAssetSymbol": "LUNA",
22
"takerAssetDecimals": 6,
23
"takerAssetIcon": "https://ethapi.openocean.finance/logos/bsc/0x9029fdfae9a03135846381c7ce16595c3554e10a1.png",
24
"getMakerAmount": "0xf4a215c300000000000000000000000000000000000000000000001b1ae4d6e2ef5000000000000000000000000000000000000000000000000000000000027545a2706e",
25
"getTakerAmount": "0x296637bf00000000000000000000000000000000000000000000001b1ae4d6e2ef5000000000000000000000000000000000000000027545a2706e",
26
"makerAssetData": "0x",
27
"takerAssetData": "0x",
28
"salt": "762950589674",
29
"permit": "0x",
30
"predicate": "0x961d5b1e000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000001000000000000000000000000a8a0213bb2ce671e457ec14d08eb9d40e6333e2d00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002463592c2b00000000000000000000000000000000000000000000000000000000635007eb00000000000000000000000000000000000000000000000000000000",
31
"interaction": "0x",
32
"makingAmount": "500000000000000000000",
33
"takingAmount": "2702702702702",
34
"maker": "0x0000000000000000000000000000000000000001",
35
"receiver": "0x0000000000000000000000000000000000000000",
36
"allowedSender": "0x0000000000000000000000000000000000000000"
37
},
38
"makerRate": null,
39
"takerRate": null,
40
"referrer": "",
41
"referrerFee": "0"
42
}
43
]
44
}