Uniswap: The Leading Decentralized Crypto Exchange

Uniswap is the leading Decentralized Crypto Exchange (DEX) that runs on the Ethereum Blockchain. Uniswap, with currently 7.3 Billion dollars in Total Value Locked is the 5th largest DeFi application running on Ethereum Network. Uniswap, as of March 2022, is also running on Polygon, Arbitrum, and Optimism Layer 2 scaling solutions. Uniswap’s trading volume has grown from about 25 Billion dollars in January 2021 to almost 75 Billion a year after. This article will provide you with further insights and information on how Uniswap works, what is Uniswap, and the importance of Uniswap in the DeFi ecosystem.

Uni swap or Uniswap DEX Trading Volume
Uniswap Trading Volume. Source: Dune Analytics

Although the trading on Decentralized Exchanges like Uniswap keeps growing, as of March 2022, most crypto trading (i.e., on ETH/USDC or ETH/USDT) is still happening in Centralized Exchanges (CEX) like Binance. To understand how Uniswap works, let’s first look at how trading usually works in Centralized Exchanges.

Trading on Centralized Exchanges

A single company or organization governs traditional Centralized Exchanges. The users have to go through a KYC process to access the platform. Then deposit funds and begin trading. In this situation, users don’t have control over their funds. The centralized exchange at any point can block your account, freeze your assets or prevent you from accessing certain functionality. That’s not an artificial scenario. Recently the Canadian Government forced Crypto exchanges to freeze protesters’ assets.

On the operational side, Centralized Exchanges (CEX) facilitate the trading activity using the Order book. Order book-based trading relies on market makers, buyers, and sellers, to place their orders on the exchange. Buy orders match the corresponding sell orders and are then removed from the order book. If there’s no match for any orders, they remain open until someone sends a matching order.

For example, if you want to sell one Ether (ETH) for 3000 dollars (USDC) on a Centralized Exchange, you would need to place your order on the order book. If someone already has an open buy order of 3000 dollars for 1 Ether, the exchange will automatically match and execute the two orders. Otherwise, your order will remain open until someone is willing to pay 3000 dollars for 1 Ether and creates the corresponding order.

This model works quite well for major markets, where there’s enough trading activity. The problem arises when you have smaller markets with fewer market participants. There’s not enough liquidity on the exchange in such markets, and traders cannot fill up their orders.

What is Uniswap?

Unlike Centralized Exchanges, Uniswap is built with smart contract technology to operate on a decentralized environment, such Ethereum, Arbitrum, Polygon, etc. In theory, the protocol or the exchange is not owned by any single authority, but rather the decisions are taken via a Decentralized Governance. UNI token holders can recommend changes to the protocol or vote for proposals made by others. More on UNI token and Decentralized Governance below.

Furthermore, users don’t need to go through any onboarding or KYC process to use the exchange. As long as they have funds on their non-custodial wallet, they can connect on the exchange and start trading. To trade on the exchange or swap tokens, users don’t have to deposit any funds. The funds leave users’ non-custodial wallets upon approval (from the users), smart contracts facilitate the trade, and send back to the users the purchased tokens. This approach allows users to maintain complete control over their funds.

In addition, any user can list a token on the exchange or become a liquidity provider. Usually, Centralized Exchanges require an individual or legal entity to pay a fee in order to list new tokens on the exchange. This fee can become extremely high depending on the exchange. On Uniswap, any user can create their own token, list it for free and provide liquidity.

In short, Uniswap is a Decentralized Exchange (DEX) that is open for anyone to trade, list tokens, provide liquidity, or participate in governance. It allows users to maintain control over their funds and, with smart contract technology, facilitates trading without any intermediary.

How Uniswap works?

Uniswap has a rather simplistic design. For someone using Uniswap for the first time, some things might look like magic. Especially for experienced traders on Centralized Exchanges used to trading on the order book. To understand how Uniswap works, you also need to understand the concepts of Automated Market Makers (AMM) and Liquidity Pools (LP).

Liquidity Pools

Uniswap introduced Liquidity Pools (LPs) to solve the liquidity problem described above in Centralized Exchanges (CEX). For every pair supported on Uniswap, there needs to be a corresponding Liquidity Pool. An LP is simply a pool of funds deposited on the exchange by various individuals called Liquidity Providers. Afterward, traders use these funds to trade on Uniswap and exchange their tokens.

Liquidity Pools on Uniswap support tokens in pairs. Each liquidity pool has an equal amount (in dollar value) of the two tokens, and liquidity providers deposit their funds with an equal amount (in dollar value) of the two tokens. For example, if someone wants to list his TOKENa on Uniswap and pair it with USDC, then that person has to create a liquidity pool for TOKENa/USDC. At the same time, the same person provides the initial liquidity that has to be an equal amount in dollar value of TOKENa and USDC. Other users can deposit their funds as additional liquidity, while others can use the liquidity pool to exchange USDC for TOKENa and vice-versa.

There are quite some risks associated when providing liquidity, but the big question is why do people want to become liquidity providers in the first place. For Uniswap to attract liquidity, incentivizes liquidity providers by rewarding them with a portion of the fees collected on the platform.

Initially, there was a fixed fee of 0.3% on each transaction executed on the exchange, paid by the traders to the liquidity pool. However, recently Unsiwap introduced an alternative structure, where the fee percentage can vary per pool. In some cases, liquidity pools can be configured such that a percentage of the fee goes to Uniswap’s treasury. The governance can use these funds at a later stage to further develop the platform.

Automated Market Makers

As previously mentioned, Liquidity Providers deposit their funds to create liquidity on the exchange with the use of Liquidity Pools (LPs). If there’s not an order book, then how does the exchange defines the price of the pairs? Uniswap uses the concept of Automated Market Makers (AMM) to define the trading pairs’ prices on the exchange. AMM is simply an algorithm or a pricing formula, built within the liquidity pools. Based on the liquidity provided, supply and demand, this algorithm defines the prices at any given time.

Uniswap’s AMM pricing formula is called the constant product market maker. This pricing formula, in a simplified version, is expressed as x * y = k. Where x and y are the reserves of tokens deposited in the liquidity pool, and k is a constant that remains unchanged while traders exchange tokens. Therefore, whenever liquidity providers add liquidity to the pool, they deposit their tokens in the ratio expressed by that formula. When traders exchange tokens, the reserves of the pool change. The x or y of the pricing formula will change in this case, which will lead to new prices.

Uniswap further developed its model and introduced last year Uniswap V3. Uniswap V3 allows liquidity providers to specify the range of prices they are willing their assets to be effective. This is done in order to improve capital efficiency and reduce slippage for pairs with small variations in price, such as stablecoins. Furthermore, this feature allows liquidity providers to select the price range they believe most of the trading will happen. This will lead to higher fees collected and higher returns for liquidity providers.

Putting Things Together

Uni swap or Uniswap Process. What is Uniswap? How Uniswap works
How Uniswap works. Source: Uniswap Docs

Uniswap relies on Liquidity Providers to deposit their funds into the protocol’s liquidity pools to create liquidity. This allows traders to swap tokens (or trade) on the exchange, using the funds provided by liquidity providers. In exchange, traders pay a small fee of about 0.05% to 0.3% which is paid to liquidity providers. Liquidity providers deposit their funds in order to collect fees and earn interest on their capital.

For example, consider Bob a liquidity provider and Alice a trader. Bob has a lot of ETH and USDC idle in his wallet and wants to become a liquidity provider. Uniswap’s ETH/USDC pool has 90 USDC and 9 ETH in reserves. This makes the price of 1 ETH = 10 USDC (10$). Bob has to deposit USDC and ETH based on this price. Hence, he decides to deposit 1 ETH and 10 USDC in the pool. In return, Uniswap will provide Bob with liquidity pool tokens (LP), representing the share Bob has in the pool. In this scenario, the LP tokens must correspond to 10%.

Alice decides to trade on the exchange and swaps 10 USDC for 1 ETH and pays as well 0.3% of this transaction to the liquidity pool. Hence, instead of 1 ETH, she will receive 0.997 ETH and 0.003 ETH worth of USDC will remain in the pool as a fee for the transaction. To keep calculations simple we exclude the portion paid for fees. After Alice’s transaction was executed successfully, in the pool remain 11 ETH and 90 USDC. This leads to price change. The price after the transaction is 1 ETH = 8.19 USDC.

After this transaction, Bob decides to withdraw his funds from the liquidity pool. Bob will receive his 10% share of the pool on the new balance. Hence, Bob will receive back 1.1 ETH and 9 USDC plus 0.0003 ETH as a reward from Alice’s transaction. That’s a very simplistic scenario to help you understand how the exchange works. In reality, there are millions of daily transactions on Uniswap and therefore the fees, depending on the pairs can be quite high.

Impermanent Loss

There is also the concept of Impermanent Loss that will be covered in detail in another article. Briefly, Impermanent Loss is the loss of dollar value associated with funds deposited in a liquidity pool compared to keeping the funds in your wallet. In the case above:

  • If Bob kept his 1 ETH and 10 USDC in his wallet, after Alice’s transaction Bob would have 1 ETH and 10 USDC in his wallet equal to 18.19$ (assuming new price is 1 ETH = 8.19 USDC).
  • By providing liquidity Bob ends up with 1.1003 ETH and 9 USDC including collected fees. This amount is equal to 18.011$.
  • Impermanent Loss for Bob equals to the difference of two dollar amounts, that is 0.179$

Arbitrage

To ensure that prices on the exchange are not disconnected from the wider market, Uniswap relies on Arbitragers to keep the prices in sync. Arbitrage traders are an essential component of the Uniswap ecosystem. These are the traders looking for discrepancies in prices across markets (or exchanges), and making a profit out of the price differences.

For example, if on Uniswap ETH is traded for 100 dollars and on another exchange 130 dollars, then an arbitrage trader will buy ETH at 100 dollars from one exchange and sell on the other exchange for 130 dollars.

What is Uniswap’s UNI token Utility?

Uniswaps’ UNI token has been released in September 2020. The initial supply of the token was distributed to the community with the method of an airdrop. The team allocated 60% of the overall supply for community members. In addition to the initial airdrop, Uniswap also distributed UNI tokens with the method of liquidity mining. About 21% is allocated to the team, 18% to investors, and 0.7% to Advisors.

UNI is a governance token. It gives token holders the right to participate in important governance decisions or make proposals associated with future protocol developments.

How does Uniswap’s governance work?

Uniswap’s Governance process has three consecutive phases:

  1. Temperature check: That’s the initial phase of the process. If someone wants to propose protocol changes, it has to go through this step. The purpose of the Temperature Check is to determine if there is sufficient support from the community to make changes to the status quo. Essentially, in this phase, people try to “sell” their proposal to the community and evaluate whether there’s any will from the community to support such changes.
  2. Consensus Check: The purpose of the Consensus Check is to establish formal discussion around a potential proposal. Given that someone gains enough support from the previous phase, then he can submit an official proposal for Consensus Check. No proposal will be accepted in this phase, unless it went through a Temperature Check. A 50k UNI yes-vote quorum is required for the Consensus Check to pass. If proposal does not gain enough support then the topic will be closed.
  3. Governance Proposal: Final step of the process. The proposal should be based on the winning outcome from the Consensus Check and can consist of one or multiple actions, up to a maximum of 10 actions per proposal. At this stage, proposal should include already implemented and audited code. In order to submit a proposal at this stage, you need to either have 2.5 million UNI tokens delegated to you or find someone with enough UNI tokens to submit the proposal. A seven-day voting period starts, where community members discuss the changes. If proposal passes, then the changes are applied to the protocol.

Why is Uniswap important?

Uniswap and its AMM model have become an essential building block of any DeFi ecosystem. Its simplistic design allows DeFi users to exchange tokens easily and efficiently.

The first protocol DeFi users seek when they begin their DeFi journey on a new Blockchain Network is the network’s Uniswap or Uniswap clone. Whenever a new blockchain network goes live, the first protocol that launches is a Uniswap clone. At the time of writing, there are 224 Uniswap clones, according to DeFi Lamma, deployed on more than 20 different blockchain networks.

How to Buy Uniswap ($UNI)?

Investors or DeFi users who wish to buy Uniswap’s native token $UNI, can buy and sell $UNI on many Centralized Exchanges such as Binance or Coinbase. Obviously, you can buy $UNI on Uniswap. In addition, you can find $UNI listed on other decentralized exchanges and networks such as Pancakeswap (BNB Chain) and Quickswap (Polygon).

Final Thoughts

Uniswap is a Decentralized Exchange (DEX) that allows anyone to trade, list tokens, provide liquidity, and participate in governance. It enables users to maintain control over their funds and, with the use of smart contract technology, facilitates trading without any intermediary.

As stated above, Uniswap and its Automated Market Maker (AMM) model have become an essential building block of DeFi. It is important for any Future DeFi user to understand how Uniswap works as it will become their primary tool.

In closing, if you are planning to begin your DeFi journey, it would be wise if you educate yourself about the associated risks of using Uniswap or a Uniswap clone. The list includes code exploits, code bugs, impermanent loss, rug pulls, MEV, etc. That’s a topic deserving its own article.

Aris Ioannou
Aris Ioannouhttps://coinavalon.io
Aris created Coinavalon with the purpose of helping the average person navigate the decentralized web. Aris has been passively in the space since 2017 and full time since late 2020. Before Coinavalon, Aris worked as a Business & IT Architect in the financial services sector. Aris holds an MSc in Advanced Computing from Imperial College London, a BSc in Computer Engineering from University of Cyprus and currently pursuing an MBA degree from CIIM.

Related Articles

Latest Articles