BitMEX uses eight core margin terms: wallet balance, unrealised PnL, margin balance, position margin, order margin, available balance, withdrawable balance, and locked balance. Each term represents a different aspect of how your funds are allocated, locked, and made available for trading, withdrawals, or collateral.
What Is Wallet Balance?
Wallet balance is the sum of deposited and withdrawn cryptocurrency (both completed and pending), plus realised profit or loss. It is calculated separately for each relevant cryptocurrency.
Formula: Wallet Balance = Deposits - Withdrawals + Realised PNL
Wallet balance only changes when you deposit, withdraw, or close a position (realising PnL). It does not fluctuate with open position performance.
What Is Unrealised PnL?
Unrealised PnL is the total unrealised profit or loss from your portfolio’s open positions. You convert unrealised PnL into realised PnL by closing a position.
The exact formula depends on the contract, but for the example of XBTUSD unrealised PnL is calculated using the formula:
Formula: Unrealised PNL = Number of Lots x Multiplier x (100 / Average Entry Price - 100 / Mark Price)
This value is calculated against the Mark price, not the last traded price. The Mark price is a fair-value index that protects against manipulation and scam wicks.
What Is Margin Balance?
Margin balance is your total equity held with the exchange. It combines your wallet balance with your unrealised PnL.
Formula: Margin Balance = Wallet Balance + Unrealised PNL
Margin balance fluctuates in real time as your open positions gain or lose value. It represents the total value of your account at any given moment.
What Is Position Margin?
Position margin is the amount of margin allocated to your open positions. It is calculated as the entry value of all contracts you hold, divided by the selected leverage, plus unrealised profit and loss.
The formula differs between margin modes:
Cross margin: Position Margin = Entry Value / Leverage
Isolated margin: Position Margin = Entry Value / Leverage + Unrealised PNL
Under cross margin, unrealised PnL is managed at the account level rather than the position level. Under isolated margin, unrealised PnL is tracked per position.
What Is Order Margin?
Order margin is the minimum amount of equity required to retain your open orders. It is calculated as the value of all open orders divided by the selected leverage.
Formula: Order Margin = Order Value / Leverage
Order margin is reserved when you place a limit order that has not yet been filled. Once the order is filled, the margin converts from order margin to position margin.
What Is Available Balance?
Available balance is the margin available for new positions. The calculation differs between cross and isolated margin modes.
Cross margin: Available Balance = Margin Balance - Order Margin - Position Margin
Isolated margin: Available Balance = Wallet Balance - Initial Margin / Order Cost - Order Margin
On cross margin, available balance can include unrealised PnL from open positions. However, unrealised PnL can only be used to trade derivatives. It cannot be withdrawn, transferred, or used to trade Spot or Convert.
What Is Withdrawable Balance?
Withdrawable balance is the margin you can withdraw or use for Spot and Convert trading. It can differ from available balance if you have unrealised PnL, because unrealised PnL cannot be withdrawn.
Formula: Withdrawable Balance = Max(0, Min(Wallet Balance, Margin Balance) - Position Margin - Order Margin)
This formula ensures you can only withdraw funds that are fully realised and not committed to open positions or orders.
What Is Locked Balance?
Locked balance is funds reserved for your open orders (order margin) and open positions (position margin). These funds are not available for new trades or withdrawals.
To make locked funds available, you can cancel your orders or close your positions on the BitMEX Trade page.