Skip to main content

Market Transaction Subscription

Info
  • The push delay of this method is about:200ms

Market Transaction Subscription

  • Method: deals.subscribe
  • Parameters:
Parameter NameRequiredTypeNotes
market_listtrue[]stringList of market names. Empty list to subscribe to all markets.
  • Subscription example:
// Subscribe to a singular market
{
"method": "deals.subscribe",
"params": {"market_list": ["BTCUSDT"]},
"id": 1
}

// Subscribe to multiple markets
{
"method": "deals.subscribe",
"params": {"market_list": ["BTCUSDT", "ETHUSDT"]},
"id": 1
}

// Subscribe to all markets
{
"method": "deals.subscribe",
"params": {"market_list": []},
"id": 1
}

Latest Market Transaction Push

  • Method: deals.update
  • Parameters:
Parameter NameTypeNotes
marketstringMarket name
deal_listarrayList of latest transactions
deal_list[n].deal_idintdeal id
deal_list[n].created_atintTransaction timestamp (milliseconds)
deal_list[n].sidestringTaker side, "buy" or "sell"
deal_list[n].pricestringFilled price
deal_list[n].amountstringExecuted Amount
  • Example:
// market's deal
{
"method": "deals.update",
"data": {
"market": "BTCUSDT",
"deal_list": [
{
"deal_id": 3514376759,
"created_at": 1689152421692,
"side": "buy",
"price": "30718.42",
"amount": "0.00000325"
},
{
"deal_id": 3514376758,
"created_at": 1689152421692,
"side": "buy",
"price": "30718.42",
"amount": "0.00015729"
},
{
"deal_id": 3514376757,
"created_at": 1689152421692,
"side": "sell",
"price": "30718.42",
"amount": "0.00154936"
}
]
},
"id": null
}

Cancel Latest Market Transaction Subscription

  • Method: deals.unsubscribe
  • Parameters:
Parameter NameRequiredTypeNotes
market_listtrue[]stringList of market names. Empty list to unsubscribe to all markets.
  • Example:
// Cancel a singular subscription
{
"method": "deals.unsubscribe",
"params": {"market_list": ["BTCUSDT"]},
"id": 1
}

// Cancel multiple subscriptions

{
"method": "deals.unsubscribe",
"params": {"market_list": ["BTCUSDT", "ETHUSDT"]},
"id": 1
}

// Cancel all subscriptions
{
"method": "deals.unsubscribe",
"params": {"market_list": []},
"id": 1
}