Why a TWAP and not the last price
A single print can be noisy. One quick wick, one thin moment in the book, and the “last price” can land somewhere the market barely traded. A TWAP smooths that out by averaging the price over a short window, so the result reflects where the market actually was, not where one trade happened to print.The formula
Each price counts for how long it was active, not how many times it shows up. When a new mark price comes in, it stays active until the next one replaces it. For a window that starts ata and ends at b:
- The start counts, the end doesn’t. The window is
[a, b). A price that arrives exactly atbshows the data reaches the end of the window, but it adds zero time to the average. - The price going in counts. The first price used is the last mark price at or before
a, as long as it’s no more than 10 minutes old. - Mark price only. Every market uses the HyperCore perpetual mark price (
markPx) for its underlying. Never the oracle price, spot price, or an exchange close. - Exact math. Prices are converted to exact fractions and calculated with whole numbers, so there’s no floating-point rounding and every node gets the same answer to the last digit.
- The window is set per contract. Each contract’s rules state its TWAP window, and new contracts may use a different one. Check the rules of the market you’re trading. The examples below use the current windows for the 15 minute Up/Down and Hit Price markets.
All times are in UTC.
Price Binary example
A Price Binary market asks one question: was the TWAP strictly above the strike? The TWAP window is the lastW seconds before expiry, so the window is [expiry − W, expiry).
Take this market:
Now weight each price by how long it was active:
What happens at the strike
The comparison is strict. Landing exactly on the strike is a No.Price Touch example
A Price Touch market asks: did a rolling TWAP reach the target at any point before the deadline? Instead of one window at the end, the TWAP is recalculated continuously over a window that slides forward through the market’s life, from the moment the market was registered to the deadline. Take this market:
At 1.5 seconds the rolling TWAP reaches 7,700, so the market settles Yes. The mark price itself never printed 7,700. What counts is the rolling average, and the exact crossing moment is solved precisely, even when it falls between two price updates.
The boundary rules:
- A touch exactly at the registration time doesn’t count. Any touch after it does.
- A touch exactly at the deadline counts.
- If the TWAP never reaches the target by the deadline, the market settles No.
What each node collects
When a market settles, every Chainlink node in the network does this work on its own, then the network checks how many returned the same result. Here is what a node pulls and what it reports back, using the Price Binary example above.1
It reads the market's rules
The node looks up the settled market by its ID and reads the rules from the verified market record: underlying, strike, TWAP window, and expiry. Outcome only sends the market ID, never a price or a result.
2
It pulls the mark price history
The node requests the accepted HyperCore mark prices for the window from Hydromancer, a Hyperliquid data service. Each row looks like this:Every row must match the market’s exact coin and DEX, carry a real block number, and have a
markPx. Two different prices at the same timestamp invalidate the data, and the node won’t guess.3
It calculates and reports
The node runs the TWAP and sends back one result. Simplified, it looks like this:
specHash is a fingerprint of the market’s rules. evidenceHash is a fingerprint of the exact market record and price rows the node used. If two nodes saw even slightly different data, their evidenceHash won’t match.4
The network compares results
The network accepts a result only when at least 4 of the 10 nodes return exactly the same one, every field included, and no other result reaches 4. Then it signs the result and records it on Arbitrum One as the market’s settlement proof.
The values above are illustrative. The timestamps, block numbers, and hashes are shortened examples, not a real market.
Learn more
Resolution
How each price market type resolves.
Settlement proofs
How Chainlink CRE records a public proof of each result.