Protections: out of range, crash, margin, liquidation
A Grid bot regularly checks the price, the position and the orders, and in emergencies it pauses itself, closes or warns you. The protections are always on and cannot be configured, but they do not replace a Stop-Loss, a moderate leverage and a wide range.
How it works
| Protection | When it fires | What the bot does |
|---|---|---|
| Out of range | the price is more than 2 % beyond the bound and has moved more than 5 % from the middle of the range; checked about every 3 minutes | a soft pause, the orders stay; the status “Out of range (above)” or “Out of range (below)”; the fills meanwhile are accounted for at once, new orders are placed after the return |
| Automatic return | the price is strictly inside the range; checked every 60 seconds | the bot resumes by itself |
| Crash protection | 80 % or more of all levels are already in position (for Long — bought); checked about every 3 minutes; works on spot as well | a hard pause: all orders are removed, the sells included; the exit from the position comes after ▶️ Resume |
| Margin overload (futures, cross margin) | the account maintenance margin as calculated by Bybit reached 80 % of the equity (at 100 % the exchange liquidates the whole account); checked about every 3 minutes, also during a pause and “out of range”. Not used in isolated margin: there each position is liquidated on its own, and “Closeness to liquidation” warns when the grid position gets close to it | a forced stop: the orders are cancelled, the grid position is closed at market, the status is “Closed”; your manual position in this pair is not closed — if there is one, you get a notification about the remainder |
| Closeness to liquidation (futures, leverage above 1) | the grid position is open, and less than 15 % is left to the real liquidation price (as reported by the exchange); without an open position it does not fire | a warning only, as in Pionex: the bot keeps working and does not close the position by itself; checked during a pause and “out of range” too, and for bots blocked by an administrator or in the “Error” status (they get their own text: the bot Stop-Loss and the margin overload do not work in these statuses); it repeats when the price moves more than 20 % away from the liquidation and comes close again |
| Position control (futures) | the position on the exchange is smaller than the expected one: closed or reduced outside the bot; checked about every 3 minutes | the exit orders are resized to the real position; when it is zero — the levels are released, the entry orders keep working |
| Exit restored | a level with a position has no sell order (for example, it was removed by hand) for two checks in a row, about 10 minutes | the exit order is placed again |
| Series of errors | 3 permanent refusals of the exchange in a row: not enough balance, a wrong lot, a key | a soft pause; after the cause is removed — ▶️ Resume |
| Too many fills in a row | more than 5 fills in 10 seconds or 20 in a minute — this is how a failure looks, not the market | a pause: the orders stay on the exchange, the fills are accounted for, new orders are not placed; check the position and tap ▶️ Resume |
| Order reconciliation | every 5 minutes the number of orders on the pair does not match the expected one | the missing ones are placed again; the extra ones are not touched |
| Safety stop (futures) | every 60 seconds, also during a pause, “out of range”, for bots blocked by an administrator and in the “Error” status; for a grid that is not trading — only if it has its own position (the bot does not touch a manual position in the pair) | a stop 0.5 % before the liquidation price; on Bybit it is visible in Positions → TP/SL (on BingX it is a separate “close the whole position” order, placed only with Isolated margin), it is not your SL; removed it — the bot puts it back within 2–3 minutes. If you placed a Stop-Loss on the entire position yourself, the bot does not replace it and does not set the safety stop (as Cornix); removed yours — the safety stop comes back in 2–3 minutes; partial stops do not interfere |
Account events: a change of the position mode on the exchange — a hard pause, “🚨 Position mode changed on the exchange” (see Position mode changed); a pair being delisted — a hard pause with “paused by the system” for every Grid bot of the pair: running, paused or “out of range” (bots blocked by an administrator or in an error lose their orders and keep their status), then a full stop with the grid position closed at market and a message about the close (except bots blocked by an administrator or in an error) — a day before the delisting date if the announcement gives it, otherwise within an hour or two after the announcement; the delisting of a perpetual contract affects only futures bots, of a coin from spot — only spot bots; announcements that name the pairs only in their text are not recognised (see Stopped by the system); the kill switch — a hard pause of all Grid bots of the account where it fired: running, paused or “out of range” (bots blocked by an administrator or in an error lose their orders and keep their status). After the kill switch an “out of range” bot no longer comes back by itself — only with ▶️ Resume (see Kill switch).
What the bot sends
Pauses, closes and warnings caused by the protections arrive immediately, in any notification mode:
- “⏸️ BTC grid (BTCUSDT) Grid bot paused. Reason: price 67500 went above the range (top 66000). Orders stay on the exchange; the bot resumes by itself when the price returns to the range, or recreate the grid in the app” — there is no ▶️ Resume button in this status, instead the card has 🔄 Recreate grid (it opens recreating in the app).
- “⏸️ … Reason: crash protection: 4 of 5 levels are already in position. All orders were removed, the position is open — check the market and tap 'Resume'”.
- “🔒 … Grid bot closed: account maintenance margin is 82 % of equity (at 100 % the exchange liquidates the account), the limit is 80 %. Orders cancelled, grid position closed at market. Total PnL: -4.10 USDT”. If your manual position in the same pair also adds to the risk, the bot does not close it — check your account.
- “⚠️ … Less than 15 % is left to the liquidation price of the grid position (liquidation ≈ 52000, price 59500). The bot will not close the position by itself — the decision is yours: add margin to the position on the exchange or set the bot Stop-Loss. The safety stop 0.5 % before the liquidation (if there is no Stop-Loss of yours on the entire position) and, in cross margin, the margin overload protection work as usual” — it comes during a pause and “out of range” too, once until the price moves more than 20 % away from the liquidation; with isolated margin and leverage from about x7 — right after the first entry (for Short — the first sell): the liquidation there is always closer than 15 %.
- “⚠️ … Less than 15 % is left to the liquidation price of the grid position (liquidation ≈ 52000, price 59500). The bot is not trading now (locked by the administrator or stopped with an error): in this state the bot Stop-Loss and the margin overload protection do not work, and the bot will not close the position by itself. The decision is yours: add margin to the position on the exchange or stop the bot — the grid position will be closed at market. The safety stop 0.5 % before the liquidation works if there is no Stop-Loss of yours on the entire position” — the same warning for a bot in the “Locked” or “Error” status.
- “🔒 … Grid bot closed: the exchange is delisting this pair. Orders cancelled, the grid position closed at market (on spot, the coins bought by the grid were sold). To keep trading, create a bot on another pair. Total PnL: 1.20 USDT” — on the close before a delisting, once. If the position could not be closed, you get “… Orders cancelled, but the grid position could not be closed: check the pair on the exchange and close the position manually before the delisting” instead.
- “⚠️ … The position for this pair was closed on the exchange outside the bot (expected 0.005, on exchange 0). Exit orders were removed, levels released, entry orders keep working. If this was not you, check your account.” — see Position closed outside the bot.
- “🔁 … The SELL exit order at level 60600 was cancelled on the exchange outside the bot — placed again.”
- “⏸️ … Reason: 3 consecutive order placement errors (last: …). Check the balance, API keys and settings, then tap 'Resume'”.
- “⏸️ … Reason: too many fills in a row (more than 5 in 10 seconds or 20 in a minute) — the failure protection paused the bot. The fills are accounted for, the orders stay on the exchange, new ones are not placed. Check the position and tap 'Resume'”.
Example with a calculation
A Long grid 60,000 — 66,000, the middle of the range is 63,000.
| Price | Beyond the bound | From the middle | Result |
|---|---|---|---|
| 67,000 | 67,000 / 66,000 = +1.5 % | +6.3 % | no pause needed: less than 2 % beyond the bound |
| 67,500 | +2.3 % | +7.1 % | both conditions are met — “Out of range (above)” |
| 65,900 after the pause | inside | — | the automatic return within a minute |
Crash protection: in a grid of 5 levels 4 are bought — that is 80 %, the bot removes all orders and waits for your decision; in a grid of 20 levels it takes 16 bought levels.
Limits and allowed values
| Parameter | Value |
|---|---|
| Out-of-range threshold | 2 % beyond the bound and 5 % from the middle |
| Crash protection threshold | 80 % of the levels in position |
| Margin overload | maintenance margin ≥ 80 % of the account equity (cross margin only) |
| Closeness to liquidation | less than 15 % — a warning |
| Series of errors | 3 refusals in a row |
| Fills in a row | more than 5 in 10 seconds or 20 in a minute |
| Safety stop | 0.5 % before the liquidation; not set if your Stop-Loss is on the entire position |
Common mistakes and what the bot says
- Manual orders on the same pair from the same keys break the order reconciliation — trade the bot's pair only through the bot.
- You removed a buy order by hand — it is not restored, the level stays empty; the bot brings a sell order back within about 10 minutes.
- “🔒 … account maintenance margin…” on a bot with a small leverage — check the other positions on the same account: in cross margin a loss of any position reduces the equity of the whole account and brings its liquidation closer. A large amount in the grid alone does not trigger it — the loss of positions does.
