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 on Bybit is currently applicable to all Perpetual and Futures trading and Spot trading (only to Unified Trading Account users). The TWAP strategy calculates the optimal time for order placement and execution based on parameters set by the user. Let's look at the following example.
Assume that the parameters set are as follows:
Total Qty: 96 BTC
Total running time: 4 hours
Frequency: 30s
Random Order: Disabled
With the above parameters, our algorithm will begin executing trades at optimal intervals over the 4-hour period.
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.
If a Random Order function is enabled, the quantity of each split order will be automatically adjusted within a certain range, typically up to 20% higher or lower than the original large order quantity. However, any other requirements specified when creating the TWAP order, such as ensuring the randomized order quantity does not exceed the maximum single order quantity, will still be followed.
During the validity period, the TWAP algorithm will split the order into smaller orders and execute them at regular time intervals to achieve a controlled and gradual fulfillment of the total order quantity. The TWAP order will continue to run until its validity period expires or the entire order quantity is completely filled. However, we cannot guarantee full order execution under exceptional circumstances.
TWAP orders are subject to the order limits stated below and may be terminated if certain conditions are triggered.
-
Each account can support 10 TWAP strategies running simultaneously, and each trading pair can open a maximum of five (5) TWAP strategies simultaneously.
-
The order placement frequency for each TWAP strategy can be set from 5 seconds per order to 60 seconds per order.
-
Please refer to Spot Trading Rules or Derivatives Trading Parameters 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.
-
All TWAP orders are Market orders (Immediate or Cancel orders). 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, and more. For more details, please refer to our FAQ section.
How to Set Up Your TWAP Strategy
Step 1: Tap on Derivatives or Trade at the bottom of the Bybit App to enter Spot or Perpetual & Futures trading. Then, click the Tools icon and select TWAP under the Trade page. Alternatively, you can switch the order type to TWAP.
Step 2: Create your TWAP order with the following parameters:
-
Position Mode: Consistent with the position mode preference of the selected contract
-
Total Qty: Enter the total quantity of the order you would like to place, or use the percentage bar to quickly set an order's contract quantity with the corresponding proportion of the account's available margin.
-
Total Running Time: Set the running time of the TWAP strategy from 5 minutes to 24 hours, or select one of our convenient preset options at 10 minutes, 30 minutes, 1 hour, 4 hours or 8 hours.
- Frequency: Select a placement frequency. The possible options will range from 5 seconds to 60 seconds per order.
-
Random Order: Tick if you would like to enable this feature
-
Reduce Only: This is only available in Perpetual & Futures Trading One-Way Mode. For Hedge Mode, traders can switch to the Close tab to create the TWAP strategy if the order is for closing purposes.
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.