Create a DEX limit order.
POST https://www.okx.com/api/v5/dex/aggregator/limit-order/save-order
Parameter | Type | Required | Description |
---|---|---|---|
orderHash | String | Yes | order hash |
signature | String | Yes | signature |
chainId | String | Yes | Chain ID (e.g., 1 for Ethereum. See Chain IDs) |
data | Object | Yes | data object |
salt | String | Yes | random number salt as idempotent identifier Current timestamp (second value) (e.g., 1691499249 ) |
makingAmount | String | Yes | The number of a token to be sold (set in minimal divisible units, e.g., 1.00 USDT set as 1000000 , 1.00 DAI set as 1000000000000000000 ) |
takingAmount | String | Yes | The number of a token to be bought (set in minimal divisible units, e.g., 1.00 USDT set as 1000000 , 1.00 DAI set as 1000000000000000000 ) |
makerToken | String | Yes | The contract address of a token to be sold (e.g.,0x53e0bca35ec356bd5dddfebbd1fc0fd03fabad39 ) |
takerToken | String | Yes | The contract address of a token to be bought (e.g.,0x2791bca1f2de4661ed88a30c99a7a9449aa84174 ) |
maker | String | Yes | The wallet address for current transaction (e.g.,0x6f9ffea7370310cd0f890dfde5e0e061059dcfd9 ) |
deadLine | String | Yes | Current order’s effective deadline timestamp (second value) (e.g., 1699520029 ) |
allowedSender | String | Yes | Setting up a zero address (0x0000000000000000000000000000000000000000 ) Everyone can deal with the current limit order. If you set a value, the limit order will only be executable at the specified address. (e.g.,0x6f9ffea7370310cd0f890dfde5e0e061059dcfd9 ) |
receiver | String | Yes | Assets will be sent to the current receiver's address. (e.g.,0x6f9ffea7370310cd0f890dfde5e0e061059dcfd9 ) |
minReturn | String | Yes | Minimum number of coins to be bought (the number must include precision, e.g. for 1.00 USDT set as 1000000 , for 1.00 DAI set as 1000000000000000000 ). |
partiallyAble | Bool | Yes | Whether partial transactions are supported (true for yes, false for no) |
Parameter | Type | Description |
---|---|---|
code | String | Status code (e.g. 0 : operation successful, 51000 : mandatory parameter cannot be null. See error codes list for more information.) |
msg | String | Server-side response information. If interface is normal, then no value; if abnormal, it will return an exception. |
{
"orderHash":"0xf1852a5c82b9ff891123456731325f4a778603471c2e8fa8d80583824c21e97a",
"signature":"0x78645ba7ed8c0266e01e46302160aad1234567ac9a0c751b9c315a516f44f54765acd11c11ffc88c9dd7f74fa63c606506ab145f94592bbbcb3cf2bac1cb13a01b",
"chainId":"137",
"data":{
"salt":"1697032618",
"makingAmount":"5900000",
"takingAmount":"6000000",
"makerToken":"0x2791bca1f2de4661ed88a30c99a7a9449aa84174",
"takerToken":"0xc2132d05d31c914a87c6611c10748aeb04b58e8f",
"maker":"0x230293u8238sh823472hjskq92j38ahj2i391k20",
"deadLine":"1697784060",
"allowedSender":"0x0000000000000000000000000000000000000000",
"receiver":"0x230293u8238sh823472hjskq92j38ahj2i391k20",
"minReturn":"6000000",
"partiallyAble" : true
}
}
{
"code":"0",
"msg":"save order success"
}