Templates

Grid

Buys lower and sells higher inside a range. Its position steps with the price: full at the bottom of the range, flat at the top, one step per level.

What it does

“Trade SOL between 63.61 and 77.75 in 10 levels.” Each time the price falls through a level it buys one step; each time it rises through one it sells a step. In a market that swings back and forth, every down-and-up round trip banks a small gain.

One check, and the call behind each step
Elysium · the token's contract
HyperCore · its own account
  1. 1Read
    Reads its position and the mark
    coreTimeMspositionaccountValuemarkPx
    Position, account value, mark
    coreTimeMspositionaccountValuemarkPx
  2. 2Find the level
    Target = levels above the price ÷ (levels − 1) × full size
    on the chain
  3. 3Step to the target
    Crossed a level down: buy a step; up: sell one
    limitOrder · IOC
    One order that fills at once
    limitOrder · IOC
  4. 4Out of range
    Above the top: flat. Below the bottom: hold or flatten
    on the chain
Every step checks again. v1 sends each step as an order that fills at once: HyperCore order status can't be read on chain yet.

What happens next

The dotted lines are the levels. White triangles are buys, grey ones sells. Grids like swings and dislike one-way trends: the price leaving the range below leaves it holding the full position.

What happens to $1,000
SOL 63.61–77.75 in 10 levels, 2× at the bottom, holds below the range
Up 15%over 2 days
81.363.6bottomtop$1,000$1,067your $1,000
$1,000 →$1,067+6.7%
1 buy · 5 sells · 63% of the time in range

If SOL rises 15% over 2 days, your $1,000 becomes about $1,067.

Sideways ±6%for 2 days
77.863.6bottomtop$1,000$1,051your $1,000
$1,000 →$1,051+5.1%
11 buys · 10 sells · 100% of the time in range

If SOL swings 6% up and down for 2 days, your $1,000 becomes about $1,051.

Down 15%over 2 days
77.860.0bottomtop$1,000$730your $1,000
$1,000 →$730−27.0%
5 buys · 0 sells · 56% of the time in range

If SOL falls 15% over 2 days, your $1,000 becomes about $730.

Down 12%, then backwithin 2 days
77.862.6bottomtop$1,000$1,019your $1,000
$1,000 →$1,019+1.9%
5 buys · 4 sells · 72% of the time in range

If SOL falls 12% and comes back within 2 days, your $1,000 becomes about $1,019.

  • Buys a step
  • Sells a step
  • Price

Illustrative price paths over 2 days. What the token does on them, and every dollar figure, comes from the template's own simulator with these settings and Hyperliquid's fees, with funding and order-book slippage where they apply. Before the fees to buy and sell the token. Not a forecast.

How it runs

target = levels above the price ÷ (levels − 1) × full size
Full size is leverage × the pool. Levels run from the lower price to the upper one, both included.
  • Inside the range the token shows “in range”; outside it, “out of range”.
  • Above the upper price it's flat.
  • Below the lower price it either holds full size (hold) or goes flat (flatten), as the creator chose.

Settings

Market
Range: Any listed perp, HIP-3 included
Default: SOL
What it does: Which market it trades.
Lower and upper price
Range: Any two prices, lower below upper
Default: ±10% around the price
What it does: Wider: survives bigger moves, fewer trades per swing.
Levels
Range: 2–200
Default: 10
What it does: More: smaller steps, more trades, smaller gain on each.
Leverage
Range: 1× up to Hyperliquid's max × (1 − cash share); at the bottom
Default: 2×
What it does: Full size at the bottom of the range.
Entry slippage
Range: 0.05%–5%
Default: 0.3%
What it does: The worst price an entry accepts. Past it, the order doesn't fill and waits for the next step.
Out of range
Range: Hold or flatten
Default: Hold
What it does: Below the bottom: keep the full position, or sell it all and wait.
Levels
The same range on the sideways ±6% path.
10 levels
11 buys, 10 sells → $1,051
20 levels
27 buys, 26 sells → $1,028

Plus the settings every template shares: the cash share, breakers, pool cap, end date, fees, market liquidity, metadata and seed. See Shared settings.

Under the hoodintended, on Elysium's precompiles

Every precompile call a Grid token makes, in the order its cycle first makes them, then the pool's own. Until Elysium publishes its precompiles these are the intended calls; the contracts run them on HyperEVM testnet today. What each does, and the assumptions behind them: Precompiles on Elysium.

coreTimeMs()
Kind: read
What it does here: How fresh the reads are. A step stops when they're older than 2 seconds.
Where today: HyperEVM: the block's time
position(vault, asset)
Kind: read
What it does here: The vault's own position on a market: its size and what it cost.
Where today: L1Read 0x…0800
accountValue(vault)
Kind: read
What it does here: What the vault's HyperCore account is worth: margin plus the open result. NAV is built from it.
Where today: L1Read 0x…080F
markPx(asset)
Kind: read
What it does here: Hyperliquid's mark price: what the stop, the bands, the levels and the strikes are checked against.
Where today: L1Read 0x…0806
limitOrder(… IOC)
Kind: write
What it does here: An order that fills at once or cancels, never worse than its limit: entries, stops, rebalances, grid steps.
Where today: CoreWriter action 1, time-in-force 3
withdrawable(vault)
Kind: read
What it does here: How much USDC can leave the account right now, to pay sellers.
Where today: L1Read 0x…0803
usdClassTransfer(amount, toPerp)
Kind: money
What it does here: Moves USDC between the account's perp and spot balances.
Where today: CoreWriter action 7
depositFor(vault, amount, dest)
Kind: money
What it does here: Sends USDC from the vault on the chain into its own HyperCore account.
Where today: Circle's CoreDepositWallet
spotSend(system, USDC, amount)
Kind: money
What it does here: Sends USDC from the HyperCore account back to the vault on the chain, to pay sellers.
Where today: CoreWriter action 6

Worked example

SOL Grid 120–160 with 5 levels (120, 130, 140, 150, 160), 2× on a $100,000 pool: full size is $200,000.

160 or above
Levels above it: 0
Target: Flat
150 – 160
Levels above it: 1
Target: 25% · $50,000
140 – 150
Levels above it: 2
Target: 50% · $100,000
130 – 140
Levels above it: 3
Target: 75% · $150,000
120 – 130
Levels above it: 4
Target: 100% · $200,000
below 120
Levels above it: 5
Target: 100% (hold) or flat (flatten)