What Is the Role of Time-Weighted Average Price (TWAP) in DeFi Oracles?
Time-Weighted Average Price (TWAP) is a method used by DeFi oracles to calculate the average price of an asset over a specific time period, rather than using a single instantaneous price. This technique is employed to mitigate the risk of flash loan attacks and price manipulation.
By averaging the price over time, temporary, large-volume price spikes are smoothed out, making the oracle feed more resistant to manipulation.