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.

1626516892045956

Overview

Uniswap is currently the largest decentralized Crypto 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. .

1

Introduction

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 during 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 ?, the trader must keep the reserve product unchanged, namely (? − Δ?) (? + Δ?) ) = ?.

1626516892063122

Figure 1: Uniswap v2 and v3 reserve curves. Providing v3 concentrated liquidity in the price range [??, ??] leads to the Uniswap v2 curve ?*? = ? intercepting the axis 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 the token ? in the unit of token ?, that is, ?? (?, ?) = −??/?? [12]. In Uniswap v2’s ?*? = ? curve environment, we have

1626516892065486

Then, we take the “price” corresponding to the AMM and the liquidity pool as the price of ?, which 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 ?, which are determined by the upper and lower limits of the position price range. This variation curve [3] is given by the following formula:

1626516892066540

The intercepts ? and ? can be calculated by making ? or ? 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.

2

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 bins ? = {?1, ?2,…, ??,.. .}, where each bin ?? corresponds to the price range [??, ??), where they form a partition of [0, ∞) ?1 = 0 and ?? = ??+1 ?, ∈ {1, 2.. }. Bin ?? corresponds to the interval [??, ??). Bin ?? represents the bin range 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 used 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 random process {??: ?∈N} at 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 ?? represent the current price bin range, and its relative index is ?(0). Let ?(−?) and ?(?) denote the Kth bin interval 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:

1626516892064030

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 range that includes the price when resetting, ?? = ?(0)

(2) Allocate ?(?) ∈ [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. The ?-reset strategy is a reset LP strategy in which a reset condition is defined so that only when the price exceeds the set ?? = {?(−??), · · ·, ?(0), · · · ?(??) } Will be reset only when 2?? + 1 consecutive bin interval.

Sometimes we also use ? to represent the probability quality of the next price distribution covered by ??. For example, if ? = 0.50, then ?? is chosen as the smallest number so that the set ?? contains at least 50% of the next price probability quality.

We sometimes write ?? to indicate 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. According to the probability of each bin interval in ??, the liquidity is distributed proportionally. According to ?? Reset.”

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

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

1626516892067662

Figure 2: Uniform ?-reset strategy, where three continuous bin intervals centered on the current price are defined. Each circle represents a price range, and the dark circle represents the current price of each time step. Once the price leaves these three consecutive bin ranges, the strategy will “reset” and redistribute liquidity to near the current price when resetting.

3

Markov model analysis

Slightly, interested readers can read the original text. https://arxiv.org/pdf/2106.12033.pdf

4

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 a ?-reset reset strategy with the following conditions:

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

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

(3) The smallest continuous bin interval set ?? centered on ??, 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 ? <?, the set of bin intervals will be greater than the set of bin intervals.

1626516892069876

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 figure shows the “alpha” and “tau” bin intervals. 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 on 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 resetting the strategy 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 specified bin intervals ?? in a set of ? 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) Distribution function ?, which is the solution of the liquidity optimization problem, defined as

1626516892069873

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:

1626516892071917

For all ?, ? ∈ ??, and constraints

1626516892081344

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

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

5

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 even ?-reset strategies for different risk preferences. In each case, we define ?? as the minimum value so that ?? contains at least 50% of the probability quality of the next price distribution.

Under 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 distribution strategy is close to the optimal, while for liquidity providers who are extremely risk-averse (for example, ? = 15), the optimal solution is completely uniform distribution.

For risk-neutral agents (? = 0), they prefer the 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 larger ? and the resulting more bin intervals to diversify their liquidity to reduce the rewards they receive The difference.

1626516892091165

Figure 4: The optimal and optimal ratios of different risk preferences (? values) 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 that of the uniform allocation. At a higher level of risk aversion (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.

1626516892114395

Figure 5: The best ?-reset reset strategy using historical Ethereum price data back-testing ? = 0.5. The red line represents the width of the ? bin interval at 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.

6

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.

Total
0
Shares
Leave a Reply
Related Posts