
The TWAP (Time-Weighted Average Price) strategy is designed to divide a large trade order into smaller orders and execute them at regular time intervals, with the aim of reducing the large order impact on the market and achieving an average execution price that reflects the market's actual price.
This helps prevent sudden market fluctuations due to large orders and allows traders to execute their trades in a controlled manner. By using TWAP, traders can take advantage of market volatility while minimizing risk. It is a popular tool in algorithmic trading and is widely used by institutional investors and hedge funds.
How Does TWAP Work
The TWAP strategy calculates the optimal time for order placement and execution based on parameters set by the user. Before we move on to the example, let's explain what each parameter represents.
Parameter |
Explanation |
Quantity |
This is the total order quantity you want to place via TWAP. |
Running Time (5m - 24h) |
This sets how long the TWAP strategy remains active. You can choose any duration from 5 minutes to 24 hours. During this time, the algorithm places sub-orders at regular intervals until the total quantity is filled or the duration ends. Note: Full execution is not guaranteed in volatile market conditions. |
Frequency |
The time interval between each sub-order. The default is 30 seconds, but you can customize this. |
Qty (Per Sub-Order) |
This is the size of each sub-order. If Random Order is enabled, each sub-order will vary by ±20% from this value. |
Random Order |
If enabled, the quantity of each sub-order will be adjusted randomly within ±20% of the specified quantity. However, any other requirements, such as ensuring each order quantity does not exceed the maximum single order quantity, will still be followed. |
Order Type (Advanced Settings) |
You can choose how each sub-order is placed.
Limit Price (Buy) = Best bid price - distance set or Best bid price × (1 - distance%) Limit Price (Sell) = Best ask price + distance set or Best ask price × (1 + distance%) |
Trigger Price (Advanced Settings) |
The TWAP strategy will be activated only when the last traded price reaches the trigger price set. |
Stop Price (Advanced Settings) |
The TWAP strategy will be terminated when the last traded price reaches the stop price set. |
Example
Assume that the parameters set are as follows:
-
Total Qty: 96 BTC
-
Total running time: 4 hours
-
Frequency: 30s
-
Random Order: Disabled
-
Order Type: Market
-
Trigger Price: $100,000
-
Stop Price: $110,000
The TWAP strategy is triggered when the price reaches $100,000, and our algorithm will begin executing trades at optimal intervals over the 4 hours.
Total running time = 4 × 60 minutes × 60 seconds = 14,400 seconds
With 14,400 seconds, the TWAP strategy will split 96 BTC into 480 orders (14,400s/30s). Within the total running time of 4 hours, a 0.2 BTC (96 BTC/480 orders) market order will be placed every 30 seconds.
The TWAP strategy will be terminated when either all 96 BTC are fully executed, the duration ends, or the stop price ($110,000) is reached, whichever comes first.
Order Limits
TWAP orders are subject to the order limits stated below and may be terminated if certain conditions are triggered.
-
Each account can support 20 TWAP strategies running simultaneously, and each trading pair can open a maximum of ten (10) TWAP strategies simultaneously.
-
The order placement frequency for each TWAP strategy can be set from 5 seconds per order to 120 seconds per order.
-
Please refer to Spot Trading Rules or Derivatives Trading Pareters for the minimum order size of each suborder.
-
For Spot Trading, the maximum order size for each suborder placed via the TWAP strategy can be found here. For Perpetual and Futures Trading, the maximum order size for each suborder must be ≤ half of the maximum order size stated here. For example, if the maximum order size for BTCUSDT is 100 BTC, the maximum quantity for each order is 50 BTC.
-
The minimum total quantity for TWAP = Max(Min Notional Value × Number of Sub Orders Placed / Last Traded Price × 1.1, Min Order Size × Number of Sub Orders Placed)
Number of Sub Orders = Running Time in Seconds / Frequency
-
If an order placed by TWAP is not fully filled under exceptional circumstances, the system will try to match the orders again. If the match fails, the order will be canceled and wait for the next order placement until the TWAP strategy is terminated or ended.
-
The TWAP strategy will not occupy any margin before any order execution. Please ensure you have sufficient balance in your account upon order execution or else the strategy will be terminated. Close order (Reduce-only Order) does not occupy any margin.
-
TWAP strategy will automatically be terminated if there is an insufficient balance to fill the order, changes to the position mode, position value exceeds the risk limit or open interest limit, operates for a 7-day duration and more. For more details, please refer to our FAQ section below.
Step-by-step Guide
How to Set Up Your TWAP Strategy
Step 1: Tap on Trade at the bottom of the Bybit App to enter the respective trading page. Then, switch the order type to TWAP.
Step 2: Create your TWAP order by filling in the parameters.
Step 3: Please make sure all the information you entered is correct and click on Confirm.
How to Terminate Your TWAP Strategy
In the position tab, click on Tools, and you can view the details of the strategy, including Filled Size/Total, Avg. Filled Price, Price Limit and more. Select Terminate to terminate your TWAP strategy.
How to View Your Order History
Please head to the All Orders page and select Tools to view the details of the TWAP strategy. Click on Details to view the order filled via the TWAP strategy.
On the Order History page, you can identify orders placed using your TWAP strategy via the TWAP label.

