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].availablestringBalance available
balance_list[n].frozenstringFrozen balance
balance_list[n].marginstringPosition margin
balance_list[n].transferrablestringBalance available for transfers
balance_list[n].unrealized_pnlstringUnrealized profit
balance_list[n].equitystringEquity
  • Example:
{
"method": "balance.update",
"data": {
"balance_list": [
{
"ccy": "USDT",
"available": "97.92470982756335000001",
"frozen": "0.00000000000000000000",
"margin": "0.61442700000000000000",
"transferrable": "97.92470982756335000001",
"unrealized_pnl": "-0.00807000000000000000",
"equity": "97.92470982756335000001"
},
{
"ccy": "BTC",
"available": "97.92470982756335000001",
"frozen": "0.00000000000000000000",
"margin": "0.61442700000000000000",
"transferrable": "97.92470982756335000001",
"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
}