Uniswap V3: A Quant Framework to model yield farming returns.

Are you well compensated for the risks you are taking?

DeFi Scientist
8 min readJun 27, 2021

Uniswap v3 launched officially in May promising lower transaction fees and better capital efficiency for liquidity pool (LP) providers. The DeFi protocol quickly witnessed tremendous success attracting close to $2bn capital within its first month.

However, returns for Liquidity Providers have been mixed since the launch. Based on current platform metrics, we demonstrate that there is too much liquidity on the platform chasing too few fees. As a result, for most pairs, the fees generated by the LP, far from compensate the expected impermanent loss (IPL) arising from the volatility in token prices. Given current market conditions, investors can expected a higher return from selling puts (when available).

To demonstrate this, we first expose the main drivers of returns of yield farming on Uniswap V3 and propose a quant framework to analyse the attractiveness of a given LP position. As an illustration, we apply this framework to the USDC/WETH pool.

Unlike most currently available methods, our framework is unique as it takes into account the liquidity distribution of the LP and simulates associated token price movements. This enables a more precise estimation of the fees one can expect to collect and subsequently of the expected strategy profit.

Yield Farming: back to basics

Before we dive into the quant stuff, let’s remind ourselves of the features of the Uniswap V3 protocol and the drivers of yield farming returns.

It is worth noting that any LP strategy is a short volatility strategy: you contribute two tokens into the liquidity pool and as the price moves, you sell progressively the best performing asset.

The main innovation of Uniswap V3 lies in:

  • the ability to concentrate liquidity within a specific price range [pmin, pmax]. This provides leverage to the LP. But as soon as the prices settles outside of the range, you will stop earning fees and will have full exposure to the underperforming asset.
  • the fees you will collect depend on how many other LPs are active in a given price range. Those fees are harder to model than for Uniswap V2 as you are in competition with other liquidity providers.
Source Uniswap V3 whitepaper

Let’s model the expected impermanent loss for a pool where we trade a crypto token (let’s call it T) versus a stable coin (i.e. USDC). We start with a portfolio value of 1 and a market price of T/USDC =1) What does our Portfolio value looks like (excluding fees) for various values of USDC/T?

We also compare this for two different liquidity ranges [0.95,1.05] and [0.9,1.1], so readers can get a better understanding for the impact of the liquidity range on the outcome.

As one can see, the PL graph is very similar to the graph of a short put strategy. The main difference being in the convexity within the chosen liquidity range. A narrower liquidity range will help you collect more fees — as long as the token price remains in the range- but you will have less upside exposure to the crypto token and more downside exposure.

Your main risk is in your token depreciating and in a crypto bull market you make money from your short volatility position and from the pool fees. However, the payoff in USD without fees is asymmetric. a small gain (c 50% of the time) when the token appreciates vs USD but a potential large loss on the downside. This leads to an average statistical loss. The LP strategy is only viable if the fees collected are bigger than on your expected IPL.

Setting up correctly your Liquidity Range is a critical part of any LP strategy. The fees that you will collect are also path dependant. To model our returns precisely, we are going to simulate token prices with Monte Carlo simulations.

.A Quant Framework for Modelling of LP returns

Given a certain token LP position and its characteristics (range, liquidity distribution of the pool and fee forecast), one can calculate an implied volatility metric assumed by the LP position.

The implied volatility metric is backed out using Monte Carlo simulations of the token pair price. The token volatility implied by the pool being the asset volatility that generates a 0 expected gain in the LP position.

Worth noting that we could reverse the process i.e. set our implied asset volatility assumptions for the pair and back out the implied fees.

As the liquidity distribution in a pool can change over time, it makes sense to run Monte Carlo simulations over a short time period. We will select a 24 hour window for the purpose of this modelling exercise.

Application to the USDC/WETH Pool

USDC/WETH is one of the largest pool in Uniswap V3 with more $200m in TVL. We start by extracting the liquidity distribution using The Graph . We notice that the bulk of the liquidity is concentrated within the 1800–2400 price range for WETH. The liquidity starts degrading slowly as the price falls from current levels. We should expect to collect more fees as the price falls further-as we will account for a higher part of the pool. As WETH appreciates, the fees we collect will diminish.

Liquidity Distribution of the USDC/WETH as of June 26th (Source Uniswap)

We also need to set up a daily fee assumption for the pool. We can see below that daily volumes have been recently well below $200m. Let’s be optimistic and assume a $200m daily volume which should translate into 600k fees ( 0.3% transaction fee) for the entire liquidity pool. Given a TVL of $235m, this would represent an APY of 93% p.a.

Historic Volumes of the USDC/WETH Liquidity Pool (Source Uniswap)

Using the framework described previously and our fee assumptions, we will calculate the implied volatility for 3 different liquidity ranges:

  • ± 1.2 % range from the current price (1760 at the time of writing)
  • ± 4.8 % range from the current price
  • ± 9.6 % range from the current price

Our framework is extremely flexible and could accommodate any liquidity range. These three ranges have been chosen to illustrate that the implied volatility does not change materially with the liquidity range.

The implied volatility for ± 1.2 % range is 99% implied volatility.

The implied volatility for ± 4.8 % range is 100.5% implied volatility.

The implied volatility for ± 9.6 % range is 107% implied volatility.

Even using our optimistic assumptions on fees, the implied volatility of those three pool positions is below the 122% level on ETH put options (source Deribit Exchange). In practice, the fees are expected to be much lower ( they were c 400–450k daily at the time of writing!) leading to a much lower implied volatility. One also could argue that implied volatility curves have skews. Therefore a wider liquidity range should justify a higher implied volatility, making LP investments even less attractive. For information, the 1650 daily Put Deribit Exchange was pricing a 152% implied volatility.

Based on a 120% implied volatility and 600k daily fees, we can expect the following daily losses on our three pools:

  • ± 1.2 % range : -1.1% If the fees are too low, a narrow liquidity range will hurt you like leveraging a bad trade.
  • ± 4.8 % range : -0.83%
  • ± 9.6 % range : -0.5%

Now, let’s turn the problem around, let’s assume an implied volatility of 120% and let’s figure out the daily fees required to breakeven. The ± 9.6 % range pool needs a 800k daily volume (124% APY) to have an expected positive return which is 2x current volumes. Or alternatively, we would need the liquidity being provided to be halved.

We have seen that the USDC/WETH has too much capital and the volumes are not enough to compensate for the implied volatility of ETH. But is it the same for all the pairs available on Uniswap ?

Screening for attractive LPs

The best way to screen quickly for attractive pools is to calculate the ratio between expected fees and realized volatility of the pair token. That is where The Graph becomes handy again to pull out all the pools data. A good rule of thumb is that fees need to have an APY at least 0.9x the implied volatility of the pair we are providing liquidity for. This could differ if for example, we have a good portion of the TVL which does not provide liquidity at current market prices. In our example of the USDC/WETH, the bulk of the liquidity was concentrated above current market prices so the pool APY was underestimating the fees we could earn.

The chart below breaks down Uniswap TVL by the APY/realized volatility ratio for the various pools. One can see that c 2/3 of he TVL is locked in pools where the expected APY is less than the implied pair volatility ! Only 1/3 of money locked has an expected positive return.

Uniswap V3 TVL breakdown by APY/Volatility ratio

The top 20 best pools based on the fees/vol ratio are shown below. As you can see those pools are quite small in size with at max a few millions dollars of assets. Their returns will be impacted by higher gas fees and the risk of new entrants in the Pool. Also, many of these involve small , less reputable coins like FEI,FRAX …

Top 20 most attractive pools for yield framing based on the APY/vol ratio.

You will also notice a USDC/WETH pool (highlighted in yellow) in the list. (https://info.uniswap.org/#/pools/0x7bea39867e4169dbe237d55c8242a8f2fcdcc387) That is not the pool we analysed previously but the one with the 1% transaction fee (!) . Its TVL is much smaller ($2.7m). This proves that the standard Uniswap fee is not always the most optimal for yield farming.

Conclusion

Uniswap is a victim of its success. As Luke Posey and glassnode pointed out in their recent newsletter (https://insights.glassnode.com/activity-on-defi-stalls/), the TVL locked on DeFI platform has outperformed the performance of Ethereum and other crypto tokens.

Source Glassnode

This creates more competition for fees from liquidity providers. In addition, the proliferation of exchanges and the new Uniswap fee tiers have had a negative impact on fees and in return the profitability of yield farming strategies.

I hope that you enjoyed our first analysis of Uniswap V3. We have more innovative quant research in the pipeline so do not forget to follow us on Medium and Twitter https://twitter.com/DefiScientist

--

--

DeFi Scientist

Innovative Quantitative Research on Crypto and DeFi. Unique blend of research, modelling, and machine learning to provide institutional-grade insights.