> About this guide: I'm Lawrence, the writer behind supa.is. Between February and May 2026 I've published 150+ articles on supa.is across crypto and brokerage tooling โ including 40+ OKX-specific guides (recent examples: OKX Trading Bots Review 2026, OKX Signal Bot + TradingView No-Code Setup, OKX Maker vs Taker Fees Explained). The most-repeated reader question across that OKX archive is exactly how to size grid bot parameters when the market is going sideways without bleeding fees, which is why I'm publishing this standardized guide instead of answering it one DM at a time.
> Note: This is a concept and decision-making guide. Specific UI fields below are reconstructed from OKX's official spot grid documentation (OKX Help โ Spot Grid Bot). Verify each field against the current OKX UI before relying on it.
Why sideways markets are the natural habitat for grid bots
A grid bot is a market-making style strategy: you tell it a price band and a grid count, it lays a ladder of buy orders below the current price and sell orders above, and every time price ticks down through a buy rung and back up through the next sell rung, it captures the spread between those two rungs.
That mechanism needs three things at the same time to be profitable:
1. Price oscillates. Up-only or down-only markets either fill all your buys (and leave you holding a bag) or fill all your sells (and leave you sitting in cash while price runs).
2. Oscillation amplitude > grid spacing + fees + slippage. If price wiggles ยฑ0.05% but each round trip costs 0.16% in fees, you bleed. 3. Range holds long enough. A 2-day chop window doesn't give the bot enough fills to amortise the parameters you set.Sideways markets โ call them range-bound, chop, consolidation, or "the boring weeks between trends" โ give you all three. Trends, breakouts, and trending ranges (where the midpoint slowly drifts) are where grid bots quietly underperform a simple buy-and-hold of the same notional.
That's the whole framing. Once you internalise that grid bots are *a paid bet that the next N days look like the last N days*, the parameter choices stop being arbitrary.
A 60-second mechanics refresher
Per OKX's official documentation, the spot grid bot "automatically places buy and sell orders at set intervals and within a specified price range," aiming to "systematically buy at lower prices and sell at higher prices" (OKX Help โ Spot Grid Bot, as of 2026-05).
Mechanically, when you start a bot with:
- Lower price =
L - Upper price =
U - Number of grids =
N - Investment =
I(in your quote currency, typically USDT)
[L, U] into N cells, then on start it splits I between (a) buying enough base asset to cover the upper-half sell orders at the current price and (b) holding the remaining quote to cover lower-half buy orders. Whenever a buy fills, it immediately posts a sell at the next rung above. Whenever a sell fills, it immediately posts a buy at the next rung below.
The "profit per grid" you see on OKX's preview is roughly (grid_spacing - 2 ร fee) ร order_size_per_grid. That number is what you should be optimising โ not the headline APR.
Two grid spacings are offered:
- Arithmetic โ equal absolute spacing.
(U - L) / N. Simpler to reason about; works fine when the price band is narrow relative to its midpoint. - Geometric โ equal percentage spacing.
(U / L)^(1/N). Better whenU / L > ~1.3, because percentage moves matter more than absolute moves at higher prices.
The three knobs that matter
Everything else on the OKX configuration screen is a derivative of three decisions:
1. Price range โ how wide is your bet?
2. Number of grids โ how dense is your ladder? 3. Investment โ how much capital do you commit?Stop loss, take profit, trailing, advanced โ those are policies that fire on top of these three primitives. Get the primitives wrong and the policies cannot save you.
Knob 1: Price range โ the most-broken parameter
Most failed grid bots I've seen failed here, not in grid count or sizing.
The intuition trap is "wider range = safer, because price can't escape it." That's half right. Wider range protects you from one-sided breakouts โ but it also forces grid spacing wider (for any fixed N), which means each round trip captures more, but each round trip happens *much less often*. If you set a 50% wide range on an asset that wiggles ยฑ2% per week, you'll get a beautiful ladder that almost never fills.
The correct framing is the opposite: the range should be narrow enough that price actually oscillates across multiple grids, but wide enough that price doesn't punch out the ceiling or floor within your holding horizon.
Two heuristics that survive contact with real markets:
- The "last N days" rule. Open the chart, mark the high and low of the recent consolidation (last 7โ30 days, depending on your horizon). Set
LandUslightly inside those extremes โ say, the 5th and 95th percentile of recent close prices. If you set the band exactly at recent high/low, you'll usually breach it; markets rarely respect their last extreme to the cent. - The ATR sanity check. If 14-period daily ATR is, say, 1.2% of price, a one-week move of 4โ5ร ATR is normal. So a range tighter than
ยฑ5 ร daily ATRfrom current price is going to break out within a week with high probability. That's a fragile bet for a bot you wanted to leave running.
L and U. Then widen by 10โ20% on each side to give the bot some margin against the inevitable wick. Then ask yourself: *if price exits this band, am I OK holding the resulting position (long or cash)?* If the answer is no, your range is wrong, regardless of what backtest says.
For more on related setups using TradingView signals into OKX, see OKX Signal Bot + TradingView setup โ it covers the same "respect the chart, not the optimiser" principle from a different angle.
Knob 2: Number of grids โ density vs profit per cell
Per OKX's documentation, "more grids enable frequent smaller trades; fewer grids produce larger but less frequent trades" (OKX Help โ Spot Grid Bot, as of 2026-05). That's correct but doesn't tell you what to actually pick.
Like what you're reading? Try it yourself โ this link supports ChartedTrader at no cost to you.
Open the OKX bot center โThe number you should care about is grid spacing as a percentage:
- Geometric grids:
spacing% โ ((U/L)^(1/N) - 1) ร 100 - Arithmetic grids:
spacing% โ (U - L) / N / midpoint ร 100
1. Round-trip fee threshold. A buy fill + a sell fill costs 2 ร your effective fee tier. If you're at OKX's standard retail tier and routing as a maker, your round-trip cost is roughly twice your maker fee. (For an exchange-by-exchange comparison of those tiers, see OKX vs Binance vs Coinbase fees; for a primer on what counts as maker vs taker on OKX specifically, see OKX Maker vs Taker Fees Explained.) Grid spacing must clear this *with margin*, otherwise normal slippage and partial fills eat the rest.
A rule that holds up: spacing โ 0.5% to 1.5% per cell for a sideways large-cap crypto using maker orders. That implies, for a 10% wide range, somewhere between 6 and 20 grids. For a 20% wide range, 13 to 40 grids. Outside those bands you're either over-fitting density (too many grids, too thin per fill) or under-using your range (too few grids, fills are rare).
The optimiser inside OKX's preview will happily quote you a higher "estimated daily profit" for more grids โ because it assumes every grid fills in a smooth oscillation. Real markets don't; they trend in bursts and chop in patches. The headline APR on the preview is, in my experience, consistently optimistic by 30โ60% versus what you actually realise.
Knob 3: Investment sizing โ and why the bot rejects you
The investment amount is "the total amount of the selected currency the bot will use to place buy and sell orders" (OKX Help โ Spot Grid Bot, as of 2026-05) โ not the per-grid amount. OKX divides it across the grids for you.
Two failure modes here:
Failure mode A: investment too small relative to grids. OKX enforces a minimum order size per grid (the exchange-wide minimum notional, which depends on the symbol โ typically a few dollars per order, but check the live screen). If yourinvestment / N falls below that minimum, the bot won't start. The fix is usually "fewer grids" rather than "more capital", unless you genuinely have more capital you're willing to commit.
Failure mode B: investment is too large for the inventory imbalance at start. When you start a bot mid-range, OKX has to convert some of your quote currency into base asset to back the upper-half sell orders. That conversion is a market order (or close to it) โ not a maker-order entry. If you start with $10,000 and current price sits at the upper third of your range, the bot might need to immediately buy a meaningful slug of base asset at taker rates. That's not catastrophic, but it's a real cost you don't see in the headline APR.
A workaround if you want to avoid the entry slippage: start the bot when price is sitting in the lower third of your range, so the initial inventory split is heavier in quote (cash) and lighter in base (forced conversion). Or stage in: start with a smaller investment, let it settle, then add capital.
Fees: the silent grid bot killer
A 0.5% grid spacing minus a 0.16% round-trip fee leaves 0.34% per cycle. That's fine. A 0.3% grid spacing minus the same 0.16% fee leaves 0.14% per cycle โ and now slippage, partial fills, and the occasional taker-converted maker-order eat the rest. Same bot, same range, same number of grids โ only the spacing changed, and one is profitable while the other isn't.
The lever you have is simple: trade your way down the VIP tiers, or stay maker-only. OKX's grid bot posts limit orders, which qualify as maker orders when they sit on the book waiting to be hit (which is most of the time, by design). That keeps you on the cheaper side of the fee schedule. The exception is the initial inventory conversion at start (taker) and the occasional cross when a fast move pushes through several grid levels at once (taker).
For a deeper look at the fee mechanics specifically โ including how OKX determines maker vs taker โ start with OKX Maker vs Taker Fees Explained.
Trailing, stop loss, and the "set and forget" myth
OKX exposes a trailing-up / trailing-down option that lets the bot "automatically adjust the grid as the price moves" (OKX Help โ Spot Grid Bot, as of 2026-05). The intent is to let your range follow a slow drift instead of breaking out.
This is genuinely useful for assets with mild trending bias inside an otherwise sideways regime โ but it isn't free. Each adjustment cancels the existing top/bottom rungs and reposts them at new levels. Cancellations are free; the repost itself is fine, but you've now lost the in-progress fill at the rung that was closest to filling. Use trailing when price is grinding slowly in one direction; turn it off when price is in true tight chop.
Stop loss "triggers if price reaches that level, causing the bot to stop trading and sell all base assets at the market price" (OKX Help โ Spot Grid Bot, as of 2026-05). That last clause is the one to internalise: the stop-loss exit is a market sell of accumulated base inventory, at exchange spot, at the moment the level breaks. If your bot has been buying its way down the ladder, your inventory at stop-loss trigger will be near-maximum โ meaning you're realising the worst of the drawdown plus market-order slippage on the way out.
The defensible choice is to set stop loss *outside* the bottom of your range with margin (so genuine breakouts trigger it, but a normal wick doesn't), and to size the investment such that even a stop-out loss is recoverable from your portfolio.
Identifying a sideways market before you deploy
A few sanity checks you can do in 60 seconds, before you press start:
- Daily ADX < 20. ADX measures trend strength. Values below 20 are conventionally interpreted as range-bound. Above 25 means a trend is in motion โ wrong regime for grid.
- Price within Bollinger Bands (20, 2) and oscillating between them. If price is hugging one band, you're in a trend, not a range.
- The week-over-week return is small. If the asset is up or down >5% on the week with a clean direction, the regime isn't sideways yet โ wait for it to plateau.
- No upcoming catalyst inside your bot's holding window. Major macro prints, project token unlocks, ETF approval dates โ these break sideways regimes in seconds. If a big catalyst falls inside the period you intended to run the bot, either skip the deployment or shorten the window.
Common pitfalls (cautionary educational)
A non-exhaustive list of mistakes I see repeatedly in grid bot configurations:
- Backtest-fitted ranges. The "best" range for the last 30 days is almost never the right range for the next 30 days. Use historical data to estimate volatility, not to pick exact
LandU. - Treating headline APR as expected return. OKX's preview APR assumes a specific oscillation frequency. Real APR is typically 50โ70% of preview for sideways assets, and can be negative if the regime breaks.
- Stacking too many grids on a thin asset. Wide bid-ask spreads on smaller-cap assets eat your grid spacing as effective slippage. Stick to top-10 or top-20 by liquidity.
- Starting at the top of the range. As discussed: forces taker-rate inventory acquisition, drags you below the breakeven from the first second.
- Running with no stop loss "to give it room." A regime change with no stop is how a bot turns into a long-only position you didn't intend to hold.
- Adding new capital to a losing bot. If the bot is bleeding because the regime broke, more capital just amplifies the bleed. The right move is to stop, evaluate, and restart with a different range โ not to martingale into a wrong setup.
When to stop the bot
The exit decision is as important as the entry, and it tends to get less attention. A defensible policy:
- Stop and re-evaluate if price closes outside your range on the daily for two consecutive sessions. The regime has shifted โ your old range is no longer the right band.
- Stop if realised volatility is falling fast (e.g., daily ATR has compressed by 50% since you started). The bot needs *some* oscillation; if the asset goes dead, you're paying the inventory carry for nothing.
- Stop if a known catalyst is imminent โ recover the cash, deploy fresh after the catalyst clears.
- Don't stop just because a single day looks ugly. One-day P&L is noise; the bot is supposed to harvest noise, not avoid it.
Wrap-up
Grid bots aren't an alpha source. They're a structured way to monetise sideways volatility, with three knobs (range, grid count, investment), one regime requirement (sideways) and one fee regime requirement (stay on the maker side of the schedule with enough spacing to clear the round-trip cost with margin). When all of those align, the bot does what it says on the tin. When they don't, no amount of trailing or stop-loss configuration recovers the misalignment.
Pick the range from the chart, not the optimiser. Pick the grid count from the spacing math, not the preview APR. Size the investment so that even a stop-out is survivable. And know in advance what conditions take you out โ both for upside (range broke up, take the profit) and downside (range broke down, take the loss before it doubles).
If you want to set one up and you don't already have an OKX account, you can register through my referral at okx.com/join/26750180 โ it gives you the same region-specific welcome incentives OKX runs (S$188 in Singapore, 100 USDT in CN, others vary by region). The bot center is under *Trade โ Trading Bots* once you're signed in.
`