市場指數訂閱
資訊
- 此介面推送延遲為:5000ms
市場指數訂閱
- 方法:
index.subscribe - 參數:
| 參數名 | 是否必須 | 類型 | 說明 |
|---|---|---|---|
| market_list | true | []string | 市場列表,空白列表代表訂閱所有市場 |
- 範例:
// 訂閱單一市場
{
"method": "index.subscribe",
"params": {"market_list": ["BTCUSDT"]},
"id": 1
}
// 訂閱多個市場
{
"method": "index.subscribe",
"params": {"market_list": ["BTCUSDT", "ETHUSDT"]},
"id": 1
}
市場指數推播
- 方法:
index.update - 參數:
| 參數名 | 類型 | 說明 |
|---|---|---|
| market | string | 市場名 |
| index_price | string | 指數價格 |
| mark_price | string | 標記價格 |
- 範例:
{
"method": "index.update",
"data": {
"market": "BTCUSDT",
"index_price": "20000",
"mark_price": "20000"
},
"id": null
}
取消指數訂閱
- 方法:
index.unsubscribe - 參數:
| 參數名 | 是否必須 | 類型 | 說明 |
|---|---|---|---|
| market_list | true | []string | 市場列表,空白列表代表訂閱所有市場 |
- 範例:
// 取消單一市集訂閱
{
"method": "index.unsubscribe",
"params": {"market_list": ["BTCUSDT"]},
"id": 1
}
// 取消多個市場訂閱
{
"method": "index.unsubscribe",
"params": {"market_list": ["BTCUSDT", "ETHUSDT"]},
"id": 1
}
// 取消所有市集的訂閱
{
"method": "index.unsubscribe",
"params": {"market_list": []},
"id": 1
}