REQUIEM
Docs · 02

Recipes

Every recipe is integer arithmetic on the decimal strings the sources publish (no floating point), in the open node file at /node/requiem-reporter.mjs (computeRecipe). Two reporters reading the same inputs sign the same value to the last unit. Values are int256 scaled 1e18: USD per HYPE for prices, USD for depth.

IdFeedInputsRound dueWindowSpread
7HYPE TWAP, 1 hcandleSnapshoteach hour10 minequal
8HYPE VWAP, 1 hcandleSnapshoteach hour10 minequal
9HYPE depth-weighted mid, $100kl2Book1 h or 1%5 min0.5%
10HYPE sell depth, 2%l2Book + Elysium pools2 h or 25%10 min3.0%

TWAP, 1 h (feed 7)

For the hour ending at T (a multiple of 3600): the mean of the sixty 1-minute closes of the HYPE perp from candleSnapshot, minutes T - 3600 to T - 60. A minute without a candle carries the previous close (or the first open in the window). Reporters sign hour T from T + 20 s, once Hyperliquid has closed the last candle, so the value is exact and every signer signs the same number; the round is observedAt = T, one per hour, in order, and a missed hour is posted later from the same candles.

VWAP, 1 h (feed 8)

Over the same candles: the sum of each minute's typical price (high + low + close) / 3 times its volume, divided by the hour's volume. An hour with no volume would be its TWAP. Same hour rule, same exact agreement.

Depth-weighted mid, $100k (feed 9)

From Hyperliquid's l2Book for HYPE, read at full precision and at 5, 4, 3 and 2 significant figures: on the finest of these whose 20 levels hold $100,000 on both sides, the average fill price of a $100,000 market buy against the asks and of a $100,000 market sell against the bids, and the midpoint of the two. An aggregated level counts at its far edge (bids rounded down, asks up), so neither fill is better than the book. It runs the mid's rule: a 1% move or every hour, 0.5% between signers, 5 minutes in its window.

HYPE sell depth, 2% (feed 10)

The USD a seller of HYPE receives before the price is 2% below the mid (the full-precision book's best bid and ask, averaged). Two venues:

  • Hyperliquid: every bid at or above the band edge, on the finest aggregation whose 20 levels reach the edge; the level that straddles the edge counts in proportion to the part of its price range inside the band.
  • Elysium: what each plain HYPE/USDC Uniswap v4 pool (0.3% and 1%, no hook) pays in USDC to move its price down to the same edge, walking its initialized ticks at one block through the StateView lens 0x27eD73aE0652fdCf71d6793412A7525f32bE9dfE. The node's result matches Uniswap's own V4Quoter to the unit.

Depth posts on a 25% change or every 2 hours, with 3% between signers (two reads of a book a few hundred milliseconds apart are close, not equal) and a 10-minute window.

How a round is checked

  • TWAP and VWAP: recomputed from the hour's closed candles; a round more than 0.05% from the recomputation is disputed.
  • Depth-weighted mid: inside the range HYPE traded in that minute and the next two, widened by the spread, as for mids.
  • Depth: the Elysium part is exact at its block. A book cannot be read in the past, so the watchers compare a pending round with a fresh reading: more than three times away is disputed, between one and a half and three times nothing is done, and a round older than 15 minutes is not judged. This bounds what a colluding quorum could post without proving each value; protocols that size liquidations on depth should also cap how much one round may change their limits.

Composing a recipe

GET /api/request?kind=twap&coin=BTC&window=30, kind=vwap, kind=dwm&size=250000, kind=depth&band=100 and kind=fundingAvg&hours=8 compute any recipe on any Hyperliquid market now, with the node's code, the rule it would run under and its cost. A requested recipe becomes a feed with addFeed on the live Feeds, inside the bounds of the Feeds chapter, with no redeploy.

Cost to the network

Measured on a fork of the live Elysium chain with the real relayer and reporters: 377,000 gas for the TWAP and VWAP of one hour in one transaction, about 188,000 per depth-weighted mid or depth round. /api/network returns the live daily total as cadence.