Skip to main content

How Is a “Time-Weighted Average Price” (TWAP) Used in a DeFi Oracle System?

A TWAP is used to calculate the average price of an asset over a specific time interval, where each price point is weighted by the amount of time it was active. DeFi Oracles use TWAPs to provide a price feed that is resistant to flash loan attacks and momentary price spikes.

By smoothing out volatility, the TWAP ensures that smart contract executions, like liquidations or settlements, are based on a fairer, more representative market price.

What Is a “Time-Weighted Average Price” (TWAP) Oracle and Why Is It Preferred over a Spot Price Oracle?
What Is a Time-Weighted Average Price (TWAP) Oracle and Its Benefit?
How Does a Time-Weighted Average Price (TWAP) Oracle Enhance Security?
What Is a Time-Weighted Average Price (TWAP) Oracle?