Overview
| Property | Value |
|---|---|
| Position Type | Spot or Perp |
| keep_position | Configurable |
| Use Cases | Large order execution, reducing slippage, systematic entry |
Configuration
Parameters
| Parameter | Description |
|---|---|
total_amount_quote | Total amount to execute in quote currency |
total_duration | Total time to spread execution (seconds) |
order_interval | Time between orders (seconds) |
mode | MAKER (limit orders) or TAKER (market orders) |
How It Works
- Order Plan: Creates schedule of orders based on duration and interval
- Execution: Places orders at scheduled times
- Monitoring: Tracks fill rates and adjusts if needed
- Completion: Reports average price and total filled
Calculated Values
The executor automatically calculates:- Number of orders:
total_duration / order_interval - Amount per order:
total_amount_quote / number_of_orders - Average executed price: Volume-weighted average of all fills
Example: Execute $50k Over 2 Hours
Example: Quick TWAP with Market Orders
Performance Metrics
The executor reports:| Metric | Description |
|---|---|
filled_amount | Total amount executed |
average_price | Volume-weighted average price |
cumulative_fees | Total fees paid |
trade_pnl | P&L vs if executed at start price |
net_pnl | P&L minus fees |
When to Use TWAP
- Executing orders larger than 1% of daily volume
- Avoiding front-running or detection
- Systematic rebalancing
- Reducing timing risk

