Grid Trading in Crypto: How Grid Bots Work, When They Win, and When They Bleed
Grid trading lays a ladder of buy-low and sell-high orders across a price range and profits from oscillation. This guide explains how a grid bot works, the parameters that define it (range, grid count, spacing), the market regimes where it wins versus fails, the real risks, and how to run one — via a third-party platform or by building on Hyperliquid’s public API.

Key takeaways
- Grid trading is a strategy that places a ladder of buy and sell limit orders at fixed intervals across a chosen price range — it automatically buys lower and sells higher as price oscillates, capturing many small profits from volatility rather than betting on direction.
- A grid is defined by three parameters: the price range (upper and lower bound), the number of grid lines, and the spacing between them. Tighter spacing means more frequent, smaller fills; wider spacing means fewer, larger ones.
- Grids profit in range-bound, sideways, choppy markets and lose money in strong trends — price breaking above the range leaves you under-allocated, and breaking below leaves you holding losing inventory you bought on the way down.
- Main risks are a breakout beyond the range, capital locked across unfilled orders, fees eroding small per-trade profits, and (for leveraged grids) liquidation — which is why a stop-out level and position sizing matter more than the grid itself.
- To run a grid you either use a third-party bot platform with a grid template or build it against an exchange API; on Hyperliquid you can code your own grid against its public API with an agent wallet that trades but can never withdraw your funds. Dexly is the non-custodial front-end and copy trading is its no-code alternative — it is not a grid bot.
What Is Grid Trading?
Grid trading is an automated strategy that lays a ladder of buy and sell orders at fixed price intervals across a chosen range, then buys low and sells high as price oscillates between those lines. Instead of betting on a direction, it harvests volatility — capturing many small profits each time price chops back and forth (Bitsgap — What is a grid trading bot and how does it work).
Picture a price chart with horizontal lines drawn every, say, $100. Below the current price you place buy orders; above it, sell orders. When price dips and fills a buy, the grid immediately posts a sell one line higher. When price rises and fills that sell, it posts a fresh buy one line lower. The grid keeps recycling those orders, pocketing the gap between adjacent lines over and over.
The direct answer
How a Grid Bot Actually Works
A grid is one of the most common templates offered by crypto trading bots because the logic is fully mechanical and needs no market view. The loop is simple (Pionex Academy — Grid trading bot explained):
- Set the grid. You pick an upper and lower price bound and how many lines sit between them. The bot seeds buy limits below the current price and sell limits above it.
- Fill and flip. Each filled buy spawns a sell one line higher; each filled sell spawns a buy one line lower. The spread between two adjacent lines is the per-trade profit.
- Repeat. As long as price stays inside the range, the grid keeps re-arming orders and accumulating those small gains — no forecasting required.
Because every action is a pre-defined rule, a grid is a textbook example of algorithmic trading — specifically a mean-reversion strategy that assumes price snaps back toward the middle of its range. It is the opposite of a trend-follower, and that opposition is the whole story of when it works.
The Parameters: Range, Grid Count, Spacing
A grid is defined by three settings, and they interact:
Price range
The upper and lower bound the grid operates within. Set it to match where you expect price to oscillate. Too narrow and price escapes quickly; too wide and capital sits idle on far-out orders.
Grid count
How many lines sit inside the range. More lines means more frequent fills and smaller profit per fill; fewer lines means rarer, larger fills. More orders also means more fees.
Spacing
The gap between adjacent lines (arithmetic = equal dollar steps, geometric = equal percentage steps). Spacing must clear trading fees, or the per-trade profit gets eaten alive.
Spacing has to beat fees
A grid is built entirely out of limit orders, so a solid grasp of order types is foundational before you configure one.
When Grids Win — and When They Bleed
Grid trading is regime-dependent. The same configuration can print steadily one month and bleed the next, purely because the market changed character.
- Wins in ranges. Sideways, choppy, oscillating markets are ideal. The more times price crosses back and forth between lines, the more round-trips the grid captures.
- Bleeds in uptrends (the missed rally). If price breaks above the upper bound, the grid sells all its inventory and stops participating — you sat out the move you were positioned for.
- Bleeds worst in downtrends (the falling knife). If price breaks below the lower bound, the grid keeps buying the whole way down and ends up holding a stack of losing inventory bought above market.
A grid is a bet that the range holds
This is the mirror image of a trend strategy like dollar-cost averaging, which keeps accumulating regardless of range. Different tools for different regimes — neither is universally “better.”
The Real Risks
Beyond picking the wrong regime, grids carry concrete, structural risks:
- Breakout risk. A strong trend turns the grid from a profit engine into a trap — the single biggest failure mode.
- Locked-up capital. Funds sit committed across many unfilled orders, reducing your flexibility to deploy elsewhere or react to news.
- Fee drag. A grid relies on a high count of small wins; frequent trading means fees can quietly out-pace the spread you capture.
- Liquidation (leveraged grids). Run a grid with leverage and a sustained move against your inventory can liquidate the position before price ever returns to the range. Understand how the venue handles margin first.
Risk control beats the grid itself
How to Run One (Platforms vs Hyperliquid API)
There are two honest paths to running a grid, depending on whether you write code:
Third-party bot platforms
Many bot platforms ship a ready-made grid template — you set the range, grid count, and spacing in a UI, connect your account, and the platform manages the orders. No code, but you rely on (and often pay) that provider.
Build it on an exchange API
Code the grid logic yourself against an exchange’s order API. Maximum control over spacing, re-anchoring, and risk caps — you own the strategy and the bugs.
On Hyperliquid, the build-your-own route is self-custodial. Hyperliquid exposes a public API — an Info endpoint for reading data, an Exchange endpoint for placing and cancelling orders, a WebSocket for live updates, and an official Python SDK (Hyperliquid Docs — API (Info, Exchange, WebSocket, agent wallets, Python SDK)). You authorise an agent wallet that can trade but never withdraw your funds, so a grid script runs against your own account without anyone taking custody of it. See Hyperliquid trading bots for the full API-and-agent-wallet picture.
Where Dexly fits (and what it is not)
Dexly is a non-custodial front-end to Hyperliquid. To be clear: Dexly has no built-in grid bot, DCA bot, or strategy engine. A grid is something you run via a third-party platform or your own code on Hyperliquid’s API. What Dexly offers as a no-code form of automation is copy trading — it mirrors a vetted human leader’s trades into your own wallet through the same agent-wallet mechanism, with per-follow USDC budget, position-size and leverage caps, and drawdown protection. A human leader adapts to a changing regime in a way a fixed grid cannot — though you still take on that leader’s losses, so the caps are a mitigant, not a guarantee. See copy trading vs bots for the comparison.
The Takeaway
Grid trading is a mechanical buy-low / sell-high strategy that profits from a market chopping inside a range. Define the range, grid count, and spacing; the bot recycles limit orders and harvests volatility. It is genuinely useful in sideways markets — and genuinely dangerous in strong trends, where a breakout either strands you out of a rally or buries you in falling-knife inventory. The strategy never protects you from that; your stop-out level, sizing, and fee-aware spacing do.
Pick the path that matches you
Coder who wants a self-custodial grid → build it against the Hyperliquid Docs — API (Info, Exchange, WebSocket, agent wallets, Python SDK) with an agent wallet that trades but cannot withdraw. Want automation without writing code → Dexly copy trading mirrors a human leader into your own wallet with hard risk caps. Either way, Dexly is the non-custodial UI where you fund with on-chain USDC and monitor or close any position — on web or the mobile app.
Educational content only — not investment advice. Grid trading carries real risk and can lose money, especially in trending markets and when leveraged; past or backtested performance does not predict future results. Verify fees, API limits, and any third-party platform’s claims against primary sources before trading. Facts verified 2026-06-30.
Keep Learning
Risk Warning: Trading perpetual futures involves significant risk of loss. Only trade with capital you can afford to lose. Dexly is a non-custodial interface; you are responsible for your own funds and trading decisions.
Frequently Asked Questions
Trade Hyperliquid on Dexly
Perps, spot, copy & prediction markets in one fast, non-custodial app. Get Dexly on iOS & Android and start in seconds.