Crypto glossary

TWAP (time-weighted average price)

Definition

TWAP (time-weighted average price) is an asset's average price over a period, giving each moment equal weight; used by trading algorithms and on-chain oracles.

To compute a TWAP you sample the price at regular intervals and average the readings, regardless of how much volume traded at each moment. Uniswap pools store a cumulative price that any contract can read at two points in time to derive the TWAP between them, which made it a common building block for on-chain price feeds.

In trading, a TWAP strategy splits a large order into equal pieces executed over hours or days to reduce market impact, and funds, DAOs and market makers use it routinely. As an oracle, a TWAP resists manipulation because moving the average requires holding a distorted price for many blocks, which is much more expensive than a single flash-loan trade.

The same smoothing that protects a TWAP makes it lag behind the market: during a sharp crash a lending protocol relying on it may liquidate too late. Short windows or pools with thin liquidity can still be manipulated, and a TWAP ignores volume, unlike the VWAP. Execution TWAPs are also predictable, which other traders can exploit.

Example

A lending protocol prices a small-cap token with a 30-minute TWAP from its main DEX pool, so a single manipulative trade barely moves the value used for loans.

Related terms

Latest articles on TWAP