Skip to main content

Wallet

Subscribe to the wallet stream to see changes to your wallet in real-time.

Topic:
user.wallet.unifiedAccount

Response Parameters

ParameterTypeComments
idstringMessage id
topicstringTopic name
typestringMessage type. snapshot
tsnumberThe timestamp (ms) that system generates the data.
dataObject
> versionintegerVersion
> resultObject
>> accountIMRatestringInitial Margin Rate: Account Total Initial Margin Base Coin / Account Margin Balance Base Coin.
>> accountMMRatestringMaintenance Margin Rate: Account Total Maintenance Margin Base Coin / Account Margin Balance Base Coin.
>> totalEquitystringEquity of account converted to usd:Account Margin Balance Base Coin + Account Option Value Base Coin.
>> totalWalletBalancestringWallet Balance of account converted to usd:∑ Asset Wallet Balance Base Coin
>> totalMarginBalancestringMargin Balance of account converted to usd:Account Wallet Balance Base Coin + Account Perp UPL Base Coin.
>> totalAvailableBalancestringAvailable Balance of account converted to usd:RM:Account Margin Balance Base Coin - Account Initial Margin Base Coin.
>> totalPerpUPLstringUnrealised P&L of perpetuals of account converted to usd:∑ Asset Perp UPL Base Coin.
>> totalInitialMarginstringInitial Margin of account converted to usd:∑ Asset Total Initial Margin Base Coin.
>> totalMaintenanceMarginstringMaintenance Margin of account converted to usd: ∑ Asset Total Maintenance Margin Base Coin.
>> coinarrayObject
>>> currencyCoinstringCoin name, such as BTC, ETH, USDT, USDC
>>> equitystringEquity
>>> usdValuestringusd value
>>> walletBalancestringWallet balance
>>> marginBalancestringMB from other assets + the actual MB balance from the current assets
>>> availableBalancestringAB from other assets + the actual AB balance from the current assets (cannot be negative)
>>> marginBalanceWithoutConvertstringMargin balance
>>> availableBalanceWithoutConvertstringAvailable balance, Margin Balance - Total Initial Margin
>>> borrowSizestringLending amount used. For USDC and USDT only. For BTC and ETH, return 0
>>> availableToBorrowstringDepreciated field, always return "" due to feature of main-sub uid sharing borrow quota
>>> accruedIntereststringAccrued interest of an asset
>>> totalOrderIMstringOrder margin pre-occupied. For portfolio margin mode, it returns ""
>>> totalPositionIMstringSum of initial margin of all positions + Pre-occupied liquidation fee. For portfolio margin mode, it returns ""
>>> totalPositionMMstringSum of maintenance margin for all positions. For portfolio margin mode, it returns ""
>>> unrealisedPnlstringUnrealised P&L
>>> cumRealisedPnlstringCumulative 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"
}