Skip to main content

Futures Account Balance Subscription

Info
  • Before using this function, you need to call the server.sign method for signature authentication. For specific signature rules, please refer to Authentication
  • The push delay of this method is about: 50~100ms

Subscribe to Asset Balance

  • Method: balance.subscribe
  • Parameters:
Parameter NameRequiredTypeNotes
ccy_listtrue[]stringList of asset names
  • Subscription example:
// Subscribe to singular asset balance
{
"method": "balance.subscribe",
"params": {"ccy_list": ["USDT"]},
"id": 1
}

// Subscribe to multiple asset balances
{
"method": "balance.subscribe",
"params": {"ccy_list": ["BTC", "ETH"]},
"id": 1
}

// Subscribe to all asset balances
{
"method": "balance.subscribe",
"params": {"ccy_list": []},
"id": 1
}

Asset Balance Push

  • Method: balance.update
  • Parameters:
Parameter NameTypeNotes
balance_list[n].ccystringAsset name
balance_list[n].account_balancestringAccount balance.
Account balance = Cross margin balance + Isolated margin balance = Transferred-in amount - Transferred-out amount + Realized PNL
balance_list[n].cross_balancestringCross margin balance.
Cross margin balance = Account balance - Isolated margin balance = Account balance - Isolated margin allocated
balance_list[n].isolated_balancestringIsolated margin balance, i.e., the margin allocated by all isolated margin positions.
Isolated margin balance = Isolated margin allocated = Account balance - Cross margin balance
balance_list[n].availablestringField to be deprecated. The current meaning is the same as isolated_margin_avbl, i.e., isolated margin available
balance_list[n].frozenstringFrozen balance
balance_list[n].marginstringPosition margin.
Position margin = Isolated margin allocated. Cross margin allocated is not actually transferred and used, and is not included in this field
balance_list[n].cross_margin_avblstringCross margin available.
Cross margin available = Max(0, Cross margin balance + Total cross margin unrealized PNL - Total cross margin allocated - Frozen margin)
balance_list[n].isolated_margin_avblstringIsolated margin available.
Cross theoretical transferable = Max(0, Cross margin balance + Min(0, Total cross margin unrealized PnL) - Total cross margin initial margin - Frozen margin)
Cross risk control transferable = Max(0, Cross position margin - Cross maintenance margin - N * Cross position value)
Isolated margin available = Min(Cross theoretical transferable, Cross risk control transferable)
The N value is tentatively set to 1.5%
balance_list[n].transferrablestringTransferable amount in the Futures account, currently equal to isolated_margin_avbl, the available margin in isolated margin mode.
balance_list[n].unrealized_pnlstringUnrealized profit
balance_list[n].equitystringEquity
  • Example:
{
"method": "balance.update",
"data": {
"balance_list": [
{
"ccy": "USDT",
"account_balance": "98.53913682756335000001",
"cross_balance": "97.92470982756335000001",
"isolated_balance": "0.61442700000000000000",
"available": "0.61442700000000000000",
"frozen": "0.00000000000000000000",
"margin": "0.61442700000000000000",
"cross_margin_avbl": "0.00000000000000000000",
"isolated_margin_avbl": "0.61442700000000000000",
"transferrable": "0.61442700000000000000",
"unrealized_pnl": "-0.00807000000000000000",
"equity": "97.92470982756335000001"
},
{
"ccy": "BTC",
"account_balance": "98.53913682756335000001",
"cross_balance": "97.92470982756335000001",
"isolated_balance": "0.61442700000000000000",
"available": "0.61442700000000000000",
"frozen": "0.00000000000000000000",
"margin": "0.61442700000000000000",
"cross_margin_avbl": "0.00000000000000000000",
"isolated_margin_avbl": "0.61442700000000000000",
"transferrable": "0.61442700000000000000",
"unrealized_pnl": "-0.00807000000000000000",
"equity": "97.92470982756335000001"
}
]
},
"id": null
}

Unsubscribe to Asset Balance

  • Method: balance.unsubscribe
  • Parameters:
Parameter NameRequiredTypeNotes
ccy_listtrue[]stringList of asset names
  • Example:
// Unsubscribe to singular asset balance
{
"method": "balance.unsubscribe",
"params": {"ccy_list": ["USDT"]},
"id": 1
}

// Unsubscribe to multiple asset balances
{
"method": "balance.unsubscribe",
"params": {"ccy_list": ["BTC", "ETH"]},
"id": 1
}

// Unsubscribe to all asset balances
{
"method": "balance.unsubscribe",
"params": {"ccy_list": []},
"id": 1
}