Engine

Risk controls

Every control that limits what the engine can do, with its exact threshold.

Risk controls are part of the engine, not an afterthought. They reduce risk; they do not eliminate losses.

Kill switch

One flag stops everything: engine_state.kill = {on, reason, by}.

  • The engine checks it every 3 s. When it engages, every strategy stands down (cancels its resting orders) and shows halted. The ledger records All strategies halted: kill switch.
  • When it is released, strategies return to running (Kill switch released; strategies resume).
  • It can be set by an operator through POST /api/v1/admin/kill, or by the drawdown limit below.
  • It survives PAPER_RESET.

See Admin & kill switch for the calls.

Drawdown halt

At every snapshot (every minute):

text
peak24h      = max(highest NAV in the last 24 h, current NAV)
drawdownBps  = max(0, round((1 − NAV / peak24h) × 10 000))

If drawdownBps ≥ MAX_DRAWDOWN_BPS (default 1 000, i.e. 10 %), the engine engages the kill switch itself with the reason NAV fell X% from its 24h peak (limit Y%) and logs an error event. Snapshots are skipped when the NAV can't be computed (a holding without a price), so the check is too.

Warning

Releasing the kill switch does not reset the 24-hour peak. If NAV is still more than the limit below it, the next snapshot engages the switch again.

All the limits

ControlThresholdWhere
Kill switch poll3 sengine
Drawdown haltMAX_DRAWDOWN_BPS, 10 % from the 24 h peakengine
Strategy pauseper strategy, by an operatoradmin API
Stale HyperCore book (market making)15 s: quotes pulled, risk warninghypercore-mm
Stale HYPE book (hedge)20 s: no tradehedge
Stale pool price (Montra)60 s: no trademontra-mm
Inventory limit45 % of the market's capital: the adding side stopshypercore-mm
Hedge marginshort ≤ USDC × 3 / price; market making keeps that margin asidehedge, hypercore-mm
Treasury limitson-chain maxHypePerCall and dailyHypeLimit, applied in paper toomontra-mm, Treasury
SlippageMontra 1 % (minOut 99 %); hedge 10 bps; arbitrage HyperCore leg 0.5 %strategies
Capital capsmarket making 25 % + 15 %, Montra 20 %, hedge 25 %, arbitrage 5 %strategies
Restartsopen orders cancelled on start; live mode cancels its own leftover HyperCore ordersengine
Live opt-inCONFIRM_LIVE=yes plus the keysconfig
Feed healthHyperliquid OK if a message arrived in the last 15 s, Montra if a price in the last 60 sheartbeat

There is no separate per-trade loss limit or rate limit beyond the ones listed.

On chain

The engine's limits sit on top of the contracts' own: the Treasury only runs allow-listed calls within its HYPE limits, the guardian can pause it, and the swap adapter always pays the Treasury. See Security & risks.