What is TWAP (time-weighted average price)?

The average price of an asset over a period, weighted only by time, and by extension the execution strategy that slices a large order evenly across that period to track it.

Not yet verifiedHow we verify

3 min read

In this entry

The average price of an asset over a period, weighted only by time, and by extension the execution strategy that slices a large order evenly across that period to track it.

The term does double duty, and confusing the two meanings is the usual source of trouble. One is a measurement, a number you can compute from a price history. The other is an order type that tries to achieve that number by trading in even pieces over a stated window.

Both uses come from the same insight: averaging over time is harder to manipulate and less punishing than acting all at once.

How it works

As a measurement, TWAP samples the price at regular intervals over a window and averages the samples. Every minute is worth the same as every other minute regardless of how much traded in it, which is what distinguishes it from vwap.

As an execution strategy, the venue divides your order into slices and releases one every interval until the window closes. A $100,000 buy over four hours might go out as 48 orders of about $2,080 at five-minute spacing, often with randomized sizing and timing so the pattern is not obvious to anyone watching the book. Each slice consumes only the top of the book and lets the book refill before the next arrives, which is how the strategy avoids the price impact of one large market order.

The tradeoff is explicit. You have swapped certainty of price for certainty of impact. A market order fills now at a known, bad price. A TWAP fills over hours at the average of whatever the market does, which may be better or worse and is not knowable in advance.

The measurement is also used as an oracle input. Pushing a spot price for one block is cheap; holding a 30-minute average away from its true level against everyone arbitraging you is not.

Example

Illustrative. You want to buy $60,000 of a token whose book holds $8,000 within 1 percent of the mid price.

Sent as one market order, the fill walks up through the book and averages perhaps 3 percent above the quoted price, costing about $1,800 in impact. Sent as a TWAP over three hours in 36 slices of about $1,667, each slice takes a fifth of the near book and the book refills between them, so impact per slice is small.

If the market drifts up 1 percent over those three hours, your average is around 0.5 percent above where you started, or roughly $300, plus a much smaller impact cost. If it drifts down, you do better than the market order did. That uncertainty is the price of the strategy.

Why it matters when you buy

Order size relative to book depth is what decides whether this matters to you. Below a few percent of near-book depth, a plain market order is fine and slicing adds nothing. Above that, splitting the order is the single largest saving available. The liquidity data shows measured depth by exchange so you can judge which case you are in, and the guide on spread and slippage covers the underlying costs.

Questions

Is TWAP the same as dollar cost averaging?

Structurally yes, though the horizons differ. TWAP works one order over hours to reduce market impact, while dollar cost averaging spreads purchases over months.

Can I use TWAP on a retail exchange?

Some offer it as a built-in order type and many do not. Where it is unavailable, placing several smaller limit orders by hand achieves a rough equivalent.

Why do lending protocols use a TWAP oracle?

Because a spot price can be pushed hard for a single block by a flash loan, and an average over a longer window cannot. It costs latency in exchange for manipulation resistance.