Hedging & risk policy
Hedging & delta neutrality
The pool holds token inventory in each market whenever traders net-sell to it. The hedger (operator) keeps, per market, a short position in that market's Hyperliquid perp (HYPE-PERP for WHYPE, BTC-PERP for UBTC, ETH-PERP for UETH, SOL-PERP for USOL, PURR-PERP for PURR) equal to the pool's token balance, so the combined book is delta-neutral:
target hedge = −tokenBalance (coin units)
gap = target − currentHlPosition
if |gap| × mid ≥ HEDGE_MIN_USD → IOC limit order, slippage-capped (30 bps default)
The hedger runs every 1.5 s and on every Swap event, then calls reportHedge(ids, hedgeSizes, hedgeEquityUsdE6) roughly every 30 s with the HL account value and per-market position sizes. The frontend shows net delta (inventory + hedge, in USD) and the age of the last report. If the report is older than hedgeStaleSec (default 600 s) the pool flags hedgeIsStale() and the UI shows a warning; deposits and withdrawals keep working.
Margin for the hedge is funded by the owner moving USDC out of the pool with moveToHedge (capped at maxHedgeCapitalBps, default 30% of NAV, tracked as hedgeCapitalOutUsdE6). Anyone can return it with returnFromHedge.
On-chain risk policy
Between a trade and the next reportHedge the pool is unhedged by that trade's size. The contract, not the bot, decides how much of that gap is acceptable:
struct RiskPolicy { uint128 maxNetDeltaUsdE6; uint16 breachSpreadBps; bool enforce; }
netDeltaUsd(id) = (tokenBalance + hedgeSize) × mid // exposed as inventory(id).netDeltaUsdE6
riskMode() = reduce-only if enforce && (hedgeIsStale() || max_i |netDeltaUsd(i)| > maxNetDeltaUsdE6)
= normal otherwise
In reduce-only mode quote, swapExactIn, swapRFQ and depositToken accept a trade only if it shrinks that market's |net delta| (|netAfter| < |netBefore|); anything else reverts ReduceOnly(netDeltaUsdE6, maxNetDeltaUsdE6). Delta-reducing trades in reduce-only mode pay spread + breachSpreadBps (still capped at maxSpreadBps). Defaults: cap $10,000, breach spread 10 bps, enforced. The owner can change the policy with setRiskPolicy (event RiskPolicySet).
The Trade and Markets pages show the current mode as a badge; /api/risk returns riskMode { mode, worstNetDeltaUsdE6, hedgeStale } and riskPolicy, and /api/quote returns a decoded ReduceOnly with an explanation when a quote is refused. The hedger only executes; the limit lives in the contract.