Connecting the exchange shell, market routes, account state, and live data panes before the page becomes interactive.
Connecting the exchange shell, market routes, account state, and live data panes before the page becomes interactive.
Rest a ladder of buys below the price and sells above it, and let chop fill both sides over and over. Each completed buy-then-sell pair through one grid step is one unit of profit — no view on direction required, only a view that price will keep crossing your levels.
BTC spends most of its time oscillating inside ranges, and a perp's minute-to-minute path crosses the same prices repeatedly. A grid monetizes that revisiting: every time price dips a step you buy, every time it pops a step you sell what you bought one level lower. You are systematically buying low and selling high inside the range — effectively running a primitive market-making book with inventory bounds set by the grid edges.
On RAETH the natural home is BTC-PERP. Use the native mark, index, and book mid to center the grid. Maker fees are zero and every fill against a taker earns you the 25% rebate — a grid on RAETH is paid to exist.
N buy LIMITs spaced STEP apart below center and N sell LIMITs above (POST_ONLY).L fills, immediately rest its paired sell at L + STEP; when a sell fills, rest its paired buy at L − STEP.STEP × qty gross profit. Track pairs, not PnL ticks.CENTER = mid(hl_mirror_book) # or native mark price
STEP = 40 # cents/contract (~6 bps of a $63k BTC)
LEVELS = 10 # per side
SIZE = 10 # contracts per level
RANGE_STOP = CENTER * 0.015 # exit if price leaves ±1.5%
start:
for i in 1..LEVELS:
rest BUY at CENTER - i*STEP, qty SIZE (POST_ONLY)
rest SELL at CENTER + i*STEP, qty SIZE (POST_ONLY)
on private fill f:
if f.side == "BUY":
rest SELL at f.price + STEP, qty f.qty # the pair-closer
else:
rest BUY at f.price - STEP, qty f.qty
every 30s:
p = mark_price(market)
if abs(p - CENTER) > RANGE_STOP:
cancel_all(market)
close_position(reduce_only IOC) # take the range-break loss
CENTER = p; restart # re-center on the new regime
# Economics per completed pair: STEP * SIZE = 40c * 10 = $4.00 gross,
# zero maker fees both legs, plus rebates when takers hit you.
# The strategy's whole P&L question is: pairs completed vs the one
# range-break loss you take when the market trends out.last_funding_rate_bps — if carrying inventory costs more than a step per day, tighten the range or flatten.| Parameter | Starting value | Why |
|---|---|---|
| STEP | 40¢ (~6 bps) | Must exceed round-trip costs by enough that a pair is real profit; smaller steps = more pairs but more inventory in trends. |
| LEVELS | 10/side | Defines max inventory (LEVELS × SIZE) and the range you survive before the stop. |
| SIZE | 10 | Margin per level at 40× is tiny; total worst-case inventory is what matters. |
| RANGE_STOP | ±1.5% | The single most important risk number — the grid's loss is concentrated entirely in range breaks. |
Related: Lead-Lag Maker