---
title: Time-Weighted Average Price
description: Page on Vedang Vatsa's site: https://veda.ng/glossary/twap
canonical: https://veda.ng/glossary/twap
last_updated: 2026-10-03
type: text/markdown
---
# Time-Weighted Average Price

Source: https://veda.ng/glossary/twap
Author: Vedang Vatsa (https://veda.ng/about)

Time-Weighted Average Price, TWAP, is the average price of an asset over a window, weighted by how long the price stayed at each level, not by volume. A brief spike barely moves TWAP because it lasts a short share of the window. To move TWAP a lot, an attacker would need to hold the fake price for hours or days, which is expensive.

Uniswap v2 and v3 implement TWAP oracles by accumulating price times time so you can query averages over past windows. Those on-chain feeds resist spot manipulation without an external oracle, which matters for liquidations and collateral checks. TWAP is also an execution style. Large orders split across time, filled in small slices, aim to land near the period's TWAP and cut impact versus one dump. Traditional desks and some DEX UIs offer this. The tradeoff is speed. You give up immediacy for a better average. This makes TWAP resistant to spot price manipulation: an attacker who briefly pushes the price to an extreme level has minimal impact on TWAP because the manipulation duration is short relative to the averaging window. Uniswap v2 and v3 implement TWAP oracles by accumulating price*time products that can be queried to compute average prices over arbitrary historical windows. These on-chain TWAP oracles provide manipulation-resistant price feeds without external dependencies, making them valuable for DeFi protocols needing reliable price data for liquidations, collateral valuation, or other critical operations. Uniswap v2/v3 oracles accumulate price over time so a one-block spike is a bad input. Attackers still try to move TWAPs. Read the window.

Glossary index: https://veda.ng/glossary