Skip to main content

What Is the Trade-off between Using a TWAP and a Spot Price Oracle?

The trade-off is between security and responsiveness. A Time-Weighted Average Price (TWAP) oracle is highly secure against flash loan and single-block price manipulations because it averages the price over time, making it robust.

However, it suffers from lower responsiveness, as it lags behind rapid market changes. A spot price oracle is highly responsive, reflecting the current market price immediately, but it is highly vulnerable to manipulation within a single block, making it less secure for high-value financial operations.

What Mechanism on a DEX Makes It Vulnerable to Price Manipulation via Sandwich Attacks?
What Are the Trade-Offs between On-Chain and Off-Chain Governance?
What Are the Primary Vulnerabilities of Using a TWAP Oracle in a DeFi Protocol?
What Are the Potential Consequences of Setting a TWAP Time Period That Is Too Short or Too Long?