What is Uniswap? A Complete Guide
The Uniswap Protocol is the largest decentralized exchange for swapping cryptocurrency tokens on Ethereum and other popular blockchains. Launched in 2018, it is the world's largest and most popular decentralized exchange, with over $2 trillion in trading volume and 465 million swaps.
As of today, the Uniswap Protocol is the fifth largest application on Ethereum with over $5 billion in total value locked (TVL). The protocol consistently does billions in weekly trading volume and is the most popular decentralized exchange by volume on Ethereum mainnet, Base, Polygon, Arbitrum, Zora, Avalanche, Optimism, Blast, ZKsync, Celo, and Binance Smart Chain.
Hayden Adams created the Uniswap Protocol in 2018 and later founded Uniswap Labs, which has built the largest marketplace for onchain digital assets such as cryptocurrency tokens and NFTs. Uniswap Lab's suite of tools includes:
- Uniswap Web App: The most popular way to swap on the Uniswap Protocol
- Uniswap Wallet: A self-custody wallet to interact with onchain apps and swap, send, or recieve crypo across 11 networks — available as a mobile app on iOS and Android or as a browser extension on Chrome
No single entity or company controls the Uniswap Protocol. It is governed by UNI token holders and stewarded by the Uniswap Foundation.
What is the Uniswap Protocol? The decentralized exchange built on Ethereum
The Uniswap Protocol is a decentralized marketplace to swap cryptocurrencies on the Ethereum blockchain. It exists as a set of persistent, non-upgradable smart contracts. That means that no one controls the codebase. The Uniswap Protocol's code cannot be changed or modified and will run as long as the blockchain is functional, even if Uniswap Labs disappears tomorrow. Anyone can deploy the Uniswap Protocol contracts on any blockchain. The Uniswap Protocol is already on several blockchains, like Ethereum mainnet, Base, Polygon, Arbitrum, Zora, Avalanche, Optimism, Blast, ZKsync, Celo, and Binance Smart Chain.
People use the Uniswap Protocol primarily for two reasons:
Swapping. The Uniswap Protocol is a decentralized exchange (DEX). Unlike traditional exchanges, decentralized exchanges are unique because they allow users to swap tokens without third parties facilitating the transaction or taking control of funds. Swapping on the Uniswap is completely self-custodial, which means you always retain control of your assets — and no third party can take or misuse your funds.
Providing Liquidity. Liquidity refers to how much of an asset is available to trade. The Uniswap Protocol relies on third parties to supply liquidity. These liquidity providers (LPs) are users who deposit tokens into a liquidity pool to provide liquidity for a particular token pair that swappers can trade with. In return for providing liquidity, LPs earn trading fees generated by the pool. Anyone can become a liquidity provider, a transformative change to participating in financial markets.
The Uniswap Protocol is open-sourced, meaning that the code is publicly viewable for anyone to see.
How does Uniswap work? Understanding automated market makers (AMM)
Unlike traditional order book exchanges where a buy order is matched to a sell order, Uniswap uses an automated market maker (AMM) system. AMMs use a mathematical algorithm to determine the price based on the supply of the asset, which removes the friction of having centralized middlemen and allows for an efficient way to buy and sell digital assets. There is no bidding or order book, just the price based on how much liquidity is available. When users want to make a swap, they input the amount of cryptocurrency they want to swap in and receive a number of tokens in exchange. All of this is done on the blockchain.
The Uniswap Protocol uses a constant product formula to determine the price of an asset. When a token is withdrawn (bought) from a pool, a proportional amount must be deposited (sold) to maintain the constant. The ratio of tokens in the pool, in combination with the constant product formula, ultimately determines the price of a token.
The constant product formula that the Uniswap Protocol uses is:
Where
- X = Reserve of the first token
- Y = Reserve of the second token
The total amount of both tokens should always balance out so that K experiences no change.
For example, if a liquidity pool has 10 ETH and 1000 USDC, the product of the two balances would be 10,000. If a user buys 1 ETH from the pool with USDC, the new balance would be 9 ETH and 1111.11 USDC, keeping the product of the two balances constant at 10,000.
The constant product market maker algorithm uses this formula to determine the price of each token in the pool based on the ratio of the two token balances. The price of a token in the pool is simply the ratio of the two token balances. In the above example, the price of ETH in terms of USDC would be 111.11 USDC after the swap.
The Uniswap Protocol has four versions:
-
Uniswap V1 was the first version of the Uniswap decentralized exchange protocol, launched in November 2018. It was a revolutionary concept in decentralized exchanges, quickly gaining popularity in the cryptocurrency community. Uniswap v1 was the first DEX to natively pair tokens against ETH, the native token for Ethereum, letting users swap against the most popular token.
-
Uniswap v2 launched in May 2020 and brought many upgrades to the Uniswap Protocol. Users could now trade any Ethererum-based (or ERC-20) token for any other ERC-20 token rather than just trading against ETH. Uniswap v2 greatly increased the protocol's flexibility and allowed for a broader range of trades.
-
Uniswap v3 is the current version of the protocol. Released in May 2021, Uniswap v3 introduced concentrated liquidity whereby liquidity providers could now choose specific price ranges rather than providing liquidity across the entire price range. This meant that LPs could concentrate their capital on a specific price range, allocating their capital more efficiently.
-
Uniswap v4 is currently being built in public with contributions from the broader Uniswap community. It has not been deployed yet. The goal with v4 is to make liquidity pools more customizable and to lower gas costs.
Read more about the history of Uniswap here.
The benefits of Uniswap: decentralization, liquidity, and accessibility
Decentralized exchanges (DEXs) like the Uniswap Protocol offer several benefits over traditional centralized exchanges (CEXs). Key benefits include decentralization, self custody, transparency, improved liquidity, and greater accessibility.
Decentralization and Self-Custodial: One of the Uniswap Protocol's main benefits is that it is decentralized. Unlike centralized entities that operate CEXs, the Uniswap Protocol operates on a decentralized network, with no single entity controlling the exchange. Decentralization has two main advantages. (1) The smart contracts that make the Uniswap Protocol cannot be changed once deployed, meaning no one can change the rules. (2) Funds are completely self-custodial. You always remain in control of your assets. No third party can take or misuse them.
Transparency: DEXs are significantly more transparent than other exchanges. Not only is all the code open source and publicly available, but the Uniswap Protocol operates on public blockchains where all transactions and smart contract interactions are recorded on a transparent and immutable ledger. Anyone can access and verify these transactions, ensuring transparency and accountability.
Improved liquidity for cheaper swaps: The Uniswap Protocol can offer improved liquidity over CEXs. By allowing anyone to create and provide liquidity to a pool, the Uniswap Protocol can tap into liquidity from retail users without relying on traditional market makers or order books, making swaps cheaper.
Greater accessibility: Another benefit of the Uniswap Protocol is greater accessibility. Anyone can trade any token or create a market for any token. In this way, DEXs are more accessible to a wider range of users, including those who may not have access to traditional banking services.
How to use Uniswap
Anyone can swap on the Uniswap Protocol. One of the easiest ways to do this is on the Uniswap web app.
Step 1: Go to the Uniswap Web App
Navigate to app.uniswap.org. This web app is hosted and maintained by Uniswap Labs. It is one of the most popular ways to exchange with the Uniswap Protocol.
Step 2: Connect your wallet
To start using Uniswap, you'll need to connect your wallet to the platform. Uniswap supports a range of wallets, including the Uniswap Wallet, Metamask, Coinbase Wallet, and WalletConnect.
If you do not have a wallet, you can learn more about wallets here and download the Uniswap mobile wallet here!
Once you've connected your wallet, you can choose which network to swap, like Ethereum, Polygon, Arbitrum, Optimism, or others.
Step 3: Choose the tokens you want to trade
Once you've connected your wallet, you can choose the tokens you want to trade. You can select from a wide range of tokens, either by navigating to the token details page, or entering the token directly. As always, do your own research when trading tokens.
Select the 'Select a token' icon and browse the list to find your token. You can also search by token name or token contract address.
Step 4: Enter the amount you want to trade
Once you've chosen the tokens you want to trade, you can enter the amount you want to trade. You can buy or sell one token for another based on the current exchange rate. Additionally, you'll see a network fee, which is the gas cost you can expect to pay to perform the swap. If you are unfamiliar with gas fees, please read this.
Step 5: Review and confirm your swap
After you've entered the amount you want to trade, the Uniswap auto router finds the best price and automatically calculates the amount of the other token you'll receive. You'll then need to confirm the trade by clicking "Swap" and approving the Ethereum wallet transaction.
If this is your wallet's first time trading this token with the Uniswap Protocol, you need to approve the token first. This additional approval is an extra layer of security to protect your funds. Read about approval transactions here.
Step 6: Wait for the transaction to be processed
After confirming your trade, you'll need to wait for the Ethereum network to process the transaction. Swaps are often completed within seconds but can take longer if the network is busy.
Frequently Asked Questions About Uniswap
What is Uniswap Labs?
Uniswap Labs is a company that develops software products that work on top of the Uniswap Protocol. Uniswap Labs was founded by Hayden Adams, who developed the Uniswap Protocol. Uniswap Labs builds and maintains products like the Uniswap web app, NFT aggregator, and Uniswap mobile wallet.
What is the UNI token?
The UNI token is the Uniswap Protocol's governance token. The Uniswap Protocol is not controlled by a single entity, but rather a community of individuals and organizations is responsible for stewarding the world's biggest AMM protocol. Users and organizations that hold UNI can use it to vote on decisions related to the Protocol.
Is Uniswap safe?
The Uniswap Protocol is one of crypto's safest and most secure protocols. The protocol has processed over $2 trillion in trading volume over hundreds of millions of transactions without incident. All contracts have been audited by world-class professional security teams.
Does Uniswap charge fees?
Uniswap Labs charges a flat fee of 0.25% to sustainably fund our operations. You can learn more about this fee here.
How to get started with Uniswap
We have several resources to help you get started with the Uniswap Protocol.
- Trade on the Uniswap web app
- Follow up on Twitter
- Discuss on Farcaster
- Explore our Help Center
- Chat with customer support
- Ask questions in our Discord community
- Dig into the code
- Read the docs