Newton's Method

A technical overview of Curve Stableswap's implementation of Newton's method - The lesson explores the mathematical concept behind Newton's method and how Curve Stableswap leverages it to solve for liquidity and token outputs during a swap.

1. Graph of Curve Stableswap AMM
A comprehensive guide to Uniswap v2's AMM curve and its derivation - The lesson explains the Uniswap v2 AMM curve by combining the constant product and constant sum curves. It further explains the role of the ‘A’ parameter and how it impacts the curve’s behavior. Duration: 7min
2. Graph Of xy/(D/2)^2
A fascinating exploration of how the function xy / (d/2)^2 behaves in 3D space, using the concepts of constant sum and constant product. The lesson demonstrates the graphical representation of this function in 3D and analyzes how it changes across the points of the constant sum and constant product curves. Duration: 3min
3. AMM Math
A detailed breakdown of Curve Stableswap's equation - This video lesson delves into the mathematical formula behind Curve Stableswap, explaining the constant sum and constant product aspects. It then demonstrates how to derive an alternate form of the equation from the initial form. Duration: 4min
4. Newton's Method
A technical overview of Curve Stableswap's implementation of Newton's method - The lesson explores the mathematical concept behind Newton's method and how Curve Stableswap leverages it to solve for liquidity and token outputs during a swap. Duration: 5min
5. Newton's Method in Python
A practical guide to implementing Newton’s Method in Python. The lesson demonstrates how to use Newton’s Method to find the roots of a function in Python, and also how to calculate the values of a curve’s equation. Duration: 12min
6. Sympy
A practical Python lesson on calculating partial derivatives with the SymPy library. The lesson covers defining a function, calculating partial derivatives using the diff function, and utilizing the results in a Newton's method algorithm. Duration: 1min

Course Overview

About the course

What you'll learn

AMM math for Curve Stableswap

How to calculate swap amount and liquidity

Curve Stableswap contracts

How to implement a swap function

How to implement the add and remove liquidity functions

How to quantify liquidity pools

How to control the flatness of the curve

Course Description

Who is this course for?

  • Software Engineers
  • Financial Analysts
  • Web3 Developers
  • Smart Contract Security Researchers

Potential Careers

Smart Contract Engineer

$100,000 - $150,000 (avg. salary)

Blockchain Financial Analyst

$100,000 - $150,000 (avg. salary)

Smart Contract Auditor

$100,000 - $200,000 (avg. salary)

Meet your instructors

Tasuku Nakamura

Tasuku Nakamura

Founder at smartcontract.engineer

Smart contract engineer and educator.

Last updated on August 11, 2025