Uniswap TWAP Implementation

Mechanism

The Uniswap time-weighted average price implementation functions as an on-chain oracle that tracks cumulative price history within liquidity pools. By recording the sum of current price observations at the beginning of each block, the protocol enables market participants to derive a precise average valuation over any chosen duration. This approach mitigates the risk of short-term price manipulation by ensuring that large, transient trades do not disproportionately skew the reference index used by external decentralized finance applications.