Skip to content

Latest commit

 

History

History
218 lines (176 loc) · 12.5 KB

uniswap-v3.md

File metadata and controls

218 lines (176 loc) · 12.5 KB

Uniswap V3

How to use this

Prerequisites

  • Advanced Solidity
  • Experience with Foundry
  • Uniswap V2

Tools

Topics

Check out the videos on Cyfrin Updraft for each lesson.

Section 1 - Intro

Introduction to Uniswap V3, how is it different from Uniswap V2 and what is concentrated liquidity?

Section 2 - Spot price (sqrt price, tick, sqrt x 96)

Math for spot price and values specific to how Uniswap V3 stores prices (slot0, sqrtPriceX96 and tick).

Section 3 - Math

How to derive the equations for concentrated liquidity.

Section 4 - Swap

Swap algorithm, math, code and exercises swapping tokens with the router contract.

Section 5 - Factory

Contract architecture of the factory contract.

Section 6 - Liquidity

Math of how liquidity is calculated followed by code and exercises.

Section 6 - Tick bitmap

Algorithm for how the next liquidity position is efficiently searched.

Section 7 - Fee algorithm

How fee is tracked internally and calculated for all liquidity providers.

Section 8 - Flash

How to get flash loans from Uniswap V3 pools

Section 9 - TWAP price oracle

How to calculate a time-weighted average pricing of tokens using Uniswap V3

Section 10 - Footnotes

Resources