交易私有订单变更事件V2

Topic: /spotMarket/tradeOrdersV2
  • 推送頻率: 實時推送

该topic将推送所有有关您的订单的变更事件。 相對於v1,v2新增一個Order Status:“new”,在推送速度上沒有差別

订单状态

"new": 订单进入撮合;

"open": 订单進入于买卖盘中(maker訂單);

"match": 订单为taker时与买卖盘中订单成交,此时该taker订单状态为match;

"done": 订单完成;

订单類型

"received": 订单进入撮合系统时发出的消息。订单刚进入撮合系统,还未与对手盘做撮合逻辑时,会推送一条消息类型为"received"、订单状态为"new"的私有消息

"open": 订单進入于买卖盘中(maker訂單);

"match": 订单成交时发出的消息, 1、狀態為open并且類型也為match時,為maker成交 2、狀態為match并且類型為match時,為taker成交

"update": 订单因被修改发出的消息:STP觸發、撤销部分订单。包含這三種情況: 1、狀態為open并且類型也為update時:撤销部分订单 ,或STP觸發 2、狀態為match并且類型為update時: STP 触发 3、狀態為done并且類型為update時:為撤销部分订单并且訂單完結,或STP觸發

"filled": 订单因成交后状态变为DONE时发出的消息

"canceled": 订单因被取消后状态变为DONE时发出的消息

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", // 原始数量
            "originFunds": "0.1", // 市价单原始资金
            "ts":1593487481683297666
    }
}

订单进入撮合系统时发出的消息。 订单刚进入撮合系统,还未与对手盘做撮合逻辑时,会推送一条消息类型为"received"、订单状态为"new"的私有消息

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", // 累计取消数量
            "canceledFunds": "0.1", // 市价单累计取消资金
            "originSize": "0.1", // 原始数量
            "originFunds": "0.1", // 市价单原始资金
            "ts":1593487481683297666
       }
	}

订单进入买卖盘时发出的消息。

match
    {
        "type":"message",
        "topic":"/spotMarket/tradeOrdersV2",
        "subject":"orderChange",
        "channelType":"private",
        "data": {
          "symbol": "KCS-USDT",
          "orderType": "limit",
          "side": "sell",
          "orderId": "5efab07953bdea00089965fa",
          "liquidity": "taker",
          "type": "match",
          "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", // 累计取消数量
          "canceledFunds": "0.1", // 市价单累计取消资金
          "originSize": "0.1", // 原始数量
          "originFunds": "0.1", // 市价单原始资金
          "ts": 1593487482038606180
        }
    }

订单成交时发出的消息

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", // 累计取消数量
        "canceledFunds": "0.1", // 市价单累计取消资金
        "originSize": "0.1", // 原始数量
        "originFunds": "0.1", // 市价单原始资金
        "ts":1593487682916117521
    }
}

订单因被修改发出的消息

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", // 累计取消数量
            "canceledFunds": "0.1", // 市价单累计取消资金
            "originSize": "0.1", // 原始数量
            "originFunds": "0.1", // 市价单原始资金
            "ts":1593487482038606180
      }
    }

订单因成交后状态变为DONE时发出的消息

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", // 累计取消数量
        "canceledFunds": "0.1", // 市价单累计取消资金
        "originSize": "0.1", // 原始数量
        "originFunds": "0.1", // 市价单原始资金
        "ts":1593487481893140844
        }
    }

订单因被取消后状态变为DONE时发出的消息