5/5
Okay, here is the improved written lesson: ### Price Scale Exercise 1 Here is the first exercise for price scales. This exercise is located under `test > curve-v2 > exercises > CurveV2PriceScale.test.sol`. Let's scroll down and see what the exercise is. The exercise is to calculate the transformed balances. For this exercise, we will be using the Curve Tri Crypto pool with USDC, WBTC, and WETH. With that being said, the first exercise is to calculate the transformed balances. ```solidity import { Test, console2 } from "forge-std/Test.sol"; import { ITriCrypto } from "../../src/interfaces/curve/ITriCrypto.sol"; import { CURVE_TRI_CRYPTO } from "../../src/Constants.sol"; uint256 constant PRECISIONS = 1e18; /* forge test \ --evm-version cancun \ --fork-url $FORK_URL \ --match-path test/curve-v2/exercises/CurveV2PriceScale.test.sol -vvv */ contract CurveV2PriceScaleTest is Test { ITriCrypto private constant pool = ITriCrypto(CURVE_TRI_CRYPTO); // Exercise 1 // Calculate transformed balances function test_calc_transformed_bals() public { uint256[3] memory xp = [uint256(0), uint256(0), uint256(0)]; uint256[3] memory precisions = pool.precisions(); // Write your code here console2.log("xp[0] = %e", xp[0]); console2.log("xp[1] = %e", xp[1]); console2.log("xp[2] = %e", xp[2]); assertGt(xp[0] / PRECISIONS, 0); assertGt(xp[1] / PRECISIONS, 0); assertGt(xp[2] / PRECISIONS, 0); } } ```
Okay, here is the improved written lesson:
Here is the first exercise for price scales. This exercise is located under test > curve-v2 > exercises > CurveV2PriceScale.test.sol.
Let's scroll down and see what the exercise is.
The exercise is to calculate the transformed balances. For this exercise, we will be using the Curve Tri Crypto pool with USDC, WBTC, and WETH.
With that being said, the first exercise is to calculate the transformed balances.
A comprehensive Vyper smart contract development course to help you kickstart your blockchain developer career. This course covers the fundamentals of Vyper, including its syntax, data structures, and functions. You will learn how to write, test, and deploy Vyper contracts. You'll also explore popular Vyper tools such as Remix, Web3.py, Titanoboa, and Moccasin. The course takes you through the entire process of deploying Vyper contracts to different testnets, such as Sepolia and ZKsync. This is a must-have course for anyone interested in becoming a Vyper smart contract developer!
Previous lesson
Previous
Next lesson
Next
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 January 13, 2026
Duration: 5min
Duration: 1h 21min
Duration: 28min
Duration: 26min
Duration: 15min
Duration: 25min
Duration: 1h
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 January 13, 2026