Explaining TWAP and VWAP in cryptocurrency trading

5tGG...kNBo
16 Dec 2023
79

Time-weighted average price (TWAP) and volume-weighted average price (VWAP) are two major types of trading algorithms used by crypto traders to execute large orders without causing significant price movements. As crypto markets tend to be volatile and liquidity can vary significantly, large market buy or sell orders can slide the price considerably. Using TWAP or VWAP helps traders split a large order into smaller pieces and execute them incrementally over a period of time to reduce the trade’s market impact.

Both TWAP and VWAP aim to achieve an execution price close to the prevailing average price over the specified time period. But they work differently under the hood.

Understanding TWAP


TWAP or Time Weighted Average Price refers to dividing a larger order into smaller, equal-sized trades that are executed incrementally and evenly spaced over a fixed period of time. The goal is to achieve an average execution price that closely matches the market price over the specified time window.

For example, if a trader wants to buy 100 BTC, they can use a TWAP strategy to split the buy order into 10 equal orders for buying 10 BTC each. These 10 smaller buy orders will be automatically executed at even intervals over a defined period, say over a 4 hour window. This ensures minimal market impact for each small order while achieving an average price close to the overall 4 hour market price.

How Does TWAP Work?


A TWAP algorithm works by slicing the parent order into child orders of equal size that are spaced out evenly over the intended trading period. It then calculates and sets fixed time intervals between each child order.

At each interval, the system places another child order to market until the full parent order quantity is complete. So the only variable is time - order size and intervals between orders are fixed. The execution price of each order may vary depending on market liquidity and conditions at the time. But collectively, the average price over all child orders tends to reflect the broader market price over the period.

Benefits of Using TWAP


The main benefits of using a TWAP trading algorithm are:

  • Achieves an average price that closely tracks overall market price over the specified time period. Each child order only accounts for a small portion of the overall trade, so its price impact is minimal. Over the full period, price averaging helps Achieve a benchmark price.


  • Smooths out volatility within a time period. By spacing out orders evenly over the time window, a TWAP algorithm can smooth over any intermittent periods of high or low volatility.


  • Guarantees completion of the full order. Determining order size, quantity, timing and frequency upfront ensures the full trade amount is completed regardless of price fluctuations.


  • Allows large order execution without affecting market. Breaking a large trade into much smaller increments prevents suddenly flooding the market on one side, which can dramatically move the price.


In summary, TWAP aims to strategically execute the full quantity of an order based on time, while closely tracking the overall market price over that period. Time is the main driver rather than price or volume.

Understanding VWAP


Unlike TWAP, VWAP or Volume Weighted Average Price incorporates current volume data into its execution strategy rather than relying solely on time. The goal is still to achieve the average market price over the specified period. But market volume and liquidity conditions directly influence the size and timing between each child order placed.

For example, a VWAP algorithm will place larger child orders during periods of higher trading activity or liquidity. And it will throttle back and place smaller orders when trading volume declines or liquidity drops. This dynamic order sizing adjusts to spread larger trades over high volume periods while minimizing market impact during thinner liquidity conditions across the session.

How Does VWAP Work?


A VWAP trading algorithm works by analyzing current and historical market data to model optimal trade execution. It assesses the traded volume in the market within the specified period to calculate what percentage of the total forecasted volume has been traded so far. It then buys or sells the same percentage of the parent order in alignment with overall volume.

For example, if 25% of the expected daily volume has been traded by noon, then a VWAP algo will aim to trade approximately 25% of the full order by noon. By continually monitoring volume data, the algo dynamically sizes and spaces child orders to match overall volume percentages across the trading period.

If trading activity suddenly rises at any point compared to historical norms, the algo will detect this volume spike. It might then place larger child orders or cluster orders more closely together to match heavier trade intensity.

Benefits of VWAP


The advantages of deploying a VWAP algorithm include:

  • Matches order frequency and sizing to actual market activity within period. Trades more aggressively during surges in volume while slowing trade pace when volatility or volume decline. This minimizes impact.


  • Adapts to changing market conditions. Continuously scans new data rather than relying on fixed schedules. So it can adjust tactics to align with shifting volume and liquidity conditions.


  • Keeps pace with volume surges. Detects atypical spikes in market activity compared to historical data and scales order size and speed appropriately.


  • Intelligently sizes child orders. Uses statistical models to determine optimal order size at any moment instead of default equal sizing. Helps avoid liquidity issues.


In summary, VWAP incorporates real-time volume data, market analytics and adaptive intelligence to execute orders with minimal impact even under volatile conditions. Timing, sizing and frequency dynamically adjust to actual volume.

Comparing TWAP vs VWAP


While both algorithms focus on averaging execution price over a timeframe, TWAP and VWAP function very differently behind the scenes:

TWAP

  • Relies purely on timing. Order size and frequency are fixed.
  • Splits parent order into equal sized child orders.
  • Spaces child orders evenly over timeframe.
  • Guarantees completing full parent order quantity.
  • Trades through volatility and changing conditions.


VWAP

  • Considers real-time volume data. Order size/timing fluctuates.
  • Dynamically sizes/spaces child orders by volume.
  • Adapts order frequency to match market pace.
  • Can fall behind planned schedule if volatility spikes.
  • Will not complete full parent order if extreme volatility.


In essence, TWAP strictly controls order timing and sizing regardless of external factors. VWAP dynamically reacts to external market activity and volatility in real-time.

Use Cases and Examples Comparing TWAP and VWAP


Both TWAP and VWAP aim to achieve execution at the average market price over a timeframe. But VWAP may have an advantage in assets that see huge intraday volatility spikes. The reason is that TWAP blindly spaces out child orders evenly through time regardless of external volatility. If prices suddenly swing while a TWAP order is mid-flight, those trades can end up far from the average.

For example, let’s assume a crypto investor wants to buy 250 ETH over a 10 hour period to avoid significantly pushing up the price with a single market order.

They decide to utilize a TWAP algorithm by dividing their buy order into 25 blocks of 10 ETH every 24 minutes from 8AM to 6PM. This ensures evenly timed and sized batches that will achieve close to the 10 hour average price by day’s end.

However, ETH happens to see an uncharacteristically wild price spike soon after the first buy execution at 8AM which takes the price far above the 10 hour average. The TWAP algo continues placing buy orders every 24 minutes at the new elevated price levels for the next few intervals. This ends up lifting the average price paid on this trade much higher than the day’s average price.

In contrast, a VWAP strategy would have detected surging volume and reacted by increasing trade size to accumulate more ETH at prices below the spike. It likely would have reduced subsequent trade sizes as prices disconnected from typical averages during the volatility burst. This dynamic sizing and spacing would likely achieve overall execution closer to prevailing market prices anchoring either side of the volatility.

This hypothetical example illustrates how VWAP can adjust to intra-range volatility while TWAP can get caught trading at higher or lower levels around spikes until normalcy resumes. The downside is VWAP may execute an order at a pace slower than expected during periods of low liquidity. Whereas TWAP is indifferent to these external factors and will meet schedules and amount targets.

TWAP Pros and Cons

Pros

  • Guarantees full execution of the order
  • Smoothes volatility by spacing fixed trades evenly
  • Achieves close to average price over period
  • Simple to set target timeframes and sizes


Cons

  • Trades at preset times regardless of price
  • Can skew average price if rapid volatility
  • Doesn’t account for shifting liquidity and volume
  • Less flexibility in responding to market microstructures


VWAP Pros and Cons

Pros

  • Matches order pace to actual market activity and liquidity
  • Adaptively sizes orders based on real volume
  • Achieves execution inline with average price
  • Responds dynamically to changing market conditions


Cons

  • May not complete full intended order size
  • Requires more historical data inputs
  • Can underperform TWAP in stable markets
  • Harder to guarantee execution schedule



Recommendations on When to Use TWAP vs VWAP


Overall VWAP typically outperforms TWAP in assets that see material short term volatility spikes intraday that cause prices to sway far from daily averages. The reason is VWAP’s real-time volume analysis allows buy and sell order sizes to adapt relative to shifting liquidity conditions when volatility strikes.

However for slowly trending assets or rangebound markets, TWAP often delivers similar execution with less complexity. If prices do not disconnect much from prevailing averages even during short bursts of volatility, then TWAP’s fixed fractional order schedule will achieve close to average pricing.

Ideal conditions for TWAP

  • Rangebound or relatively stable assets
  • Longer order scheduling timeframes
  • Basic execution with less customization needed
  • Functionality offered across more exchanges and services


Better suited conditions for VWAP

  • Assets with high intraday volatility spikes
  • Short timeframe orders (hourly or less)
  • Require adaptive order sizing, frequent optimization
  • Need execution inline with volume and liquidity shifts
  • Functionality exists across platforms being used


In summary:

  • TWAP - Better for evenly pacing orders over longer periods in stable markets


  • VWAP - Recommended for assets with intraday volatility requiring adaptive order scheduling


VWAP and TWAP have the same end goal - to minimize market impact when placing large orders by achieving the average price over a specified timeframe. But VWAP dynamically watches intraday volume flows and volatility shifts to guide order size and spacing accordingly. In contrast TWAP relies on fixed fractional order scheduling evenly distributed over the period regardless of external factors.

While both can produce similar results in rangebound markets, VWAP has an edge in assets prone to violent intraday swings by adapting tactics relative to accelerating or declining volumes. TWAP’s fixed schedules mean timing and size remain static even if prices swing out of typical averages.

For smooth basic execution - choose TWAP. For more advanced adaptive trading aligned to liquidity - select VWAP. Every crypto trader should understand these vital algorithms for carefully accumulating or distributing large sized orders. Configuring the right approach can optimize trade performance in all market conditions.

Write & Read to Earn with BULB

Learn More

Enjoy this blog? Subscribe to CapitalThink

5 Comments

B
No comments yet.
Most relevant comments are displayed, so some may have been filtered out.