Templates

Grid. Buy lower and sell higher, inside a range.

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

SettingRangeDefaultWhat it does
Market
Any listed perp, HIP-3 included
SOL
Which market it trades.
Lower and upper price
Any two prices, lower below upper
±10% around the price
Wider: survives bigger moves, fewer trades per swing.
Levels
2–200
10
More: smaller steps, more trades, smaller gain on each.
Leverage
1× up to Hyperliquid's max × (1 − cash share); at the bottom
2×
Full size at the bottom of the range.
Entry slippage
0.05%–5%
0.3%
The worst price an entry accepts. Past it, the order doesn't fill and waits for the next step.
Out of range
Hold or flatten
Hold
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.

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

SOL priceLevels above itTarget
160 or above
0
Flat
150 – 160
1
25% · $50,000
140 – 150
2
50% · $100,000
130 – 140
3
75% · $150,000
120 – 130
4
100% · $200,000
below 120
5
100% (hold) or flat (flatten)
HyperliquidBTCETHHYPESOL