Skip to article
Degrees of SatoshiFollow the connections.
Degrees of Satoshi/ Encyclopedia

Encyclopedia DeFi · Entry 161

TWAP oracles: averaging prices over time

Theme
DeFi
Sources
2 cited records
Reading time
About 3 minutes
Automated verification
Substantive update
In this article

At a glance

Key facts

Key facts for TWAP oracles: averaging prices over time
FactDetailSource
V2 exampleUniswap v2 accumulates prices to support arithmetic time-weighted averages.[1]
V3 exampleUniswap v3 accumulates ticks to support geometric mean prices.[2]
WindowThe selected interval changes responsiveness and the exposure being measured.[1][2]
01

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.

02

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.

03

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.

Direct answers

Questions people ask

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.

Inspect the evidence

The answer and key facts have stable claim links. These records retain the scope and qualification when reused.

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: DeFi · data through 2026-10-02. Verification: verified · 2026-10-02T18:15:18.493Z.

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

Scope: DeFi · data through 2026-10-02. Verification: verified · 2026-10-02T18:15:18.493Z.

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

Scope: DeFi · data through 2026-10-02. Verification: verified · 2026-10-02T18:15:18.493Z.

Link to this claim
Window: The selected interval changes responsiveness and the exposure being measured.

Scope: DeFi · data through 2026-10-02. Verification: verified · 2026-10-02T18:15:18.493Z.

Link to this claim
Revision history
  1. — First publication after primary-source research and independent automated verification.

Source register

Sources and references

Retrieval dates and locators are recorded individually.
  1. Uniswap v2 whitepaperUniswap

    Full-range constant-product inventory and cumulative-price oracle design.

    Locator: Price oracle; Liquidity; Fees · Version / scope: Uniswap v2 whitepaper, March 2020 · Retrieved: 2026-10-02T17:03:45.008ZOpen source
  2. Uniswap v3 whitepaperUniswap

    Range-based positions and oracle time accumulation.

    Locator: Concentrated Liquidity; Oracle · Version / scope: Uniswap v3 whitepaper, March 2021 · Retrieved: 2026-10-02T17:03:45.213ZOpen source
How this article was made

Research and drafting use AI assistance. A separate automated review checks claims against primary sources; no external expert or named human review is implied. Publication, substantive editing, source retrieval and verification are recorded separately. This version was independently checked by an automated reviewer on 2 October 2026.

Editorial method and corrections

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/