Topics
    Introduction to TWAP Strategy
    bybit2024-12-05 08:34:22
    On the AppOn the WebsiteFrequently Asked Questions

    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: 

     

    TWAP APP 01.png  

     

    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. 

    1. Each account can support 10 TWAP strategies running simultaneously, and each trading pair can open a maximum of five (5) TWAP strategies simultaneously. 

    2. The order placement frequency for each TWAP strategy can be set from 5 seconds per order to 60 seconds per order.

    3. Please refer to Spot Trading Rules or Derivatives Trading Parameters for the minimum order size of each suborder.

    4. 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. 

    5. 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. 

    6. 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. 

    7. 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.  
     

    image.png





     

    Step 2: Create your TWAP order with the following parameters:

    1. Position Mode: Consistent with the position mode preference of the selected contract

    2. 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.

    3. 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.

    4. Frequency: Select a placement frequency. The possible options will range from 5 seconds to 60 seconds per order.
    5. Random Order: Tick ​​if you would like to enable this feature

    6. 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.

     

    image.png

      



     

    Step 3: Please make sure all the information you entered is correct and click on Confirm. 
     

    TWAP APP 02.png  








     

    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.

     

    image.png








     

    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.

     

    image.png



    On the Order History page, you can identify orders placed using your TWAP strategy via the TWAP label. 

     

    image.png

    Was it helpful?
    yesYesyesNo