1/5
## Remove Liquidity: Contract Call We will look at the first variation of removing liquidity. To do this, we will call the function `remove_liquidity`. This function will burn the liquidity provider's LP shares. The pool will then send back all of the tokens that are in the pool. The amounts will be proportional to the amount of LP tokens that were burnt. These tokens will be sent back to the liquidity provider. For example, let's say we have a user who calls `remove_liquidity` on the StableSwap 3Pool contract. This contract contains three tokens: * DAI * USDC * USDT The user will specify the amount of LP shares that they want to burn. The StableSwap contract will then calculate the amount of each of these tokens: * DAI * USDC * USDT that the user is entitled to. It will then burn the shares and send the tokens back to the user.
A practical guide to removing liquidity from a StableSwap 3 pool. This lesson explains the process of withdrawing liquidity from a pool by calling the 'remove_liquidity' function and demonstrates how the contract calculates the amount of tokens returned to the user in proportion to the burned LP shares.
Previous lesson
Previous
Next lesson
Next
Give us feedback
Course Overview
About the course
AMM math for Curve Stableswap
How to calculate swap amount and liquidity
Curve Stableswap contracts
How to implement a swap function
How to implement the add and remove liquidity functions
How to quantify liquidity pools
How to control the flatness of the curve
Smart Contract Engineer
$100,000 - $150,000 (avg. salary)
Blockchain Financial Analyst
$100,000 - $150,000 (avg. salary)
Smart Contract Auditor
$100,000 - $200,000 (avg. salary)
Last updated on November 27, 2024
Solidity Developer
Curve StableswapDuration: 14min
Duration: 32min
Duration: 26min
Duration: 23min
Duration: 20min
Duration: 23min
Course Overview
About the course
AMM math for Curve Stableswap
How to calculate swap amount and liquidity
Curve Stableswap contracts
How to implement a swap function
How to implement the add and remove liquidity functions
How to quantify liquidity pools
How to control the flatness of the curve
Smart Contract Engineer
$100,000 - $150,000 (avg. salary)
Blockchain Financial Analyst
$100,000 - $150,000 (avg. salary)
Smart Contract Auditor
$100,000 - $200,000 (avg. salary)
Last updated on November 27, 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