Skip to main content

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 NameRequiredTypeNotes
market_listtrue[]stringMarket 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 NameTypeNotes
eventstringPosition update event type
positionobjectPosition info
position.position_idintPosition ID
position.marketstringMarket name
position.sidestringPosition side, long or short
position.margin_modestringPosition type, cross or isolated
position.open_intereststringPosition
position.close_avblstringAmount that's available for position closing
position.ath_position_amountstringATH position amount
position.unrealized_pnlstringUnrealized PNL
position.realized_pnlstringRealized PNL
position.avg_entry_pricestringAverage entry price
position.cml_position_valuestringCumulative position value
position.max_position_valuestringMax. position value
position.take_profit_pricestringTake-profit price
position.stop_loss_pricestringStop-loss price
position.take_profit_typestringTake profit trigger price type, latest_price or mark_price
position.stop_loss_typestringStop loss trigger price type, latest_price or mark_price
position.leveragestringLeverage
position.margin_avblstringMargin available.
position.ath_margin_sizestringATH margin amount
position.position_margin_ratestringPosition margin rate
position.maintenance_margin_ratestringMaintenance margin rate
position.maintenance_margin_valuestringMaintenance margin amount
position.liq_pricestringLiquidation price
position.bkr_pricestringBankruptcy price
position.adl_levelintAuto-deleveraging level
position.settle_pricestringSettlement price, calculated as mark price
position.settle_valuestringSettlement value, calculated as mark price
position.first_filled_pricestringThe first filled price of the position
position.latest_filled_pricestringThe latest filled price of the position
position.created_atintPosition creation timestamp (milliseconds)
position.updated_atintPosition 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 NameRequiredTypeNotes
market_listtrue[]stringMarket 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
}