What is Uniswap

Uniswap is a popular decentralized exchange for cryptocurrency. It is one of the cornerstone projects of the Ethereum and decentralized finance (DeFi) ecosystem.

In this post we’ll break down what Uniswap is, how it works and why it matters. We make some generalizations for simplicity and assume no prior knowledge of Uniswap.

With that, let’s dig in!

Traditional trading: how it works

To fully appreciate Uniswap and decentralized exchange, it helps to first understand how traditional trading works using services such as Vanguard or Coinbase.

When you buy a share of Apple (AAPL) on Vanguard or units of Bitcoin (BTC) on Coinbase, you are “hiring” Vanguard and Coinbase as a middle man. They take your money and buy the given asset off an exchange order book: a list of buyers and sellers. The price you get for AAPL or BTC is the price another party has pre-agreed to sell or buy at.

Traditional trading generally has these characteristics:

  1. There is a trusted middle man to execute your trades (Vanguard, Coinbase)
  2. There is an order book filled with buyers (bids) and sellers (asks) that determine the value of your trade
  3. You don’t directly hold your own assets – the middle men hold them on your behalf
  4. You are required to provide personal information and be known to trade
An order book for Bitcoin (BTC) on Coinbase Pro (traditional trading model)

There are many advantages to this traditional trading model. For example – it is very well-established and powers very large, efficient markets. If you’ve bought a stock at a brokerage, or cryptocurrency on any major exchange (Coinbase, Binance, Kraken, etc.) this is the model you were interacting with.  

What is Uniswap?

Uniswap is an exchange system for cryptocurrency that operates on the Ethereum blockchain. Uniswap is an open source protocol, meaning anyone can interact with it and understand how it works.

Uniswap focuses exclusively on trading Ether (ETH) and Ethereum-based assets. At the time of writing, the size of this market was over $100 billion.  

So how does Uniswap compare to the traditional trading model?

Here are 4 interesting examples of how Uniswap differs:

  1. There is no trusted middle man to make trades. You trade directly from your own Ethereum self-custody wallet (e.g. MetaMask) using the Ethereum blockchain. This is what makes Uniswap a decentralized exchange (DEX)
  2. There is no order book! The price for buying or selling is determined through automated market making, which is handled by smart contracts on the Ethereum blockchain (more on this later)
  3. You directly hold your Ethereum-based assets in your own wallet. There is no custody middle man
  4. Your personal identity is not known (or required) to use Uniswap or Ethereum directly
Making a trade on the Uniswap exchange app

Automated market making

If Uniswap isn’t using an order book, how exactly does it figure out what the price is for buying and selling in any given moment?

Instead of an order book, Uniswap developed a clever mechanism called automated market making (AMM). AMM allows Uniswap exchanges to always provide a price, even for very small markets, without requiring buyers and sellers to pre-list their orders at fixed prices.

For this automated market making design to work, Uniswap replaced order books with a new, novel concept: liquidity pools.

Liquidity pools

Instead of relying on buyers and sellers who pre-agree on prices to form an order book, Uniswap incentivizes investors (aka “LPs” or “Liquidity Providers”) to pool their Ethereum-based assets into Uniswap smart contracts in exchange for a share of the transaction fees.

These invested Ethereum-based assets are allocated to trades automatically by smart contracts based on the rules of the Uniswap protocol. As more trades are made, the investors (LPs) accrue more transaction fees.  

Every trading pair on Uniswap has a liquidity pool. Anyone in the world can create Uniswap trading pairs or provide liquidity to them without permission.

One of the most popular trading pairs on Uniswap at the time of writing is USDC-ETH. This pair let’s you exchange USDC for ETH or vice versa.  

To become an investor in the USDC-ETH liquidity pool you must contribute an equal ratio (50%/50%) of both assets into the pool. To invest $1,000 you would need to contribute $500 in USDC and $500 in ETH.  

The top 10 exchanges, sorted by pool size, at the time of writing

Liquidity tokens (LP tokens)

Investors are willing to pool their assets in Uniswap because there is a financial incentive: they get a share of transaction fees (currently: 0.30% of every trade).

When investors pool their assets into Uniswap, they get liquidity tokens (“LP tokens”) back in return. These LP tokens are conceptually similar to owning stock or equity – they represent a direct claim on a portion of the total liquidity pool and accumulated transaction fees.

If you become an investor in the USDC-ETH trading pair, you will contribute USDC and ETH in equal amounts and get a Uniswap USDC-ETH LP token in return.

When investors want to cash out of a given pool, they simply trade in their Uniswap LP token and are given assets from the pool according to their percentage ownership. Because of the accumulation of fees, the amount of assets you receive should be greater than what you put in.

We won’t go deeply into Uniswap LP returns analysis here, but if you are interested in learning more, we suggest understanding more about impermanent loss (divergence loss). Impermanent loss is a key factor to consider when investing in Uniswap liquidity pools.

Using this liquidity pool system, Uniswap has attracted billions (in USD terms) of capital from investors. At the time of writing, there is over $1.5B invested, which is powering thousands of decentralized trading pairs!

Uniswap vs Coinbase Example

To further highlight the differences (and similarities) between traditional trading and decentralized trading using Uniswap, we can compare the same trade on both platforms.

Buying $100 of USDC with Ether (ETH) on Coinbase

  • Pre-trade Approval: Sign up and go through identity verification process
  • Price discovery: Order book (bids and asks) – you are matched with an existing price on the USDC-ETH order book
  • Speed: Near-instant
  • Custody: Custodial. You trust Coinbase to keep assets safe while holding them on platform (unless you transfer to a self-custody wallet)

Buying $100 of USDC with Ether (ETH) on Uniswap

  • Approval to trade: None. You need only an Ethereum wallet
  • Price discovery: Automated market maker (AMM) – the USDC-ETH Uniswap smart contract determines price algorithmically
  • Speed: Depends on transaction fees you specify to Ethereum, but likely 15 – 45 seconds
  • Custody: Self-custody. You trust yourself to keep assets safe in your own wallet

Why use Uniswap?

We’ve covered how Uniswap is different than traditional trading and exchanges, but why is it useful?

Where are the areas where someone might prefer Uniswap over a custodial alternative like Coinbase?

1. It’s non-custodial

While the quality and security of cryptocurrency exchanges has improved dramatically in the past decade, there still are an alarming number of exchange hacks that result in loss of customer funds.

Because custodial exchanges hold huge sums of assets on behalf of users, they are constantly under attack. When these attacks succeed, customers holding their assets at the exchange are often left powerless.

Uniswap, as a decentralized exchange, does not require you to give up control of your assets to trade. You can trade on Uniswap via Ethereum from the comfort of your own wallet.

Self-custodying cryptocurrency is not a riskless activity and requires its own set of best practices, but it does eliminate exchange hack risk.

2. It’s completely permissionless

Trading on traditional exchanges requires permission in at least two forms:

  1. You have to be approved to trade or transfer by providing your identity and sensitive personal information
  2. The assets that are available are selected at the discretion of the exchange

On Uniswap, you don’t need to be approved to trade, transfer or invest in liquidity pools. Anyone in the world with an internet connection and an Ethereum wallet can participate. Users who value privacy or those living in countries with restrictive capital controls may appreciate this aspect of Uniswap and decentralized exchange.

Uniswap is also not limited in what trading pairs it can offer or support. Any person can create a trading pair between two Ethereum-based assets and seed the initial liquidity pool. This results in a huge combination of trading pairs for a myriad of assets.

3. It has unique trading pair support

Thanks to the permissionless nature, there’s assets and trading pairs on Uniswap you simply can’t get on custodial alternatives.

Because it so easy to spin up a trading pair on Uniswap, it’s often the very first place new Ethereum-based assets are listed and available. Even when trading pairs are later added on custodial exchanges (Coinbase Pro, Binance et al) – Uniswap often has very competitive liquidity and fees.

Final thoughts

Uniswap is one of the breakaway success stories of Ethereum and DeFi. It has become one of the most important parts of the DeFi ecosystem and has proven that decentralized applications can compete (and sometimes win) versus centralized alternatives.

It will be exciting to watch what innovations the Uniswap team comes up with next and seeing the project grow as crypto becomes increasingly mainstream.

By Alex Treece – Zabo