Wallet
Subscribe to the wallet stream to see changes to your wallet in real-time.
Topic:
user.wallet.unifiedAccount
Response Parameters
Parameter | Type | Comments |
---|---|---|
id | string | Message id |
topic | string | Topic name |
type | string | Message type. snapshot |
ts | number | The timestamp (ms) that system generates the data. |
data | Object | |
> version | integer | Version |
> result | Object | |
>> accountIMRate | string | Initial Margin Rate: Account Total Initial Margin Base Coin / Account Margin Balance Base Coin. |
>> accountMMRate | string | Maintenance Margin Rate: Account Total Maintenance Margin Base Coin / Account Margin Balance Base Coin. |
>> totalEquity | string | Equity of account converted to usd:Account Margin Balance Base Coin + Account Option Value Base Coin. |
>> totalWalletBalance | string | Wallet Balance of account converted to usd:∑ Asset Wallet Balance Base Coin |
>> totalMarginBalance | string | Margin Balance of account converted to usd:Account Wallet Balance Base Coin + Account Perp UPL Base Coin. |
>> totalAvailableBalance | string | Available Balance of account converted to usd:RM:Account Margin Balance Base Coin - Account Initial Margin Base Coin. |
>> totalPerpUPL | string | Unrealised P&L of perpetuals of account converted to usd:∑ Asset Perp UPL Base Coin. |
>> totalInitialMargin | string | Initial Margin of account converted to usd:∑ Asset Total Initial Margin Base Coin. |
>> totalMaintenanceMargin | string | Maintenance Margin of account converted to usd: ∑ Asset Total Maintenance Margin Base Coin. |
>> coin | array | Object |
>>> currencyCoin | string | Coin name, such as BTC, ETH, USDT, USDC |
>>> equity | string | Equity |
>>> usdValue | string | usd value |
>>> walletBalance | string | Wallet balance |
>>> marginBalance | string | MB from other assets + the actual MB balance from the current assets |
>>> availableBalance | string | AB from other assets + the actual AB balance from the current assets (cannot be negative) |
>>> marginBalanceWithoutConvert | string | Margin balance |
>>> availableBalanceWithoutConvert | string | Available balance, Margin Balance - Total Initial Margin |
>>> borrowSize | string | Lending amount used. For USDC and USDT only. For BTC and ETH, return 0 |
>>> availableToBorrow | string | Depreciated field, always return "" due to feature of main-sub uid sharing borrow quota |
>>> accruedInterest | string | Accrued interest of an asset |
>>> totalOrderIM | string | Order margin pre-occupied. For portfolio margin mode, it returns "" |
>>> totalPositionIM | string | Sum of initial margin of all positions + Pre-occupied liquidation fee. For portfolio margin mode, it returns "" |
>>> totalPositionMM | string | Sum of maintenance margin for all positions. For portfolio margin mode, it returns "" |
>>> unrealisedPnl | string | Unrealised P&L |
>>> cumRealisedPnl | string | Cumulative Realised P&L |
Stream Example
{
"id": "5332858071ac1a-adcf-4c22-9967-4bdb763d993d",
"topic": "user.wallet.unifiedAccount",
"ts": 1673246212184,
"data": {
"result": {
"accountIMRate": "0.1062",
"accountMMRate": "0.0126",
"totalEquity": "5306.99168766",
"totalWalletBalance": "5015.81303189",
"totalMarginBalance": "5315.50124767",
"totalAvailableBalance": "4750.87543737",
"totalPerpUPL": "299.68821577",
"totalInitialMargin": "564.62581029",
"totalMaintenanceMargin": "67.39562585",
"coin": [
{
"currencyCoin": "USDC",
"equity": "696.90520008",
"usdValue": "696.90520008",
"walletBalance": "702.87476009",
"marginBalance": "5315.50124767",
"availableBalance": "4750.87543737",
"marginBalanceWithoutConvert": "705.41476009",
"availableBalanceWithoutConvert": "472.43375944",
"borrowSize": "0",
"availableToBorrow": "1500000",
"accruedInterest": "0",
"totalOrderIM": "172.47750096",
"totalPositionIM": "60.50349967",
"totalPositionMM": "16.09254346",
"unrealisedPnl": "-2.07956",
"cumRealisedPnl": "153.26214849"
},
{
"currencyCoin": "USDT",
"equity": "2989.97442076",
"usdValue": "2975.11272839",
"walletBalance": "2691.34184935",
"marginBalance": "5330.29357298",
"availableBalance": "4750.7346256",
"marginBalanceWithoutConvert": "2989.97442076",
"availableBalanceWithoutConvert": "2658.33944077",
"borrowSize": "0",
"availableToBorrow": "2500000",
"accruedInterest": "0",
"totalOrderIM": "0.9205456",
"totalPositionIM": "330.71443439",
"totalPositionMM": "51.24010721",
"unrealisedPnl": "298.63257142",
"cumRealisedPnl": "-3418.29414098"
}
]
},
"version": 177440
},
"type": "snapshot"
}