User Position Subscription
Reminder
- Before using this endpoint, please call the "server.sign" method for signature authorization.
- The push delay of this method is: real-time
User Position Subscription
- Method:
position.subscribe
- Parameters:
Parameter Name | Required | Type | Notes |
---|---|---|---|
market_list | true | []string | Market list. Empty list to subscribe to all markets. |
- Example:
// Subscribe to a singular market
{
"method": "position.subscribe",
"params": {"market_list": ["BTCUSDT"]},
"id": 1
}
// Subscribe to multiple markets
{
"method": "position.subscribe",
"params": {"market_list": ["BTCUSDT", "ETHUSDT"]},
"id": 1
}
// Subscribe to all markets
{
"method": "position.subscribe",
"params": {"market_list": []},
"id": 1
}
Position Update Push
- Method:
position.update
- Parameters:
Parameter Name | Type | Notes |
---|---|---|
event | string | Position update event type |
position | object | Position info |
position.position_id | int | Position ID |
position.market | string | Market name |
position.side | string | Position side, long or short |
position.margin_mode | string | Position type, cross or isolated |
position.open_interest | string | Position |
position.close_avbl | string | Amount that's available for position closing |
position.ath_position_amount | string | ATH position amount |
position.unrealized_pnl | string | Unrealized PNL |
position.realized_pnl | string | Realized PNL |
position.avg_entry_price | string | Average entry price |
position.cml_position_value | string | Cumulative position value |
position.max_position_value | string | Max. position value |
position.take_profit_price | string | Take-profit price |
position.stop_loss_price | string | Stop-loss price |
position.take_profit_type | string | Take profit trigger price type, latest_price or mark_price |
position.stop_loss_type | string | Stop loss trigger price type, latest_price or mark_price |
position.leverage | string | Leverage |
position.margin_avbl | string | Margin available. |
position.ath_margin_size | string | ATH margin amount |
position.position_margin_rate | string | Position margin rate |
position.maintenance_margin_rate | string | Maintenance margin rate |
position.maintenance_margin_value | string | Maintenance margin amount |
position.liq_price | string | Liquidation price |
position.bkr_price | string | Bankruptcy price |
position.adl_level | int | Auto-deleveraging level |
position.settle_price | string | Settlement price, calculated as mark price |
position.settle_value | string | Settlement value, calculated as mark price |
position.first_filled_price | string | The first filled price of the position |
position.latest_filled_price | string | The latest filled price of the position |
position.created_at | int | Position creation timestamp (milliseconds) |
position.updated_at | int | Position update timestamp (milliseconds) |
- Example:
{
"method": "position.update",
"data": {
"event": "",
"position": {
"position_id": 246830219,
"market": "BTCUSDT",
"side": "long",
"margin_mode": "cross",
"open_interest": "0.0010",
"close_avbl": "0.0010",
"ath_position_amount": "0.0010",
"unrealized_pnl": "0.00",
"realized_pnl": "-0.01413182100000000000",
"avg_entry_price": "30721.35000000000000000000",
"cml_position_value": "30.72135000000000000000",
"max_position_value": "30.72135000000000000000",
"take_profit_price": "0.00000000000000000000",
"stop_loss_price": "0.00000000000000000000",
"take_profit_type": "latest_price",
"stop_loss_type": "latest_price",
"leverage": "50",
"margin_avbl": "0.61442700000000000000",
"ath_margin_size": "0.61442700000000000000",
"position_margin_rate": "0.02000000000000000000",
"maintenance_margin_value": "0.15364710000000000000",
"maintenance_margin_rate": "0.005",
"liq_price": "31179.87761194029850746268",
"bkr_price": "31335.77700000000000000000",
"adl_level": 5,
"settle_price": "30721.35000000000000000000",
"settle_val": "30.72135000000000000000",
"first_filled_price": "30721.35",
"latest_filled_price": "30721.35",
"created_at": 1642145331234,
"updated_at": 1642145331234
}
},
"id": null
}
Cancel User Position Subscription
- Method:
position.unsubscribe
- Parameters:
Parameter Name | Required | Type | Notes |
---|---|---|---|
market_list | true | []string | Market list. Empty list to subscribe to all markets. |
- Example:
// Unsubscribe to a singular market
{
"method": "position.unsubscribe",
"params": {"market_list": ["BTCUSDT"]},
"id": 1
}
// Unsubscribe to multiple markets
{
"method": "position.unsubscribe",
"params": {"market_list": ["BTCUSDT", "ETHUSDT"]},
"id": 1
}
// Unsubscribe to all markets
{
"method": "position.unsubscribe",
"params": {"market_list": []},
"id": 1
}