1/5
Let's go over an example of the amount of USDC that a user will receive for burning S shares. We'll assume that the total share is equal to 1,100 and the amount of share that we are burning is 100. This will reduce the total shares to 1,000, a decrease of 9%. We need to reflect this 9% share decrease in the amount of tokens in the pool. Before burning the shares, the pool had 1,210 USDC. After the decrease, the pool will have 1,100 USDC. The difference between these two values, 110 USDC, will be sent to the user. We can calculate this difference using the following formula: ``` L0 - L1 = S / T * L0 ``` Where: * L0 is the value of the pool before the shares are burnt * L1 is the value of the pool after the shares are burnt * S is the number of shares that are burnt * T is the total number of shares In our example: * L0 = 1,210 * S = 100 * T = 1,100 Therefore: ``` L0 - L1 = 100 / 1100 * 1210 = 110 ``` This confirms that the user will receive 110 USDC. [Diagram showing the pool before and after burning the shares]
A simple explanation of how the amount of USDC is calculated when burning shares in a liquidity pool - This lesson covers the ratio of share to total share in a liquidity pool and how that ratio is applied to calculate the USDC reward to the user for burning shares. The lesson provides a numerical example to illustrate this process.
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