Skip to main content
← DeFi glossary

Glossary · T

TWAP Oracle

Time-Weighted Average Price — an oracle that calculates the average price of an asset over a defined time window rather than using a single instantaneous price. TWAP oracles are significantly harder to manipulate via flash loans than spot price oracles, making them a safer choice for DeFi protocol price feeds.

Last updated

How TWAP Oracle works in practice

A time-weighted average price oracle reports an average over a window rather than the instantaneous price. Averaging makes manipulation expensive: an attacker must hold the price away from fair value for the whole window, not just for one block.

Worked example

A 30-minute TWAP means a manipulator must sustain the distorted price for 30 minutes against arbitrageurs profiting from correcting it. That is orders of magnitude more expensive than a single-block push.

Figures are illustrative and chosen to be checkable, not live market data.

The mistake that costs people money

The same averaging that resists manipulation makes the oracle lag. In a genuine fast crash, a TWAP reports a price higher than reality, so liquidations fire late and the protocol can accrue bad debt. Manipulation resistance and responsiveness trade off directly.

TWAP Oracle: common questions

What is TWAP Oracle?
Time-Weighted Average Price — an oracle that calculates the average price of an asset over a defined time window rather than using a single instantaneous price. TWAP oracles are significantly harder to manipulate via flash loans than spot price oracles, making them a safer choice for DeFi protocol price feeds.
How does TWAP Oracle work in practice?
A time-weighted average price oracle reports an average over a window rather than the instantaneous price. Averaging makes manipulation expensive: an attacker must hold the price away from fair value for the whole window, not just for one block.
Can you give an example of TWAP Oracle?
A 30-minute TWAP means a manipulator must sustain the distorted price for 30 minutes against arbitrageurs profiting from correcting it. That is orders of magnitude more expensive than a single-block push.
What do people get wrong about TWAP Oracle?
The same averaging that resists manipulation makes the oracle lag. In a genuine fast crash, a TWAP reports a price higher than reality, so liquidations fire late and the protocol can accrue bad debt. Manipulation resistance and responsiveness trade off directly.

Related terms (T)