the implied vol of uniswap v3 position and its analysis Framework

zelos
zelos-research
Published in
8 min readMay 12, 2023

TL;DR:

  1. Uniswap V3 makers have varying opinions about volatility.
  2. Volatility can be extracted from the mint/burn behavior.
  3. A liquidity-weighted IV index can be calculated from maker behavior.

Big Questions About Uniswap V3

Uniswap V3 has been live for over a year and has helped to maintain Uniswap’s competitive edge in the DEX space. There are now many Uniswap maker funds in the ecosystem, such as the Gamma Strategy. At the beginning of this year, we evaluated the performance of these funds using our developed Demeter tool. However, there are two problems in uniswap: pricing and implied volatility.

Pricing

Assuming a maker has a view on volatility, how do they decide their upper and lower bounds to maximize returns? What is the expected return rate for a maker when selecting their bounds? In a Medium article by Guillaume Lambert, Guillaume Lambert proposed that Uniswap V3 is like selling a covered call. However, there are still some unanswered questions:

  1. If we consider liquidity position to be an option, what is the expiration date?
  2. Unlock or lock? it is equivalent to the American or European type.
  3. How are fees estimated?

We pick the Monte Carlo simulation from the financial engineering toolkit to effectively solve this problem.

Implied Volatility for V3 Makers

If we assume that the LP position is a combination of options, we can calculate its implied volatility as we do for options. Guillaume Lambert discusses a method for calculating IV for pools in his Medium article. Can we further infer the volatility of each position based on this? Remember this question, we will soon be able to answer it.

Our Framework

There are many tools available for traditional financial engineering. In this post, we will use MC methods to solve the above problems. For traditional SPDE methods, we found a good paper on V2, https://arxiv.org/pdf/2302.11942.pdf, and will derive a V3 version in a future post.

For MC, we need to solve the following problems in order:

  1. How to predict the fee rate.
  2. Path generation.
  3. Terminal condition and terminal value.
  4. Pricing.
  5. one position’s IV
  6. New IV index

Fee Return Rate

The first problem we need to solve is predicting the fee return rate. This is a relatively simple but important problem. What is the fee rate when we provide liquidity with an upper and lower bound?

Our answer is to abandon any models and simply statistic all possibilities in 24 hours. We calculate theta, the fee return rate for a position within the (lower bound, upper bound). To simplify the calculation and easy understanding, we make the following assumptions:

  1. The total value invested for one liquidity position is $1.
  2. Theta is the fee daily return rate, without units.
  3. The upper and lower bounds are calculated as float.

With simple and naive calculations, we can obtain the following theta chart. If the position range is (0.97, 1.02), the daily return rate for the LP’s fee is about 0.0075. Of course, choosing such a narrow boundary means that the LP itself bears larger risks, and the fee collection will not last long either, as high risk means high returns.

theta

Path Generation

GBM

We will not discuss GBM in depth since it is not the main point of this article. However, we will briefly discuss the formula.

For a path, there are two important parameters: the volatility and path length T. T is a relatively free variable that can be changed according to demand. In this post, we have made a statistical review of positions over the past year, and a considerable portion of positions have a lifespan of no more than 24 hours. Therefore, we also set the path length to 24 hours. Considering performance and blockchain time, the step length is set to 1 minute.

As for volatility, we will discuss this again when we discuss implied volatility. In fact, we calculated paths for multiple volatility levels if the computing power allowed. vols_pathes is a list that contains GBM paths for multiple volatilities.

paths generate code

Terminal Condition and Terminal Value

For a position, excluding fees, its value at any price S_t is relatively easy to calculate, even though you also need to calculate it on paper.

Here, we assume that the initial LP value is 1, and the upper and lower bounds are calculated in proportion. Therefore, the principal value of the LP at any price is:

After handling the principal part, we still need to calculate the fee return rate for the path. This involves a tricky problem: when does our maker stop providing liquidity?

There are two types of choices here:

American:

Liquidity provision ends when the price is out of bounds. Therefore, the time for the LP to provide liquidity is the time it takes to reach the upper or lower bound for the first time. If neither is reached, that is great, and we can collect fees until the expiration date. As shown in the figure below, the path ends the calculation either at the boundary or at the expiration date.

path example
life span code

The other is European: waiting until expiration. If the price falls outside the market-making range, we hope that the price returns to the range. If the maker can fully hedge through options or other financial instruments, this is also a reasonable method. In this case, we only need to calculate the number of points within the range on the path.

We choose the America type, which is also the most realistic, as makers can indeed withdraw their liquidity at any time.

Pricing

This is almost the final step. We convert the fee return rate of lp’s boundary into the fee return rate per step length, and then calculate the value of the maker making an LP in a path as follows:

one path value = lp_value +fee return rate*step_length * life_span

in 2022–03–16,we choose two lps

one_lp : LP_CONFIG(0.9,1.1,0.001891250855536557508701400359)

another lp is LP_CONFIG(0.8,1.25,0.0008512103053980997998489133312)

we plot hist of two lp’s path value under sigma = 50%

Since each path appears with equal probability, we only need to take the average of all paths to get the expected return rate of the LP. We can also find the combination of upper and lower bounds with the highest return rate.

Implied Volatility for One Position

Let’s back to how we calculate the implied volatility in the options market: Based on the market price, assuming that the transaction price is fair, we can use the pricing method to reverse the parameter volatility.

When we look back at the pricing method we just solved, if an LP appears to have an expected return greater than 1, we can say that the input volatility is incorrect, in addition to understanding that it can make money. If we can find a volatility that makes the result of pricing equal to 1, we can say that this volatility is the implied volatility of this LP.

This is why we need to generate paths for multiple volatilities at once. In addition, we have a qualitative conclusion that can help us do a good numerical method. That is, volatility and expected return are monotonic. The lower the volatility, the longer the LP can collect fees, and the smaller the expected loss of the LP. Therefore, if two similar volatilities appear, one with an expected return greater than 1 and the other with an expected return less than 1, we can find the zero point through the difference, which is the numerical method for implicit volatility we developed.

We calculated the implied volatility for all upper and lower bound pairs used in the theta 3D map:

and plot it:

When approaching 1 from the lower bound, it can cause unstable solutions, but overall, we have obtained a satisfactory curve for implied volatility. This means that if the realized volatility is lower than the implied volatility, the maker is expected to make a profit. This surface can even explain some interesting things. We tracked the performance of the gamma strategy on the USDC-ETH pair on Matic at the beginning of the year:

We found that gamma tends to set asymmetric upper and lower bounds, with a higher upper bound and a relatively high lower bound.

If placed on the IV surface, a simple explanation can be obtained that this setting can increase the implied volatility and expand returns while maintaining the market-making bound width.

New IV Index

We can calculate the IV corresponding to a position, so it’s time to make a vote. We can simply use the liquidity of the position as the weight to vote for the implied volatility belonging to this pool.

Specifically, we selected trading data from December 20, 2022, to March 20, 2023, calculated the theta table for each day, and then calculated the implied volatility surface for each day. For those positions that entered the statistical process, we crudely made two versions:

  1. Lifespan is less than 10 days, and the current price is still within the maker range of LP
  2. Newly constructed on that day, namely, from the mint event

After a simple voting process, we obtained the IV time series belonging to ETH-USDC-MATIC-005 and compared it with the dvol of Deribit in the same period.

It perfectly shows the correlation of volatility, which means that our IV method is effective. Our makers in the market are smart.

Pearson correlation coefficient:

corr between active_100 and dvol is 0.6234082297737792
corr between mean_100 and dvol is 0.5782885873063338

What Else Can We Do?

Greeks

In addition to volatility, our MC analysis framework can also be extended to numerical methods for Greeks to help makers understand more realistic risk values. We will combine this work with the PDE method for comparison, so stay tuned for our follow-up posts.

IV by User

We should not only select the best fund managers through statistical methods but also find the fund managers/addresses that are most sensitive to volatility. These outstanding prophets should not be hidden in the events of mint/burn.

end

This concludes our analysis of the implied volatility of Uniswap V3 positions. We have developed a framework for extracting implied volatility from maker behavior and demonstrated its effectiveness in predicting volatility and correlating it with actual volatility data. We believe that this framework can be extended to include Greeks and further enhance the understanding of risk values for makers.

Any suggestions are welcome! comment directly or mail to zelos@antalpha.com

--

--