# Zou Chuanwei: In-depth analysis of AMM’s conditional liquidity logic and potential impact

Uniswap v3 adds a granularity control function on the basis of the constant product curve x*y=k (“Research on Uniswap v3” (No. 33, 2021)). Liquidity providers (LP) can choose to concentrate funds in the most frequently traded interval to achieve centralized liquidity and improve capital utilization. Uniswap v3 creates ERC-721 contracts for the positions of liquidity providers.

I call this practice of Uniswap v3 Conditional Liquidity, which is liquidity that exists only under certain conditions. Conditional liquidity does not exist in the traditional financial field. So, why can AMM support conditional liquidity? What is the impact of conditional liquidity on AMM and even the general DeFi field? The study of these two issues will help us deeply understand the nature of AMM and liquidity.

### The internal logic of AMM

“The General Theory of AMM” (No. 31, 2021) studies the general form of AMM. Like this article, this article only studies AMM for two types of encrypted assets, called X and Y respectively, and uses encrypted asset X as the accounting unit, that is, all prices and market value units are encrypted asset X.

The state of AMM is reflected in the number of two encrypted assets in the liquidity pool, which is assumed to be (x, y) at a certain moment. Under the general form of AMM, no matter how the two encrypted assets are traded (without considering the impact of transaction fees, the same below), the liquidity pool always satisfies

Where f is a monotonically decreasing convex function with respect to x.

Suppose that an investor exchanges an encrypted asset X with a quantity of △x to AMM for an encrypted asset Y with a quantity of △y. After the transaction is completed, the state of the liquidity pool becomes (x+△x, y-△y) and is satisfied. This is equivalent to

When the liquidity pool state is (x, y), the instantaneous price of a unit of encrypted asset is

The above (1)-(3) are the three most basic relationships to understand AMM from the perspective of liquidity pool status. AMM can also be understood from two other perspectives, and both can give new insights into the internal logic of AMM.

First, from the perspective of investors. Investors can regard AMM as a “black box”, and they are mainly concerned about how much they can exchange when the number of encrypted assets X of △x is exchanged for encrypted assets Y from AMM. If two AMMs can always provide the same number of encrypted assets Y for the same number of encrypted assets X, then from the perspective of investors, the two AMMs are equivalent to each other.

Figure 1: Uniswap v3’s liquidity pool

Second, from the perspective of liquidity providers. Liquidity providers are concerned about how much liquidity needs to be provided to support AMM activities at a certain price level. It can be seen from (1) and (3) that the liquidity pool can be expressed as a function of the instantaneous price p(x):

However, the optimal use of liquidity also has a cost, which is mainly reflected in the fact that Uniswap v3 cannot be separated from a specific range. But only within the range, investors’ feelings are consistent. In addition to the instantaneous price and the average price, another important indicator for investors is the impact of the transaction on the instantaneous price, which is the slippage function defined as follows:

It can be proved that for Uniswap v3, the slippage function is equal to

### The meaning of conditional liquidity for AMM and DeFi

AMM’s support for conditional liquidity comes from two aspects.

First, the price of encrypted assets changes continuously. In any time period, transactions will only occur in a partial price range. Liquidity providers only need to provide liquidity in this range to support AMM operation. If AMM uses global liquidity, “dead inventory” will inevitably form in any price range, reducing the efficiency of liquidity use. Uniswap v3 reduces the burden on liquidity providers by removing “dead inventory”, but provides investors with the same trading functions in a local price range, so it is a Pareto improvement.

Second, the application of smart contracts allows liquidity providers to provide liquidity in a differentiated manner according to possible future situations. If the liquidity provider is sufficiently rational, then the distribution of liquidity in different price ranges will effectively reflect the market’s expectations of the price trend. In those price ranges with higher probability, more liquidity will be gathered. According to (10), this will reduce the slippage function (k becomes larger, s is lower), thereby bringing a better trading experience for investors. Liquidity providers who choose these price ranges will share more transaction fees. In those price ranges that are less likely, liquidity providers are equivalent to providing investors with a tail insurance. In this way, the market mechanism drives the supply of liquidity and can maximize the efficiency of liquidity allocation. Of course, this process is also accompanied by a complex game between liquidity providers.

Similar logic holds true for other DeFi fields. The DeFi project uses over-collateralization to manage credit risk in a decentralized and trustless environment, converts credit risk into liquidity risk caused by over-locking collateral, and dynamically monitors the adequacy of collateral based on changes in the price of encrypted assets degree. However, the excess collateral is mainly aimed at the situation where the price of encrypted assets has fallen sharply. When the price of encrypted assets rises, the credit risk is not high. Therefore, it can be considered to introduce conditional collateral through smart contracts in DeFi projects that use over-collateralization. For example, only when the price of an encrypted asset drops to a certain level, it can be used as collateral, and it can be used freely at other times. This can improve the efficiency of the use of collateral. Conditional collateral is essentially equivalent to providing tail insurance in the event of a sharp drop in the price of encrypted assets.

In summary, in the DeFi field, smart contracts can be used to allow the same encrypted asset to play different roles in different situations in the future. For example, an ETH holder can promise to provide AMM with liquidity in a certain price range, and at the same time promise to provide collateral for a decentralized lending platform when the price of ETH drops to a certain level. Only these two scenarios will not happen at the same time, this kind of “one thing with two uses” approach is established. In essence, this is the application of Arrow-Debreu Securities’ ideas in the DeFi field, which will bring new innovation space to DeFi.

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)
Previous 2021-07-19 08:30
Next 2021-07-19 08:32

2021-05-19

2021-05-07

2021-06-03

2021-07-23

2021-10-07

2021-08-05