TWAP
Time-Weighted Average Price. Splits a large order into smaller pieces executed every 30 seconds.
Use When
Executing large orders without moving the market.
Parameters
Asset: The token or contract you want to trade
Total Size: Complete order size to execute over time
Direction: Buy/Sell
Duration: How long to spread the order (in minutes)
Reduce Only (optional): Only reduces existing position
How It Works
You specify total size and duration
Bullpen/Hyperliquid calculates suborder size and frequency
Every 30 seconds, a small market order executes
Process continues until duration expires or full size is filled
Final average execution price is calculated
Execution Details
Suborder frequency: Every 30 seconds
Suborder slippage: Max 3% per suborder
Catch-up mechanism: If suborders don't fill (wide spread, low liquidity), TWAP tries to catch up
Catch-up size cap: Catch-up suborders capped at 3x normal size
Early completion: Can complete before duration if all size fills efficiently
Example
TWAP Order
Total size: 100 BTC
Duration: 60 minutes
Suborders: ~120 suborders (one every 30 seconds)
Size per suborder: ~0.83 BTC
Each suborder executes as a market order with 3% max slippage. Final execution price is the weighted average of all fills.
Benefits
Reduced Market Impact
Avoids dumping large orders that move price
Blends into natural market flow
Better average price on large positions
Predictable Execution
Systematic, emotionless execution
No timing decisions
Reduces trader stress
Slippage Control
3% max per suborder (vs unlimited on single market order)
Total slippage often much lower than one large market order
Drawbacks
Price Risk
Exposure to price movement during duration
If price trends against you, later fills are worse
No guarantee of execution at current price
Not Instant
Takes time to complete
Not suitable for urgent entries/exits
Visible on Chain
Sophisticated actors may detect TWAP patterns
In thin markets, still creates predictable flow
When to Use
✅ Good for:
Large position entries (>$100k)
Building positions over time
Reducing slippage on illiquid assets
Accumulation/distribution phases
❌ Not good for:
Urgent exits
Stop losses
Small positions
Highly time-sensitive trades
Best Practices
Size threshold: Use for orders >5% of orderbook depth
Duration selection:
Short (5-15 min): Normal liquidity
Medium (30-60 min): Thinner liquidity or very large orders
Long (>1 hour): Extremely large positions or quiet markets
Monitor execution: Watch suborder fills in case you need to cancel
Combine with limit orders: For non-urgent large positions, scale in with limit orders instead
Market conditions: TWAP works best in stable markets; avoid during high volatility
TWAP vs Market Order vs Limit Ladder
Speed
Slow
Instant
Variable
Slippage
Low-Medium
High
Lowest
Certainty
High
Guaranteed
Low
Market impact
Low
High
Lowest
Best for
Large orders
Urgent execution
Patient accumulation
Last updated

