Risk Warning: Beware of illegal fundraising in the name of 'virtual currency' and 'blockchain'. — Five departments including the Banking and Insurance Regulatory Commission
Information
Discover
Search
Login
简中
繁中
English
日本語
한국어
ภาษาไทย
Tiếng Việt
BTC
ETH
HTX
SOL
BNB
View Market
Analyze how Uniswap V3 can better improve capital utilization
QuarkChain夸克链
特邀专栏作者
2021-09-09 06:54
This article is about 2644 words, reading the full article takes about 4 minutes
Dr. Zhou first started from the Uniswap capital utilization formula, analyzed the method adopted by Uniswap to improve the capital utilization rate of a single transaction pair, and then designed more (greater than or equal to three) currencies to build

Introduction

Introduction

This article is a set of principle design for the project that Dr. Zhou, founder and CEO of QuarkChain, serves as a consultant to increase the funding rate. The purpose is to share DeFi design ideas and communicate with more DeFi enthusiasts. Dr. Zhou (qizhou@quarkchain.org) first started from the Uniswap fund utilization formula, and analyzed the method adopted by Uniswap to improve the capital utilization rate of a single transaction. Then, on this basis, more (greater than or equal to three) currencies are designed to build a liquidity original scheme for a collective fund pool, and the advantages that this method can bring, such as higher capital utilization and lower Gas and higher LP returns. Welcome to communicate with Dr. Zhou about the model design of this article.

A Brief Review of Uniswap V2

Uniswap V2 is the most popular and successful DEX. In the form of trading pairs, paired assets are priced and exchanged through curves. The principle is as follows:

where x and y are the balances of assets in the pool. Given Δx, in order to exchange Δx for Δy, Uniswap V2 will perform the following calculation

In this way, the xy = k invariant is still satisfied after conversion, and the price is

A great feature of Uniswap V2 is that it is permissionless - anyone can create a trading pair of two assets by providing tokens. For example, by providing x = 1 ETH and y = 3000 USDT in the pool, an LP can create a trading pair with ETH initially priced at 3000 USDT/ETH.

Despite Uniswap V2's widespread adoption, the key issue with Uniswap V2 is its capital inefficiency, as liquidity is distributed across prices [0, +∞]. This means that if the prices of two assets are concentrated in a relatively small range (such as stable currency exchange), most of the assets deposited in the pool will not participate in the exchange, resulting in high slippage and lower fee income for LP.

Uniswap V3 that centralizes liquidity

Uniswap V3 improves capital inefficiency through a technique called pooled liquidity, which uses the following curve:The actual price of the exchange is in the range of [p_a, p_b], p_a

< p_b. V2 is essentially a special case of V3 if we set p_a = 0 and p_b = +∞.

When providing liquidity, Uniswap V3 will ask LP for the price range of liquidity (see the figure below).

This allows LPs to pool liquidity within a target price range, resulting in greater capital efficiency.

Due to the concentration of liquidity, the TVL of Uniswap V3 grew very smoothly, reaching 2.5B in about 3 months.

secondary title

Concentrate multi-asset liquidity

Uniswap V3 only provides centralized liquidity for a pair of assets. A natural question then is:

"What if multiple assets are pooled together in one pool?"

By pooling the liquidity of more assets, we can achieve greater capital efficiency because assets can share liquidity in a pool rather than individual liquidity. In V3, by contrast, due to the illiquidity of direct swaps, swaps may be routed to multiple trading pairs. For example, swapping TUSD -> BUSD may be routed to TUSD -> USDT -> BUSD, which means traders will pay more fees and the slippage will increase accordingly.

So the core question is

"What should the curve of multi-asset liquidity concentration look like?"

Unfortunately, the answer is not simple, but more complex.

Let's start with the stablecoin exchanges that would benefit the most from pooling liquidity. Assuming that the prices of two stablecoins are between [p, 1/p] (eg, p = 0.999), we can simplify the V3 curve as

where [p, 1/p] = [p_a, p_b]. The nice thing about simplifying the curve is that it's somewhat symmetrical. First, let's add a third stablecoin trading pair to get the following equation

Note that the equation for three assets has some slight changes compared to the equation for two assets:

● The right side of the equal sign is L³ not L²

● On the left side of the equals sign we use the cube root of p instead of the square root of p.

Proposition 1. Given any number of assets in the pool, {x,y,z}, the price of exchanging any two tokens through the above curve will be in the range of [p,1/p]

Example:

Example:

The case where the three currencies are evenly distributed

● x, y, z = [1000,000e6, 1000,000e6, 1000,● 3 stablecoins, rounded to 6 decimal places

000e6], that is, each asset has 1M in the pool

● p = 0.999, that is, the price range is [0.999, 1.001]

L = x / (1 — ∛0.999) = 2998.99977x

Since the three terms are equal, we have:

Note that we are about 2000 times more money efficient compared to the xy = k curve (where L = x).

Swapping Token 1 (T1) for 10,000e6 (say $10k) of Token 0 (T0) will return 9999.96e6 T1 @ 0.999996 T0/T1. As a comparison, the xy=k curve would return 9375e6 T1 @ 0.9375 T0/T1, which has much higher slippage.

extremely unbalanced situation

● x, y, z = [0, 0, 1000,● 3 stable coins, still take 6 decimal places

000e6], that is, each asset has 1M in the pool

● p = 0.999, that is, the price range is [0.999, 1.001]

Following the curve, we can solve for L = 999.333z. So swapping 10,000e6 T0 for T2 will return 10009.90e6 T2 @ 1.00099 T0/T2, which is almost the same as the limit price (1/0.999).

current status

current status

We are preparing to deploy a new stablecoin swap algorithm using Solidity, which is expected to have the following characteristics:

● High-precision fixed-point solution

● n = 3 assets (can be expanded to more)

● Adjustable price range [p, 1/p]

● Uniswap V2 style interface (mining/burning/exchanging)

Once the implementation of the algorithm is well validated, we will use it as a release candidate for the next Smoothy.finance (SMTY) - the next generation same-asset stablecoin exchange protocol project that I am an advisor to.

future development

future development

In the area of ​​centralized liquidity for pooled assets, several interesting topics can be developed further:

● More assets {x_0, x_1,...,x_n}, the curve looks like

● Different price ranges for different assets, where the equation might look like

conclusion

conclusion

The liquidity of collective assets is one of the hottest topics in DEX because of its benefits:

● Greater capital efficiency

● Reduced slippage

● More LP income

Uniswap V3 is the first DEX to provide centralized liquidity for paired assets. For stable currency exchange, capital efficiency can be increased to 2000 times.

We also designed a liquidity pool that can pool more than three assets:

● Share liquidity among multiple assets

● Very suitable for stablecoin exchange

● Can become a competitive product in the same asset stablecoin swap market (vs. Curve)

Uniswap
Welcome to Join Odaily Official Community
AI Summary
Back to Top
Dr. Zhou first started from the Uniswap capital utilization formula, analyzed the method adopted by Uniswap to improve the capital utilization rate of a single transaction pair, and then designed more (greater than or equal to three) currencies to build
Author Library
Download Odaily App
Let Some People Understand Web3.0 First
IOS
Android