Skip to main content

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

A TWAP oracle calculates the average price of an asset over a specific time interval, rather than providing a single snapshot price. It is used to mitigate the risk of price manipulation, specifically "flash loan attacks." By averaging the price over time, short, sharp price spikes caused by manipulation have less impact on the final reported price.

This makes the contract execution more robust and secure.

Why Is the Median Often Preferred over the Average in Oracle Data Aggregation?
How Do Cross-Chain TWAP Oracles Attempt to Mitigate Manipulation Risks?
How Does a Decentralized Oracle Network Prevent Data Manipulation?
How Is a ‘Time-Weighted Average Price’ (TWAP) Used in Settlement?