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.
| Values | Source | Notes |
|---|---|---|
| mark, oracle, funding, oi, mid, change | activeAssetCtx (WebSocket) | One subscription per coin. |
| mid (all coins), cross-check | allMids (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.position | userFills (WebSocket) | At most 10 watched addresses, Hyperliquid's per-IP cap. |
| kHYPE.rate | Kinetiq StakingAccountant on HyperEVM, 0x9209648Ec9D448EF57116B73A2f081835643dc7A | kHYPEToHYPE(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.
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.
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:
snapshotTimeis not in the future and at mostmaxStalenessseconds 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.