Understanding Uniswap: a beginner’s guide and review

Beginner's guide to Uniswap DEX: the constant product AMM, UNI tokenomics, and the road from v1 to v4 and UNIfication.
By Manny Reimi
TLDR

If you've watched Uniswap clear billions in volume and wondered how a DEX prices trades with no order book and no custodian, this article has the answer. You'll learn how the constant product formula x * y = k sets prices, how liquidity providers earn fees while facing impermanent loss, and how Uniswap went from the 2020 SushiSwap vampire attack through v3 and v4 to the UNIfication fee switch.

Understanding Uniswap: a beginner’s guide and review
TL;DR: You can get a summary of this article on its last section

Uniswap is an open-source decentralized exchange (DEX) that swaps ETH and ERC-20 tokens. As a collection of smart contracts, trade happens in Uniswap with no centralization, fully on-chain. Uniswap completely does away with the concept of an order book. It launched without a token of its own; since September 2020 the $UNI governance token has coordinated the protocol (more on that in the Tokenomics section).

This article is a guide to the fundamentals behind Uniswap. We will cover the history and technology behind the protocol, its future, as well as its market maturity and the state of its ecosystem.

In presenting this guide and review of Uniswap, I will divide my analysis into 5 sections, each containing a salient feature of the project, as follows:

  • Legitimacy
  • Purpose
  • Tokenomics
  • Ecosystem
  • Summary.

Legitimacy

Uniswap was created by Hayden Adams, a mechanical engineer who was hoping to get some experience in Solidity, the programming language of Ethereum smart contracts. Adams ran into a post by Vitalik Buterin of Ethereum proposing a new kind of DEX.

Let’s run on-chain decentralized exchanges the way we run prediction markets. — Vitalik Buterin

Vitalik goes on to describe a system with an on-chain automated market maker (AMM) and built-in pricing mechanisms and dynamics. Adams took this as a practice exercise but eventually received a $100k grant from the Ethereum Foundation.

Uniswap creator Hayden Adams with Ethereum's Vitalik Buterin

In April 2019, Uniswap received a $1M seed round from Paradigm which was used to build Uniswap v2 according to the Uniswap Whitepaper. In August 2020, Uniswap announced an $11M Series A round led by Andreessen Horowitz which was used to build Uniswap v3.

Purpose

Uniswap was created to address problems with existing decentralized exchanges. Whereas 0x-based relayers provided non-custodial trading, they handled all trading logic on private servers, due to the slow performance of their smart contracts. This led to, for example, IDEX being pressured into instituting KYC procedures and blocking access to certain IP addresses.

Uniswap’s unique architecture allows it to create a fast and efficient trading environment that’s fully on-chain. Uniswap does this by doing away with order books completely, relying instead on liquidity pools. In a traditional order book model, market makers place tiered bids on both the buy and the sell price, and profit from the spread. The price displayed to the other becomes the mid-market price. Doing order book matching would require an enormous amount of data requests to fill different orders at the same time.

Uniswap unicorn mascot depicted as a hunter

The model used by Uniswap is called the constant product market maker model (CPMMM), a variant of AMM. Prices are set according to a deterministic algorithm, following the simple logic of maintaining a constant x * y = k relationship between the liquidity of trading pairs on any market.

Another major headache of DEXs is the need to obtain liquidity. Uniswap provides a one-time mechanism to provide liquidity, which makes it attractive to market makers. A market maker or liquidity provider (LP) on Uniswap gets a cut of the 0.30% of fees per trade according to his share of the liquidity pool. So, by depositing ETH into a Uniswap contract, one can get a share of the 0.30% fees on each trade without ever adjusting buy and sell bids to keep up with the market.

The impressive growth of Uniswap proved the model. By September 2020, total value locked (TVL) and 24-hour volume had both surpassed $1B, and Uniswap had taken the no.1 spot in TVL with $1.7B locked while surpassing the daily volume of giants like Coinbase. Uniswap remains the most dominant DEX to this day, and it long ago outgrew Ethereum mainnet alone: the protocol now runs across Ethereum and a dozen other chains.

Tokenomics

To really understand the success of Uniswap one must consider the simplicity in its design and mechanics.

Illustration of the Uniswap constant product equation

Take, for example, a trading pair between $ETH and $DAI . We know from the formula x * y = k that the relationship between the two pairs must be inverse. That is to say, if the pool is set up with 1,000 $ETH and 100,000 $DAI , to maintain the constant 100,000,000 at all times, then if we take 1 $ETH out of the pool, we must add 100.10 $DAI . That gives us a price, in this example, of $100.10 per $ETH . Conversely, to take 100 $ETH , we would need 111,111.11 $DAI for a price of $111.11 per $ETH . As can be seen, the price doesn’t change linearly. To avoid significant slippage, pools must have sufficient liquidity.

To provide liquidity, one must add equal parts of both assets to the contract. For example, if a contract has 900 $ETH and 90,000 $DAI , for a user to add 100 $ETH he must add 10,000 $DAI as well. The LP is given minted LP tokens equivalent to 10% of outstanding supply. Once the LP decides to withdraw its liquidity, the LP tokens are burnt. (In v1 and v2 these pool-share tokens were confusingly also named “UNI” tokens; they are unrelated to the UNI governance token discussed below.)

By now you may be thinking that the price of $ETH is not $100, but higher (around 400 $USDT when this review was first written, in September 2020). Whenever the price of Uniswap is out of sync, an arbitrage opportunity is presented. In this case, users will come and buy $ETH in Uniswap at 100 $USDT and sell it elsewhere at the market price, pocketing the spread, until the spread disappears. Meanwhile, liquidity providers will make 0.30% off of these trades.

Uniswap unicorn mascot depicted as prey

There are, of course, risks to LPs in this model which are outside the scope of this guide. Suffice it to say that, for any given trading pairs, if price swings are too drastic in either direction and the volumes are low, LPs are likely to suffer what is called an impermanent loss that fee earnings won’t be able to overcome.

Uniswap governance revolves around the $UNI token that was airdropped to all users on September 16, 2020. Every user who had previously used Uniswap DEX on mainnet received 400 $UNI tokens in unlocked form.

According to CoinMarketCap, the pairs with the most volume on Uniswap in September 2020 were:

Trading PairVolume (%)
$USDT/$ETH17.20%
$USDC/$ETH11.57%
$SUSHI/$ETH10.84%
$DAI/$ETH7.46%
$YFI/$ETH5.59%

Together these 5 pairs accounted for over 53% of the volume in a 24-hour window at the time.

Uniswap can be connected with any Ethereum or ERC20 compatible wallet that supports Web3 or contract data like MetaMask. Other wallets like Pillar, Trust Wallet. and Ledger are also great options.

Ecosystem

Map of the Uniswap ecosystem of liquidity providers, traders, and developers

Uniswap ecosystem players are liquidity providers, traders, and developers. Each of them plays an important role in the growth of Uniswap. Traders are the main users of any exchange, they pay 0.30% to get their tokens swapped. This fee goes to liquidity providers, while developers integrate Uniswap to power trading or retail experiences in their dApps among other use cases.

Development Roadmap

When this review was first written, Uniswap v3 had just been announced with no confirmed features. The protocol has shipped three major upgrades since:

  • v3 (May 2021) introduced concentrated liquidity: LPs choose the price range their capital works in, multiplying capital efficiency over the v2 model described above.
  • v4 (January 2025) introduced hooks, letting developers attach custom logic (dynamic fees, limit orders, custom oracles) to pools, and moved all pools into a single contract to cut gas costs.
  • UNIfication (December 2025): governance passed the UNIfication proposal with over 99% support, activating protocol fees that buy and burn $UNI and burning 100M $UNI from the treasury.

A dev can find all of the guiding and tooling he needs to integrate Uniswap on the Uniswap docs. Uniswap maintains an SDK written in TypeScript to build interfaces that link to Uniswap. There’s the possibility to take the smart contracts from Uniswap and adapt them to your application, with Uniswap providing a testing environment as well. The Uniswap API is to retrieve data about Uniswap — this data is organized and not meant to be used for structuring transactions (where live data from contracts is ideal).

It is to note that Uniswap is an open protocol, anyone can create an ERC20 token and list it on Uniswap.

The SushiSwap challenge 🍣

Banner featuring the SushiSwap mascot

Perhaps as a preemptive strive to Uniswap v3, or maybe because there is some hostility from some corners in Crypto towards VC-backing, the truth is many early (and semi-professional) LPs seem to feel sidelined by the growth of Uniswap, as their percentage of the pool has been diluted by better-capitalized players. In response, an anonymous group of degen devs announced an “evolution of Uniswap” that introduced a governance token. They named the project SushiSwap and the token $SUSHI together with a Yam-inspired interface with heavy emoji 👨🏼‍🍳 use. The governance token proposes new tokenomics, with the 0.30% fee for trades split as 0.25% for LPs with 0.05% getting conveyed to $SUSHI and going to existing $SUSHI holders. $SUSHI can be earned by providing liquidity, and initially by staking Uniswap liquidity tokens from a select number of pools into SushiSwap as part of a plan the team calls The Liquidity Migration™ which has been labeled by the Crypto experts as vampire mining as eventually liquidity in these pools will be migrated to SushiSwap.

What initially seemed like a memecoin project, eventually brought into its pools $800M or 80% of total Uniswap assets the weekend after its announcement. While the Uniswap team has warned of the risks of putting what now is $1B in a project that is but days old and as a “whale game”, Binance and others have listed $SUSHI while Quantstamp audited its codebase. In some ways, many have turned this into some sort of contest between so-called elites and anons. Definitely the hottest controversy in Crypto of 2020, and maybe since the DAO incident or Bitcoin’s first fork.

We wrote at the time that we would know the outcome within a week, and we did. SushiSwap completed its liquidity migration in September 2020, briefly pulling around $1B out of Uniswap, but the takeover did not stick. Uniswap answered with the $UNI airdrop on September 16, widely read as a direct response to the vampire attack, liquidity flowed back within weeks, and Uniswap retained its dominance while SushiSwap settled into a distant second and faded over the years that followed.

In Summary

Uniswap’s elegant implementation of a simple econometric equation led to the resurgence of demand in decentralized exchanges. While Uniswap has championed openness and ease-of-development for the community at large to benefit from its utility, the open question this review closed on in 2020, whether it could remain a sustainable and self-governable protocol, has largely been answered: the DAO has governed the protocol through three major versions, and with UNIfication its fees now accrue to $UNI holders through burns.

Have a suggestion? Edit this page