Skip to main content
DFR Publication
Donate
← DeFi glossary

Glossary · T

TWAP Oracle

Key takeaway

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.
Which DeFi concepts are most closely linked to TWAP Oracle?
TWAP Oracle is closely connected to Oracle, Basis Trade, Collateral. Understanding how these concepts interact helps evaluate real yield, execution costs and smart-contract risk in decentralised finance.
What is the main risk or misconception around TWAP Oracle?
The same averaging that resists manipulation makes the oracle lag.
Which guide covers TWAP Oracle in practice?
Read "What Is a Flash Loan?" for full context on how TWAP Oracle affects real DeFi workflows, costs and risk management.

Related DeFi glossary terms

  • Oracle A service that provides external data — typically asset prices — to smart contracts on a blockchain. DeFi protocols rely on oracles to determine collateral values and trigger liquidations. Chainlink is the dominant decentralised oracle network. Oracle manipulation is a common attack vector in DeFi exploits.
  • Basis Trade A delta-neutral trading strategy that profits from the difference (basis) between the spot price and futures price of an asset. In DeFi, the Ethena USDe stablecoin implements a basis trade: holding staked ETH (earning staking yield) while shorting ETH perpetual futures (capturing positive funding rates when the market is bullish). The combined yield funds USDe's interest payments.
  • Collateral Assets deposited as security for a loan. In DeFi lending (Aave, Compound), collateral must exceed the borrowed amount — called overcollateralisation. If the collateral value falls below the required ratio, it is automatically liquidated to repay the loan.
  • Tokenomics The economic design of a cryptocurrency or token — including total supply, distribution schedule, vesting periods, inflation/deflation mechanics, fee captures, and burn mechanisms. Strong tokenomics align the incentives of all participants (team, investors, users) with the protocol's long-term success.
  • Arbitrage The practice of exploiting price differences for the same asset across different markets. In DeFi, arbitrage bots constantly scan DEXs for price discrepancies and execute trades to profit from the difference, simultaneously normalising prices across platforms.
  • Health Factor A numeric score in DeFi lending protocols (Aave, Compound, Morpho) that represents the safety of a collateralised borrowing position. Health Factor = (collateral value × liquidation threshold) ÷ borrow amount. A health factor above 1 means the position is safe; below 1 triggers automatic liquidation. Maintaining a health factor of 1.5+ is a common recommendation for comfortable buffer against liquidation from market volatility.