Skip to main content
A TWAP (Time-Weighted Average Price) order is an execution strategy for traders who need to move size without showing their full intent to the market. Instead of sending one large market order, the trader submits a total quantity and a duration, and Intention takes it from there — placing child market orders at a fixed cadence until the job is done.

Parameters

When you submit a TWAP you specify:
  • Symbol — the contract to trade
  • Side — buy or sell
  • Total quantity — the full size, denominated in base units or USDC value (converted via mid-price at intake)
  • Duration — integer minutes between 5 minutes and 24 hours
  • Split interval — time between child orders (default 30 seconds)
  • Randomized — whether to jitter child-order sizes
  • Reduce-only — whether the TWAP can only close an existing position
From these, Intention computes:
number_of_orders = duration / split_interval + 1
size_per_suborder = total_quantity / number_of_orders

Validation

Before a TWAP starts, the system checks that the plan is feasible:
  • Every planned child order respects the contract’s minimum and maximum order size
  • The full total quantity passes an initial margin check
  • If reduce-only, the total quantity is no larger than the current position
If any check fails, the TWAP is rejected at submission.

Execution and catch-up

The first child order fires at submission time as a market order with a 3% max slippage. Subsequent child orders fire once per split_interval, at the first block after each interval boundary. Each child order size is:
size = min(
  max(min_qty, remaining_qty / remaining_children, 3 × size_per_suborder),
  max_qty
)
If a child order fails (for example, because of insufficient liquidity within the slippage tolerance), the TWAP skips it and notifies the user, but does not pause. When actual filled volume lags the target (elapsed / duration) × total_quantity, the strategy enters catch-up mode, growing subsequent child orders up to 3× the base size until it is on schedule.

Randomization

With the randomized flag enabled, child-order sizes are sampled from a bounded interval around the current average:
  1. Compute the average remaining size per remaining child.
  2. Take a ±20% band around the average.
  3. Intersect with safe floor and ceiling so the remaining children can still fit within min/max order size.
  4. Intersect with the per-order 3× limit.
  5. Sample uniformly from the resulting interval.
  6. The final child is deterministic — it takes whatever is left, subject to min/max order size.
Randomization breaks up the signature of the TWAP on the tape so observers cannot easily predict the next child order.

Margin handling

TWAP checks initial margin at submission time but does not lock margin for remaining quantity — you are free to transfer, withdraw, or trade other symbols while a TWAP runs. If a child order hits insufficient margin during execution, the entire TWAP terminates.
Because margin is not locked, it is possible to starve a running TWAP of margin by moving funds mid-run. If continuous execution matters, leave headroom in your available balance.

When to use TWAP

  • Entering or exiting a position larger than visible book depth
  • Reducing market impact on thin pairs
  • Hiding the intent of a large rebalance
  • Systematic dollar-cost-averaging into a multi-day target
For price-ladder execution instead of time-sliced execution, see Scale orders.