An article discusses the best market-making plan for Uniswap V3

Written in the front: Since its launch, Uniswap V3 has leapt to the top position of the decentralized exchange (DEX) trading volume in just a few months, and according to statistics, most Uniswap V3 LPs are still used Simple, passive liquidity position, which shows that Uniswap V3 has huge potential that has not been tapped. And four researchers from Harvard University, Michael Neuder, Rithvik Rao, Daniel J. Moroz, and David C. Parkes wrote papers discussing Uniswap v3’s liquidity supply strategy. They concluded that the risk is neutral and low Under risk conditions, the proportional reset allocation strategy is almost the best, while in high-risk situations or for liquidity providers who are extremely risk-averse, the optimal solution is to reset the allocation evenly.


Uniswap is currently the largest decentralized digital asset exchange, and its latest version, Uniswap v3, allows liquidity providers (LP) to allocate liquidity to one or more asset price ranges instead of the entire price range. When the asset market price remains within this range, the rewards received by the liquidity provider (LP) are proportional to the amount of liquidity allocated.

This raises the question of liquidity provision strategies: when prices remain within the range, a smaller interval will lead to more concentrated liquidity and correspondingly greater returns, but the risk will be higher. We formalized this problem and studied three types of strategies for liquidity providers (LP): (1) uniform distribution, (2) proportional distribution, and (3) optimal (through constrained optimization problem) distribution.

We show the experimental results based on the historical price data of Ethereum, which shows that a simple liquidity provision strategy can produce near-optimal utility. In the case of low risk, it is more than 200 times higher than Uniswap v2 liquidity supply income. .


Decentralized finance (DeFi) is a large and fast-growing field in the cryptocurrency and blockchain ecosystem. It aims to replicate traditional financial intermediaries and tools using smart contracts executed on the blockchain (usually Ethereum) And carry out financial innovation.

From May 2020 to May 2021, the TVL (total lock-in value) entering the DeFi agreement has rapidly increased from US$800 million to US$80 billion[15].

As a decentralized exchange (DEX) in the DeFi subfield, it allows users to exchange different types of tokens without a trusted intermediary. At present, most decentralized exchanges (including Uniswap) belong to the constant function market maker (CFMM) category. CFMM does not use an order book like a traditional exchange, but instead uses an automated market maker (AMM) to determine the price of an asset.

In Uniswap v2, token pairs can be exchanged with each other using a liquidity pool containing two tokens. Allowable transactions are determined by the reserve curve ?*? = ?, where? And? Represent the number of tokens of each type in the liquidity pool, and? Remains unchanged in the transaction. Liquidity providers (LP) add tokens to the liquidity pool for traders to exchange, and get rewards through fees paid by traders. Figure 1 (blue) shows the reserve curve of Uniswap v2. In order to exchange a certain number of tokens? for a certain number of tokens?, traders must keep the reserve product unchanged, namely (? − Δ?) (? + Δ?) =?.


Figure 1: Uniswap v2 and v3 reserve curves. Providing v3 concentrated liquidity in the price range [??, ??] causes the Uniswap v2 curve ?*? =? To intercept the axes at? And? Respectively. The intercept is calculated by setting? And? To zero in the v3 reserve curve (Equation 1).

The reserve curve also defines the effective price of tokens in units of tokens, that is, ?? (?, ?) = −??/?? [12]. In Uniswap v2’s ?*? =? Curve environment, we have


Then, we take the “price” corresponding to the AMM and the liquidity pool as the price of ?, that is,? (?, ?), and we make? Tokens volatile relative to? Tokens. In Uniswap v2, when a trader uses liquidity for swap transactions, the liquidity provider will be rewarded, each incurring a fixed fee of 0.3% [2]. Each liquidity provider provides liquidity over the entire range of possible prices (0, ∞) and is rewarded according to its proportion of the total liquidity in the pool.

On May 3, 2021, Uniswap’s new protocol Uniswap v3 [3] was launched on the Ethereum mainnet. The main update of Uniswap v3 to Uniswap v2 is to increase centralized liquidity [3]. In three weeks, this new agreement accumulated more than 1.2 billion U.S. dollars in TVL, and the average daily transaction volume reached 1.6 billion U.S. dollars [17]. In Uniswap v3, liquidity providers (LP) can provide liquidity to any number of price ranges (called positions).

When the price stays in this range, the liquidity allocated to the position [??, ??] will be rewarded from the fee. If multiple liquidity providers (LPs) distribute liquidity within an interval containing the correct price, each LP will be rewarded in proportion to the liquidity it has in the price range. Figure 1 (red) shows how Uniswap v2’s constant product curve moves to intercept the axes at? And ?, these two axes are determined by the upper and lower limits of the position price range. This variation curve [3] is given by the following formula:

mSv7hj7OEEfoLKHZIXakz78aSdLiXA85NYLXoibQ.pngThe intercept? And? Can be calculated by letting? Or? Be zero respectively.

In this way, Uniswap v3 supports multiple strategies for liquidity allocation, and each strategy has different trade-offs. In addition, there is a cost to redistribute liquidity, which involves block transactions, so gas fees will be incurred, so this cost must be included in the liquidity provider’s strategy.

The contributions of this article are as follows:

(1) Formalize the problem of liquidity provision and a series of liquidity provision strategies, which we call the “reset liquidity provision strategy” (reset-LP strategy);

(2) Provide three types of LP reset strategies for liquidity providers, which we call uniform, proportional and optimal;

(3) Analyze and calculate the expected utility of resetting the LP strategy;

(4) Solve the optimal reset LP strategy based on the historical price of Ethereum;

(5) Prove that proportional distribution is optimal for risk-biased LP providers, and uniform distribution is optimal for risk-averse LP providers;

(6) Back-test the optimal reset LP strategy to prove that under appropriate conditions, the LP provider who adopts this strategy will get 200 times higher return on investment than following the v2 strategy.

1, 1 directory

Section 2 introduces the Uniswap v3 protocol and introduces the concept of liquidity supply strategy. Our main concern is the reset strategy class called “?-reset”. The third section introduces the Markov model, which is used to analyze the expected utility of this type of strategy. Section 4 introduces three specific liquidity provision strategies, including the optimal “?-reset” reset strategy.

Section 5 introduces the empirical results based on the historical price data of Ethereum. Section 6 puts forward and summarizes the issues that need to be further studied.

About Uniswap v3

Uniswap v3 introduces the concept of centralized liquidity to AMM. Liquidity providers (LP) can now specify one or more price ranges for one of the assets that provide liquidity, instead of within the entire price range of (0, ∞) Provide liquidity. When the price of the specified asset is within one of these intervals (and only within this time interval), the liquidity provider can earn transaction fees. In addition, if multiple liquidity providers (LP) allocate liquidity to the same price, each of them will be rewarded in proportion to the total liquidity they own in the price range.

By choosing a more concentrated range, liquidity providers (LP) can increase their returns when prices remain within that range, but this will also increase the difference in returns. In order to formalize it, we established a set of discrete price bin interval models, and the liquidity provider (LP) chooses how much liquidity to place in each bin interval and when to redistribute liquidity.

Definition 2.1 (Bin). We define a set of bin? = {?1, ?2,…, ??,.. .}, where each bin ?? corresponds to the price range [??, ??), and they form [0, ∞ ), where ?1 = 0 and?? = ??+1 ?, ∈ {1, 2.. }. Bin ?? corresponds to the interval [??, ??). Bin ?? represents the bin interval containing the current price of the asset.

For the rest of this work, we measure the other asset of the token pair in units of one asset. For example, in the USDC/ETH pool, we use stable USDC units to measure the volatile price of ETH. Consider the time? =? And let? Denote the bin interval containing the current price of the volatile asset. The liquidity provision strategy at time? =? Provides a method to determine the liquidity ratio allocated by the liquidity provider (LP) to each bin interval.

We made the following assumptions:

(1) Stable price distribution-We assume the next price distribution, describing that the percentage change of price relative to the current price is constant over time. We use the 10-minute historical price data of Ethereum for empirical verification, and we found that the correlation coefficient between the following probability distribution pairs is ?^2 = 0.98 (i) The price of ETH above 300 USD and the price of ETH below 300 USD (Ii) The price of ETH from April 2018 to April 2019 and the price of ETH from April 2019 to April 2020.

(2) The fixed cost of redistributing liquidity-we assume that the cost of redistributing liquidity is fixed (fixed to 1), and other values ​​are standardized with respect to this cost. For example, if the liquidity provider allocates ℓ = 100 units of liquidity, this is interpreted as 100 times the cost of redistributing liquidity.

(3) Regular updates-We assume that the liquidity allocation of the liquidity provider (LP) will be updated regularly, and any reallocation will take effect immediately. In addition, we take the period length to be long enough (at least 10 minutes), and the network transmission delay is not the focus of this paper.

(4) Single strategy provider-We assume a single liquidity strategy provider, and implicitly model the remaining providers to distribute liquidity across the entire price range, that is, follow the Uniswap v2 liquidity provision method ( Translator’s comment: There are a large number of LP positions with different strategies in the actual Uniswap v3 environment, so the optimal strategy results given in the paper are not meaningful).

2. 1 Liquidity provision strategy

When describing the problem of liquidity provision strategy, we first define the stochastic process {??:? ∈ N} of the price ?? at the time index. We model the next stable price distribution, describing that the change in price relative to the current price is constant over time and is also constant to the current price.

To this end, we re-index the price bin interval relative to the current price. Let ?? denote the current price bin interval, and set its relative index as? (0). Let ?(−?) and ?(?) denote the Kth bin interval of ?? on the left and right, respectively. For the set ?? = {−?max, −?max + 1,…, 0,…, ?Max}, where ?max is the largest possible next price change. According to Hypothesis 1, we can write the following formula:


Where ℎ(?) is the probability of moving k bin intervals to the left or right.

In view of this, we can now define a simple liquidity provision category strategy.

Definition 2.2. The reset liquidity provision strategy (reset-LP strategy) includes:

(1) The bin interval including the price when resetting, ?? = ?(0)

(2) Assign ?(?) ∈ [0, 1], specify the liquidity ratio allocated to each bin interval ?(?) in ?.

(3) A reset condition, which specifies a subset of bin intervals in? That causes the strategy to be reset. After resetting, the allocation rule? Is used to redistribute liquidity, centered on the new price ?.

Of particular interest is the ?-reset reset strategy family.

Definition 2.3. ?-reset strategy is a reset LP strategy in which reset conditions are defined so that only when the price exceeds the set?? = {?(−??), · · ·, ?(0), · · · ?( ?? )} 2?? + 1 continuous bin interval to reset.

Sometimes we also use? To represent the probability quality of the next price distribution covered by ?. For example, if? = 0.50, then? Is selected as the smallest number such that the set? Contains at least 50% of the next price probability quality.

We sometimes write ?? to represent a set of relative indexes corresponding to this set of bin intervals, that is, ?? = {−??, · · ·, 0, · · · ?? }. The usage can be clearly understood from the context.

To illustrate, consider the following strategy.

Example 1 (fixed strategy)-“Always provide liquidity within the price range [$30, $50].”

Example 2 (uniform?-reset strategy)-“Evenly distribute liquidity across a series of bin intervals centered on the current price??. Reset when the price exceeds this range.”

Example 3 (Proportional ?-reset strategy 1)-“Let? = 0.5, so ?? contains the middle 50% of the probability quality of the next price distribution. The liquidity is allocated proportionally according to the probability of each bin interval in ??. According to ?? to reset.”

Example 4 (Proportional ?-reset strategy 2)-“Let? = 0.5, so ?? contains the middle 50% of the probability quality of the next price distribution. According to each bin interval in the middle 90% of the probability quality of the next price distribution The probability of the distribution of liquidity is proportional to the probability. Reset according to ??.”

The uniform ?-reset strategy is shown in Figure 2.


Markov model analysis

Slightly, interested readers can read the original text.

Liquidity provision strategy

We now propose three ?-reset reset strategies.

4.1 Proportional distribution strategy

In this strategy, the liquidity provider (LP) allocates liquidity proportionally according to the probability of reaching a certain bin interval.

Definition 4.1. This proportional strategy is one with the following conditions? -reset Reset strategy:

(1) The price bin interval when resetting the strategy is ??;

(2) The smallest set of continuous bin intervals ??, centered on ??, account for at least the next price distribution probability quality ?;

(3) The smallest continuous bin interval set ?? with ?? as the center, which accounts for at least? Of the probability quality of the next price distribution;

(4) Distribution function

?(?) ∝ ℎ(?), for ? ∈ ??, (14)

Figure 3 shows an example of a proportional allocation strategy (in the case of?> ?). If? <?, then the set of bin intervals will be greater than the set of bin intervals.


Figure 3: Example of proportional? Reset strategy, where?> ?. The height of the bar represents the amount of liquidity in each bin interval. When the strategy is reset for the last time, the price is ?? and the next price probability distribution is displayed in blue. The “alpha” and “tau” bin intervals are shown in the figure. In this case, the five bin intervals in the middle are part of ?? and ??.

4.2 Even distribution strategy

In this strategy, the liquidity provider (LP) distributes liquidity evenly over a set of bin intervals.

Definition 4.2. The even distribution strategy is a ?-reset reset strategy with the following conditions:

(1) The price bin interval when the strategy is reset is ??.

(2) A set of continuous bin intervals, ?? ⊂ ?;

(3) A set of continuous bin intervals, ?? ⊂ ?;

(4) Distribution function

?(?) = 1/(2?? + 1), for ? ∈ ??, (15)

Where ?? is the number of bin intervals in ??.

4. 3 Optimal liquidity strategy

In this strategy, the liquidity provider (LP) optimally allocates liquidity over a set of bin intervals for a set of specified continuous bin intervals (in the ?-reset reset strategy).

Definition 4.3. The optimal liquidity strategy is defined as:

(1) The price bin interval when resetting the strategy is ??;

(2) A set of continuous bin intervals, ?? ⊂ ?;

(3) A set of continuous bin intervals, ?? ⊂ ?;

(4) The distribution function ?, which is the solution of the liquidity optimization problem, is defined as


The constraint specifies that (i) all liquidity has been allocated, and (ii) the liquidity allocated to each bin interval is non-negative.

If there is an internal solution, the optimization problem can be obtained by the Lagrange Multiplier method (Lagrange Multiplier) to obtain the standard solution. Then use the following formula to characterize the program:


For all ?,? ∈ ??, and constraints


as well as

?(?) ≥ 0 for ? ∈ ?? .

In practice, we use the SLSQP method [9] to solve this constrained optimization problem.

Measure strategy performance based on historical prices

In order to study the liquidity provision strategy described above, we used the price data of ETH from March 2018 to April 2020 (a total of 100,000 observations) and simulated the returns of different liquidity allocation strategies.

Figure 4 compares the performance of optimal, proportional, and uniform ?-reset strategies for different risk preferences. In each case, we define ?? as the minimum value such that ?? contains at least 50% of the probability quality of the next price distribution.

In risk-neutral (? = 0) and low-risk situations (for example,? = 0.1), the proportional allocation strategy is almost optimal, with? = 0.14 and? = 0.74, respectively. In high-risk situations (for example,? = 10), the uniform allocation strategy is close to the optimal, while for liquidity providers who are extremely risk-averse (for example,? = 15), the optimal solution is completely uniform allocation.

For risk-neutral agents (? = 0), they prefer a smaller? Because they are willing to update their configuration more frequently. For liquidity providers with a higher degree of risk aversion (for example,? = 3), they prefer a larger? And the resulting more bin intervals to diversify their liquidity to reduce the rewards they receive The difference.


Figure 4: The optimal, optimal ratio of different risk preferences (? value) and the expected utility of the uniform allocation strategy. In the case of low risk aversion (for example,? = 0, 0.1 and 1), the performance of the proportional allocation strategy is significantly better than the uniform allocation. At higher risk aversion levels (for example,? = 10 or 15), even distribution is the optimal strategy.

5.1 Comparison with Uniswap v2

In addition, we can also compare the above Uniswap v3 liquidity allocation strategy with Uniswap v2 through historical price data.

Recall that in Uniswap v2, liquidity providers (LP) cannot specify the liquidity price range they want to provide.


Figure 5: Backtesting using historical Ethereum price data? = 0.5 The best?-reset reset strategy. The red line represents the width of the? Bin interval for each time step, and the blue line represents the width of the? Bin interval. Compared with providing liquidity evenly within the price range (Uniswap v2 allocation), through this optimal allocation strategy, the utility obtained by LP is increased by an average of 230 times.

For liquidity providers who can avoid risks (? = 0.1), the optimal ?-reset liquidity provision strategy is 230 times more effective than the Uniswap v2 strategy.

in conclusion

This article discusses the issue of liquidity supply strategy brought about by the Uniswap v3 agreement. We proposed the ?-reset reset strategy and outlined a technique for analyzing and calculating their expected utility. We describe three different implementations of this strategy and compare their performance under historical ETH data. Given the? Bin interval and the next price distribution, we can find the optimal? Reset strategy. By backtesting our strategy on historical price data, we find that the expected utility of the optimal ?-reset strategy is the Uniswap v2 strategy utility More than 200 times.

We hope that this work can be the first step in formalizing and comparing the performance of these strategies. The framework mentioned here only represents a subset of the complete strategy space, and the richer strategy categories will also modify the liquidity allocation and reset strategies based on recent price changes.

It will be interesting to study the issue of liquidity provision in the context of multiple liquidity providers (LP), as will the strategic empirical research conducted on Uniswap v3.

In addition, there is an interesting macro-level link between Uniswap v3 and gas prices. If the gas fee is low, the liquidity provider (LP) will update their positions more frequently, which may cause the gas price to rise. Understanding the dynamics and relationship between Uniswap and gas prices is another promising research direction.

Posted by:CoinYuppie,Reprinted with attribution to:
Coinyuppie is an open information publishing platform, all information provided is not related to the views and positions of coinyuppie, and does not constitute any investment and financial advice. Users are expected to carefully screen and prevent risks.

Like (0)
Donate Buy me a coffee Buy me a coffee
Previous 2021-07-18 04:37
Next 2021-07-18 04:40

Related articles