How a grid works
This page explains the mechanics of a GRIDer grid: the parameters you set, how orders are placed and re‑placed, and how the bot keeps the strategy running.
The parameters you control
| Parameter | What it is |
|---|---|
| Direction | Grid LONG or Grid SHORT. Sets whether the grid is biased to accumulate long or short as price moves through the range. |
| Upper limit / Lower limit | The top and bottom of your price range. Orders only exist inside this band. |
| % spacing between levels | The gap between consecutive levels, as a percentage. Tighter spacing = more levels = more (smaller) trades. |
| Grid Size (USD) | Total capital allocated to the grid. It is divided across the levels. |
| Leverage (perps only) | Multiplies your buying power, and your risk. Spot grids have no leverage. |
| Initial entry price (optional) | A limit price to start at, instead of entering immediately at market. |
| Stop-loss (optional) | A price at which GRIDer closes the grid to limit a losing breakout. |
| Close Grid Price (optional) | A target price at which GRIDer closes the grid and cancels remaining orders. |
The number of levels is derived from your range and spacing. The capital per level — what GRIDer calls the effective investment per level — is your Grid Size spread across those levels.
How orders are placed
When you start a grid, GRIDer:
- Makes the initial entry. Either immediately at market, or — if you set an initial entry price — it places a limit order and waits. While waiting, the grid shows a Pending entry badge and does nothing else until that first order fills.
- Places the grid. Around the current price it sets buy orders below and sell orders above, at your levels.
- Reacts to fills. This is the heart of the strategy (next section).
The fill cycle
Every time an order fills, GRIDer re‑arms the grid so it's always ready for the next swing:
- A buy fills → GRIDer places a sell one level up (to book the profit on the way back) and makes sure the next buy below is in place.
- A sell fills → GRIDer places a buy one level down and makes sure the next sell above is in place.
sell ●────────────┐ ← placed after the buy below filled
▼
price ~~~~~~~~~~~~~~~~~~~~~~~~
▲
buy ●────────────┘ ← re-placed after the sell above filled
So the grid continuously "walks" buy/sell pairs as price oscillates, closing a small profit on each completed pair. You don't manage any of this — GRIDer maintains both legs automatically.
How fills are detected (reliably)
Detecting a fill quickly and correctly matters. GRIDer combines:
- Price crossing — a single shared market feed (
allMids) tells GRIDer when price reaches one of your levels. - Order‑status confirmation — a direct REST check confirms the order actually filled before acting on it.
- Persistence — active orders and fills are saved, so the grid can be rebuilt after a restart.
This belt‑and‑braces approach exists because exchanges and networks don't always deliver the perfect event at the perfect time. It's also why GRIDer scales: it relies on the shared price feed rather than a per‑user stream that the venue would rate‑limit.
Surviving restarts
If the backend restarts, GRIDer resumes each running grid by trying, in order:
- Match live orders already resting on the exchange.
- Match saved orders from its database against what's still open on the exchange.
- Recover from your position — if a real position exists, it rebuilds a fresh buy/sell pair around the current price.
- Fallback — if it can't safely resume (no position, or margin/range problems), it marks the grid stopped and asks you to review.
A key safety rule: after an ambiguous event, GRIDer never opens a brand‑new position on its own. If there's nothing to recover, it stops and waits for you.
Margin pauses (perps)
If the exchange rejects an order because other positions are using your margin, GRIDer doesn't break the chain. It pauses the grid briefly and retries automatically once margin frees up. You'll see a notice; add funds or reduce other positions to resume faster. See Troubleshooting.
Next: Spot vs perpetual grids and Risk and range breakouts.