← Back to Blog
MARKET ANALYSIS

How the LMEX Liquidation Engine Works (And Why It Matters for Your Bot)

June 29, 2026 · 7 min read · LMEX.AI

When your position liquidates, what actually happens? Most retail traders treat liquidation as a single event — "you got liquidated" — without understanding the multi-step process the exchange runs to close out your position, the insurance fund mechanics behind it, and how all of that flows back into market prices everyone else sees.


This article walks through the LMEX liquidation engine, the four stages a liquidated position moves through, and the implications for how you should run your bot.


Why this matters for traders


Two practical reasons:


1. **Liquidation prices are not where you'd guess.** The "liquidation price" shown in your account is the maintenance margin level — but the actual price you exit at is often meaningfully worse. Understanding why helps you set wider buffers.


2. **Liquidation cascades drive flash crashes.** Most sharp moves in crypto perpetuals — 5%, 10%, 20% wicks — are liquidation cascades, not fundamental news. Your strategy should account for this regime rather than treat every spike as signal.


Maintenance margin and initial triggers


The position starts to liquidate when account equity falls below maintenance margin requirement. On LMEX's tiered system:


  • Tier 1 (notional < \$50K): 0.5% maintenance margin
  • Tier 2 (\$50K-\$250K): 1%
  • Tier 3 (\$250K-\$1M): 2.5%
  • Higher tiers: progressively higher requirements

  • So a 10× leveraged position has ~10% initial margin and ~0.5-2.5% maintenance margin. The position can lose 7.5-9.5% before triggering liquidation — but the liquidation itself doesn't happen at maintenance margin. It happens at the calculated "liquidation price" which factors in the gap between maintenance and where the exchange estimates it can actually close the position.


    The four stages of liquidation


    When the engine triggers, the position moves through four stages in sequence:


    **Stage 1: Smart liquidation attempt.** The engine first tries to close the position passively, placing limit orders into the book at favourable prices. For small positions in liquid markets, this often works and you exit close to the "liquidation price". Smart liquidation is enabled by default.


    **Stage 2: Aggressive market close.** If passive close doesn't fill within a short window (typically 1-3 seconds), the engine switches to market orders. This walks the book, with each tick of slippage eating into your remaining equity. For positions large enough to move the book, slippage during this stage is the biggest source of unexpected losses.


    **Stage 3: Insurance fund absorption.** If your equity reaches zero before the position is fully closed, the insurance fund covers the remaining loss. The exchange's insurance fund exists exactly for this — bridging the gap between your maintenance margin and the actual achievable exit price.


    **Stage 4: Auto-deleveraging (ADL).** When the insurance fund is depleted by sustained losses (rare but happens in extreme moves), the exchange auto-closes positions on the opposite side starting with the highest-PNL, highest-leverage traders. If you're long with 20% unrealised PNL during a flash crash, you might get force-closed not because of your own risk but because the exchange needs counterparties.


    ADL is the worst-case outcome and one of the few ways a profitable position can be involuntarily closed. It's rare but not unprecedented.


    Insurance fund mechanics


    LMEX maintains an insurance fund that accumulates from:

  • Liquidation profits (when the engine closes a position above the bankruptcy price)
  • Direct exchange contributions

  • And depletes from:

  • Liquidation losses (when the engine can't close above bankruptcy)
  • ADL events (theoretically — usually ADL fires before fund depletion)

  • Current fund size and historical changes are published on the LMEX status page. A healthy fund means ADL is unlikely; a shrinking fund signals stress in the market.


    For traders, the practical takeaway: check the insurance fund size before opening large leveraged positions. A fund covering 100+ days of typical liquidation flows is healthy. Below that, ADL risk becomes non-trivial during stress events.


    What this means for your bot


    Several practical implications for retail and algo traders:


    **Set your own stops well before the exchange's liquidation price.** The exchange's "liquidation price" is where the engine triggers, not where you'll actually exit. Setting a manual stop 1-2% before that price gives you a clean exit at your chosen level instead of slippage-eaten emergency close. This single practice prevents most catastrophic losses.


    **Lower leverage gives you more decision time.** A 20× position liquidates on a 4.5-5% move. A 5× position liquidates on a 17-18% move. The lower-leverage position gives you hours instead of minutes to react to adverse moves. For most retail strategies, 3-5× leverage is the sweet spot.


    **Treat flash crash candles as noise, not signal.** A 10% wick on 1-minute candles is almost certainly a liquidation cascade, not new information. Strategies that react to extreme candles often buy/sell exactly the worst possible price. Filter out moves >2× ATR on a single bar.


    **Plan for ADL.** Run as if your profitable positions might be force-closed during major events. Take profit incrementally on big winners rather than holding through the next stress event. Pyramid out on the way up instead of waiting for a single exit.


    What goes wrong


    The most common ways traders get hurt by liquidation mechanics:


    **Setting stops AT the liquidation price.** This guarantees you'll get liquidated instead of stopped, with worse slippage. Stops should be tight enough to fire before liquidation triggers.


    **Adding to a losing position to "lower the average".** Each addition shifts the liquidation price closer to current price. The position now has less buffer than before. This is how small losing trades turn into account-blowing losses.


    **Treating leverage as free capital.** 10× leverage doesn't multiply returns 10× — it multiplies both gains and losses, and crucially, it accelerates the path to liquidation during normal volatility. A strategy that would be marginally profitable at 1× often blows up at 10× because typical drawdowns now trigger liquidation.


    **Ignoring funding during stress.** Funding rates spike during liquidation cascades, often 0.5%+ per 8h. Holding a leveraged long while the perp is paying 1.5%+ daily funding eats the position fast. Stress events change the carry cost meaningfully.


    Frequently Asked Questions


    Q: How do I see my exact liquidation price?

    It's shown in your position panel on LMEX. The exchange calculates it dynamically based on mark price and your current margin. It updates whenever you add or remove margin, modify position size, or when mark price changes significantly.


    Q: Can I add margin to avoid liquidation?

    Yes, before liquidation triggers. Once the engine has started closing your position, additional margin won't stop it. Add margin proactively during adverse moves, not reactively when liquidation is imminent.


    Q: What's the difference between mark price and last price?

    Mark price is calculated from a basket of spot prices on multiple exchanges; last price is the most recent perp trade. Liquidations trigger on mark price, not last. This prevents manipulation where someone moves the perp briefly to liquidate positions — the mark price stays anchored to the underlying spot market.


    Q: How often does ADL actually happen?

    Rarely. On LMEX historically, ADL has triggered only during extreme market events (typically 1-3 times per year for any given contract). For typical traders running modest leverage, ADL risk is negligible. For traders holding large profitable positions through major events, it's worth planning for.


    Related Articles


    → The Math of Drawdown Recovery (And Why It Should Terrify You)
    → Stop Loss and Take Profit Automation: Risk Management for Trading Bots
    → LMEX Funding Rates Explained: How to Profit from Positive and Negative Rates
    ← All ArticlesBuild a Bot →