Medium
engineering

Building Uniswap V3

Build the actual Uniswap V3 protocol from scratch. Concentrated liquidity, tick bitmaps, the swap loop, fee growth accounting, the TWAP oracle, and a single-hop router. Every line of code, modernized to Solidity 0.8.x. When you finish, you understand the most-forked concentrated-liquidity engine in DeFi because you wrote it.

What you are building

You will write the actual Uniswap V3 protocol: the SqrtPriceMath, Tick, TickBitmap, Position, SwapMath, and Oracle libraries, the UniswapV3Pool with mint, burn, collect, flash, and the full tick-crossing swap loop, the factory with its CREATE2 deployer pattern, and a single-hop SwapRouter with verified callbacks. Concentrated liquidity, fee growth accounting, and the observation ring buffer, exactly as they run in production. Eighteen sections, modernized to Solidity 0.8.x.

License: GPL-2.0-or-laterSource: Uniswap/v3-coreSolidity: ^0.8.20
18 sections
Lynx375 Lynx
~420 min