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 $1.5 trillion in trading volume and 250 million swaps.
As of today, the Uniswap Protocol is the fifth largest application on Ethereum with over $4 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, Polygon, Arbitrum, and Optimism.
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:
- The Uniswap Web App: The most popular way to swap on the Uniswap Protocol
- Uniswap App: A mobile app to purchase, send, and swap cryptocurrencies and explore NFTs
- Uniswap NFT Aggregator: A marketplace to explore, buy, and sell NFTs at better prices
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, Polygon, Arbitrum, Optimism, Binance Smart Chain, and Celo.
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.
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:
- 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.
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.
Anyone can swap on the Uniswap Protocol. One of the easiest ways to do this is on 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.
To start using Uniswap, you'll need to connect your Ethereum wallet to the platform. Uniswap supports a range of wallets, including the Uniswap Wallet, Metamask, Coinbase Wallet, and WalletConnect.
Once you've connected your wallet, you can choose which network to swap, like Ethereum, Polygon, Arbitrum, Optimism, or others.
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.
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.
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.
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.
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.
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.
The Uniswap Protocol is one of crypto's safest and most secure protocols. The protocol has processed over $1.5 trillion in trading volume over hundreds of millions of transactions without incident. All contracts have been audited by world-class professional security teams.
Uniswap Labs does not charge fees to use its platform. But swappers do pay two types of fees: (1) Network Fee and (2) LP Fees
- Network Fees: Every transaction on the Ethereum blockchain requires a network fee, also known as a gas fee. Validators use their own computers to verify and process transactions instead of relying on a central authority. In return, validators are compensated through network fees. Network fees are determined by the supply and demand of block space. When there is a lot of traffic on a network (high volume of transactions), the network fee is higher. When there is low traffic on the network (low volume of transactions), the network fee is lower. You can also swap on Layer 2 chains, which are built on top of Ethereum and have lower costs.
- LP Fees: LP fees are split between liquidity providers within a specific pool as compensation for providing liquidity. These fees can range between 0.05% to 1%. This money goes directly to individual LPs and not to Uniswap Labs.
We have several resources to help you get started with the Uniswap Protocol.