ETH-PERP
Long, openingbeforeOpenLeverageGuardCaps leverage by 30-day volatilityafterOpenReferralSplitPays the referrer 10 bpsAttach 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
An example ETH long, from open to close. Keep scrolling to see which hooks fire at each step.
beforeOpenLeverageGuardCaps leverage by 30-day volatilityafterOpenReferralSplitPays the referrer 10 bps2,300 m midnight zone
Each of these is a single contract that any market can opt into.
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.
beforeOpenbeforeModifySplit fees with whoever brought the trader in. The payout lands in the same block the position opens.
afterOpenafterCloseTighten max leverage when a market turns volatile, and loosen it when things calm down. Try it:
beforeOpenbeforeModifyStreaks, seasons and leaderboards scored from real closes, so nobody can fake a result offchain.
afterCloseWhen a position grows past a size you set, open a matching hedge on HyperCore spot, and unwind it when the position closes.
afterModifyafterCloseTop up margin from a vault right before a liquidation would hit, or pay a bounty pool when one does.
beforeLiquidationafterLiquidation4,800 m abyss
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.
5,900 m abyss
Your hook runs on Elysium and works with positions and order books on HyperCore.
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.
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 mainnet10,935 m hadal trench
Builder access includes the interface, a starter repo and help deploying to mainnet. Early hooks get listed in the launch directory.