Add Liquidity Overview

A comprehensive guide to adding liquidity to Curve's B2AMM. The lesson explains how liquidity providers can deposit tokens into the Curve B2AMM pool, and how they can claim swap fees collected from traders. Additionally, the lesson explains the concept of liquidity in different AMMs, including the formula used to calculate liquidity in a constant product AMM. The lesson then explains how a user can add liquidity using WETH and how the pool contract will handle the transfer of WETH between the user and the pool contract.

1. Add Liquidity Overview
A comprehensive guide to adding liquidity to Curve's B2AMM. The lesson explains how liquidity providers can deposit tokens into the Curve B2AMM pool, and how they can claim swap fees collected from traders. Additionally, the lesson explains the concept of liquidity in different AMMs, including the formula used to calculate liquidity in a constant product AMM. The lesson then explains how a user can add liquidity using WETH and how the pool contract will handle the transfer of WETH between the user and the pool contract. Duration: 2min
2. Code Outline Add Liquidity
A comprehensive guide to adding liquidity to a Uniswap V3 pool using Vyper. This lesson covers how to use the `add_liquidity` function to provide liquidity to a pool, how to calculate the amount of liquidity tokens to be minted, and how to handle imbalance fees. Duration: 2min
3. Code Walkthrough Add Liquidity
A comprehensive guide to Vyper smart contract development using Moccasin - This lesson covers the fundamental concepts of Vyper, including creating functions, deploying contracts, interacting with contracts, and testing. It also walks you through the use of Moccasin, an open-source tool for building and deploying Vyper smart contracts. Duration: 5min
5. Exercise Add Liquidity
A comprehensive introduction to adding liquidity to a Curve pool. The lesson explains how to set up a contract with 1,000 USDC to approve the pool contract to spend the funds. It then guides users through the process of adding liquidity to the pool contract and explains how to write code to complete the task. Duration: 1min
6. Solution Add Liquidity
A comprehensive guide to adding liquidity to the I-TryCrypto pool on Curve using Vyper, an Ethereum smart contract language. The lesson covers the basics of deploying smart contracts with Moccasin, a framework that simplifies the process of interacting with Vyper and Ethereum, along with testing the contract using Foundry. Duration: 2min

Course Overview

About the course

What you'll learn

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

Course Description

Who is this course for?

  • Software Engineers
  • Web3 Developers
  • Finance Developers
  • AI Developers
  • Smart Contract Security Researchers

Potential Careers

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)

Meet your instructors

Tasuku Nakamura

Tasuku Nakamura

Founder at smartcontract.engineer

Smart contract engineer and educator.

Last updated on July 2, 2025