Friday, May 7, 2021
Home Decrypt News What is Uniswap and How Does It Work?

What is Uniswap and How Does It Work?

In brief

  • Uniswap is an Ethereum based exchange that allows anyone to swap ERC20 tokens.
  • Uniswap V2 launched in May 2020, enabling direct ERC20 to ERC20 swaps and adding a host of technical improvements.
  • In September 2020, Uniswap launched its UNI governance token with an airdrop to anyone who had used the protocol before September 1.

Decentralized exchanges solve many of the problems of their centralized counterparts, including the risk of hacking, mismanagement, and arbitrary fees. However, decentralized exchanges have their own problems, mainly lack of liquidity—which means a lack of amount of money sloshing around an exchange that makes trading faster and more efficient.

That’s where Uniswap comes in. It’s trying to solve decentralized exchanges’ liquidity problem, by allowing the exchange to swap tokens without relying on buyers and sellers creating that liquidity. 

Below we explore how Uniswap works and how it became one of the most popular decentralized exchanges on Ethereum. 

What is Uniswap?

Uniswap is a protocol on Ethereum for swapping ERC20 tokens. Unlike most exchanges, which are designed to take fees, Uniswap is designed to function as a public good—a tool for the community trade tokens without platform fees or middlemen. Also unlike most exchanges, which match buyers and sellers to determine prices and execute trades, Uniswap uses a simple math equation and pools of tokens and ETH to do the same job. 

Who invented Uniswap?

Uniswap was created by Hayden Adams, who was inspired to create the protocol by a post made by Ethereum founder Vitalik Buterin.

What’s so special about Uniswap?

Uniswap’s main distinction from other decentralized exchanges is the use of a pricing mechanism called the “Constant Product Market Maker Model.” 

Any token can be added to Uniswap by funding it with an equivalent value of ETH and the ERC20 token being traded. For example, if you wanted to make an exchange for an altcoin called Poop Token, you would launch a new Uniswap smart contract for Poop Token and create a liquidity pool with–for example–$10 worth of Poop Token and $10 worth of ETH. 

Where Uniswap differs is that instead of connecting buyers and sellers to determine the price of Poop Token, Uniswap uses a constant equation:  x * y = k.

In the equation, x and y represent the quantity of ETH and ERC20 tokens available in a liquidity pool and k is a constant value. This equation uses the balance between the ETH and ERC20 tokens–and supply and demand–to determine the price of a particular token. Whenever someone buys Poop Token with ETH, the supply of Poop Token decreases while the supply of ETH increases–the price of Poop Token goes up.

As a result, the price of tokens on Uniswap can only change if trades occur. Essentially what Uniswap is doing is balancing out the value of tokens, and the swapping of them based on how much people want to buy and sell them. 

What else is different about Uniswap?

Absolutely any ERC20 token can be listed on Uniswap–no permission required. Each token has its own smart contract and liquidity pool–if one doesn’t exist, it can be created easily. Once a token has its own exchange smart contract and liquidity pool, anyone can trade the token or contribute to the liquidity pool while earning a liquidity provider fee of 0.3%. To contribute to a liquidity pool, you need an equal value of ETH and ERC20 tokens. 

How are Uniswap tokens produced?

Whenever new ETH/ERC20 tokens are contributed to a Uniswap liquidity pool, the contributor receives a “pool token”, which is also an ERC20 token. Pool tokens are created whenever funds are deposited into the pool and as an ERC20 token, pool tokens can be freely exchanged, moved, and used in other dapps. When funds are reclaimed, the pool tokens are burned or destroyed. Each pool token represents a user’s share of the pool’s total assets and share of the pool’s 0.3% trading fee.

How to swap tokens using Uniswap

The Uniswap protocol can be accessed through its front-end at You’ll also need an Ethereum address, for example using a wallet such as MetaMask.

Thus armed, you can swap tokens or add tokens to a Uniswap liquidity pool; it’s just a matter of selecting the token that you want to swap out of, and the token you want to swap into. Then you’ll need to approve the transaction using your wallet, and confirm the swap (remembering to bear in mind any additional Ethereum fees for swapping).

Since Uniswap is an open protocol of smart contracts, a number of front-end user interfaces have already been created for it. For example, InstaDApp allows you to add funds into Uniswap pools without needing to access the official Uniswap user interface. Interfaces such as allow users to add funds to Uniswap pools using just ETH instead of ETH and another token. The interface even offers simple one-click solutions for purchasing pool tokens in combination with bZx token strategies. 

With an array of official and unoffical resources for developers to build on the protocol, we should expect to see many more integrations between Uniswap’s unique token swapping system and new decentralized finance (DeFi) products in the coming years.

Uniswap V2 and beyond

Though Uniswap launched back in November 2018, it wasn’t until relatively recently that the protocol began to see significant traction. 

Much of this recent interest is down to the release of Uniswap V2—a major upgrade that now allows direct ERC20 to ERC20 swaps, cutting Wrapped Ether (WETH) out of the equation where possible. Uniswap V2 also supports previously incompatible ERC20 tokens like OmiseGo (OMG) and Tether (USDt), and adds a host of technical improvements that make it more desirable to use. 

As liquidity mining and yield farming platforms dramatically increased in popularity in 2020, Uniswap saw a corresponding surge in interest, since many DeFi platforms allow Uniswap liquidity providers to see an additional return on their LP tokens. 

This, in combination with the 0.3% exchange fees distributed to liquidity providers—and the platform’s popularity as a launchpad for popular DeFi project tokens—has seen Uniswap rise the ranks to become the number one DeFi platform by total value locked (TVL)—a measure of the total value of crypto assets locked up in the platform. 

UNI token launch and airdrop

In September 2020, Uniswap launched UNI, the network’s governance token, airdropping 400 UNI tokens to every wallet address that had interacted with the Uniswap protocol before September 1.

From a distribution of 150 million UNI tokens, around 66 million were claimed in the first 24 hours following the airdrop. After distributing 40% of the tokens in the first year, it will taper down by 10 percentage points in each subsequent year, until all the tokens have been allocated.

Uniswap plans to distribute a capped total of 1 billion UNI over four years, with 60% earmarked for distribution to the community, 21.5% allocated to Uniswap employees and the remaining 18.5% going to investors and advisors. 

As a governance token, UNI entitles holders to a vote in how the protocol is run, affording them immediate ownership of Uniswap governance, the UNI community treasury, the protocol fee switch, eth ENS, the Uniswap Default List (tokens.uniswap.eth) and SOCKS liquidity tokens. The token was quickly listed on the Coinbase Pro exchange, and soon after on the main Coinbase exchange. 

Uniswap’s token launch can be considered a response to the rise of SushiSwap, a clone of the protocol that added a token to encourage usage. In a more direct challenge, SushiSwap also tried to drain Uniswap of liquidity through a process called “vampire mining”.

In its first week of trading following its launch, the UNI token initially surged from a price of $1 to a peak of over $7, before dropping off by 30% to around $5. The amount of Ethereum locked in Uniswap similarly surged, shooting up to $1.6 billion in the first two days following the UNI token launch and $1.9 billion by the seven-day mark.

Popular Articles