Parameters
From duration and interval:
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
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: 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
3× base size — the ceiling
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.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.