HELIX// risk home trade stats hlp docs
MOCK docs
contract HelixPerps.sol · maint margin 2% major · 5% alt · liq bounty 1% · HLP gate 8% drawdown · funding clamp ±0.005%/h · params immutable · onchain
RISK

risk engine. — every margin tier, every safety rail, every number lifted straight from the contract.

parameters immutable · no admin can edit · audited
01 MARGIN PARAMETERS // per-market initial & maintenance margin · leverage cap · funding clamp sourceHelixPerps.sol
tier max leverage initial margin maintenance liq bounty example
Major — ETH, BTC, SOL, HYPE 25× max 4.00% 2.00% 1.00% $100 → $2.5k notional
Alt — all other markets 10× max 10.00% 5.00% 1.00% $100 → $1.0k notional
initial margin = floor — you cannot open under this. maintenance margin = floor below which the position is liquidatable. the gap between them is your survival buffer. major-tier MMR=2% means a 2% adverse move at max-leverage liquidates you. a smart trader stays at 50–60% of max leverage to keep buffer.
02 LIQUIDATION FLOW // what happens, in order, when a position falls under maintenance margin
01

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.

mark = AMM.priceOf(marketId)
02

health drops to MMR

your equity (margin + unrealized PnL) divided by notional equals your health ratio. when it hits maintenance, you're liquidatable.

health = (margin + pnl) / notional
liq when health ≤ MMR_bps / 10000
03

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.

bounty = notional × 100 / 10000
= 1% of notional
04

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.

deficit = max(0, bounty + slip − margin)
hlpAssets -= deficit
05

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.

hook → engine.sweep(maxCount)
up to N unhealthy positions / swap
03 POSITION CALCULATOR // estimate liquidation price and survival range before opening
notional$5,000
liq price$0.00
distance to liq0%
maintenance margin2%
est. open fee$0
est. liq bounty (1%)$0
verdict
04 SCENARIOS // what HELIX does in each market state — your edge cases answered

🟢 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
05 SAFETY RAILS // hard-coded limits the contract enforces · no governance · no admin override
safety threshold effect scope source
HLP drawdown gate 8% from peak withdrawals pause HLP only HLP_DRAWDOWN_GATE_BPS
funding clamp ±0.005%/h cap on per-block accrual every market FUNDING_CLAMP_PP1E8
liquidation bounty 1.00% paid to keeper that triggers liq every liq LIQ_BOUNTY_BPS
maintenance margin · major 2.00% health floor for major markets ETH / BTC / SOL / HYPE MAINT_MARGIN_BPS_MAJOR
maintenance margin · alt 5.00% health floor for alt markets 20 alt markets MAINT_MARGIN_BPS_ALT
no admin contract has no owner / pauser / upgrader protocol-wide no Ownable import
every threshold here is a public constant in HelixPerps.sol. no governance vote, no multi-sig key, no timelock can change them. the only way to ship new params is a fresh deployment. that's the trade-off you accept for credible neutrality.