TWAP Orders: Splitting Large Trades
Split large orders into smaller slices over time
TWAP (Time-Weighted Average Price) orders break a large trade into smaller pieces executed over time. The goal is to minimize market impact — instead of slamming a $5000 buy that pushes the price up 8 points, you split it into 10 pieces of $500 each spread over 50 minutes, averaging into the position smoothly.
## When to Use TWAP
TWAP is most useful when:
- **Your trade is large relative to market depth.** If you want to buy $2000 of shares but the order book only has $800 at the best price, a market order would walk you up the book and you'd pay 5-10 points of slippage. TWAP avoids this by patiently filling at the best price as new liquidity arrives.
- •**You don't have a strong opinion on short-term price direction.** TWAP averages your fill price over time. If you think the price will move significantly during execution, you might be better off taking immediate liquidity (or splitting your order manually based on your view).
- •**You want price-time diversification.** Even if you can afford a single market order, TWAP gives you the average price over the execution window, reducing your dependence on luck-of-the-moment price.
When NOT to use TWAP:
- Time-critical signals where 30+ minutes of execution kills the edge
- •Markets resolving in under an hour (you might not finish executing)
- •Very small trades ($50 or less) where slippage isn't a concern
## Configuration Parameters
Open **Dashboard → TWAP** to create a new TWAP order. You'll configure:
- **Market.** Pick the market from the dropdown (or paste a Polymarket URL).
- •**Direction.** YES or NO.
- •**Total size ($).** $50 minimum, $50,000 maximum. Up to 10% of recent 24h volume is a reasonable cap.
- •**Number of slices.** 3 to 20. More slices = smoother fill but longer execution.
- •**Interval between slices (minutes).** 1 to 60. Common: 5-10 minute intervals.
- •**Price limit.** Maximum price per share you're willing to pay. Slices above this price will skip (and try the next interval).
- •**Mode.** Paper or Live (Live requires CLOB credentials in Settings → Trading API).
- •**Side.** Buy (open position) or Sell (close existing position).
A typical first TWAP:
- •Total: $1000
- •Slices: 10
- •Interval: 5 minutes
- •Total execution time: 50 minutes
## How Execution Works
After confirming, the TWAP order enters our execution queue. Every minute (via cron), the engine checks:
- Is it time to execute the next slice? (next_slice_time has passed)
- •Is the current best ask below your price limit?
- •Is there enough liquidity to fill this slice?
If all three are yes, the slice executes via the Polymarket CLOB API (Live mode) or simulates a fill (Paper mode). The order detail page updates with the new fill.
If a slice can't execute (price too high or low liquidity), it skips that interval and tries again at the next. The TWAP doesn't "give up" — it just waits for better conditions.
If you want to cancel a TWAP mid-execution, click the order in the TWAP page and hit "Cancel". Remaining slices won't execute. Already-filled portions stay in your position.
## Reading the TWAP Execution Log
The order detail page shows a timeline of slice executions:
- ✅ Filled at $0.42 (size $100) — slice completed
- •⏸️ Skipped — price above limit — slice missed its window
- •❌ Failed — API error — see error message
- •⏳ Pending — not yet executed (still in queue)
The "Average fill price" updates as slices complete. Your final P&L will be based on this average, not the price at the moment you started the TWAP.
## TWAP vs. Limit Orders
A common question: why use TWAP instead of just placing a limit order at the price you want?
- A **limit order** sits on the book at a single price. It fills only if someone takes your liquidity. If no one comes to your price, you get nothing.
- •A **TWAP** patiently takes liquidity at the current best ask (subject to your price limit). It almost always fills the full size, just not at a single price.
TWAP is better when you definitely want the position; limit orders are better when you only want to enter at a specific price.
## Common TWAP Pitfalls
- **Price limit too tight.** Setting the limit at the current price means any upward tick skips the slice. Leave 1-2pp of headroom.
- •**Too few slices on a large order.** A $5000 TWAP with 3 slices = $1666 per slice, which may still move the price. Use 10+ slices for orders over $2000.
- •**Too long an interval on time-sensitive signals.** A 60-minute slice gap on a market that resolves in 4 hours doesn't make sense.
- •**Forgetting to cancel.** TWAPs keep executing until done or cancelled. If your thesis changes, cancel immediately.
## Related Docs
- [Live CLOB Trading](/docs/live-trading)
- •[Bot Execution Engine](/docs/bot-execution)
- •[Slippage Simulator](/docs/slippage)