What is Uniswap?

Advanced

10 mins read July 28, 2023

Other than crypto exchanges, there is another form of exchange that is referred to as Decentralised Exchange (DEX). Decentralised exchanges require no custodian or middlemen to facilitate trading. The limitations on the blockchain have made it quite a challenge to set up decentralised exchanges that can meet the needs of the crypto community as well as crypto exchanges. In this regard, developers are making strides to improve the performance of DEX as well as its user experience. One of such innovations by developers to make this a reality is Uniswap.

What is Uniswap?

In 2018, the Uniswap protocol was developed by Hayden Adams, who was said to be inspired to work on the project by one of the posts made by Vitalik Buterin, Ethereum founder. Uniswap is an exchange protocol on ethereum that is used for swapping ERC-20 tokens. It eliminates the need for a custodian or centralised party to facilitate trading. As an automated liquidity protocol, Uniswap allows traders to trade without order books or intermediaries.

Uniswap is designed to act as a public good, which means that unlike other crypto exchanges it doesn’t charge any listing fees. It is open-source software and can be found listed as such on GitHub. As open-source software, its code can be copied by anyone to create a separate decentralised exchange. In fact, users can list their tokens on the exchange at no extra costs, unlike crypto exchanges which may charge extra fees for new coins to be listed.

Apart from this, users on Uniswap maintain full control of their funds at all times. Crypto exchanges require that users give up control of their private keys so that their orders can be executed on the internal database of the crypto exchanges. This may prove time-consuming and sometimes even expensive. However, Uniswap allows users full control of their private keys without having to put their funds in the hands of others.

Another feature that distinguishes it from other exchanges is that it doesn’t need to match buyers and sellers to execute a trade. Using a simple match equation, ETH, and a pool of tokens it can determine prices and execute trades. In essence, Uniswap is fully automated and can operate without any third party.

It is no surprise that Uniswap is considered one of the most successful projects that are an integral part of the DeFi movement.

How Uniswap works

Before we get started on explaining how Uniswap works, it is important that you understand the order book system. Think of the order book as a ledger where buy and sell orders are listed along with the amount placed in each order. The order book is used by crypto exchanges across the globe. For a successful trade to be executed with the order book system, a buy order would be matched with the sell order on the same book at the same amount and price of that asset, and vice versa. The amount of buy and sell orders for an asset on the ledger is referred to as market depth.

For instance, you may wish to sell 1 ether (ETH) at a price of $2,000 on a crypto exchange. For that trade to be executed, you would need to wait for a buyer who is willing to buy that amount of ETH at that price or even higher on the other side of the order book.  This might pose a problem when there is a narrow market, that is when the market is quiet and there isn’t a lot of buy or sell orders.

However, while Uniswap is also an exchange platform, it does not use the order book system. Uniswap eliminates the need for an order book; rather tokens are exchanged directly through liquidity pools which are defined by its smart contracts.

The Uniswap protocol runs on automated computer programs. It operates two smart contracts, that is, the exchange and factory contract. The exchange contract executes trade (token swaps) while the factory contract allows for new tokens to be added to the platform. Uniswap doesn’t use an order book but operates with a Constant Product Market Marker which is a derivation of the Automated Market Maker (AMM).

Automated Market Marker (AMM) 

Automated Market Marker (AMM) refers to smart contracts that provide liquidity pools/reserves which traders can trade against. The liquid pools are funded/sponsored by liquidity providers. The protocol allows anyone to become a liquidity provider as long as they can deposit an amount equivalent to two tokens in the liquid reserve which can either be ETH or ERC-20 tokens. The pool may comprise stablecoins such as USDT, DAI among others. The traders who utilise the AMM are charged a fee which is distributed across the liquidity providers according to the percentage they have staked in the pool.

This incentivises traders to fund a liquid reserve that traders can trade against to facilitate trade without the need for a third party. Liquidity providers have the option to select the token pool they wish to fund. The prices of the token are determined mathematically by computer programming. With the implementation of the AMM, traders do not have to worry about the liquidity of the market and can sell without a buyer and vice versa.

The Automated Market Marker eliminates the need for an order book system in the calculation of the token price. The price of an asset is determined by the highest buyer and lowest seller in the order book system. However, the AMM uses a mathematical equation, x*y=k in the calculation of the price of an asset. This is calculated by alternatively increasing or decreasing the price of an asset based on the amount of coins in a specific pool.

For instance, a trader may wish to trade ETH/DAC. In this case, the trader deposits ETH into the pool thereby increasing the amount of ETH in the pool. The trader withdraws DAC from the pool reducing the amount of DAC in the pool. What does this mean? The x*y= k formula dictates that K is a constant value. To maintain “K”, the price of ETH reduces and the price of DAC increases. Therefore, for subsequent times the trader makes that exchange he would get less ETH for the same price.

It is important to note that the size of the liquid pool may also influence price changes. This is because there would be less impact on the price of an asset if the liquid pool is larger. Therefore, the size of an order may significantly affect the balance of “x” and “y” resulting in a shift in the price.

How to use Uniswap

There is no special skill required to get started with Uniswap, all you need is an ERC-20 supported wallet such as MetaMask, Trust wallet, Fortmatic. The first step is to credit your wallet so you can pay for gas (ethereum transaction fees which may vary in price depending on your service provider). Your wallet service provider may give you an option ranging from slow, medium to fast on the Ethereum blockchain which may result in price variations.  The speed you select would affect how fast your transactions are processed by ethereum network miners.

Uniswap is an open-source website resulting in variations developed by different developers. However, you can use either of these to get started: https://uniswap.org, https://app.uniswap.org or https://uniswap.exchange.

  1. Connect to the Uniswap interface
  2. Click on the “use Uniswap” option displayed on the dashboard
  3. Click on the “connect wallet” option and select your wallet type
  4. Select the token you would like to exchange from and to
  5. Click on swap to confirm
  6. A preview would be displayed on your screen for confirmation, confirm the transaction

Wait as the transaction is confirmed on the Ethereum blockchain. You can also monitor the progress through https://etherscan.io/. All you have to do is copy and paste your transaction ID on the website.

What are Uniswap tokens (UNI)

The Uniswap native token (UNI) is a governance token. Holders of this token are given a special privilege to vote on modification and developments on Uniswap. For instance, they are allowed to vote on the fee structure and how minted tokens are distributed among members of the community and developers. It was created in September 2020 to promote allegiance among members who were switching to its rival DEX, SushiSwap.

SushiSwap, a fork of Uniswap had in a bid to gain more followers rewarded its users with SUSHI tokens for relocating their funds to the platform. SUSHI token allows its users voting right and a percentage of transaction fees paid by traders to the platform. In a bid, to retain its members Uniswap created about 1 billion UNI tokens. About 150 million of these tokens were distributed to all their users. Each user received 400UNI tokens which was equivalent to $1000.

What is Arbitrage in Uniswap?

Arbitrage traders are traders who spot price differences on a trading platform and use that to generate a profit. They buy an asset cheaper from a crypto exchange and sell at a higher cost to another crypto exchange.

On the Uniswap network, they are on the lookout for tokens that are trading below or average the average market price and buy or sell them according. By consistently doing this, they work towards rebalancing the relationship between “x” and “y” till there isn’t any more profit to be made. Therefore, their actions on the Uniswap network ensures that the token price remains at competitive prices with those in other exchanges.

The actions of arbitrage traders may lead to an impermanent loss for liquidity providers. The change in the price of an asset may affect the value of the asset withdrawn by liquidity providers. This is because in their bid to balance the prices, they would invariably increase one asset and decrease the other asset. If a liquid provider had more of the asset that was decreased then his withdrawal would be less. However, this isn’t considered an impermanent loss to liquidity traders as the profit generated from transaction fees is more than enough to cover losses as a result of arbitrage.

Modifications on the Uniswap Protocol

The Uniswap protocol is decentralised and doesn’t make any profit. All profit generated from transaction fees are distributed among liquidity providers; even the founders of Uniswap do not get a cut from the profit generated. Presently, liquidity providers receive 0.3% per trade which they can redeem at any time. The profit is distributed according to the percentage each liquidity provider has staked in the pool. It isn’t uncommon to find a percentage of the fees set aside for modifications and development of Uniswap. In fact, two modifications to Uniswap have been created that is, the Uniswap v2, Uniswap v3.

The latest version of Uniswap that is the Uniswap v3 possesses some features which help with capital efficiency. This is largely because of its mathematical computation which dictates that “k” must be constant. As such the funds pooled by liquidity providers lays dormant. The reason why the funds locked up in a reserve may seem dormant is that the liquidity is used to maintain a price curve between zeros to infinity. In a situation that one of the assets in the pool gets a price curve of 5x-s, 10x-s, 100x-s, the liquidity reserved would come in handy.  The reserve would ensure that there is still liquidity, so you may consider the reserve as a form of backup. For instance, Uniswap presently has about $5 billion funds locked up and only runs about $1billion daily.

The modifications in the Uniswap v3 allows liquidity provider set price ranges for which they would like to provide liquidity for. This would allow more concentration in the price ranges allowing for more liquidity. Concentrated liquidity would also reduce price shifts that arise from large trade volumes. The new modifications to Uniswap in its v3 create a form of on-chain order book system on Ethereum. However, this may come at a disadvantage to lazy Liquid providers who may need to optimise their strategy to make more profit as the new modifications favour professional market makers. However, aggregators like Yearn Finance can use this as an avenue to help liquidity providers to remain competitive in setting their price range.

The new feature that allows liquid providers to set their custom price range connotes that their positions aren’t fungible any longer. This means the Uniswap Liquidity provider’s position is currently represented by a Non-fungible token (NFT). As a fungible token, it could be used in any aspect of DeFi but these may be difficult with the uniqueness of the token in the v3. However, developers are working on how derivatives can be made to fix this new development.

During the course of the last year, the transaction fees on Ethereum skyrocketed making it difficult for smaller traders to participate actively within the community. However, with the Uniswap v3, the scaling solution, Optimistic rollup is implemented resulting in lower transaction fees allowing smaller traders to fit better in the community.

Conclusion

Currently, Uniswap is the fourth-largest DeFi built on the Ethereum blockchain. With an Ethereum wallet, you can easily swap tokens without the need for a third party, like a crypto exchange. It allows anyone to earn from transaction fees, by contributing to the liquidity reserve. It eliminates the need for an order book system by operating an Automated Market marker. The cost of the transaction fees may be its major challenge of yet as it limits smaller users from participating actively in the network. However, Uniswap is still undergoing modifications to help meet the needs of the members of its community.

Disclaimer: This article is meant to provide general guidance and understanding of cryptocurrency and the Blockchain network. It’s not an exhaustive list and should not be taken as financial advice. Yellow Card Academy is not responsible for your investment decisions.

Crypto scoop

Sign up for our weekly newsletter

Stay informed with the latest updates to buy, sell, and store your crypto on the go.

phone

Download the Yellow Card app

Start trading crypto with ease

Get the Yellow Card app to buy, sell, and store your crypto on the go.