0/5
# Uniswap V2 and V3 Liquidity Curves In this lesson we will review the differences between the liquidity curves of Uniswap V2 and V3. In Uniswap V2, we use a constant product curve. The curve can be expressed as x * y = L^2. In this equation, x and y represent the amounts of two tokens, and L is a constant representing the liquidity. Higher liquidity in the pool is desired because it results in less price impact for swaps. On a graph, if liquidity increases, the curve shifts towards the top right, and flattens out. If we make a swap on an AMM with high liquidity, we can swap a lot of tokens before the price changes. If liquidity is low, even a small swap will move the price considerably. For example, in an AMM with low liquidity, a swap of 1 DAI for USDC might yield only 0.9 USDC, which is a poor result. Therefore, higher liquidity makes AMMs more appealing to traders because there is less price impact. Let's imagine a situation where we have a constant product AMM with token amounts set to 100 for both x and y, and the current price is labeled P. Now, what if we only want to provide liquidity for a certain price range such as Pa and Pb. For instance, in a DAI/USDC pool, this range might be between 0.99 and 1.01. With Uniswap V2, if we were to swap tokens so that the price remained in this price range, we could swap a small amount of token x and a small amount of token y. What if we wanted to utilize all our 100 token x and 100 token y and still remain in this price range? This is where Uniswap V3 comes in. It allows us to concentrate liquidity between the price ranges of Pa and Pb. This means that all our token x would be used between P and the upper bound price Pb, and all our token y would be used between P and the lower bound price Pa. To show how powerful this is, we can compare what would happen if we tried to create the same curve on Uniswap V2. We would need roughly 254 token x and 254 token y. If we decrease the price ranges of Pa and Pb, the liquidity increases, which means less price impact. If we increase the price ranges, liquidity will decrease. If we continue increasing the price ranges, the concentrated curve will converge into the curve of Uniswap V2. If we provide liquidity for the price range from 0 to infinity, we would get the same curve as Uniswap V2. So let's consider our DAI/USDC pool and set the price range from 0.99 to 1.01. We will zoom out and see what the concentrated liquidity curve looks like. We will see that our original Uniswap V2 curve is still present, but our concentrated liquidity curve now uses the same 100 token x and y between 0.99 and 1.01. If we tried to create this curve on Uniswap V2, we would require approximately 20,051 of token x and y. However, in Uniswap V3, we only require the 100 token x and y to get the same liquidity curve within the specified price ranges.
A detailed look at concentrated liquidity on Uniswap. The lesson covers how concentrated liquidity allows liquidity providers to utilize a specific amount of capital in a price range, instead of a large amount across the entire price range. The lesson demonstrates how liquidity, as it relates to price impact, changes on Uniswap v2 and Uniswap v3.
Previous lesson
Previous
Next lesson
Next
Give us feedback
Course Overview
About the course
Concentrated liquidity and derive its equations
Uniswap V3 math
How to calculate the spot price of tokens
Single and multi position swapping
Factory contract architecture
How to calculate liquidity requirements
Uniswap V3 fee algorithm
Flash loans
TWAP price oracle
Smart Contract Auditor
$100,000 - $200,000 (avg. salary)
Blockchain Financial Analyst
$100,000 - $150,000 (avg. salary)
DeFi Developer
$75,000 - $200,000 (avg. salary)
Smart Contract Engineer
$100,000 - $150,000 (avg. salary)
Web3 developer
$60,000 - $150,000 (avg. salary)
Web3 Developer Relations
$85,000 - $125,000 (avg. salary)
Last updated on May 15, 2025
DeFi Developer
Uniswap V3Duration: 3min
Duration: 35min
Duration: 25min
Duration: 22min
Duration: 1h 43min
Duration: 11min
Duration: 1h 03min
Duration: 12min
Duration: 51min
Duration: 41min
Duration: 10min
Duration: 7min
Course Overview
About the course
Concentrated liquidity and derive its equations
Uniswap V3 math
How to calculate the spot price of tokens
Single and multi position swapping
Factory contract architecture
How to calculate liquidity requirements
Uniswap V3 fee algorithm
Flash loans
TWAP price oracle
Smart Contract Auditor
$100,000 - $200,000 (avg. salary)
Blockchain Financial Analyst
$100,000 - $150,000 (avg. salary)
DeFi Developer
$75,000 - $200,000 (avg. salary)
Smart Contract Engineer
$100,000 - $150,000 (avg. salary)
Web3 developer
$60,000 - $150,000 (avg. salary)
Web3 Developer Relations
$85,000 - $125,000 (avg. salary)
Last updated on May 15, 2025