What Is a Time-Weighted Average Price (TWAP) Oracle, and Why Is It Used in Derivatives?
A TWAP oracle calculates the average price of an asset over a specific period, rather than providing a single snapshot price. It is used in derivatives to make the contract resistant to sudden, short-term price manipulation attacks, like flash loans.
By averaging the price, the TWAP ensures that the settlement or liquidation is based on a more stable, representative market price.