Security and trust

Caps, the keeper and how to re-check a print.

Roles

RoleCanCannot
Upgrade authorityReplace the program; the only key that can initialize the poolAnything else at runtime
Pool authority (two-step handover)Create series and set their parameters, set keeper, fees, cooldown, grace, treasury and buyback accounts, pause new opens and depositsMove vault funds, change a live market, edit prints, stop exits, settlement, liquidation or withdrawals
KeeperPost the next funding print of a market, once, in order, after its period ended, within the per-period boundPost twice, skip ahead, post early, post after expiry, touch funds
AnyoneSettle matured positions, liquidate under-margined ones, close finished empty markets, sweep feesRedirect any payout; every payout account is pinned to the owner, the LP, or the stored treasury and buyback

The keeper is the one trusted feed

A wrong print would move money between traders and LPs for that one period. Four things bound it.

  1. Each print is capped at 5% of notional per period, above Hyperliquid's own 4% an hour clamp.
  2. A print lands only for the exact end of the next unprinted period (PrintOutOfOrder, PrintFromFuture).
  3. Every print emits a FundingPrinted event with venue, coin, rate and source timestamp.
  4. The keeper key is separate from the pool authority and can do nothing else.

Re-check any print yourself

# Hyperliquid, the hour ending at source_ts
curl -s https://api.hyperliquid.xyz/info -H 'content-type: application/json' \
  -d '{"type":"fundingHistory","coin":"BTC","startTime":<source_ts_ms - 3600000>}'

# Binance, the 8-hour period ending at source_ts
curl -s 'https://fapi.binance.com/fapi/v1/fundingRate?symbol=BTCUSDT&startTime=<source_ts_ms - 60000>&limit=1'

Multiply the venue's decimal rate by 1e12 and compare it with the rate field of the event.

Checks in the program

RiskCheck
Someone claims the pool at deployinitialize requires the program's upgrade authority
Two markets for one seriesMarket PDA seeds are venue, coin and maturity
Trading on a rate that is already publicOpens, early closes and liquidations require the current period to be running (MarketStale)
Account substitutionEvery PDA checked by seeds and bump, positions carry has_one = owner, market, token accounts checked for mint and owner
Hidden markets in LP pricingDeposits and withdrawals take every active market, sorted by address (InvalidMarketSet)
A run on the pool mid-moveWithdrawal cooldown, and withdrawals that would leave exposure above the caps are refused
A third party pushing a position underLiquidation triggers on the anchor, so moving the book cannot force it
ArithmeticChecked math everywhere, exact integer accrual, rounding against the trader

Known limitations

  • During a running period, Hyperliquid's predicted funding is public, so a trade late in the hour carries a good guess of that period's print. The edge is one period of rate deviation on the trade's notional.
  • LPs are short a foresight option by design. A replay against an adversary with perfect 7-day foresight all year takes 29.6% of the pool, and LPs earn spread and skew from everyone else.
  • If prints stop, trading on that market stops, and anyone can settle after maturity plus the grace window at what printed. Missing periods accrue nothing on either leg.