- Check prerequisites
- Install tools
- Watch videos on Cyfrin Updraft
- Do exercises under topics
- Ask questions on GitHub discussions
- Advanced Solidity
- Experience with Foundry
- Uniswap V2
- Foundry
- Python / Jupyter lab (optional)
Check out the videos on Cyfrin Updraft for each lesson.
Introduction to Uniswap V3, how is it different from Uniswap V2 and what is concentrated liquidity?
- Concentrated liquidity
- Difference between v2 and v3
- Graph - concentrated liquidity
- Graph - tick
- Graph - tick on constant product curve
- Graph - single position
- Graph - multi positions
- ETH/USDT liquiduity price graph example
- Repositories overview
- Contracts overview
Math for spot price and values specific to how Uniswap V3 stores prices (
slot0
,sqrtPriceX96
andtick
).
slot0
(tick and sqrtPriceX96)- Math - tick to price
- Python - code example
- Math - sqrtPriceX96 to price
- Python - code example
- Math - sqrtPriceX96 to tick
- Python - code example
- Exercise 1
- Solution 1
How to derive the equations for concentrated liquidity.
- Math - equation for x and y from liquidity and price
- Math - curve of real reserves
- Math - how many token x and y between pa and pb?
Swap algorithm, math, code and exercises swapping tokens with the router contract.
- Swap algorithm
- Single position
- Multi position
- Liquidity net intro
- Math - liquidity net
- Graph - liquidity net
- Swap math
- Math - what is the price after +/- dx or dy
- Math - swap fee
- Code walkthrough swap
- Contract call
- Exact input single
- Exact input
- Exact output single
- Exact output
- Code walkthrough
SwapRouter02
- Exercise 1 - single pool exact input
- Solution 1 - single pool exact input
- Exercise 2 - multi pool exact input
- Solution 2 - multi pool exact input
- Exercise 3 - single pool exact output
- Solution 4 - single pool exact output
- Exercise 4 - multi pool exact output
- Solution 4 - multi pool exact output
Contract architecture of the factory contract.
- Contract call
- Code walkthrough
- Exercise 1 - get pool
- Solution 1 - get pool
- Exercise 2 - create pool
- Solution 2 - create pool
Math of how liquidity is calculated followed by code and exercises.
- Math - Liquidity
- Math - Liquidity delta
- Graph - Tick spacing
- Contract call
UniswapV3Pool
mint
burn
collect
NonFungiblePositionManager
mint
increaseLiquidity
decreaseLiquidity
- Mint
- Increase liquidity
- Decrease liquidity
- Collect fee and remove liquidity
Algorithm for how the next liquidity position is efficiently searched.
How fee is tracked internally and calculated for all liquidity providers.
- Math - Fee equation
- Fee growth
- Graph - fee growth
- Fee growth inside
- Graph - fee growth inside
- Fee growth outside
- Fee growth below
- Fee growth above
- Position fee
- Code walkthrough
How to get flash loans from Uniswap V3 pools
How to calculate a time-weighted average pricing of tokens using Uniswap V3
- Math - TWAP
- Math - TWAP of token x and y
- Python - simulation
- Code walkthrough
- Exercise 1
- Solution 1