DEX liquidation price calculation guide

What Is a Liquidation Price?

When you open a leveraged position on a perpetual DEX, you put up collateral (margin) and borrow the rest from the exchange. Your liquidation price is the exact price level at which your remaining margin is no longer sufficient to cover the borrowed amount. When the market hits this price, the exchange forcefully closes your position to prevent losses from exceeding your deposited collateral.

Understanding your liquidation price before entering a trade is not optional — it is the difference between a controlled loss and a wiped-out account. Every DEX displays this number in the trading interface, but knowing how it is calculated gives you a real edge in risk management.

The Liquidation Price Formula

For a standard isolated-margin long position, the liquidation price is calculated as:

Liquidation Price = Entry Price × (1 - 1/Leverage + Maintenance Margin Rate)

Let's break this down with an example. Suppose you open a 10x leveraged long on BTC at $74,000 with $1,000 in margin. Your position size is $10,000. If the maintenance margin rate is 0.5%:

Liquidation Price = $74,000 × (1 - 1/10 + 0.005) = $74,000 × (1 - 0.10 + 0.005) = $74,000 × 0.905 = $66,970

This means if BTC drops 9.5% from your entry to $66,970, your position gets liquidated — and you lose your entire $1,000 margin.

How Leverage Affects Liquidation Distance

Leverage is the single biggest factor determining how close your liquidation price sits to your entry. The relationship is not linear — doubling your leverage more than halves your liquidation buffer:

  • 5x leverage: Liquidation is roughly 19% away from entry (plenty of room)
  • 10x leverage: Liquidation is roughly 9% away (moderate buffer)
  • 20x leverage: Liquidation is roughly 4.5% away (tight)
  • 50x leverage: Liquidation is roughly 1.5% away (extremely tight)

At 50x leverage, a mere 1.5% adverse move wipes out your entire position. This is why experienced traders use lower leverage on volatile assets and reserve high leverage only for very short timeframes with tight stop losses.

Cross Margin vs Isolated Margin Liquidation

Most perpetual DEXs, including Hyperliquid and Lighter, offer two margin modes:

Isolated margin limits the collateral to what you specifically allocate to that position. If the position gets liquidated, you only lose that allocated amount — your other funds remain safe. The liquidation price is calculated based solely on the margin assigned to that position.

Cross margin uses your entire account balance as collateral. This pushes your liquidation price further away but means all your funds are at risk if the position goes badly wrong. Cross margin is useful for hedging scenarios or when you are confident in a position but want to avoid premature liquidation from short-term wicks.

Practical Strategies to Avoid Liquidation

1. Use Stop-Loss Orders Religiously

A stop-loss order closes your position at a price you choose, long before liquidation becomes a threat. Set your stop loss at a level where your trade thesis is invalidated — not where you hope to minimize the loss. A good rule of thumb: set your stop so that if it triggers, you lose no more than 1-2% of your total account value.

2. Choose Lower Leverage

This is the simplest and most effective way to avoid liquidation. At 3-5x leverage, you can survive significant market swings and noise without being stopped out. Lower leverage also reduces the emotional pressure of watching every tick.

3. Monitor Your Margin Ratio

Your margin ratio is the percentage of your collateral that is being used. Keep it well below the maintenance requirement. For example, if maintenance margin is 5%, keep your used margin below 50% of your available balance. This buffer gives you time to react to adverse moves without facing immediate liquidation.

4. Avoid Trading Around High-Volatility Events

Economic data releases, Fed announcements, and major protocol upgrades can cause rapid price swings. A healthy liquidation buffer can evaporate in seconds during these events. Either close positions before scheduled events or widen your stop-loss levels significantly.

Trade with Confidence on Hyperliquid

Use code HOLYGRAIL for access to isolated margin, real-time liquidation tracking, and deep liquidity

Start Trading →

Related Reading