Futures Account Balance Subscription
Info
- Before using this function, you need to call the
server.signmethod 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 Name | Required | Type | Notes |
|---|---|---|---|
| ccy_list | true | []string | List 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 Name | Type | Notes |
|---|---|---|
| balance_list[n].ccy | string | Asset name |
| balance_list[n].account_balance | string | Account balance. Account balance = Cross margin balance + Isolated margin balance = Transferred-in amount - Transferred-out amount + Realized PNL |
| balance_list[n].cross_balance | string | Cross margin balance. Cross margin balance = Account balance - Isolated margin balance = Account balance - Isolated margin allocated |
| balance_list[n].isolated_balance | string | Isolated 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].available | string | Field to be deprecated. The current meaning is the same as isolated_margin_avbl, i.e., isolated margin available |
| balance_list[n].frozen | string | Frozen balance |
| balance_list[n].margin | string | Position 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_avbl | string | Cross 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_avbl | string | Isolated 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].transferrable | string | Transferable amount in the Futures account, currently equal to isolated_margin_avbl, the available margin in isolated margin mode. |
| balance_list[n].unrealized_pnl | string | Unrealized profit |
| balance_list[n].equity | string | Equity |
- 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 Name | Required | Type | Notes |
|---|---|---|---|
| ccy_list | true | []string | List 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
}