Rest API and Websocket Update (4th January 2021)

Planned release date: 11 Jan 2021

Rest API update:

/v2/orders:
Before the release:

  • stopPrice and limitPrice data are missing, side returns SELL_STOP and other incorrect types

e.g:
{‘event’: ‘orders’, ‘timestamp’: 1607959393965, ‘accountId’: ‘213603’, ‘data’: [{‘orderId’: ‘304304315061864645’, ‘marketCode’: ‘BTC-USD’, ‘clientOrderId’: ‘600002’, ‘side’: ‘SELL_STOP’, ‘orderType’: ‘LIMIT’, ‘quantity’: ‘0.001’, ‘remainingQuantity’: ‘0.001’, ‘price’: ‘9402.0’, ‘orderCreated’: 1607639693650, ‘lastModified’: 1607639693650, ‘lastTradeTimestamp’: 1607639693631, ‘timeInForce’: ‘FOK’}]}

After the release:

  • response to stopPrice and limitPrice data, side will only return BUY or SELL types

e.g.:
{‘event’: ‘orders’, ‘timestamp’: 1608535317714, ‘accountId’: ‘13670886’, ‘data’: [{‘orderId’: ‘304310444641716529’, ‘marketCode’: ‘BTC-USD-SWAP-LIN’, ‘clientOrderId’: ‘1608535253053’, ‘side’: ‘SELL’, ‘orderType’: ‘STOP’, ‘quantity’: ‘0.5’, ‘remainingQuantity’: ‘0.5’, ‘price’: ‘24705.0’, ‘stopPrice’: ‘24800.0’, ‘limitPrice’: ‘24705.0’, ‘orderCreated’: 1608535253292, ‘lastModified’: 1608535253292, ‘lastTradeTimestamp’: 1608535253266, ‘timeInForce’: ‘GTC’}]}


Websocket update:

Nullify price and timeInForce for MARKET order in ACK and OrderMatched messages.

the initial place order reply, price and timeInForce will be removed from the reply for orderType MARKET, e.g.:
{‘event’: ‘placeorder’, ‘submitted’: True, ‘tag’: ‘1608074873364’, ‘timestamp’: ‘1608074874335’, ‘data’: {‘clientOrderId’: ‘1608074873364’, ‘marketCode’: ‘FLEX-USD’, ‘side’: ‘SELL’, ‘orderType’: ‘MARKET’, ‘quantity’: ‘1.0’, ‘timeInForce’: ‘IOC’, ‘price’: ‘0.040’}}

from the OrderMatched notice, price and timeInForce will be removed from the reply for orderType MARKET, e.g.:
{‘table’: ‘order’, ‘data’: [{‘accountId’: ‘439’, ‘clientOrderId’: ‘1608074873364’, ‘orderId’: ‘448421479627569049’, ‘price’: ‘0.04’, ‘quantity’: ‘1.0’, ‘side’: ‘SELL’, ‘status’: ‘FILLED’, ‘marketCode’: ‘FLEX-USD’, ‘timeInForce’: ‘IOC’, ‘timestamp’: ‘1608074874363’, ‘matchId’: ‘448421479627569050’, ‘matchPrice’: ‘0.065’, ‘matchQuantity’: ‘1.0’, ‘orderMatchType’: ‘TAKER’, ‘remainQuantity’: ‘0.0’, ‘notice’: ‘OrderMatched’, ‘orderType’: ‘MARKET’, ‘fees’: ‘0.00027857’, ‘feeInstrumentId’: ‘FLEX’, ‘isTriggered’: ‘false’}]}

目录