TWAP
Time-Weighted Average Price
Price averaged over time rather than a single spot observation
Definition
Time-weighted average price averages a price over a time window rather than using a single spot observation. Oracle TWAPs are distinct from execution strategies that split an order over time. Uniswap v2 averages prices arithmetically; v3 averages ticks, yielding a geometric mean price.
Example
If a price is $100 for 20 minutes and $110 for 10 minutes, its arithmetic 30-minute TWAP is (100 × 20 + 110 × 10)/30 = $103.33. A v3-style geometric average is about $103.23, before tick rounding.
How it works
An accumulator records price, or log-price ticks, multiplied by elapsed time. Subtracting two observations and dividing by the interval gives a time average; the chosen window trades responsiveness for manipulation cost.
Risks to Consider
- A long window lags a genuine market move
- Thin liquidity can still be manipulated across multiple blocks
- Missing observations or wrong token units can break the calculation
Common Questions
Is TWAP the same as a spot price or a trading bot?
No. Spot is the current price; oracle TWAP is a historical average. TWAP order execution is a separate strategy for splitting trades, not an oracle security guarantee.

