A trader opens a 10x leveraged long position on Bitcoin at $45,000 using $1,000 in collateral on a decentralized exchange. The position size becomes $10,000 notional. Within hours, the price moves to $44,000. The trader receives a liquidation warning. But at what exact price does the exchange force the position closed, and how do margin, fees, and the exchange’s liquidation mechanism determine that threshold? The answer is not intuitive without understanding the underlying formula, and miscalculating liquidation price has cost traders substantial losses across perpetual futures platforms.
Liquidation price is the price level at which a trader’s collateral falls below the minimum required to support an open position. On a decentralized exchange operating on its own blockchain, that calculation is transparent on-chain but still requires careful interpretation. Understanding how leverage, entry price, maintenance margin ratio, and trading fees combine to determine your liquidation threshold is not optional for anyone using perpetual futures. This walkthrough uses real position examples to show the precise math, how different margin modes affect the calculation, and why the formula matters more than any calculator that hides the logic.

The core liquidation formula and what each variable means
Every perpetual futures liquidation depends on a consistent principle: when your account equity falls below the maintenance margin requirement, your position becomes subject to forced closure. The mathematical foundation is straightforward, but the terms require precise definition. Let’s define:
Liquidation Price = Entry Price ± (Collateral × Leverage × Maintenance Margin Ratio) / (Position Size)
This formula applies to long positions with a minus sign and short positions with a plus sign. The direction matters because long positions are liquidated when price falls below the threshold, while short positions are liquidated when price rises above it. More formally, a position liquidates when the margin ratio—the ratio of account equity to notional position size—falls to or below the maintenance margin requirement set by the exchange.
On hyperliquid, the base maintenance margin for perpetual futures is 5%, meaning your account must hold at least 5% of your position size in equity to avoid liquidation. A position is liquidatable at precisely the price where equity equals maintenance margin times position size. Before that point is reached, the exchange allows you to operate. At that point, liquidation mechanics are triggered. Understanding this relationship is essential because leverage amplifies both gains and losses, and the liquidation price is where leverage turns a loss into a forced exit.
Walking through a long position: entry, collateral, and the liquidation boundary
Suppose a trader deposits $5,000 USDC and opens a long position on Ethereum at $2,500 with 5x leverage. Position size is therefore $25,000 notional (5,000 × 5). The trader must now calculate at what price Ethereum can fall before forced closure occurs. Using the maintenance margin of 5% on most perpetual exchanges:
Liquidation Price = $2,500 − ($5,000 × 5 × 0.05) / $25,000
Liquidation Price = $2,500 − ($1,250) / ($25,000)
Liquidation Price = $2,500 − $0.05 = $2,499.95
This result might seem counterintuitive: at only a 5% drop, the position is at liquidation price? The reason lies in how leverage magnifies exposure. A 5x position means your $5,000 equity moves 5x as fast as the underlying price. A 1% price decline means a 5% loss of collateral at 5x leverage. If price falls 1% from $2,500 to $2,475, your position loses $250 in value, reducing account equity from $5,000 to $4,750. That leaves a margin ratio of 4.75 / 25,000 = 0.019 or 1.9%, which is below the 5% maintenance requirement, triggering liquidation.
This is why the term “liquidation price” is more precise than “how far can price move before I lose everything.” You do not lose the entire collateral at liquidation price. Instead, the exchange takes over and closes the position at or near that price. Your remaining equity is what survives after the liquidation and any penalties. If the position closes exactly at liquidation price, you retain roughly 5% of the original position value; if price continues moving against you, the liquidation may execute at an even worse price, and your loss can be larger.
How margin modes change the effective liquidation threshold
Liquidation price calculation is not fixed across all margin modes. Most perpetual futures platforms, including decentralized ones, offer cross margin, isolated margin, and sometimes strict isolated margin modes. Each changes how the exchange treats collateral and position risk.
In cross margin mode, all account collateral backs all open positions. If you have $10,000 in account equity and open multiple positions, each one can borrow against the full $10,000. Liquidation price for each position is therefore higher (safer) because the total account equity is pooled. If one position moves against you, equity in that position decreases, but equity in other profitable positions can offset it, raising the overall margin ratio. This mode is useful for traders managing a portfolio, but it can also hide risk: a cascade of losses across positions can trigger sudden liquidation.
In isolated margin mode, each position has its own isolated collateral bucket. You explicitly allocate a portion of account equity to each position. Liquidation price is calculated only using the collateral in that position, not the total account. A $5,000 allocation to an Ethereum position liquidates independently of other positions, and funds in other positions are protected. This mode is clearer and safer for isolating bets, but it can also be inefficient because unused collateral is locked.
Some platforms offer strict isolated margin, which adds an extra constraint: the isolated collateral cannot be borrowed from other accounts and cannot cover shortfalls. This is the simplest liquidation model and is often preferred by risk-averse traders, but it further reduces leverage availability. The takeaway is that liquidation price is not a platform constant—it depends on the margin mode you selected and how you allocated collateral before entering the position.
The role of trading fees in the true liquidation calculation
Most liquidation walkthroughs omit one critical variable: trading fees. The maintenance margin calculation on many exchanges technically includes a small buffer for fees, but a precise calculation should account for both entry and exit fees explicitly. On perpetual futures platforms, the CFTC oversees rules around leverage and liquidation mechanics to protect traders from hidden liquidation mechanics, yet fee treatment can still reduce effective collateral.
In the Ethereum example above, assume the platform charges a 0.045% taker fee when you close. The effective fee cost when liquidation occurs is approximately 0.045% of position size, or about $11.25 on a $25,000 position. This is a small amount, but it reduces collateral at the moment of liquidation. A more exact formula would be:
Liquidation Price = Entry Price − [(Collateral − (Entry Fee + Liquidation Fee)) × Leverage × Maintenance Margin] / Position Size
For practical purposes, the fee impact is typically small enough that it does not shift liquidation price by more than a few cents on volatile assets. However, in volatile markets or with very tight margin ratios, fees can matter. A trader holding a position near liquidation price should always assume fees could push liquidation closer than the raw math suggests. On a decentralized exchange, every on-chain transaction includes gas costs as well; however, platforms that charge no gas fees eliminate that additional friction.
Short positions and the inverted liquidation boundary
A short position inverts the liquidation logic because the trader profits if price falls and loses if price rises. For a short, liquidation occurs when price rises, not falls. The formula becomes:
Liquidation Price = Entry Price + (Collateral × Leverage × Maintenance Margin Ratio) / Position Size
Suppose a trader shorts Ethereum at $2,500 with $5,000 collateral and 5x leverage (same position size of $25,000). Liquidation price is $2,500 + $0.05 = $2,500.05. If Ethereum rises to $2,500.05, the position is liquidatable. The direction is inverted because a short position loses money when price rises, so the upside limit is the liquidation boundary rather than the downside limit.
The practical implication is that short positions on volatile assets can be riskier in markets that are moving up because price can breach your liquidation threshold faster and with less warning. Many traders find this asymmetry important: they may hold longer-term longs with confidence in a bull market, but shorts require tighter management and faster exits if price begins rising. The liquidation price formula does not change the fundamental risk, but it makes the directional asymmetry explicit.
Understanding liquidation mechanisms: HLP backstop and auto-deleveraging
Knowing your liquidation price is one thing; understanding what happens at that price is another. Decentralized finance platforms employ different mechanisms to manage liquidation and maintain solvency, and these mechanisms affect the actual exit price you receive. On perpetual futures platforms operating as decentralized exchanges, two main mechanisms prevent the order book from collapsing during mass liquidations: a backstop liquidity pool and auto-deleveraging.
A backstop liquidity pool (such as HLP on certain platforms) acts as a last-resort counterparty when liquidations occur faster than the order book can absorb. If liquidation triggers and there is no immediate buyer at liquidation price, the backstop purchases the position at a slightly worse price, protecting other traders from cascading losses. This mechanism is funded by traders who stake collateral into the pool, and they receive a portion of liquidation fees as compensation for providing this service. From a liquidated trader’s perspective, the backstop means you might be closed at a worse price than anticipated, but the liquidation process itself remains orderly.
Auto-deleveraging is a secondary mechanism that reduces the size of multiple open positions proportionally if neither the order book nor the backstop can absorb liquidations. Instead of closing one trader completely, the protocol reduces leverage across all positions in a direction (all longs, or all shorts). This is fairer to the liquidated trader but more disruptive to the market overall. Most platforms use it only as a last resort after the backstop has been exhausted.
The relevance to your liquidation price calculation is this: the actual exit price at liquidation may be worse than the theoretical liquidation price by 0.1% to 1% depending on market conditions and which liquidation mechanism executes. In thin markets or during volatile spikes, liquidation can execute significantly worse. This is not a hidden fee; it is a consequence of liquidity constraints, and understanding this risk should influence your position sizing and margin choice.
Using a liquidation calculator and what it should show you
Most perpetual futures platforms provide a liquidation price calculator integrated into the position entry interface. Before you open a position, the calculator shows the liquidation price given your entry price, collateral, and leverage. A good calculator displays all the variables clearly and recalculates instantly as you adjust leverage or collateral. It also shows the margin ratio at different price levels, not just the single liquidation point.
When evaluating a liquidation calculator, check that it shows: the maintenance margin percentage used; whether fees are included; which margin mode is active; and what happens to liquidation price if you add or remove collateral. A calculator that only shows a number without context can be misleading because it hides the assumptions. For example, a calculator that assumes zero fees will understate true liquidation risk if the platform actually charges taker fees on exit.
A more useful approach is to build your own spreadsheet or use a calculator that displays the formula explicitly. Plug in real numbers: your entry price, leverage, collateral, maintenance margin (typically 5% for base tier), and estimated fees. Recalculate manually at least once before committing real funds. This discipline prevents the common mistake of opening a position without ever asking “at what price do I get liquidated?” Until you can answer that question, you do not fully understand your risk.
Risk management beyond liquidation price
Liquidation price is a hard boundary, but it is not the only risk threshold that matters. The Financial Conduct Authority regulates crypto derivatives trading and requires platforms to disclose leverage limits and liquidation mechanics to protect retail traders, yet you must still manage risk proactively. Most professional traders set stop-loss orders well before reaching liquidation price, often at 50% to 80% of the distance to liquidation.
If your liquidation price is $2,499.95 on a $2,500 entry, placing a stop-loss at $2,499.98 would close your position at a small loss before liquidation executes. This is psychological as well as financial: liquidation is typically a worst-case scenario with losses compounded by panic, slippage, and the possibility of extreme price moves. Exiting at a planned stop-loss price before reaching liquidation is almost always preferable. The discipline to set and execute stops is harder than the math, but it is what separates disciplined traders from those who hold into liquidation.
Another consideration is the liquidation cascade effect. If many traders are liquidated at similar price levels, the liquidation selling itself can push price further down, causing more liquidations. This is especially visible in decentralized perpetual futures markets where liquidation mechanics are transparent on-chain. During extreme volatility, a liquidation price that seemed safe can become a point of no return. Accounting for this systemic risk means avoiding the maximum leverage available and maintaining higher collateral than the minimum required.
Regulatory context and platform risks
Perpetual futures trading is regulated differently across jurisdictions. The European Securities and Markets Authority has set leverage caps on crypto derivatives for retail traders, typically limiting leverage to 2:1 or 5:1 depending on asset volatility, while Ontario’s Securities Commission restricts certain derivative products entirely. Decentralized platforms that operate without geographic restrictions must still comply in jurisdictions where they have users, and many do restrict access from regulated regions.
The implication for liquidation price calculation is that the maximum leverage available to you depends on where you are located and what the platform supports. A platform offering 20x leverage may not offer it to all users, and regulatory changes could force deleveraging of existing positions. Before calculating an aggressive liquidation scenario, verify that your platform is operating legally in your jurisdiction and that your leverage tier will remain available.
Beyond regulation, the platform itself is a technical risk. Cryptocurrency exchanges and blockchain-based platforms carry smart contract risk, meaning bugs or exploits in the code could affect liquidation mechanics, collateral safety, or settlement. Even decentralized exchanges that do not hold your private keys can experience outages, bridge failures (if cross-chain deposits are used), or consensus failures. These risks are not reflected in the liquidation price formula, but they are real. Understanding that a well-calculated liquidation price is only as good as the platform executing it is important for proper risk assessment.
Frequently asked questions
What is the exact formula for liquidation price on hyperliquid?
For long positions: Liquidation Price = Entry Price − (Collateral × Leverage × Maintenance Margin Ratio) / Position Size. For shorts, add instead of subtract. Maintenance margin is typically 5%. The formula applies to cross margin mode; isolated margin uses only the isolated collateral. Fees and the specific margin mode can shift the calculation slightly.
Does my liquidation price change if I add more collateral?
Yes. Adding collateral to an open position raises your liquidation price (for longs, makes it lower; for shorts, makes it higher), meaning the position becomes safer. Removing collateral lowers the liquidation price (makes it easier to hit). On a decentralized exchange, adjusting collateral is typically an on-chain transaction, so you should factor in any associated costs.
Can I avoid liquidation by closing my position at a better price before liquidation price is reached?
Yes. Liquidation price is the exchange’s forced closure threshold, but you can close (or reduce) your position voluntarily at any price above it. Many traders use stop-loss orders to close at a predetermined price well before reaching liquidation, accepting a planned loss rather than risking forced liquidation with larger slippage or fees.
How does hyperliquid’s HLP backstop affect my liquidation price?
The HLP backstop does not change your calculated liquidation price, but it affects the actual exit price when liquidation executes. Instead of your position being left unmatched, the HLP provides liquidity, but at a slightly worse price. Your position still liquidates at approximately your calculated threshold, but actual slippage may be 0.1% to 1% worse depending on market conditions.
