# TWAP oracles: averaging prices over time

A time-weighted average price, or TWAP, averages price observations over an interval according to time spent at each value. It can reduce dependence on one instantaneous pool price, but introduces lag and does not eliminate manipulation risk. The pool, window, observation availability and averaging method all matter.

Evidence: [Uniswap v2 whitepaper](https://app.uniswap.org/whitepaper.pdf); [Uniswap v3 whitepaper](https://app.uniswap.org/whitepaper-v3.pdf)

Canonical: https://degreesofsatoshi.com/encyclopedia/twap-oracles/
Published: 2026-10-02
Substantively modified: 2026-10-02
Independently verified by an automated reviewer: 2026-10-02T18:15:18.493Z
Data current through: 2026-10-02

AI-assisted research and drafting with a separate automated source-verification pass; no external expert or named human review is implied.

## Key facts

- **V2 example:** Uniswap v2 accumulates prices to support arithmetic time-weighted averages. ([Uniswap v2 whitepaper](https://app.uniswap.org/whitepaper.pdf))
- **V3 example:** Uniswap v3 accumulates ticks to support geometric mean prices. ([Uniswap v3 whitepaper](https://app.uniswap.org/whitepaper-v3.pdf))
- **Window:** The selected interval changes responsiveness and the exposure being measured. ([Uniswap v2 whitepaper](https://app.uniswap.org/whitepaper.pdf); [Uniswap v3 whitepaper](https://app.uniswap.org/whitepaper-v3.pdf))

## Weight by time rather than number of trades

For a simple arithmetic example, a price of 100 for 30 minutes and 120 for 30 minutes gives a one-hour average of 110. Ten trades at one moment should not automatically receive ten times the time weight.

This example is not the geometric method used by a v3 tick-based oracle. Name the averaging convention when comparing outputs.

Evidence: [Uniswap v2 whitepaper](https://app.uniswap.org/whitepaper.pdf)

## Subtract two observations and divide by elapsed time

A cumulative price records price multiplied by elapsed time. The difference between observations gives an interval total that can be divided by the interval length.

An application must have suitable observations spanning the intended window. A requested duration is not proof that enough trustworthy history is available.

Evidence: [Uniswap v2 whitepaper](https://app.uniswap.org/whitepaper.pdf)

## Smoothing trades immediacy for a longer measurement

A longer interval can reduce sensitivity to brief moves but responds more slowly to a genuine market change. Pool depth and an attacker’s ability to sustain a distortion affect manipulation economics.

Using a TWAP does not automatically make a lending or settlement application safe. Match the source liquidity and window to the use case and failure handling.

Evidence: [Uniswap v2 whitepaper](https://app.uniswap.org/whitepaper.pdf); [Uniswap v3 whitepaper](https://app.uniswap.org/whitepaper-v3.pdf)

## Questions

### Are all TWAP values calculated the same way?

No. Arithmetic and geometric approaches differ, as do observation windows and sources. Uniswap v2 and v3 illustrate why the exact method must be identified.

Evidence: [Uniswap v2 whitepaper](https://app.uniswap.org/whitepaper.pdf); [Uniswap v3 whitepaper](https://app.uniswap.org/whitepaper-v3.pdf)

## Claims and scope

### twap-oracles-quick-answer

A time-weighted average price, or TWAP, averages price observations over an interval according to time spent at each value. It can reduce dependence on one instantaneous pool price, but introduces lag and does not eliminate manipulation risk. The pool, window, observation availability and averaging method all matter.

Scope: {"collection":"defi","dataAsOf":"2026-10-02","blockHeight":null}

### twap-oracles-fact-v2-example

V2 example: Uniswap v2 accumulates prices to support arithmetic time-weighted averages.

Scope: {"collection":"defi","dataAsOf":"2026-10-02","blockHeight":null}

### twap-oracles-fact-v3-example

V3 example: Uniswap v3 accumulates ticks to support geometric mean prices.

Scope: {"collection":"defi","dataAsOf":"2026-10-02","blockHeight":null}

### twap-oracles-fact-window

Window: The selected interval changes responsiveness and the exposure being measured.

Scope: {"collection":"defi","dataAsOf":"2026-10-02","blockHeight":null}

## Sources

- [Uniswap v2 whitepaper](https://app.uniswap.org/whitepaper.pdf) — Uniswap. Full-range constant-product inventory and cumulative-price oracle design. Locator: Price oracle; Liquidity; Fees. Retrieved: 2026-10-02T17:03:45.008Z.
- [Uniswap v3 whitepaper](https://app.uniswap.org/whitepaper-v3.pdf) — Uniswap. Range-based positions and oracle time accumulation. Locator: Concentrated Liquidity; Oracle. Retrieved: 2026-10-02T17:03:45.213Z.

## Revision history

- 2026-10-02: First publication after primary-source research and independent automated verification.

## Cite this entry

Degrees of Satoshi editorial project. “TWAP oracles: averaging prices over time.” Published 2026-10-02; updated 2026-10-02. https://degreesofsatoshi.com/encyclopedia/twap-oracles/
