Overview
Time-Weighted Average Price (TWAP) is a trading strategy used to slice up big orders into smaller chunks sold over a period of time with the goal of reducing slippage from the rebalance. When a trader submits a large buy or sell order, they run the risk of negatively influencing the price of the asset with the trade itself, resulting in them and their users getting a worse deal. In order to combat this, a trader may elect to run a TWAP strategy where they break up the large order into smaller size ones to make sure the price during the trade stays closer to market price.
You can think of Rebalancing as the same as putting a trade on the market. Because our robo-sets are getting bigger and bigger, we run the risk of increased slippage during the rebalances when we do just a single rebalancing auction.
Slippage
Let’s look at why slippage happens. During a rebalance, Set’s contract submits a massive limit order that constantly updates every block to make the price more attractive. This means that the price of the assets being sold, for the sake of the example we will use ETH, to acquire the assets being bought, let’s say USDC, starts of at a premium above fair value (ETH price is greater than market price in USDC) and is linearly lowered according to a predefined curve. This allows those participating in the auction to get in when the price is right for them. Naturally, this happens once the ETH price in the auction is lowered until it is very slightly lower than the market price - once that happens rebalancing liquidity providers compete on buying the ETH from the Set and selling the Set USDC. That difference between the ETH price in the auction and the market price is known as the slippage and is the value lost from the Set. This is by design so that we can trustlessly incentivize liquidity providers to rebalance our Sets and maintain the integrity of the protocol.
TWAP Advantage
Because the difference is pure profit for the liquidity provider, many of them compete aggressively on giving the Set the best price so the slippage ends up being very small. The problem occurs when the Rebalances get so large that it becomes hard for liquidity providers to get enough capital to buy assets from the Set, or effectively hedge their positions. The harder this process is for the liquidity provider, the longer and less competitive the auction becomes, the more the ETH price gets lowered and diverges from the market price, and thus the more slippage is realized by the Set.
To combat this, TWAP Rebalancing divides the rebalancing into several chunks that conduct Set’s usual linear auctions. Each chunk uses the latest oracle price at the start of its own auction in order to make sure the most updated price is used. So each chunk auction uses the latest market price and is able to close quicker, resulting in a much more efficient process and less loss to slippage.
Changes on the User Experience
The Set being rebalanced remains in the rebalanced state throughout the entire TWAP rebalance, including the time between the chunk auctions. This means, like before, the Set cannot be bought and sold during the rebalance.
Because our auctions are now more efficient we may now add ERC20 Sets that we were not available before due to liquidity concerns.
The old non-TWAP Sets will still be fully supported, but moved into the Legacy Sets tab and new users will not be able to buy them on TokenSets. Robosets will be redeployed using TWAP and users of old sets are encouraged to trade them in for the new ones. Social traders have the ability to rebalance whenever they want so will not be required to redeploy and will be able to take advantage of TWAP mechanism once it's ready. For further details, check here.