UNISWAP V3

Altonomy
9 min readMay 18, 2021

--

Active Liquidity Management: Traders’ Perspective

Author: Ricky Li, Siddharth Lalwani, Hongxu Yan

Abstract

Uniswap V3 introduces flexible liquidity providing price ranges and fees, which opens up opportunity for more sophisticated strategies to maximize profit for users in managing their liquidity. But it also bestows substantial challenge for users facing unknown risks. In this article, several factors and their effects on efficiency of the liquidity providing strategy, will be discussed, including (1) pair volatility’s impact on liquidity price range chosen; (2) periodical position relocation frequency and costs; (3) delay of relocation leading to worse yield; (4) impermanent loss with hedging leg.

Through a quantitative analysis and simple simulation, suggestions on how to put together an optimal market making strategy will be offered.

Introduction

On the 5th of May, Uniswap V3 was deployed to Ethereum mainnet. At the time of writing this report (2021–05–07 4:40 UTC), the Total Value Locked (TVL) is $367.59m, and 24hr volume is $226.69m, not on a comparable level with V2 (TVL $7.91b, Volume $1.13b), but Volume/TVL ratio is significantly higher. Concentrated Liquidity on Uniswap V3 provides better capital efficiency but bears new types of risks if managed poorly. This report will guide readers through a few essential factors that liquidity providers should consider for determining their strategy:

● Token price volatility

● Liquidity providing price range selection

● Gas cost and frequency of liquidity relocation

The report will also quantify the impact of the above factors on fees, price risk, and impermanent loss through simple simulations.

In Uniswap V3, trading fees and price range are additional parameters that liquidity providers must specify, as shown in the following UI panel (Figure 1 Liquidity Position UI panel).

Figure 1 Liquidity Position UI panel

Liquidity Providers must be careful when selecting trading fees. If there is no pool for that pair with that trading fee, it will create a new pool, and this operation takes a lot of gas (around 1000 USD at 50 Gwei).

The rest of the article will discuss optimizing the two parameters to maximize the Liquidity Providing (LP) fees while reducing token price risk and impermanent loss.

Token Price Volatility

Why does the volatility of this pair in the pool matter?

Traders will broaden the price range when the pairs are more volatile because their liquidity is only active in that range and earns a trading fee. Meanwhile, concentration within the range will be diluted and lead to a lower trading fee distributed given the same capital. Accordingly, the balance between width and concentration needs to be achieved regarding the pair’s volatility.

Two types of volatilities are evaluated: (A) the expected volatility that determines the specified price range, and (B) the realized volatility in the market and determines the trading fee distributed.

A few assumptions:

● Given a certain level of volatility expected over one day, traders want to ensure that the price will be inside the range they set in 90% of the time (confidence level), assuming the price series fits a normal distribution. Only the stochastic variation is considered here, and upward trends are ignored.

● The realized volatility can lead to a different portion of total volume happening within the range traders specified as time goes by. The assumption is that trades are of the same size at all different prices.

● Liquidity density is defined as:

x and y are the mounts of ABC and USDT tokens traders put. The liquidity is NOT in a unit of Dollar.

● As there are also other liquidity providers in the same range, the trading fees traders can earn are only a portion of the total trades happening inside the range, according to the weight of liquidity.

The configuration parameters (Figure 2 Configuration Parameters) used are shown below:

Figure 2 Configuration Parameters

Assuming realized volatility keeps at the same level, fees that can be earned when setting different price ranges are listed (Figure 3 Earned Fees With Different Price Ranges)

Figure 3 Earned Fees With Different Price Ranges
Figure 4 Earned Fees With Different Relative Price Range Width

There is a trend that when expected volatility goes higher than actual volatility, the range specified would be unnecessarily broad, leading to less fee collected and less capital efficiency.

Gas Cost for Relocating Liquidity Range

The trading price will move out of the liquidity range according to the market condition. Various strategies can be used to relocate the liquidity range. For example, traders can choose to wait for the price to revert into the range, change the range boundary when the price reaches there, or proactively relocate position even when the price has not moved out of the range yet.

To analyze gas cost’s impact when relocating the liquidity range, here is a simple strategy that relocates the position once the price reaches either boundary.

The liquidity relocation operation takes two steps,

● Removing old position

● Adding new position.

Each step takes 350k gas. Therefore, it will cause 0.028 ETH, around $100. (Gas consumed can vary, depending on whether this is the first mint pool and many other factors. Please refer to the Gas Cost Table in Appendix)

Assumption: the price series of ABC/USDT pair follows Arithmetic Brownian Motion:

A trending factor is added here (instead of considering only stochastic variation in the below section). Without a one-sided trend factor, the Expectation of first hit time would not be bounded (it goes to infinite instead).

In Arithmetic Brownian Motion, the assumption is the shifting(trending) constant to be 1.5%, which equals the daily yield of the pair. Thus, the average first hit time given price range can be calculated by the following equation:

The formula to calculate a cost for position relocation each day:

Figure 5 Profit With Different Relative Range Width Considered Relocation Cost
Figure 6 Profit With Different Relative Range Width Considered Relocation Cost

With a broader price range, less frequent adjustment is needed. On the other hand, a narrower range of price collects more trading fees and costs more on relocation.

Relocation Latency

Uniswap V2 does not require active management on liquidity positions, making it friendly for retail users to manually conduct the operations via Uniswap UI at a low frequency. However, in V3, if the liquidity position is not adjusted in time, it will not generate the desired amount of yield for traders.

In the above section, the relocation strategy is triggered once the price breaches either boundary of the range. If a position is not adjusted promptly, to what extent would the yield be?

● The expected amount of trading fee earned on the 1st day is given from the above section when the position is centered around the current price. Taking one day as the step size to calculate can also be converted to a continuous-time model using integration.

● Starting from the 2nd day, if no relocation is performed prior, the overall volatility will increase when time accumulates.

Therefore, on the 2nd day, there will be less volume of trade located inside the range specified at the beginning, leading to less fee earned compared to the 1st day

Calculate the expected amount of fee collected on the 2nd day to compare the yield on the second day with that on the first day, and see yield is worsened to what extend:

Figure 7 Yield Drops When Relocation Delayed with Different Relative Range Width

As observed, when the price range is narrower, it is more affected by late relocation. Delaying the position adjustment by one day can cause the yield to drop by as much as 20%~30%.

Thus, using algorithms to monitor and control the liquidity position on V3 to avoid delaying position adjustment is recommended, especially for those who specified a narrow range for utilizing capital more efficiently.

Impermanent Loss

Impermanent loss exists with any AMM. However, the effect is amplified in V3 as the capital is concentrated in a narrow range.

The below section models impermanent loss according to change of trading price, with unit currency in either USDT or ABC. Configuration parameters are as below:

Figure 8 Configuration Parameters

USDT as Unit Currency

When ABC price rises, in pool ABC is converted to USDT gradually until there is no ABC left in the position. In this case, traders should effectively LONG ABC. In the meanwhile, to hedge that exposure, traders can SHORT 1 ABC from the beginning. In this way, the whole portfolio would be (1) position in pool + (2) hedged leg of SHORT 1 ABC.

Figure 9 Impermanent Loss When Price Changes Using USDT as Unit Currency

For the whole portfolio, the value is maximized when the price gets back to the initial price. And if price breaches boundary, there would be around 2.5% of the impermanent loss.

Figure 10 Impermanent Loss When Price Changes Using USDT as Unit Currency

ABC as unit Currency

When ABC price drops, USDT is converted to ABC gradually until there is no USDT left in the position. In this case, traders effectively LONG USDT. To hedge the exposure, traders LONG 1 ABC from the beginning. In this way, the whole portfolio would be (1) position in pool + (2) hedged leg of LONG 1 ABC.

Figure 11 Impermanent Loss When Price Changes Using ABC as Unit Currency
Figure 12 Impermanent Loss When Price Changes Using ABC as Unit Currency

Conclusion

Uniswap V3 market-making requires finer adjustments and more frequency interventions compared to V2. Nevertheless, more complex strategies can be constructed to gain a competitive advantage over other liquidity providers via parameter tuning.

Figure 13 Influential Factors for V3 Market Making

To maintain an efficient market making strategy in V3, at least the below aspects need attention:

● Choose an appropriate price range to place liquidity in, according to pair volatility, and other provider’s position around that range.

● Manage periodical position relocation, and set an appropriate frequency, taking consideration of cost on operation gas consumed.

● React when price moves out of the specified range quickly, better with the help of an automatic algorithm instead of doing manually

● Handle impermanent loss with a hedging leg if need to balance exposure on both sides. V3’s impermanent loss is more severe than V2 as liquidity is concentrated. If the price range is narrow, the impermanent loss will be more significant.

References

  1. First Hitting Time and Expected Discount Factor. (n.d.). http://marcoagd.usuarios.rdc.puc-rio.br/hittingt.html.
  2. Overview: Uniswap. Uniswap Unicorn. (n.d.). https://docs.uniswap.org/.
  3. Uniswap Interface. (n.d.). https://app.uniswap.org/.

Appendix

Figure 15 Gas Cost Table

Note: Readers can download the article in PDF here.

--

--

Altonomy

Based in New York and Singapore, Altonomy is a world’s leading trading and asset management firm in crypto space.