1/5
### Creating a graph of a curve�s equation On the right of the display, we can see a graph consisting of the constant sum, constant product, and curve v1 equations. In this lesson, we'll explore what the graph of the curve v2�s equation looks like. To start, we'll first copy the equation of curve v1, then paste it in the curve v2 equation input. ``` AK0D(x + y) + xy = AK0D^2 + (D / 2)^2{x >= 0}{y >= 0} ``` Next, we'll modify the K0 parameter. Curve v2 introduces a new component called K, which extends K0. We'll change K0 to K. Next, we need to make the change in the equation as well. We'll replace the K0 with K here ``` AKD(x + y) + xy = AKD^2 + (D / 2)^2{x >= 0} ``` and here. ``` AKD(x + y) + xy = AKD^2 + (D / 2)^2{x >= 0} ``` Now, ``` K = K0() ``` We need to multiply by an expression that involves gamma. ``` K = K0(g / g + 1 - K0)^2 ``` Now we must define what the parameter gamma is. ``` g = 1 ``` Gamma will be a number between 0 and 1. In the real world, gamma is a small number, so we'll adjust the slider to reflect this. So this is what the curve v2's equation looks like compared to curve v1. The graph of curve v2 looks more like the constant product curve than the graph of curve v1's equation. Looking at the graph, it is not obvious how concentrated liquidity is enabled. Another question is, how does this graph handle volatile tokens? In the next lesson, we'll answer this question, and how this graph enables concentrated liquidity. Later on in another video, we�ll talk about price scales, which enable curve v2 to support volatile tokens.
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.
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