用戶方案委託單訂閱
提示
- 此功能使用前需要呼叫
server.sign方法進行簽章鑑權 - 此介面推送延遲為:即時推送
用戶方案委託單訂閱
- 方法:
stop.subscribe - 參數:
| 參數名 | 是否必須 | 類型 | 說明 |
|---|---|---|---|
| market_list | true | []string | 市場列表,空白列表代表訂閱所有市場 |
- 範例:
// 訂閱單一市場
{
"method": "stop.subscribe",
"params": {"market_list": ["BTCUSDT"]},
"id": 1
}
// 訂閱多個市場
{
"method": "stop.subscribe",
"params": {"market_list": ["BTCUSDT", "ETHUSDT"]},
"id": 1
}
// 訂閱所有市集
{
"method": "stop.subscribe",
"params": {"market_list": []},
"id": 1
}
計畫委託單更新推播
- 方法:
stop.update - 參數:
| 參數名 | 類型 | 說明 |
|---|---|---|
| event | string | 計劃單更新事件類型 |
| stop | object | 規劃委託資訊 |
| stop.stop_id | int | 訂單id |
| stop.market | string | 市場名 |
| stop.side | string | buy或sell |
| stop.type | string | 訂單類型,limit或market或GTC或IOC或FOK |
| stop.price | string | 觸發後的下單價格,市價單為"0" |
| stop.amount | string | 觸發後的下單數量 |
| stop.trigger_price | string | 觸發價格 |
| stop.trigger_direction | string | 計劃單觸發方向 |
| stop.trigger_price_type | string | 觸達價格類型,latest_price或mark_price或index_price |
| stop.taker_fee_rate | string | taker 費率 |
| stop.maker_fee_rate | string | maker 費率 |
| stop.client_id | string | 使用者自訂id |
| stop.status | string | 計劃單狀態 |
| stop.created_at | int | 訂單創建時間(毫秒) |
| stop.updated_at | int | 訂單更新時間(毫秒) |
- 範例:
{
"method": "stop.update",
"data": {
"event": "put",
"stop": {
"stop_id": 98389557871,
"market": "BTCUSDT",
"side": "sell",
"type": "limit",
"price": "20000.00",
"amount": "0.0100",
"trigger_price": "20000.00",
"trigger_direction": "higer",
"trigger_price_type": "index_price",
"taker_fee_rate": "0.00046",
"maker_fee_rate": "0.00026",
"client_id": "",
"status": "active_success",
"created_at": 1689146382674,
"updated_at": 1689146382674
}
},
"id": null
}
取消計劃委託訂閱
- 方法:
stop.unsubscribe - 參數:
| 參數名 | 是否必須 | 類型 | 說明 |
|---|---|---|---|
| market_list | true | []string | 市場列表,空白列表代表訂閱所有市場 |
- 範例:
// 取消單一市集訂閱
{
"method": "stop.unsubscribe",
"params": {"market_list": ["BTCUSDT"]},
"id": 1
}
// 取消多個市場訂閱
{
"method": "stop.unsubscribe",
"params": {"market_list": ["BTCUSDT", "ETHUSDT"]},
"id": 1
}
// 取消所有市集的訂閱
{
"method": "stop.unsubscribe",
"params": {"market_list": []},
"id": 1
}