0/5
### Remove Liquidity Overview Let�s look at how a liquidity provider can remove liquidity from a Curve V2 AMM. A liquidity provider can remove liquidity by calling the function `remove_liquidity`. To remove liquidity, the user will call `remove_liquidity`, specifying the amount of LP shares that they want to return back to the pool. This LP share is an ERC20 token. The pool contract will then burn these LP shares. The contract will calculate the amount of USDC, WBTC, and ETH to send back to the user, and then transfer it to the user. The user also has an option to withdraw in WETH, instead of ETH. If they chose to do so, after the LP share is sent back to the pool contract, the pool contract will convert the ETH that would have been sent back to the user into WETH. This is done by calling the function `deposit` on the WETH contract. The WETH contract will receive this ETH and then turn it into WETH. Instead of ETH, WETH will be sent back to the user.
A comprehensive guide to building a Vyper smart contract lottery. The lesson covers how to use the Moccasin framework, write tests, and deploy the lottery contract to a local network. The lesson also discusses the importance of using Chainlink VRF for secure on-chain randomness.
Previous lesson
Previous
Next lesson
Next
Give us feedback
Course Overview
About the course
AMM math for Curve Cryptoswap
How liquidity is concentrated
Price-repegging
How function calls interact with the AMM
Curve Cryptoswap state variables
How the function exchange works
How to swap tokens
How to add and remove liquidity
Math for Curve Cryptoswap’s internal price oracle
Implicit differentiation
Smart Contract Auditor
$100,000 - $200,000 (avg. salary)
Blockchain Financial Analyst
$100,000 - $150,000 (avg. salary)
DeFi Developer
$75,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 May 15, 2025
DeFi Developer
Curve CryptoswapDuration: 4min
Duration: 1h 21min
Duration: 28min
Duration: 26min
Duration: 14min
Duration: 24min
Duration: 59min
Duration: 5min
Course Overview
About the course
AMM math for Curve Cryptoswap
How liquidity is concentrated
Price-repegging
How function calls interact with the AMM
Curve Cryptoswap state variables
How the function exchange works
How to swap tokens
How to add and remove liquidity
Math for Curve Cryptoswap’s internal price oracle
Implicit differentiation
Smart Contract Auditor
$100,000 - $200,000 (avg. salary)
Blockchain Financial Analyst
$100,000 - $150,000 (avg. salary)
DeFi Developer
$75,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 May 15, 2025