Private Order Change V2

Topic: /spotMarket/tradeOrdersV2

  • Push frequency: real-time

This topic will push all change events of your orders. Compared with v1, v2 adds an Order Status: "new", there is no difference in push speed

Order Status

"new": the order enters the matching system;

“open”: the order is in the order book(maker order);

“match”: when taker order executes with orders in the order book, the taker order status is “match”;

“done”: the order is fully executed successfully;

Order Type

"received": The message sent when the order enters the matching system. When the order has just entered the matching system and has not yet done matching logic with the counterparty, a private message with the message type "received" and the order status "new" will be pushed.

"open": the order is in the order book(maker order);

"match": the message sent when the order is match,

  1. When the status is open and the type is match, it is a maker match.
  2. When the status is match and the type is match, it is a taker match.

"update": The message sent due to the order being modified: STP triggering, partial cancellation of the order. Includes these three situations:

  1. When the status is open and the type is update: partial amounts of the order have been canceled, or STP triggers
  2. When the status is match and the type is update: STP triggers
  3. When the status is done and the type is update: partial amounts of the order have been filled and the unfilled part got canceled, or STP is triggered.

"filled": The message sent when the status of the order changes to DONE after the transaction

"canceled": The message sent when the status of the order changes to DONE due to being canceled

received
{
  "type": "message",
  "topic": "/spotMarket/tradeOrdersV2",
  "subject": "orderChange",
  "channelType": "private",
  "data": {
    "symbol": "KCS-USDT",
    "orderType": "limit",
    "side": "buy",
    "orderId": "5efab07953bdea00089965d2",
    "type": "received",
    "orderTime": 1593487481683297666,
    "price": "0.937",
    "clientOid": "1593487481000906",
    "status": "new",
    "originSize": "0.1", //original quantity
    "originFunds": "0.1", //The original funds of the market order
    "ts": 1593487481683297666
  }
}

The message sent when the order enters the matching system. When the order has just entered the matching system and has not yet done matching logic with the counterparty, a private message with the message type "received" and the order status "new" will be pushed.

open
{
  "type": "message",
  "topic": "/spotMarket/tradeOrdersV2",
  "subject": "orderChange",
  "channelType": "private",
  "data": {
    "symbol": "KCS-USDT",
    "orderType": "limit",
    "side": "buy",
    "orderId": "5efab07953bdea00089965d2",
    "type": "open",
    "orderTime": 1593487481683297666,
    "size": "0.1",
    "filledSize": "0",
    "price": "0.937",
    "clientOid": "1593487481000906",
    "remainSize": "0.1",
    "status": "open",
    "canceledSize": "0.1", // Cumulative number of cancellations
    "canceledFunds": "0.1", // Market order accumulative cancellation funds
    "originSize": "0.1", // original quantity
    "originFunds": "0.1", // Market order original funds
    "ts": 1593487481683297666
  }
}

when the order enters into the order book;

match
{
  "type": "message",
  "topic": "/spotMarket/tradeOrdersV2",
  "subject": "orderChange",
  "channelType": "private",
  "data": {
    "symbol": "KCS-USDT",
    "orderType": "limit",
    "side": "sell",
    "orderId": "5efab07953bdea00089965fa",
    "liquidity": "taker",
    "type": "match",
    "feeType": "takerFee", //Fee type, this parameter is only included when type=match, message type: "takerFee", "makerFee"
    "orderTime": 1593487482038606180,
    "size": "0.1",
    "filledSize": "0.1",
    "price": "0.938",
    "matchPrice": "0.96738",
    "matchSize": "0.1",
    "tradeId": "5efab07a4ee4c7000a82d6d9",
    "clientOid": "1593487481000313",
    "remainSize": "0",
    "status": "match",
    "canceledSize": "0.1", // Cumulative number of cancellations
    "canceledFunds": "0.1", // Market order accumulative cancellation funds
    "originSize": "0.1", // original quantity
    "originFunds": "0.1", // Market order original funds
    "ts": 1593487482038606180
  }
}

when the order has been executed and its status was changed into DONE;

update
{
  "type": "message",
  "topic": "/spotMarket/tradeOrdersV2",
  "subject": "orderChange",
  "channelType": "private",
  "data": {
    "symbol": "KCS-USDT",
    "orderType": "limit",
    "side": "buy",
    "orderId": "5efab13f53bdea00089971df",
    "type": "update",
    "oldSize": "0.1",
    "orderTime": 1593487679693183319,
    "size": "0.06",
    "filledSize": "0",
    "price": "0.937",
    "clientOid": "1593487679000249",
    "remainSize": "0.06",
    "status": "open",
    "canceledSize": "0.1", // Cumulative number of cancellations
    "canceledFunds": "0.1", // Market order accumulative cancellation funds
    "originSize": "0.1", // original quantity
    "originFunds": "0.1", // Market order original funds
    "ts": 1593487682916117521
  }
}

The message sent by the order due to modification

filled
{
  "type": "message",
  "topic": "/spotMarket/tradeOrdersV2",
  "subject": "orderChange",
  "channelType": "private",
  "data": {
    "symbol": "KCS-USDT",
    "orderType": "limit",
    "side": "sell",
    "orderId": "5efab07953bdea00089965fa",
    "type": "filled",
    "orderTime": 1593487482038606180,
    "size": "0.1",
    "filledSize": "0.1",
    "price": "0.938",
    "clientOid": "1593487481000313",
    "remainSize": "0",
    "status": "done",
    "canceledSize": "0.1", // Cumulative number of cancellations
    "canceledFunds": "0.1", // Market order accumulative cancellation funds
    "originSize": "0.1", // original quantity
    "originFunds": "0.1", // Market order original funds
    "ts": 1593487482038606180
  }
}

The message sent when the status of the order changes to DONE after the transaction

canceled
{
  "type": "message",
  "topic": "/spotMarket/tradeOrdersV2",
  "subject": "orderChange",
  "channelType": "private",
  "data": {
    "symbol": "KCS-USDT",
    "orderType": "limit",
    "side": "buy",
    "orderId": "5efab07953bdea00089965d2",
    "type": "canceled",
    "orderTime": 1593487481683297666,
    "size": "0.1",
    "filledSize": "0",
    "price": "0.937",
    "clientOid": "1593487481000906",
    "remainSize": "0",
    "status": "done",
    "canceledSize": "0.1", // Cumulative number of cancellations
    "canceledFunds": "0.1", // Market order accumulative cancellation funds
    "originSize": "0.1", // original quantity
    "originFunds": "0.1", // Market order original funds
    "ts": 1593487481893140844
  }
}

The message sent when the status of the order changes to DONE due to being canceled