Skip to main content

Get Wallet Balance

HTTP Request

GET /cloud/trade/v3/account/wallet-balance

Request Parameters

ParameterRequiredTypeComments
accountTypetruestringAccount type. Trading account: UNIFIED
coinfalsestringCoin name
  • If not passed, it returns non-zero asset info
  • You can pass multiple coins to query, separated by comma.

Response Parameters

ParameterTypeComments
listarrayObject
> accountTypestringAccount type
> accountIMRatestringAccount IM rate. All account wide fields are not applicable to Trading account (isolated margin)
> accountMMRatestringAccount MM rate
> totalWalletBalancestringWallet Balance of account converted to usd:∑ Asset Wallet Balance By USD value of each asset。
> totalMarginBalancestringMargin Balance of account converted to usd:totalWalletBalance + totalPerpUPL.
> totalAvailableBalancestringAvailable Balance of account converted to usd:Regular mode:totalMarginBalance - totalInitialMargin.
> 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
>> coinstringCoin name, such as BTC, ETH, USDT
>> equitystringEquity of current coin
>> usdValuestringUSD value of current coin.
>> walletBalancestringWallet balance of current coin
>> availableToWithdrawstringNote: this field is deprecated for accountType=UNIFIED from 9 Jan, 2025
  • Derivatives available balance:
    isolated margin: walletBalance - totalPositionIM - totalOrderIM - locked - bonus
    cross margin: look at field totalAvailableBalance(USD), which needs to be converted into the available balance of accordingly coin through index price
>> totalOrderIMstringPre-occupied margin for order.
>> totalPositionIMstringSum of initial margin of all positions + Pre-occupied liquidation fee.
>> totalPositionMMstringSum of maintenance margin for all positions.
>> unrealisedPnlstringUnrealised P&L
>> cumRealisedPnlstringCumulative Realised P&L
>> bonusstringBonus.

Request Example

GET /cloud/trade/v3/account/wallet-balance?accountType=UNIFIED HTTP/1.1
Host: openapi-testnet.zoomex.com
X-BAPI-SIGN: XXXXX
X-BAPI-API-KEY: XXXXX
X-BAPI-TIMESTAMP: 1672125440406
X-BAPI-RECV-WINDOW: 5000

Response Example

{
"retCode": 0,
"retMsg": "OK",
"result": {
"list": [
{
"accountType": "UNIFIED",
"accountIMRate": "",
"accountMMRate": "",
"totalEquity": "",
"totalWalletBalance": "",
"totalMarginBalance": "",
"totalAvailableBalance": "",
"totalPerpUPL": "",
"totalInitialMargin": "",
"totalMaintenanceMargin": "",
"coin": [
{
"coin": "BTC",
"equity": "0",
"usdValue": "",
"walletBalance": "0",
"borrowAmount": "",
"availableToBorrow": "",
"availableToWithdraw": "0",
"accruedInterest": "",
"totalOrderIM": "0",
"totalPositionIM": "0",
"totalPositionMM": "",
"unrealisedPnl": "0",
"cumRealisedPnl": "0.12384551"
},
{
"coin": "ETH",
"equity": "0.30050274",
"usdValue": "",
"walletBalance": "0.30050274",
"borrowAmount": "",
"availableToBorrow": "",
"availableToWithdraw": "0.30050274",
"accruedInterest": "",
"totalOrderIM": "0",
"totalPositionIM": "0",
"totalPositionMM": "",
"unrealisedPnl": "0",
"cumRealisedPnl": "0"
},
{
"coin": "EOS",
"equity": "900.3811056",
"usdValue": "",
"walletBalance": "900.3811056",
"borrowAmount": "",
"availableToBorrow": "",
"availableToWithdraw": "900.3811056",
"accruedInterest": "",
"totalOrderIM": "0",
"totalPositionIM": "0",
"totalPositionMM": "",
"unrealisedPnl": "0",
"cumRealisedPnl": "0"
},
{
"coin": "XRP",
"equity": "1100.7278334",
"usdValue": "",
"walletBalance": "1100.7278334",
"borrowAmount": "",
"availableToBorrow": "",
"availableToWithdraw": "1100.7278334",
"accruedInterest": "",
"totalOrderIM": "0",
"totalPositionIM": "0",
"totalPositionMM": "",
"unrealisedPnl": "0",
"cumRealisedPnl": "0"
},
{
"coin": "USDT",
"equity": "60028.59717864",
"usdValue": "",
"walletBalance": "59991.29717864",
"borrowAmount": "",
"availableToBorrow": "",
"availableToWithdraw": "55992.23760272",
"accruedInterest": "",
"totalOrderIM": "0",
"totalPositionIM": "3999.05957592",
"totalPositionMM": "",
"unrealisedPnl": "37.3",
"cumRealisedPnl": "-59483.31410791"
}
]
}
]
},
"retExtInfo": {},
"time": 1696667951890
}