Liquidation on a grid bot is not the same as liquidation on a simple leveraged long or short. The price that triggers it shifts constantly as orders fill, open contracts accumulate, and unrealised P&L changes. Most traders who get liquidated by a grid bot didn't see it coming because they calculated the wrong number — or didn't calculate it at all.
How exchange liquidation works
On a perpetual futures exchange, liquidation is triggered when your account's margin ratio falls below the maintenance margin requirement. Maintenance margin is typically 0.5%–1% of notional value depending on position size and exchange. When your remaining equity — initial margin plus unrealised P&L — drops to that threshold, the exchange closes your position forcibly.
The liquidation price is the mark price at which that condition is met. It is not a fixed number. It is a function of your entry price, open position size, available margin, and the maintenance margin rate. Because a grid bot's open position size changes continuously as orders fill, the liquidation price changes throughout the trade.
Why grid bots are different from simple leveraged positions
A simple 5× leveraged long on BTC at $100,000 with $10,000 margin has a roughly fixed liquidation price that you can calculate once at entry. A long grid bot with the same capital starts with a partial position and accumulates more longs as price falls through the grid levels. As each buy fills, the open position grows — and the liquidation price rises toward the current price.
This is the specific danger of a long grid bot in a falling market. The bot is designed to buy more as price drops. Each fill adds to the open long position. Each additional long raises the liquidation price. Price falling and liquidation price rising is a converging gap — and it closes faster than most traders expect.
Calculating the liquidation price for a long grid
The simplified formula for a long position's liquidation price is:
Liq price = Entry price × (1 - 1/Leverage + Maintenance margin %) Where: Entry price = Average cost of the open long position Leverage = Account leverage setting Maintenance margin = Exchange's maintenance margin rate (e.g. 0.5% = 0.005)
For a long grid bot, the "entry price" in this formula is the average cost of all open long contracts — which changes every time a buy order fills. Here is a worked example as the grid fills:
Setup: Capital: $10,000 Leverage: 5× Entry price: $100,000 Grid range: $90,000 – $100,000 (long grid, 10 levels) Grid spacing: $1,000 Order size: 0.02 BTC per level Maintenance margin: 0.5% At deployment (no fills yet): Open contracts: 0 Liq price: N/A — no position Price drops to $99,000 — first buy fills: Avg entry: $99,000 Open: 0.02 BTC Liq price: $99,000 × (1 - 0.2 + 0.005) = $79,695 Price drops to $97,000 — three fills total: Avg entry: ~$98,000 Open: 0.06 BTC Notional: $5,880 Liq price: $98,000 × (1 - 0.2 + 0.005) = $78,890 Price drops to $90,000 — all 10 levels filled: Avg entry: ~$95,000 Open: 0.20 BTC Notional: $19,000 Liq price: $95,000 × (1 - 0.2 + 0.005) = $76,475
In this example the liquidation price stays well below the grid range throughout. The position is safe — but notice that the notional value of the open position ($19,000) now exceeds the initial capital ($10,000) because leverage has amplified it. If the grid range were tighter, or leverage higher, the numbers compress quickly.
The danger zone: when liquidation price enters the grid range
The critical warning sign is when the calculated liquidation price is above the bottom of the grid range. That means price could still be within your intended operating range when the account gets liquidated. The bot would still have unfilled buy orders sitting below the current price — but the account is already gone.
Same setup but with 10× leverage: All 10 levels filled: Avg entry: ~$95,000 Open: 0.20 BTC Notional: $19,000 Liq price: $95,000 × (1 - 0.1 + 0.005) = $85,975 Bottom of grid range: $90,000 Liquidation price ($85,975) is below the range — still safe. But with a tighter range ($95,000 – $100,000, 10 levels): Avg entry: ~$97,500 Notional: $19,500 Liq price: $97,500 × (1 - 0.1 + 0.005) = $87,788 Bottom of range: $95,000 Liq price ($87,788) still below — but margin for error has shrunk. Add a losing run where price drops 10% below the range: Unrealised loss erodes margin further — liq price rises.
Neutral grid liquidation: both sides at risk
A neutral grid runs a long book below the mid-price and a short book above it. This means liquidation can be triggered from either direction. If price drops far below the range, the long book accumulates a large net long position that may hit its liquidation threshold. If price rises far above the range, the short book does the same.
The liquidation prices for each book are calculated independently. The simulator computes both and displays whichever is the more immediate threat given the current net position. In a neutral grid, neither boundary is inherently safe — both need to be checked.
What the simulator shows you
The simulator displays the estimated liquidation price as an orange dashed line on the order book visualisation. It recalculates as you adjust leverage, range, grid count, or capital. In the Monte Carlo output, the liquidation rate metric tells you what percentage of simulated paths hit this price before the trade horizon ended.
A liquidation rate above 5% warrants serious attention. A rate above 15% means the configuration has a structural problem — not bad luck, but a setup where a meaningful minority of realistic price paths end in a total loss.
Set a long grid with 10× leverage and a 5% range. Watch the liquidation price indicator on the order book visualisation, then increase capital or reduce leverage until the orange line sits comfortably below the grid bottom.
Launch the simulator →