1/5
## Remove Liquidity One Coin Another common way to remove liquidity is to call the function `remove_liquidity_one_coin`. This function will burn the LP shares of the user and then send back a single token specified by the user. For example, on the StableSwap3Pool contract, a user could call `remove_liquidity_one_coin` and specify an amount of LP shares to burn. The user could then specify a single token they want all of their liquidity withdrawn in. Let's say for example, they want all of their liquidity withdrawn in DAI. The StableSwap contract will calculate the amount of DAI to send back to the user, and then transfer this DAI over to the user. The difference between this function and the function `remove_liquidity` is that `remove_liquidity` will send back all three tokens to the user, whereas `remove_liquidity_one_coin` will send back just the single token specified by the user.
A technical guide to removing liquidity from a StableSwap3Pool. The lesson covers the differences between `removeLiquidity` and `removeLiquidityOneCoin` functions, including burning LP shares, receiving a single token, and the calculation of the amount of the specific token received by the user.
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