How Does a Time-Weighted Average Price (TWAP) Help Defend against Price Feed Attacks?

A Time-Weighted Average Price (TWAP) is a method that calculates the average price of an asset over a specific period, rather than taking the price at a single moment. This mechanism effectively smooths out any sudden, short-lived price spikes or drops caused by manipulation attempts, such as those executed via flash loans.

Since a flash loan attack is instantaneous, the momentary manipulated price has minimal impact on the overall calculated average, thus protecting the smart contract.

What Is the Role of Time-Weighted Average Price (TWAP) in DeFi Oracles?
How Does a TWAP Oracle Specifically Defend against Flash Loan Price Manipulation?
How Does a Time-Weighted Average Price (TWAP) Oracle Mitigate Flash Loan Attacks on a Derivatives Contract?
How Do Time-Weighted Average Prices (TWAPs) Mitigate Oracle Manipulation Risks?
What Is Time-Weighted Average Price (TWAP) and How Does It Defend against Flash Loan Attacks on Oracles?
What Is the Impact of “Flash Loans” on the Stability of Liquidity Pools in DeFi?
What Is the Difference between a Volume-Weighted Average Price (VWAP) and a TWAP?
What Is the Role of Time-Weighted Average Price (TWAP) in Mitigating Oracle Attacks?

Glossar