Skip to main content

Market Status Subscription

Info
  • Subscribe to 24h market status
  • The push delay of this method is about:200ms

24h Market Status Subscription

  • Method: state.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": "state.subscribe",
"params": {"market_list": ["BTCUSDT"]},
"id": 1
}

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

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

24h Market Status Push

  • Method: state.update
  • Parameters:
Parameter NameTypeNotes
marketstringMarket name
laststringLatest price
openstringOpening price
closestringClosing price
highstringHighest price
lowstringLowest price
volumestring24H volume
valuestring24h value
volume_sellstringTaker selling volume
volume_buystringTaker buying volume
insurance_fund_sizestringInsurance fund amount
mark_pricestringMark price
index_pricestringIndex price
open_interest_sizestringCurrent position
latest_funding_ratestringCurrent funding rate.The funding rate at the current settlement time point, calculated from the previous funding fee period.
If the funding rate is positive, the long positions pay the short side;
If the funding rate is negative, the short positions pay the long side.
next_funding_ratestringNext funding rate.Predicted funding rate value for the current contract, calculated based on the current moment (updated in real-time, for reference only).At the time of funding rate collection, the predicted funding rate = current funding rate
latest_funding_timeintThe time when the current funding rate is collected.Funding rates are calculated every minute and are paid/collected once every 8 hours by default. When the premium rate is too high, it can be dynamically adjusted to 2h or 4h.
next_funding_timeintThe time when the next funding rate will be collected.Funding rates are calculated every minute and are paid/collected once every 8 hours by default. When the premium rate is too high, it can be dynamically adjusted to 2h or 4h.
periodintPeriod, fixed at 86400, indicates that the data is a one-day value
  • Subscription example:
{
"method": "state.update",
"data": {
"state_list": [
{
"market": "ETHUSD_SIGNPRICE",
"last": "1892.29",
"open": "1884.62",
"close": "1892.29",
"high": "1894.09",
"low": "1863.72",
"volume": "0",
"value": "0",
"volume_sell": "0",
"volume_buy": "0",
"open_interest_size": "0",
"insurance_fund_size": "0",
"latest_funding_rate": "0",
"next_funding_rate": "0",
"latest_funding_time": 0,
"next_funding_time": 0,
"period": 86400
},
{
"market": "DOTUSDT",
"last": "5.2483",
"open": "5.15690000000000000000",
"close": "5.2483",
"high": "5.30640000000000000000",
"low": "5.09040000000000000000",
"volume": "51996.00000000000000000000",
"value": "269813.72216000000000000000",
"volume_sell": "11747.70000000",
"volume_buy": "14624.70000000",
"open_interest_size": "92414.6",
"insurance_fund_size": "24497980.15228462554747551920",
"mark_price": "5.2513",
"index_price": "5.2513",
"latest_funding_rate": "-0.00012921",
"next_funding_rate": "0.00009768",
"latest_funding_time": 0,
"next_funding_time": 0,
"period": 86400
}
]
],
"id": null
}

Cancel Market Status Data Subscription

  • Method: state.unsubscribe
  • Parameters:
Parameter NameRequiredTypeNotes
market_listtrue[]stringList of market names. Empty list to unsubscribe to all markets.
  • Unsubscribe example:
// Cancel all subscribed markets
{
"method": "state.unsubscribe",
"params": {"market_list": []},
"id": 1
}

// Cancel a singular subscribed market
{
"method": "state.unsubscribe",
"params": {"market_list": ["BTCUSDT"]},
"id": 1
}

// Cancel multiple subscribed markets
{
"method": "state.unsubscribe",
"params": {"market_list": ["BTCUSDT", "ETHUSDT", "BNBUSDT"]},
"id": 1
}