Introduction
Uniswap V2 in simplest words is one of the most influential smart contracts ever written, its V1 was introduced on November 2, 2018 by Hayden Adams. Two years later its V2 was released and changed how AMMs work — and to this day it is still the most forked DeFi protocol.
This book, Uniswap V2 From Scratch is not just a walkthrough the code, we will built it from scratch and understand why it was designed the way it was, how it works and why you should bother to learn its architecture. Regardless of this book, I highly recommend going through Uniswap V2 Whitepaper.
By the end, you won't just know how Uniswap V2 works — you'll know how to build it yourself or fork and modify the original version. Whether you're a DeFi developer or a smart contract researcher, this book will give you a mental model on how decentralized exchanges work, specifically Uniswap V2.
What you'll learn
- What are AMMs (Automated Market Makers) and its mathematical foundation
- The architecture of Uniswap V2:
Factory,PairandRouter - How fees and liquidity tokens work
- How to build Uniswap V2 from scratch