A price your contracts can trust.
Give one pool its own time-weighted average price. The hook records the pool’s price once per block that trades, and any contract can read the average over the last minutes or hours. An optional cap stops a price pushed for one block from dragging the average.
Integration notes
local builds · not independently audited.
Build & exports
Downloads
What your build includes
Your configured hook and the complete 48-file Solidity source project (the oracle, Uniswap v4-core as pinned) with its compiler input and third-party notices.
This builder targets local chain 31337. Building here is free and does not connect a wallet, deploy contracts or move funds. To put the hook on Base, Robinhood Chain, Ethereum, Arbitrum One or BNB Chain, use the deploy panel below.
How to read it
consult(seconds) returns the average tick over the last seconds; consultSqrtPriceX96(seconds) returns it as a price. observe([...]) returns raw tick cumulatives for your own windows. oldestAge() says how far back it can reach. A read further back than the history reverts.
The first trade in a block records the price that held since the previous block that traded; trades later in the same block do not record again, so a price moved and moved back inside one block leaves no mark. With truncation on, a price pushed for a single block counts as at most the cap times the seconds since the last observation.
No owner and no fees: the hook only reads the pool and never changes a swap. It is still an oracle on one pool: a pool with little liquidity can be moved over many blocks by anyone willing to pay for it. Pick windows and truncation for the value you secure.
