1/5
We’ve derived the equation for how much liquidity we should receive when removing liquidity. Let’s recap that equation. ``` L0 - L1 / L0 = dx / x0 = dy / y0 ``` This equation tells us that when we decrease the liquidity from L0 to L1, then we will have to remove dx amount of token x and dy amount of token y. So, we’ve derived this equation for how much liquidity we should receive when removing liquidity. Now, let’s talk about how that equation interacts with how we actually define the pool value. Let me write that down. **True for all 3 functions to measure pool value F(x, y) -> L** ``` F(x, y) = √xy ``` or ``` F(x, y) = 2x ``` or ``` F(x, y) = 2y ``` This equation is true whether we define the pool value function f(x, y) to be equal to the square root of x * y, or set it equal to 2x, or set it equal to 2y. Now, when we set the pool value function to 2x and 2y, this equation is straightforward. So, I’ll leave that as an exercise for you if you’re curious. In the next video, we’ll go over the case when we define the pool value function f(x, y) to be equal to the square root of x * y. And then, we’ll derive this equation. We’ll see how this derivation can be used to provide a conceptual understanding of the equation that we derived for removing liquidity.
A detailed explanation on the relationship between liquidity and pool value. This video shows how liquidity is defined and how to interpret the relationship between the change in liquidity and change in pool value.
Previous lesson
Previous
Next lesson
Next
Give us feedback
Course Overview
About the course
How to use Uniswap v2 dex and contracts
Interacting with the Uniswap v2 router and factory
How to create Uniswap v2 liquidity pools
How to add liquidity to Uniswap v2 pools
Swaps, flash swaps, flash swap arbitrage, and time-weighted average price (TWAP)
Security researcher
$49,999 - $120,000 (avg. salary)
Smart Contract Auditor
$100,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 October 9, 2024
Solidity Developer
Uniswap V2Duration: 14min
Duration: 1h 20min
Duration: 10min
Duration: 54min
Duration: 25min
Duration: 26min
Duration: 1h 03min
Duration: 59min
Course Overview
About the course
How to use Uniswap v2 dex and contracts
Interacting with the Uniswap v2 router and factory
How to create Uniswap v2 liquidity pools
How to add liquidity to Uniswap v2 pools
Swaps, flash swaps, flash swap arbitrage, and time-weighted average price (TWAP)
Security researcher
$49,999 - $120,000 (avg. salary)
Smart Contract Auditor
$100,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 October 9, 2024
Testimonials
Read what our students have to say about this course.
Chainlink
Chainlink
Gustavo Gonzalez
Solutions Engineer at OpenZeppelin
Francesco Andreoli
Lead Devrel at Metamask
Albert Hu
DeForm Founding Engineer
Radek
Senior Developer Advocate at Ceramic
Boidushya
WalletConnect
Idris
Developer Relations Engineer at Axelar