Skip to content
Learning path Bronze Understand and protect

Grid trading: order grids and inventory risk

Grid trading automates buys and sells at preset levels; oscillations may create cycles, but trends, costs, and execution can still produce losses.

Grid trading distributes buy and sell orders across several prices chosen in advance. It seeks to turn movement inside a band into repeated cycles, but it does not forecast the market or guarantee a profit.

In plain terms — A grid bot is a program that buys and sells automatically at prices chosen in advance. Small gains from some steps are not enough: money still exposed can make the overall result negative.

Operating mechanics

The grid mainly uses limit orders: a buy limit may execute at the stated price or lower; a sell limit at the stated price or higher. The limit controls price, but does not assure execution.

The user defines a lower bound, an upper bound, and intermediate levels. This interval is the operating price range. In a typical spot configuration, the system holds part of the funds in the quote asset and part in the base asset, then places buys below the current price and sells above it.

After a buy executes, many implementations prepare a sell at the next higher grid level; once that sell executes, a lower buy can be recreated. This is an execution cycle, not risk-free arbitrage. Initialization rules, order sequence, and out-of-range behavior vary by platform and must be checked in the service's own documentation.

Mechanics and risks of a spot grid Five price levels show sell orders above the center price, buy orders below it, and a decline through the lower boundary. Spot grid: local cycles, overall result SELL 104SELL 102 BUY 98 → SELL 100 BUY 98BUY 96 Trend below the grid: exposure remains open
The grid realizes only cycles that actually execute. Use the keyboard or pointer to explore levels, inventory, and an exit from the range.

Parameters and control sequence

Description and decision must be kept separate before activation. This page explains the fields; it does not recommend a pair, range, or grid count.

  1. Identify the market, base asset, and quote asset, then check minimum price increment, minimum quantity, and fees.
  2. Define the band, levels, and maximum committed capital, including what should happen if price remains outside the band.
  3. Check whether the distance between levels can absorb costs and differences between the theoretical price and the executed price.
  4. Monitor open orders, inventory, and Total P&L: the realized and unrealized result of the whole configuration.

More levels reduce the distance between orders and may increase execution frequency, but they also reduce the gross margin per cycle. Unfilled orders, partial executions, rounding, and insufficient funds can alter the expected sequence.

Risks hidden by the cycle counter

The grid profit shown by some exchanges adds completed cycles. It is not necessarily the overall result: when price falls, the unrealized loss on the accumulated asset can exceed small realized cycle gains. Official Bybit and OKX documentation expressly distinguishes these metrics.

In a downtrend, a spot grid tends to acquire inventory as price falls; in an uptrend it tends to sell inventory during the rise. A breakout can therefore leave a losing position or reduced participation in the move. Versions based on derivatives or borrowed capital follow different risk rules and are not interchangeable with the spot grid described here.

Illustrative example only — Levels are 96, 98, 100, 102, and 104. A buy filled at 98 followed by a sell at 100 creates a gross gap of 2 per unit before costs. If price instead falls to 90, filled buys remain exposed: earlier positive cycles do not automatically make Total P&L positive.

Technical depth: geometry, inventory, and execution

An arithmetic grid uses equal absolute gaps; a geometric grid uses equal percentage changes. Not every platform supports both or accounts for initial orders, fees, and residual quantities in the same way.

Expert check before evaluating a result

Reconstruct each execution from the order record; mark residual inventory at the current price; subtract fees and other costs; separate closed cycles from unmatched orders; document the stopping, cancellation, or repositioning rule. A historical simulation, or backtest, that assumes every execution occurs at the theoretical grid level can overstate the result.

Sources