Uniswap V2 Explained (Beginner Friendly)

Leo Zhang
12 min readFeb 28, 2022
(source: https://twitter.com/VitalikButerin/status/1489998905211195393)

Among those keywords about the core tech and mechanisms in crypto mentioned by Vitalik, what is x*y=k? It looks quite simple. Isn’t it?

Yes it is. In fact, it’s the formula that drives decentralized exchanges. For instance, It is being used by Uniswap, an active decentralized cryptocurrency exchange on Ethereum.

Uniswap

Uniswap allows anyone to make market and swap tokens. The first version — Uniswap V1, was released in 2018 as a proof of concept. Version 2 was a production version released in 2020. And Version 3, which is currenty the latest version, was launched in 2021.

In this blog post, I will explain how Uniswap V2 works with examples that walk through basic scenarios, and how the simple but powerful formula works.

I believe having a good understanding of Uniswap V2 and its core idea makes it much easier to understand the latest version V3 and the mechanism of other decentralized exchanges.

Let’s get started.

Liquidity Pool

Uniswap V2 allows traders to directly swap from one ERC-20 token to another ERC-20 token. Traders don’t trade directly with each other. Instead, they trade with a token pool that has both tokens reserved. This token pool is called “Liquidity Pool”. But the…

--

--