Intro

A comprehensive guide to understanding Curve B2 - a specialized AMM, particularly well-suited for volatile token pairs. This lesson will delve into the unique features of Curve B2, comparing it to Uniswap B2 and highlighting the key differences in how they manage liquidity. You'll learn how the algorithm of Curve B2 leverages an exponential moving average to strategically concentrate liquidity around the current market price, potentially boosting your trading efficiency and earning more swap fees. The lesson will cover: * How Curve B2 differs from Uniswap B2 * The concept of concentrated liquidity * The dynamic fee structure employed by Curve B2 * The role of an exponential moving average in determining liquidity placement This detailed explanation will equip you with a thorough understanding of Curve B2's workings and its advantages for volatile token trading.

DeFi Developer

Curve Cryptoswap

1. Intro
A comprehensive guide to understanding Curve B2 - a specialized AMM, particularly well-suited for volatile token pairs. This lesson will delve into the unique features of Curve B2, comparing it to Uniswap B2 and highlighting the key differences in how they manage liquidity. You'll learn how the algorithm of Curve B2 leverages an exponential moving average to strategically concentrate liquidity around the current market price, potentially boosting your trading efficiency and earning more swap fees. The lesson will cover: * How Curve B2 differs from Uniswap B2 * The concept of concentrated liquidity * The dynamic fee structure employed by Curve B2 * The role of an exponential moving average in determining liquidity placement This detailed explanation will equip you with a thorough understanding of Curve B2's workings and its advantages for volatile token trading. Duration: 3min
2. Equation
A comprehensive guide to Vyper Smart Contract Development - Level up your career path from beginner to expert This course will teach you how to develop and deploy Vyper smart contracts. You will learn the basics of Vyper, how to use Remix IDE, and how to deploy your contracts to a testnet. You will also learn about advanced concepts such as NFTs, DeFi, and algorithmic trading. By the end of this course, you will be able to develop and deploy your own Vyper smart contracts, and you will have a solid understanding of the Vyper ecosystem. Duration: 2min
3. Graph
A comprehensive guide to building decentralized applications with Vyper, an Ethereum-based smart contract programming language. This lesson will walk you through creating a Vyper contract, deploying it to the Sepolia testnet, and testing it with Mochasin. You will learn about the essential concepts of Vyper, including how to initialize variables, define functions, and manage storage. We will also explore how to interact with your deployed contract and get your contract working in the real world. Duration: 2min
4. Python Concentrated Liquidity
A comprehensive guide to building Vyper smart contracts, a beginner-friendly guide to smart contract development - The course will teach you how to build secure, reliable Vyper smart contracts and set you on your web3 development career path! We will learn how to build your own contracts, test them and deploy them on different networks, and even how to audit them. We will also explore some of the most powerful applications of Vyper, like NFTs, DeFi, and stablecoins! Duration: 3min
5. Graph Gamma
A comprehensive guide to understanding Vyper smart contract development, this lesson focuses on the 'G' component of the Curve B2 AMM. This component acts as a "magic sauce" to concentrate liquidity. The lesson dives into the behavior of the component and its impact on the overall liquidity of Curve B2. This includes plotting the component's behavior on a 3D graph, visualizing how it behaves compared to the constant product, and understanding how the 'G' parameter affects the concentration of liquidity. Duration: 8min
6. Recap
A comprehensive guide to Curve B2's equation for concentrated liquidity - How it changes the way AMMs work. This lesson will cover the secrets behind Curve B2's concentrated liquidity by analyzing K0 and G components and their impact on liquidity distribution. Duration: 9min
7. Price Scale
A comprehensive guide to Curve V2's price scale, explaining how it's used to represent the value of tokens relative to the first token in a pool. The lesson covers concepts like transformed balance, providing an example of a pool with USDC, WBTC, and ETH to illustrate how the price scale is applied to calculate transformed balances for each token. Duration: 3min
8. Price Scale And Concentrated Liquidity
A comprehensive lesson on price scales and AMM equations in Curve V2, exploring how they enable concentrated liquidity. The lesson covers transforming token balances, the concept of D/2, and how to calculate the output amount of a swap near D/2. Duration: 9min
9. Python Price Scale And Concentrated Liquidity
A practical simulation of the Curve V2 equation using Python - this lesson shows how to use Python code to perform swaps on Curve V2 with and without the price scale, to highlight the differences. It then shows how to solve for the value of liquidity (D) in the Curve V2 equation using the `scipy.optimize.fsolve` function. The lesson concludes by comparing the results of the two swap simulations and demonstrating the impact of the price scale on the final token balance. Duration: 12min
10. Price Scale Repeg
Learn how adjusting Curve V2’s price scale recenters liquidity, enabling arbitrage and aligning pool prices with the market. Duration: 6min
11. Graph Amm Price Scale
An introduction to using Vyper for building smart contracts. The lesson covers how to write smart contracts using Vyper in Remix IDE, as well as the use of Titanoboa and Web3.py to help you run, deploy and test your smart contracts. Duration: 4min
12. Graph Cpamm Liquidity
A comprehensive course on Vyper smart contract development using Moccasin. The course covers setting up a development environment, deploying and interacting with smart contracts, using Titanoboa and Web3.py, and testing with a variety of methods. This course is designed for beginners to expert blockchain developers to understand the fundamentals of Vyper smart contract development. Duration: 1min
13. Graph Pool Value
A beginner's guide to building smart contracts with the Vyper programming language. This lesson teaches you how to: - Build Vyper contracts using the Remix IDE - Use AI to write smart contracts - Deploy contracts to the pyevm network - Deploy contracts to the eravm network - Write unit tests for your smart contracts - Write stateful fuzzers for your smart contracts - Use the Moccasin testing framework to deploy and test your smart contracts - Build your own ERC20 token - Implement a secure lottery smart contract - Build a stablecoin smart contract using Vyper <p align="right">(<a href="#table-of-contents">back to top</a>) ⬆️</p> Duration: 5min
14. Math Pool Value
An in-depth dive into the pool value equation for Curve V2 AMMs - why it uses the constant product equation and why it's evaluated at equilibrium. This lesson will help you understand the mathematical basis of Curve V2 AMMs and how they work to provide liquidity in the market. Duration: 7min
15. Repeg Loss Part 1
A comprehensive course that teaches you how to develop smart contracts using the Vyper programming language. This lesson focuses on a key aspect of Curve V2 AMMs - how they lose value when they re-peg the price scale. The lesson uses a Desmos graph to illustrate this concept and helps to understand how Curve V2 AMMs make decisions about re-pegging based on profit and loss calculations. Duration: 3min
16. Repeg Loss Part 2
A comprehensive guide to using Moccasin, a Vyper smart contract development tool, for building blockchain applications. This lesson focuses on understanding the impact of re-pegging on the liquidity of a Curve V2 AMM, a popular decentralized exchange protocol. By visualizing the AMM's curve before and after re-pegging, we can see how the liquidity pool value changes and how it can lead to losses for the AMM. Duration: 4min

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 May 15, 2025