Skip to main content

Get Wallet Balance

Obtain wallet balance, query asset information of each currency. By default, currency information with assets or liabilities of 0 is not returned.

info

Under the new logic of UTA manual borrow, spotBorrow field corresponding to spot liabilities is detailed in the announcement.

Old walletBalance = New walletBalance - spotBorrow

HTTP Request

GET /v5/account/wallet-balance

Request Parameters

ParameterRequiredTypeComments
accountTypetruestringAccount type
  • UTA2.0: UNIFIED
  • UTA1.0: UNIFIED, CONTRACT(inverse derivatives wallet)
  • Classic account: CONTRACT, SPOT
To get Funding wallet balance, please go to this endpoint
coinfalsestringCoin name, uppercase only
  • If not passed, it returns non-zero asset info
  • You can pass multiple coins to query, separated by comma. USDT,USDC

Response Parameters

ParameterTypeComments
listarrayObject
> accountTypestringAccount type
> accountLTVstringdeprecated field
> accountIMRatestringAccount IM rate
  • You can refer to this Glossary to understand the below fields calculation and mearning
  • All account wide fields are not applicable to
    UTA2.0(isolated margin),
    UTA1.0(isolated margin), UTA1.0(CONTRACT),
    classic account(SPOT, CONTRACT)
  • > accountIMRateByMpstringAccount IM rate calculated by mark price
    > accountMMRatestringAccount MM rate
    > accountMMRateByMpstringAccount MM rate calculated by mark price
    > totalEquitystringAccount total equity (USD)
    > totalWalletBalancestringAccount wallet balance (USD): ∑Asset Wallet Balance By USD value of each asset
    > totalMarginBalancestringAccount margin balance (USD): totalWalletBalance + totalPerpUPL
    > totalAvailableBalancestringAccount available balance (USD), Cross Margin: totalMarginBalance - totalInitialMargin
    > totalPerpUPLstringAccount Perps and Futures unrealised p&l (USD): ∑Each Perp and USDC Futures upl by base coin
    > totalInitialMarginstringAccount initial margin (USD): ∑Asset Total Initial Margin Base Coin
    > totalInitialMarginByMpstringAccount initial margin (USD) calculated by mark price: ∑Asset Total Initial Margin Base Coin calculated by mark price
    > totalMaintenanceMarginstringAccount maintenance margin (USD): ∑ Asset Total Maintenance Margin Base Coin
    > totalMaintenanceMarginByMpstringAccount maintenance margin (USD) calculated by mark price: ∑ Asset Total Maintenance Margin Base Coin calculated by mark price
    > coinarrayObject
    >> coinstringCoin name, such as BTC, ETH, USDT, USDC
    >> equitystringEquity of coin
    >> usdValuestringUSD value of coin
    >> walletBalancestringWallet balance of coin
    >> freestringAvailable balance for Spot wallet. This is a unique field for Classic SPOT
    >> lockedstringLocked balance due to the Spot open order
    >> spotHedgingQtystringThe spot asset qty that is used to hedge in the portfolio margin, truncate to 8 decimals and "0" by default
    >> borrowAmountstringBorrow amount of current coin
    >> availableToWithdrawstringNote: this field is deprecated for accountType=UNIFIED from 9 Jan, 2025
    • Transferable balance: you can use Get Transferable Amount (Unified) or Get All Coins Balance instead
    • Derivatives available balance:
      isolated margin: walletBalance - totalPositionIM - totalOrderIM - locked - bonus
      cross & portfolio margin: look at field totalAvailableBalance(USD), which needs to be converted into the available balance of accordingly coin through index price
    • Spot (margin) available balance: refer to Get Borrow Quota (Spot)
    >> accruedIntereststringAccrued interest
    >> totalOrderIMstringPre-occupied margin for order. 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
    >> bonusstringBonus. This is a unique field for accounType=UNIFIED
    >> marginCollateralbooleanWhether it can be used as a margin collateral currency (platform), true: YES, false: NO
  • When marginCollateral=false, then collateralSwitch is meaningless
  • >> collateralSwitchbooleanWhether the collateral is turned on by user (user), true: ON, false: OFF
  • When marginCollateral=true, then collateralSwitch is meaningful
  • >> availableToBorrowstringdeprecated field, always return "". Please refer to availableToBorrow in the Get Collateral Info
    >> spotBorrowstringBorrow amount by spot margin trade and manual borrow amount (does not include borrow amount by spot margin active order). spotBorrow field corresponding to spot liabilities is detailed in the announcement.

    Request Example

    GET /v5/account/wallet-balance?accountType=UNIFIED&coin=BTC HTTP/1.1
    Host: api-testnet.bybit.com
    X-BAPI-SIGN: XXXXX
    X-BAPI-API-KEY: xxxxxxxxxxxxxxxxxx
    X-BAPI-TIMESTAMP: 1672125440406
    X-BAPI-RECV-WINDOW: 5000

    Response Example

    {
    "retCode": 0,
    "retMsg": "OK",
    "result": {
    "list": [
    {
    "totalEquity": "3.31216591",
    "accountIMRate": "0",
    "accountIMRateByMp": "0",
    "totalMarginBalance": "3.00326056",
    "totalInitialMargin": "0",
    "totalInitialMarginByMp": "0",
    "accountType": "UNIFIED",
    "totalAvailableBalance": "3.00326056",
    "accountMMRate": "0",
    "accountMMRateByMp": "0",
    "totalPerpUPL": "0",
    "totalWalletBalance": "3.00326056",
    "accountLTV": "0",
    "totalMaintenanceMargin": "0",
    "totalMaintenanceMarginByMp": "0",
    "coin": [
    {
    "availableToBorrow": "3",
    "bonus": "0",
    "accruedInterest": "0",
    "availableToWithdraw": "0",
    "totalOrderIM": "0",
    "equity": "0",
    "totalPositionMM": "0",
    "usdValue": "0",
    "spotHedgingQty": "0.01592413",
    "unrealisedPnl": "0",
    "collateralSwitch": true,
    "borrowAmount": "0.0",
    "totalPositionIM": "0",
    "walletBalance": "0",
    "cumRealisedPnl": "0",
    "locked": "0",
    "marginCollateral": true,
    "coin": "BTC",
    "spotBorrow": "0"
    }
    ]
    }
    ]
    },
    "retExtInfo": {},
    "time": 1690872862481
    }