Skip to main content

Get Contract Account Balance

HTTP Request

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

Request Parameters

ParameterRequiredTypeComments
accountTypetruestringAccount type
  • Normal account: CONTRACT
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
> 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 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
>> availableToWithdrawstringAvailable amount to withdraw of current coin
>> 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=CONTRACT 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": "CONTRACT",
"accountIMRate": "",
"accountMMRate": "",
"totalEquity": "",
"totalWalletBalance": "",
"totalMarginBalance": "",
"totalAvailableBalance": "",
"totalPerpUPL": "",
"totalInitialMargin": "",
"totalMaintenanceMargin": "",
"accountLTV": "",
"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
}