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 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].available | string | Balance available |
balance_list[n].frozen | string | Frozen balance |
balance_list[n].margin | string | Position margin |
balance_list[n].transferrable | string | Balance available for transfers |
balance_list[n].unrealized_pnl | string | Unrealized profit |
balance_list[n].equity | string | Equity |
- 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 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
}