Math

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

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.

Weights

For this, we will split the capital in a next way:

VEthUsdc=wβ‹…VtVOsqthEth=(1βˆ’w)β‹…VtV_{EthUsdc} = w \cdot V_t \newline V_{OsqthEth} = (1-w)\cdot V_{t}

​Where VtV_{t}​ - is total available capital in ETH terms, VEthUsdcV_{EthUsdc}​ is a capital to be deployed to the ETH-USDC pool, and VOsqthEthV_{OsqthEth} is a capital to be deployed to the oSQTH-ETH pool. ww​ is value weight assigned for the ETH-USDC pool, while (1βˆ’w)(1-w)​ 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 ww =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.

Boundaries

The next step is to calculate the boundaries in which we want to provide liquidity. For the ETH-USDC pool it will be:

EthUsdcLower=1e121.0001ln1e12EthUsdcln1.0001+TS+EthUsdcLTEthUsdcLower = \frac{1e12}{1.0001^{\frac{ln{\frac{1e12}{EthUsdc}}}{ln{1.0001}}+TS+EthUsdcLT}}
EthUsdcUpper=1e121.0001ln1e12EthUsdcln1.0001βˆ’EthUsdcUTEthUsdcUpper = \frac{1e12}{1.0001^{\frac{ln{\frac{1e12}{EthUsdc}}}{ln{1.0001}}-EthUsdcUT}}

Where EthUsdcis 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:

OsqthEthLower=11.0001βˆ’lnOsqthEthln1.0001+TS+OsqthEthLTOsqthEthLower = \frac{1}{1.0001^{-\frac{ln{OsqthEth}}{ln{}1.0001}+TS+OsqthEthLT}}
OsqthEthUpper=11.0001βˆ’lnOsqthEthln1.0001βˆ’OsqthEthUTOsqthEthUpper = \frac{1}{1.0001^{-\frac{ln{OsqthEth}}{ln{}1.0001}-OsqthEthUT}}

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.

Liquidities

Then we can calculate liquidities, which we will get by providing value to the desired LP range:

LEthUsdc=EthUsdcβ‹…VEthUsdc2EthUsdcβˆ’EthUsdcLowerβˆ’EthUsdcEthUsdcUpperL_{EthUsdc}=\frac{EthUsdc \cdot V_{EthUsdc}}{2\sqrt{EthUsdc}-\sqrt{EthUsdcLower}-\frac{EthUsdc}{\sqrt{EthUsdcUpper}}}
LOsqthEth=VOsqthEth2OsqthEthβˆ’OsqthEthLowerβˆ’OsqthEthOsqthEthUpperL_{OsqthEth} = \frac{V_{OsqthEth}}{2\sqrt{OsqthEth}-\sqrt{OsqthEthLower}-\frac{OsqthEth}{\sqrt{OsqthEthUpper}}}

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.

Portfolio dynamics

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:

PnL=PnLEthUsdc+PnLOsqthEthΒ PnLEthUsdc=Ξ”VEthUsdc+LpFeeEthUsdcΒ PnLOsqthEth=Ξ”VOsqthEth+LpFeeOsqthEthβˆ’oSQTHβ‹…frβ‹…OsqthEthΒ Ξ”V=Vtβˆ’V0=L(2(ptβˆ’p0)+p0βˆ’ptph)PnL=PnL_{EthUsdc}+PnL_{OsqthEth} \newline \ \newline PnL_{EthUsdc}=\Delta V_{EthUsdc}+LpFee_{EthUsdc} \newline \ \newline PnL_{OsqthEth}=\Delta V_{OsqthEth} + LpFee_{OsqthEth}-oSQTH \cdot fr \cdot OsqthEth \newline \ \newline \Delta V=V_t-V_0=L(2(\sqrt{p_t}-\sqrt{p_0})+\frac{p_0-p_t}{\sqrt{p_h}})

Where p0p_0​ is the initial price, ptp_t​ is the price at the time tt, php_h​is the upper boundary of the position, V0V_0​ is the initial value, VtV_t​ is the value of a position in a certain pool at the time tt, LpFeeEthUsdcLpFee_{EthUsdc}​ and LpFeeOsqthEthLpFee_{OsqthEth}​ is a trading fee for LPing for the correspondent pool, oSQTHoSQTH​ is an amount of the squeeth, and frfr 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.

IV bumps

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:

NFβ‹…p2β‹…exp(IV2β‹…fp)SF\frac{NF\cdot p^2 \cdot exp(IV^2\cdot fp)}{SF}

whereNFNF is the current normalization factor, fpfp β€” funding period, IVIV β€” implied volatility, SFSFβ€” scaling factor, and pp - 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.

Calibration

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:

wpos=0.5+0.01IVΒ wneg=0.5βˆ’0.01IVw^{pos} = 0.5 + \frac{0.01}{IV} \newline \ \newline w^{neg}=0.5-\frac{0.01}{IV}

​Where wposw^{pos} is a weight when we expect the growth of IV and wnegw^{neg} is a weight when we expect a decrease in IV.

Boundaries are adjusted in the next way:

baseTickAdj=Floor((IVbumpβˆ’1)/TP)β‹…TSΒ posTickAdj=ifelse(baseTickAdj<120,Β 60,Β BaseTickAdj)Β negTickAdj=ifelse(baseTickAdj>60,Β 120,Β baseTickAdjbaseTickAdj=Floor((IV_{bump}-1)/TP)\cdot TS \newline \ \newline posTickAdj = ifelse (baseTickAdj < 120, \ 60, \ BaseTickAdj) \newline \ \newline negTickAdj = ifelse(baseTickAdj >60, \ 120, \ baseTickAdj

Where IVbump=ifelse(IVt<IVtβˆ’1,Β IVtβˆ’1IVt,Β IVtIVtβˆ’1)IV_{bump}=ifelse (IV_t<IV_{t-1}, \ \frac{IV_{t-1}}{IV_t}, \ \frac{IV_t}{IV_{t-1}}), 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.

Last updated