Data sources and freshness
Docs

Data sources and freshness

Where every value comes from, how fresh it is, and the exact rules under which a keeper refuses to fire.

Feeds

The engine reads Hyperliquid's own WebSocket and info API. It subscribes only to what registered strategies and the live preview need, so a strategy on BTC funding adds BTC's asset context, and a whale strategy adds that address's fills.

ValuesSourceNotes
mark, oracle, funding, oi, mid, changeactiveAssetCtx (WebSocket)One subscription per coin.
mid (all coins), cross-checkallMids (WebSocket and info API)Info API compared every 60 s.
imbalance(N)l2Book (WebSocket)Computed over the first N levels.
bigtrade(window)trades (WebSocket)Largest notional in the window.
0xADDR.COIN.positionuserFills (WebSocket)At most 10 watched addresses, Hyperliquid's per-IP cap.
kHYPE.rateKinetiq StakingAccountant on HyperEVM, 0x9209648Ec9D448EF57116B73A2f081835643dc7AkHYPEToHYPE(1e18), read every 60 s.

Measured cadence

We timed the live feeds. activeAssetCtx arrives about once per second per coin, trades arrive in real time, and allMids and l2Book arrive about every 12 seconds. The rule of thumb: values from the asset context and trades are seconds fresh; book imbalance is as fresh as the last book.

tradesreal timeactiveAssetCtxabout 1 s per coinallMidsabout every 12 sl2Bookabout every 12 skHYPE.rateevery 60 s (HyperEVM read)0 s24 s
Shape of each feed over 24 seconds. Tick positions are illustrative; the cadences are the measured ones.

When the keeper refuses

Before any fire the keeper runs these checks, in this order. If one fails the decision is recorded as refused, with the reason, and nothing is sent.

01Feed down the WebSocket is disconnectedrefuse
02Warming up less than 3 s since a reconnect, while snapshots refill the state3 s
03Feed lag the newest frame is older than 5 s5 s
04No recent cross-check no info API comparison in the last 180 s180 s
05Disagreement WebSocket mids and the info API's allMids differ by more than the limit on HYPE, BTC, ETH or SOL50 bps
06Stale value a value this strategy reads last arrived more than 30 s ago (kHYPE.rate: 300 s)30 s

A trigger that was already sent is never sent again: the keeper writes the transaction hash to its journal before waiting for the receipt, and checks the journal before every send.

On-chain checks

The contracts do not trust the keeper's clock or its replay. Every fire must pass:

  • Staleness: snapshotTime is not in the future and at most maxStaleness seconds old, which the owner sets per strategy, from 1 to 120.
  • Trigger: strictly greater than the last fired trigger.
  • Limits: before expiry, under maxFires, after the cooldown, and enough escrow for the whole fire.
  • Condition: the VM re-runs the program on the submitted values and reverts if it is false.
  • On HyperEVM: every MARK and ORACLE value is within 1% of the live read precompile in the same transaction.

Lag, gaps and halts

The WebSocket client pings every 20 seconds and treats 10 seconds of silence as a stall. It reconnects with exponential backoff from 250 ms up to 30 s. While it is down, every fire is refused; after it is back, the 3 second warm-up lets snapshots refill the state before anything fires.

If HyperCore halts, frames stop and the feed-lag rule refuses within 5 s. If the WebSocket keeps talking but drifts from the info API, the cross-check refuses within a minute. Strategies resume on their own once the data is fresh again; a condition that became true during the gap fires on its next rising edge, never twice.