Skip to main content
A large order taken at once pays for its own impact: it walks the book, and every level it consumes is worse than the last. A TWAP order spreads the same size across time instead, taking a slice at fixed intervals so the book has time to replenish between them. The trade is explicit. You accept price risk over the execution window — the market can move against you while you are working — in exchange for avoiding the impact of doing it all at once.

Parameters

From duration and interval: N=durationinterval+1base slice=QNN = \frac{\text{duration}}{\text{interval}} + 1 \qquad \text{base slice} = \frac{Q}{N} A slice fires immediately on start, then at each interval, and once more at the end of the window.

Validation before it starts

A TWAP is rejected up front if it cannot possibly complete as specified:
  • Slices must be large enough to be valid orders — the total divided across the schedule cannot fall below the market’s minimum
  • Slices must not exceed the market’s maximum order size
  • The full size must satisfy initial margin
  • If reduce-only, the total must not exceed your current position
Failing early matters here. A TWAP that discovers halfway through that its slices are below the minimum leaves you partially executed with no clean way to finish.

Execution and catch-up

Each slice is submitted as a market order with a 3% slippage bound. Slices land on the first block after each interval elapses, since execution is driven on-chain rather than by a wall clock. If a slice fills less than intended — thin book, slippage bound reached — the shortfall is not lost. The schedule tracks against where it should be: target=telapsedtduration×Q\text{target} = \frac{t_{\text{elapsed}}}{t_{\text{duration}}} \times Q When actual fills fall behind that target, subsequent slices are enlarged to catch up:
underfilled
catching up
Why a ceilingA strategy that answers illiquidity by sending ever-larger orders becomes the impact it was meant to avoid.target = elapsed ÷ duration × total
Six slices, 6.0 total — slice 3 underfills in a thin book
Slice 11.00
Slice 21.00
Slice 30.40
Slice 41.20
Slice 51.20
Slice 61.20
3× base size — the ceiling
The cap is the important part. Catching up is desirable; catching up without limit is not — a strategy that responds to illiquidity by sending progressively larger orders becomes the impact it was designed to avoid. No slice exceeds three times the base size, so recovery is gradual. A slice that fails entirely is skipped and reported. The strategy does not pause: one bad slice in a thin moment should not strand the rest of the order.

Randomization

With randomization on, slices are not identical. Before each one, the strategy computes the average of what remains and picks a size within a safe band around it. Fixed-size slices at fixed intervals are a pattern, and a pattern in the order flow is information for anyone watching. Randomizing removes the regularity without changing the schedule’s total. The remaining-quantity arithmetic still binds. Randomization varies sizes; it does not let the strategy overshoot or leave a residue at the end.

When TWAP is the right tool

Use it when your order is large relative to visible depth, when you have time, and when average price over a window is an acceptable objective. Do not use it when you need the position now — a TWAP is the opposite of urgency. And do not use it when you have a specific price in mind: TWAP has no price target, only a time schedule. If price matters more than immediacy, scale orders place resting limit orders across a price range instead.
A TWAP does not guarantee full execution. Slices are market orders bounded by slippage, and in a sustained one-way move they can repeatedly underfill. Catch-up is capped, so a window that ends with the market gone against you can leave the order substantially incomplete.

Where to go next

Scale orders

Splitting across price instead of across time.

Market orders

The slippage bound each slice is subject to.

Order book

Judging whether your order is large relative to depth.

Fees

Every slice is a taker order and pays the taker fee.