Skip to main content

What Is a “Time-Weighted Average Price” (TWAP) Oracle and Why Is It Preferred over a Spot Price Oracle?

A TWAP oracle calculates the average price of an asset over a period of time, typically by sampling the price at the beginning and end of each block. It is preferred over a spot price oracle because it is highly resistant to price manipulation, such as flash loan attacks, which can temporarily spike or crash the spot price in a single block.

The averaging effect smooths out volatility and makes manipulation economically infeasible.

Why Is the Time-Weighted Average Price (TWAP) Often Preferred over a Spot Price for Options Oracles?
What Is a Volume-Weighted Average Price (VWAP) and How Does It Differ from TWAP?
What Is the Role of Time-Weighted Average Price (TWAP) in DeFi Oracles?
How Does a Time-Weighted Average Price (TWAP) Oracle Mitigate Flash Loan Attacks?