Hooks for every perp position on Elysium.

Attach your own Solidity contract to a position. It runs when the position opens, changes, gets liquidated or closes.

180 m sunlight zone

Every position passes four checkpoints. Open, modify, liquidation, close. Now you can put code at each one.

Uniswap v4 made pools programmable with hooks. Illicium does the same for perp positions, running on Elysium's fast blocks next to Hyperliquid's order books.

640 m twilight zone

Follow one position down.

An example ETH long, from open to close. Keep scrolling to see which hooks fire at each step.

ETH-PERP

Long, opening
Example position
Notional$25,000
Leverage25x10x
Mark price3,412.50
Unrealized PnL$0.00
Margin health 2.40
beforeOpenLeverageGuardCaps leverage by 30-day volatility
afterOpenReferralSplitPays the referrer 10 bps
hook callselysium
  1. openPosition(ETH-PERP, long, $25,000, 25x)#4,812,310beforeOpenLeverageGuardvol 4.1% → cap 10x, leverage set 25x → 10x
  2. #4,812,310afterOpenReferralSplit10 bps ($2.50) → 0x8f3c…a21e

2,300 m midnight zone

What builders hook.

Each of these is a single contract that any market can opt into.

Position taxes

Charge a fee when a position opens or grows, and route it to a treasury, a buyback or stakers. A $15,000 size increase at 0.05% sends $7.50.

beforeOpenbeforeModify

Referral rewards

Split fees with whoever brought the trader in. The payout lands in the same block the position opens.

afterOpenafterClose

Dynamic leverage limits

Tighten max leverage when a market turns volatile, and loosen it when things calm down. Try it:

Max leverage10x
beforeOpenbeforeModify

Trading games

Streaks, seasons and leaderboards scored from real closes, so nobody can fake a result offchain.

afterClose

Automated hedging

When a position grows past a size you set, open a matching hedge on HyperCore spot, and unwind it when the position closes.

afterModifyafterClose

Liquidation shields

Top up margin from a vault right before a liquidation would hit, or pay a bounty pool when one does.

beforeLiquidationafterLiquidation

4,800 m abyss

Hooks are plain Solidity.

Implement the callbacks you need and register the contract against a market. A before-hook can change a trade or stop it. An after-hook sees the result and acts on it.

LeverageGuard.sol

    

5,900 m abyss

Fast logic above. Deep liquidity below.

Your hook runs on Elysium and works with positions and order books on HyperCore.

Elysium

Where hook contracts live and run. An EVM layer 2 for Hyperliquid built by Kinetiq, on Arbitrum Orbit's Nitro stack. Gas is paid in HYPE and batches settle to HyperEVM.

HyperCore

Hyperliquid's trading engine, home to the perp and spot order books. Hooks read positions and depth from it and can send orders back, with fills reported onchain.

arrives with Elysium's first upgrade after mainnet

10,935 m hadal trench

Ship your hook on Elysium mainnet.

Builder access includes the interface, a starter repo and help deploying to mainnet. Early hooks get listed in the launch directory.