Rebalance
Auction mechanism design
To remain in the profitability range, the strategy performs so-called rebalance auctions - a procedure, during which the strategy contract adjusts its token holding proportion to bring back the desired price exposure.
There a 2 types of rebalance auctions:
Time rebalances - periodical tokens adjustments based on the rebalance time threshold.
Price rebalances - token adjustments to cut the losses in a case of huge price change between the regular time rebalances
Both types have the same auction design, the only difference between them is trigger conditions. Time rebalance auction activates when enough time was elapsed since the previous rebalance (for example, 12h), while the Price rebalances auction activates on huge drops in ETH price (for example, -7%).
Mechanism
To handle rebalance procedure, we will use a value-based Dutch auction, where amounts that need to be exchanged with the bidder are calculated based on the total ETH value (NAV) held by the strategy before and after the rebalance procedure.
Rebalance
The flow is next:
The keeper calls one of the
timeRebalance, priceRebalance
functionsContract checks for the rebalance conditions (whether enough time has passed or price deviation is large enough)
Withdraw all the liquidity from Uniswap pools
Calculate the auction parameters
Exchange with the keeper the current set of tokens for the desired one to achieve the target price exposure
Mint new liquidity positions
Record snapshot
1) Price Multiplier
The first step is to calculate the price multiplier based on the auction completion ratio (the time when the bidder has called the rebalance function).
There is an auction time of 10 min during which the keeper can call the rebalance function.
Where auctionTriggerTime
is a timestamp at which the bidder has called the rebalance function, while minPriceMultiplier
and maxPriceMultiplier
is min = 0.95 and max = 1.05 price multipliers.
So at the beginning of the auction, when the completion ratio will be 0, the price multiplier will be equal to 1.05, while at the end of the auction the multiplier will be equal to 0.95.
In the case that there are no bids during the auction period, the price multiplier will remain at the minimum levels till the execution call by some keeper.
2) Auction prices
The next step is to calculate the auction prices aEthUsdc and aOsqthEth for ETH/USDC and oSQTH/ETH respectively.
3) Total Value
Then, we calculate the ETH value that we will use to provide liquidity on Uniswap, as the current ETH value of tokens held by the strategy, calculated at the current prices:
In order to make sure, that even in the extreme market (or liquidity) conditions there is enough incentive for the keeper to rebalance, we discount total value by the current price multiplier. So there will be up to 4% arbitrage profit.
​Where, ETH, oSQTH, and USDC are the current amount of tokens, while OsqthEth and EthUsdc are the current market prices of the correspondent tokens.
3) Weight
The next step is weight - a coefficient that is needed to achieve target price exposure at auction prices.
The problem here is that the current prices in pools are different from the auction prices around which we would like our liquidity. So, if we will just naively place the liquidity in a 50:50 proportion, or even after adjusting for the IV, we will get the incorrect value split between the ETH-USDC and oSQTH-ETH LP pools.
Thus, we need again to adjust the value split to that one that will provide us with the target price exposure after the rebalance auction.
So, the values for LP will be:
3)​ Implied Volatility bump
Depending on whether or not we observe a positive or negative IV bump, we calculate the expected IV bump over the next period as:
With the additional check on its value, because the value of expIVbump > 2
will lead to the negative value of one of the lower or upper boundaries.
4) Boundaries
Based on these auction prices calculate the boundaries of liquidity placement
Similarly, for the oSQTH-ETH pool:
Where baseThreshold
is the parameter that defines the base size of the boundaries and tickAdj
is boundaries adjustment, which depends on whether we expect a positive or negative IV bump and its amplitude.
5) Liquidities
Based on the total LP value calculate the desired liquidities:
7) Amount of tokens
Now, we can get the required amount of tokens that need to be provided to mint desired amount of liquidity:
The Deltas (amount of tokens) that need to be exchanged with the keeper:
Where balanceEth
, balanceUsdc
, and balanceOsqth
are the current amounts of assets held by the strategy.
Negative deltas mean that the strategy gives these tokens in exchange for the requested one (with a positive sign).
Last updated