The core of Uniswap V3 is to provide liquidity through intervals (Concentrated Liquidity), where liquidity providers add liquidity to a range that has the potential for price fluctuations to improve capital utilization.
TWAMM automated market makers as a new type of AMM protocol can also use Concentrated Liquidity.
Capital Utilization
Let's look at the utilization rate of Uniswap V2 using non-concentrated liquidity.
The above graph shows the volume change curve of $x-y$ in the pool. The current price in the pool is at $c$ and is assumed to fluctuate between $a$ price point and $b$ price point. Sliding from point $c$ to point $a$ consumes the maximum $y_{real}$ and sliding from point $c$ to point $b$ consumes the maximum $x_{real}$. That is, the current price $c$ point, oscillating between $a$ and $b$ points, consumes only $x_{real}$ and $y_{real}$ at maximum. Theoretically it is enough to provide $x_{real}$ and $y_{real}$. And in fact, as shown above, at the price $c$ point, $x$ and $y$ are provided greater than $x_{real}$ and $y_{real}$, respectively. It is obvious that the funds $x-x_{real}$ and $y-y_{real}$ are never used in this case, which is also called idle funds. In this case, the capital utilization rate is $\dfrac{x_{real}}{x}$ or $\dfrac{y_{real}}{y}$. If the price fluctuation is very small, the capital utilization is very low.
How to add liquidity in a certain price interval and provide Swap function is the focus point of Uniswap V3, which needs to start with the virtual Reserves.
Showen Peng changed 3 years agoView mode Like Bookmark
Definition
Assume that TWAMM requires $N$ blocks to execute a large virtual transaction, and that the pool selling $X$ sells at a rate of $x_{rate}$ per block, while the pool selling $Y$ sells at a rate of $y_{rate}$ per block. Thus, the total amount of $X$ sold during the whole period is $x_{in}=Nx_{rate}$ and the total amount of $Y$ sold is $y_{in}=Ny_{rate}$.
Also, we note the initial reserves $x_{reserve}$ and $y_{reserve}$ for this time period in embeded AMM as $x_{0}=x_{ammStart}$ and $y_{0}=y_{ammStart}$, respectively.
According to the design of TWAMM, large orders are traded with blocks, each block sells $x_{rate}$ to get $y_{out}$, or sells $y_{rate}$ to get $x_{out}$, while AMM updates the values of $x_{reserve}$ and $y_{reserve}$, the whole process $N$ transactions in total.
It is worth noting that each block transaction of AMM always follows a constant product market making.
Formula
Showen Peng changed 3 years agoView mode Like 3 Bookmark