-
Notifications
You must be signed in to change notification settings - Fork 7
Place Order
Jason Zong edited this page Jun 2, 2018
·
11 revisions
Request POST /v1/placeorder
-
Authorization: Bearer <token>Token obtained when signing in
-
traderAddrTrader address -
pairIdString of trading pair, e.g. "ETH_LOOM" -
amountAmount of token to buy or sell -
priceOrder price in ethereum -
action"Buy" or "Sell" -
nonceOrder nonce. The recommended value is the current timestamp in millisecond -
expireTimeSecOrder expire time (timestamp in second) -
sigsignature of Keccak256(SHA3) of signing message using private key of the trader address.
| Field | Length | Note |
|---|---|---|
| Prefix | 40 | "\x19Ethereum Signed Message:\n70DEx2 Order: " |
| Market Address | 20 | DEx address: 0x7600977eb9effa627d6bd0da2e5be35e11566341 |
| Nonce | 8 | |
| ExpireTimeSec | 8 | |
| AmountE8 | 8 | Amount * 1e8 |
| PriceE8 | 8 | Price * 1e8 |
| IoC(Immediate or Cancel) | 1 | Only 0 is supported for now |
| Action | 1 | Buy=0, Sell=1 |
| PairId | 4 | int32(tokenCode(A)) << 16 | int32(tokenCode(B)) |
{
"amount": "66.51501244",
"price": "0.00150342",
"action": "Buy",
"nonce": 1522290645732,
"expireTimeSec": 1522377045,
"sig": "0x3d42c49bebfc912d5b6698556db273e9e38b72928b052eccd967a4bb4d31cb007b363a1a30d45ee5055b64a8a7d8bac7fc1d4d2f3009d910b856467699a58b4f00",
"pairId": "ETH_ADX"
} {
"order": {
"orderId": "10000004",
"pairId": "ETH_ADX",
"action": "Buy",
"price": "0.01000000",
"amountTotal": "10.00000000",
"amountFilled": "0.00000000",
"filledAveragePrice": "0.00000000",
"status": "Unfilled", // "Filled" or "Unfilled" or "PartiallyFilled" or "Cancelled" or "Expired"
"createTimeMs": "1522554774421",
"updateTimeMs": "1522554774421",
"expireTimeSec": "1522641169",
"nonce": "1522554769144"
}
}