How to Calculate the Liquidation Price of a Perpetual Contract
The liquidation price is the price at which the system forcibly closes a Perpetual Contract position. You calculate it from the average entry price, the position margin, the maintenance margin, the contract value and the taker fee rate. This article uses a Gold (XAUUSD) Perpetual Contract example to show the calculation for four cases: isolated long, isolated short, cross long and cross short. In the example, the isolated long liquidation price is about 2,986 USD per oz, the isolated short is about 3,615 USD per oz, the cross long is about 2,318 USD per oz, and the cross short is about 4,281 USD per oz, against an entry price of 3,300 USD per oz.
Key terms
- Liquidation price: the estimated price at which a position is forcibly closed.
- Isolated margin mode: each position is calculated on its own, using only the margin assigned to it.
- Cross margin mode: the whole available account balance absorbs the risk of all cross positions.
- Average entry price: the average price at which the position was opened.
- Quantity: the number of contracts in the position.
- Contract value: the amount of the underlying asset in one contract. In this example, 0.01 oz per contract.
- Leverage: the multiple applied to your margin. In this example, 10x.
- Taker fee rate: the fee rate for orders that remove liquidity. In this example, 0.05% (0.0005).
- Maintenance margin ratio (MMR): the ratio used to set the minimum margin a position must keep. In this example, 0.5% (0.005).
- Maintenance margin (MM): the minimum margin a position must keep. Formula: Average entry price × Quantity × Contract value × MMR.
- Position margin: the margin the position holds. Long formula: Average entry price × Quantity × Contract value × (1/Leverage + Taker fee rate).
- Wallet balance: the cash balance in the contract account, used in cross margin mode.
When liquidation is triggered
Liquidation is triggered when the Maintenance Margin Ratio of a position (or of the cross margin account) reaches 100% or less. At that point, losses have reduced equity to the maintenance margin level. The position can no longer absorb further losses, so the system starts forced liquidation automatically.
Isolated margin liquidation price formulas
In isolated margin mode, the liquidation price depends only on the position’s average entry price, its margin and its maintenance margin. Funds elsewhere in the account do not change it.
Long:
Liquidation Price = (Maintenance Margin − Position Margin + Average Entry Price × Quantity × Contract Value) ÷ [Quantity × Contract Value × (1 − Taker Fee Rate)]
Short:
Liquidation Price = (Average Entry Price × Quantity × Contract Value + Position Margin − Maintenance Margin) ÷ [Quantity × Contract Value × (1 + Taker Fee Rate)]
Example inputs for the isolated and cross scenarios
- Gold entry price (average entry price): 3,300 USD per oz.
- Position size: 1 contract.
- Contract value: 0.01 oz per contract.
- Leverage: 10x.
- Taker fee rate: 0.05% (0.0005).
- Maintenance margin ratio: 0.5% (0.005).
- Wallet balance (cross scenarios only): 10 USD.
Scenario 1: isolated long
- Notional value: 3,300 × 1 × 0.01 = 33 USD.
- Position margin: 33 × (1/10 + 0.05%) = 33 × 0.1005 = 3.3165 USD.
- Maintenance margin: 33 × 0.5% = 0.165 USD.
- Liquidation price: (0.165 − 3.3165 + 33) ÷ [1 × 0.01 × (1 − 0.05%)] = 29.8485 ÷ 0.009995.
Result: the isolated long liquidation price is about 2,986 USD per oz, about 9.5% below the entry price.
In isolated margin mode, the maximum loss on a long position is limited to its position margin (about 3.32 USD). Other funds in the account are not affected.
Scenario 2: isolated short
- Notional value: 33 USD.
- Position margin (short): 33 × [(1/10 + 0.05%) × (1 + 0.05%) + 0.05% × (1 − 0.5%)] = 33 × [0.1005 × 1.0005 + 0.0005 × 0.995] ≈ 33 × 0.10105 ≈ 3.3347 USD.
- Maintenance margin: 33 × 0.5% = 0.165 USD.
- Liquidation price: (33 + 3.3347 − 0.165) ÷ [1 × 0.01 × (1 + 0.05%)] = 36.1697 ÷ 0.010005.
Result: the isolated short liquidation price is about 3,615 USD per oz, about 9.5% above the entry price.
Cross margin liquidation price formula
In cross margin mode, the liquidation price is affected by the wallet balance and by the profit and loss (PnL) of other cross positions. The formula below is simplified for one contract, with no isolated positions and no pending orders:
Cross Margin Liquidation Price = [Wallet Balance − Total Maintenance Margin − Long Average Entry Price × Long Quantity × Contract Value + Short Average Entry Price × Short Quantity × Contract Value] ÷ [Contract Value × ((Taker Fee Rate − 1) × Long Quantity + (1 + Taker Fee Rate) × Short Quantity)]
If the account holds cross positions in several contracts, add the unrealized PnL of the other contracts to the numerator. Also subtract their liquidation fees and maintenance margins. The example in this article uses a single contract.
Scenario 3: cross long
- Total maintenance margin: 3,300 × 1 × 0.01 × 0.5% = 0.165 USD.
- Numerator (short quantity is 0): 10 − 0.165 − 33 + 0 = −23.165.
- Denominator: 0.01 × [(0.0005 − 1) × 1 + 0] = −0.009995.
- Liquidation price: −23.165 ÷ −0.009995.
Result: the cross long liquidation price is about 2,318 USD per oz, about 29.8% below the entry price. The extra wallet balance (about 6.68 USD above the isolated position margin of about 3.32 USD) moves the liquidation price lower, so the position can withstand a larger price fall than in isolated mode.
Scenario 4: cross short
- Total maintenance margin: 3,300 × 1 × 0.01 × 0.5% = 0.165 USD.
- Numerator (long quantity is 0): 10 − 0.165 − 0 + 33 = 42.835.
- Denominator: 0.01 × [0 + (1 + 0.0005) × 1] = 0.010005.
- Liquidation price: 42.835 ÷ 0.010005.
Result: the cross short liquidation price is about 4,281 USD per oz, about 29.7% above the entry price. In cross margin mode, losses on other cross positions reduce overall equity. That raises the liquidation price for longs and lowers it for shorts, which makes liquidation easier. This is the main risk of cross margin mode.
Summary of the four scenarios
| Scenario | Mode | Direction | Liquidation price (USD per oz) | Distance from entry |
| Scenario 1 | Isolated margin | Long | about 2,986 | down about 9.5% |
| Scenario 2 | Isolated margin | Short | about 3,615 | up about 9.5% |
| Scenario 3 | Cross margin | Long | about 2,318 | down about 29.8% |
| Scenario 4 | Cross margin | Short | about 4,281 | up about 29.7% |
Factors that move the liquidation price
- Adding margin (isolated): the long liquidation price moves down, and the short liquidation price moves up. Both are safer.
- Reducing leverage: the long liquidation price moves down, and the short liquidation price moves up.
- Partially closing a position: the liquidation price is recalculated and is generally safer.
- A funding fee is deducted: the margin falls. The long liquidation price moves up slightly, and the short liquidation price moves down slightly.
- Other cross positions at a loss: the cross liquidation price moves up for longs and down for shorts. This is dangerous.
- Other cross positions at a profit: the cross liquidation price moves down for longs and up for shorts. This is safer.
How to monitor the distance to the liquidation price
Each position in the contract trading interface shows an estimated liquidation price in real time. It updates when you add margin or partially close the position.
Use this formula to measure the distance:
Liquidation Distance Ratio = |Current Mark Price − Estimated Liquidation Price| ÷ Current Mark Price × 100%
Example: if the current mark price is 3,000 USD and the estimated liquidation price is 2,880 USD, the liquidation distance ratio is 4%. Only about 4% of price movement separates the current price from liquidation.
Recommended actions:
- Check the distance between the estimated liquidation price and the current mark price regularly.
- When the distance narrows significantly, decide whether to add margin, reduce the position or set a stop-loss.
- When you set a stop-loss, leave a buffer before the estimated liquidation price.
Risk warning: the estimated liquidation price is for risk reference only. Fast market moves, changes in liquidity, fee deductions or changes in account equity can make the actual liquidation differ from the estimate.
For the liquidation trigger, execution process and bankruptcy price, see Perpetual Contract Liquidation Rules.