1/5
## Introduction to Pool Value In this lesson, we're going to explore how to measure the value of a constant product AMM pool. We'll define a function *f* that takes the amount of tokens in the pool as input and outputs the value of the pool. This function is simply the square root of the product of the two tokens. ``` f(x, y) = √xy ``` This function is motivated by the constant product equation, which states that the product of the two tokens in the pool is always a constant. We can see this in the following equation: ``` xy = L² ``` Where *x* and *y* are the amounts of the two tokens, and *L* is the liquidity. We can take the square root of both sides of the equation to get: ``` √xy = L ``` This equation tells us that the value of the pool is equal to the square root of the product of the two tokens. We can use this function to measure the change in the value of the pool as liquidity is added. We can calculate this change using the following formula: ``` L₁ - L₀ / L₀ = f(x₀ + dx, y₀ + dy) - f(x₀, y₀) / f(x₀, y₀) ``` Where *L*1 is the liquidity after adding liquidity, *L*0 is the liquidity before adding liquidity, *x*0 is the amount of the first token before adding liquidity, *y*0 is the amount of the second token before adding liquidity, *dx* is the amount of the first token added, and *dy* is the amount of the second token added. In the next lesson, we'll look at how to simplify this formula.
A technical explanation of the formula used to calculate pool value. The lesson covers the derivation of the pool value formula using the square root of the product of the pool's token quantities, demonstrating its application in a real-world scenario.
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