跳到主要内容

Websocket 模拟盘

Websocket 也支持订阅模拟盘消息

Tickers Channel

当在websocket中订阅消息时, 直接使用模拟币对

订阅消息

{
"op": "subscribe",
"args": [
{
"instType": "SUSDT-FUTURES",
"channel": "ticker",
"instId": "SBTCSUSDT"
}
]
}

成功订阅返回

{
"event": "subscribe",
"arg": {
"instType": "SUSDT-FUTURES",
"channel": "ticker",
"instId": "SBTCSUSDT"
}
}

推送数据

推送数据
{
"action": "snapshot",
"arg": {
"instType": "SUSDT-FUTURES",
"channel": "ticker",
"instId": "SBTCSUSDT"
},
"data": [
{
"instId": "SBTCSUSDT",
"last": "27000.5",
"bidPr": "27000",
"askPr": "27000.5",
"bidSz": "2.71",
"askSz": "8.76",
"open24h": "27000.5",
"high24h": "30668.5",
"low24h": "26999.0",
"priceChangePercent": "-0.00002",
"fundingRate": "0.000010",
"nextFundingTime": 1695722400000,
"markPrice": "27000.0",
"indexPrice": "25702.4",
"quantity": "929.502",
"baseVolume": "368.900",
"quoteVolume": "10152429.961",
"openUtc": "27000.5",
"symbolType": 1,
"symbol": "SBTCSUSDT",
"deliveryPrice": "0",
"ts": 1695715383021
}
],
"ts": 1695715383039
}