Math
Last updated
Last updated
Hedgehog model in Google Spreadsheet.
The goal is to create a synthetic portfolio that will keep linear ETH exposure while earning fees from providing liquidity on Uniswap.
To achieve it, the strategy deploys all the available capital to the ETH-USDC pool (neg convexity) and to the oSQTH-ETH (pos convexity).
The trick is that the ETH-USDC pool has a payoff with a negative convexity.
While the oSQTH-ETH pool has positive convexity.
So by combining them together we will get a portfolio with a simple linear ETH payoff, that earns trading fees from both ETH-USDC and oSQTH-ETH pool while paying only a small funding cost for the long oSQTH position.
For this, we will split the capital in a next way:
Where - is total available capital in ETH terms, is a capital to be deployed to the ETH-USDC pool, and is a capital to be deployed to the oSQTH-ETH pool. is value weight assigned for the ETH-USDC pool, while is a weight, that determines the share of the total value that will be used to provide liquidity for the oSQTH-ETH pool on Uni V3.
Initially =50%, but in a {Calibration} section, we will adjust this parameter to react to the different market conditions, based on the current and expected implied volatility.
The next step is to calculate the boundaries in which we want to provide liquidity. For the ETH-USDC pool it will be:
Where EthUsdc
is the current ETH/USDC price, TS
is the tick spacing of the ETH-USDC pool (60), EthUsdcLT
and EthUsdcUT
is the lower and upper range thresholds.
For the oSQTH-ETH pool the boundaries will be:
In the same way, the OsqthEth
is the current oSQTH/ETH price, TS
is the tick spacing of the oSQTH-ETH pool (60), OsqthEthLT
and OsqthEthUT
is the lower upper range thresholds.
Then we can calculate liquidities, which we will get by providing value to the desired LP range:
After providing which, the strategy position initially will consist of:
ETH 50.5%
USDC 25.09%
oSQTH 24.41%
We say initially, because with changes in the ETH/USDC price the constitution of the strategy's portfolio will also change.
CHART
This in turn affects the value of our synthetic ETH portfolio.
The total profit and losses (PnL) of our portfolio is the sum from LP for the ETH-USDC pool, LP for the oSQTH-ETH pool, LP fees + funding for the long squeeth position:
Where is the initial price, is the price at the time , is the upper boundary of the position, is the initial value, is the value of a position in a certain pool at the time , and is a trading fee for LPing for the correspondent pool, is an amount of the squeeth, and is a squeeth funding rate.
As you can see, the resulted portfolio outperforms the pure ETH holding in a +-5% price change range. In other words, the profitability range of this strategy is +-5%, inside which, the portfolio earns more than just holding ETH on the upside while losing less on the downside.
If we will look at the portfolio performance relative to ETH holding, we can see, that in an ideal world (price change = 0%) we can expect up to 0.38% daily profits from Uniswap V3 trading fees.
However, in the real world, ETH is a very volatile asset, so the strategy can quickly drop out of the profitability range, so we need to periodically adjust the proportion of token holding to bring back the desired price exposure, otherwise, the strategy will lose a lot of money.
When the price increases the strategy needs to sell some USDC and ETH to buy oSQTH, while when the price decreases we need to sell some oSQTH and ETH to get USDC. We perform this proportion adjustment via a so-called rebalance auction, a procedure during which the strategy sells excess and buys missing tokens. In short, it’s a value-based Dutch auction, where the amounts that need to be exchanged with the keeper are calculated based on the current total ETH value of strategy holdings.
More on it in {Rebalance auction} section.
Back to the strategy PnL, from the chart above we can see that there is a large share of oSQTH, the price of which heavily depends on the ETH implied volatility (IV), as the oSQTH price determines as:
where is the current normalization factor, — funding period, — implied volatility, — scaling factor, and - current ETH/USDC price.
So, huge IV jumps significantly affect the strategy PnL, for example here is the chart, where after the position deployment we consider the 2 potential cases of volatility jumps (bumps).
Where Pos IV bump = IV * bump, and Neg IV bump = IV / bump.
As you can see, an IV bump significantly change the profitability of the strategy, doubling the returns and size of the profitability range in the case of a positive IV bump, and in the case of a negative IV bump, the strategy performance moves to an almost negative area with very small expected profits from LP.
Also, there is arise a little asymmetry in payoffs, which will only grow with the increase in base IV and potential bumps.
Here is for example, the extreme case with base IV = 100% and bump = 1.5
This asymmetry relative to the 0% price change leads to a dramatic change in the strategy performance, so in our next step, we will adjust the strategy input parameters to optimize the returns by fixing the payoff asymmetry.
To even out the payoffs and make them symmetrical, we will use a kind of implied volatility arbitrage.
As IV is a clearly mean-reverting process, the logic is simple - when the current IV is higher than the IV during the previous rebalance, we will adjust the boundaries and value multiplier expecting decreasing in IV. And vice versa, when the current IV is lower than during the next period we will adjust the parameters expecting further IV growth.
CHART
This way of arbitrage is a little bit different from the classical one when we trade expecting a return to the average, but in practice, there is no difference between using MA or using IV value during the previous period. But, this arb way significantly simplifies the contract logic.
The new value multiplier, as a function of the current IV:
Where is a weight when we expect the growth of IV and is a weight when we expect a decrease in IV.
Boundaries are adjusted in the next way:
Where , TP - tick adjustment parameter (0.05), TS - tick spacing.
The new payoff diagram:
Now the payoff structure is symmetrical around zero, and also at the same time, we can see that the expected profit at zero price change significantly increased from ~1.5% to ~2%, while the expected loss due to falling vol has also decreased to ~-0.5%.
We can say that we’ve done the classical volatility adjustment — corrected the quotes expecting certain levels of market volatility. Pretty causal type of operation that is used by all of the prop market makers.
But, what if our expectations about the IV are wrong, and instead of volatility falling, we will observe IV growth?
In this case, the strategy profitability range will be from -6.8% to +3.8%, with an extremum at -1%.
In the opposite case, when we expect IV growth but observe that vol is falling, we will have the next payoff:
Don’t be confused with the label “Pos IV bump”, as in this case. it means that we expected IV growth but were wrong.