Risk controls
Caps on every open, protocol equity, liquidation, and the invariants the vault keeps.
Every limit in the vault applies to opens. Exits are never blocked: a user can always close, add margin, be liquidated, or claim, even when a cap is hit or the vault is paused.
Checks on every open
An open that fails any of these checks is cancelled with a full refund. The
cancellation reason is emitted in OrderCancelled.
| Check | Limit | Cancel reason |
|---|---|---|
| Price | Fill price within acceptablePrice | Price |
| Pause | The vault is not paused | Paused |
| Position size | Notional ≤ maxPositionNotionalUsdc, at request and again at the fill price | PositionCap |
| Leverage | Notional ÷ margin ≤ the tier for gross open interest after the trade | Leverage |
| Equity floor | protocolEquity ≥ minInsuranceBufferUsdc | EquityFloor |
| Open interest | Gross open interest after the trade ≤ maxOpenInterestMultiple × protocol equity | OpenInterestCap |
| Unhedged exposure | |net size after the trade − szi| × mark ≤ maxUnhedgedUsdc, unless the trade shrinks the gap | UnhedgedCap |
Gross open interest is the sum of every position's absolute size times the mark, so a long and a short never cancel out. An open that shrinks the unhedged gap passes the unhedged cap, but still counts toward gross open interest.
Leverage tiers
The maximum leverage depends on how much open interest the vault already
carries. There are three tiers. Their open interest caps strictly increase and
their leverage never increases, so a larger book allows less leverage. No tier
can exceed the immutable LEVERAGE_CEILING.
Why there are so few caps
The unhedged cap bounds the protocol's open exposure, so it replaces several controls that would otherwise be needed:
- a per-block flow cap, because flow the hedge does not keep up with grows the gap, and the unhedged cap stops it;
- a hedge-lag circuit breaker, because a hedge that keeps failing leaves the gap above the cap, which already stops risk-increasing opens;
- a HyperCore margin check, because with too little margin the IOC does not fill, and the gap stops new opens the same way.
Protocol equity
Protocol equity is what the vault owns after paying every user what it owes them. It is the base for the open interest cap and the equity floor.
protocolEquity = EVM USDC + Core account value + Core spot USDC
− (isolated margin + locked collateral + claimable)
− users' unrealized PnLCore spot USDC is included so equity does not dip while margin moves between
HyperCore perps, HyperCore spot, and HyperEVM. Within one execute batch the
vault reads protocol equity once. Later opens in the batch only add margin and
fees, so the cached value can only understate equity.
Liquidation
liquidate(clone) closes a position at the current mark once its equity,
including the accrued borrow fee, is at or below maintenanceMarginBps of
notional. Anyone can call it, and it works while paused.
Penalty
A penalty of up to liquidationPenaltyBps of notional is taken from the
remaining equity.
Split
liquidatorShareBps of the penalty is credited to the liquidator's claimable,
and the rest goes to the insurance buffer. Any equity left after the penalty is
credited to the position's clone.
Bad debt and the reward floor
The insurance buffer absorbs any bad debt. It then tops up the liquidator's
reward to minLiquidatorRewardUsdc, as far as the buffer allows, so even
underwater positions pay a liquidator.
The parameter bounds make self-liquidation more expensive than closing while equity covers the penalty: the buffer's share of the penalty is at least the spread plus the trade fee.
Invariants
What the vault always maintains
- Cash: HyperEVM USDC is at least isolated margin plus locked collateral.
- Accounting: the net size, gross size, margin, locked collateral, and claimable totals equal the sums over clones.
- Bounded payout: no clone receives more than its collateral plus its absolute size times the range between the highest and lowest mark seen.
- Bystander isolation: no action changes another clone's position or claimable.
- Price bounds: every execution is at the mark plus or minus the spread,
and within the user's
acceptablePrice. - Execution window: a request executes only in block N+1 or N+2.
- Hedge bound: a risk-increasing open never leaves the gap above
maxUnhedgedUsdc. - Exits always work: closes, liquidations, added margin, and claims never revert because of a cap or a pause.
- Full refunds: cancelled and expired requests return all of their collateral.
- Core is the truth: the hedge size is only ever read from
szi.
Continue with hedging for how the gap is closed, or parameters for the value of each cap.