risk engine. — every margin tier, every safety rail, every number lifted straight from the contract.
price moves against you
mark price tracks the live AMM pool every block. there is no off-chain oracle, no admin to halt — the curve writes the mark.
health drops to MMR
your equity (margin + unrealized PnL) divided by notional equals your health ratio. when it hits maintenance, you're liquidatable.
liq when health ≤ MMR_bps / 10000
keeper calls liquidate()
any address can call liquidate(trader, marketId). the contract verifies health, settles the position at mark, and pays bounty to the caller.
= 1% of notional
residual loss → HLP
if your remaining margin can't cover the bounty + slippage, the deficit is absorbed by HLP. this is why HLP earns 50% of fees — it backstops the system.
hlpAssets -= deficit
swept on next swap
queued liquidations are batched and cleared inside the v4 hook's beforeSwap — every swap pays a small gas tax to keep the book clean.
up to N unhealthy positions / swap
🟢 normal volatility
price moves < 1% / minute. funding settles hourly, rate clamped at ±0.005% / hr.
HLP earns 50% of all fees, share price drifts up. no liquidations queued.
expected🟠 5% gap move
major asset gaps 5% on news. positions above 50% MMR survive; max-leverage longs get queued.
hook sweeps liqs over the next ~3 swaps. HLP absorbs ~0.2% deficit. stake stays solvent.
stress🔴 flash crash (-15%)
cascade event. HLP drawdown approaches 8% gate — withdrawals from HLP pause until peakAssets recovers.
protocol stays open for trade + close. positions still liquidatable. $HELIX buyback continues.
drawdown gate⚪️ funding extremes
funding rate is hard-clamped to ±0.005% / hr (≈ ±43.8% APR worst case). cannot exceed that even at 100% one-sided OI.
capped⚪️ MEV / sandwich
mark price comes from the AMM tick after the swap completes. sandwiching a perp open just moves the entry by the same delta as a swap — no advantage.
neutralized⚪️ oracle attack
there is no oracle. mark price = the AMM pool price, which is also where the underlying spot trades. cannot be diverged without arbitrage.
no oracle