Decentralized exchanges are a solution to various problems of centralized exchanges like the risk of hacking, mismanagement, and arbitrary fees. As such, decentralized exchanges also have their own problems as they lack liquidity. It is where Uniswap Exchange comes into the picture.
Uniswap is a decentralized exchange that aims to solve the liquidity issues where the exchange is able to swap tokens without depending on the buyers and sellers who create that liquidity.
Uniswap is one of Ethereum’s biggest wins right now and the project has a raft of new inventions coming up in the future. Let’s go in-depth about what is Uniswap, how does it work, how to use Uniswap, and much more.
What is Uniswap?
Uniswap is a Decentralized Exchange hosted on the Ethereum Blockchain as well as a public, open-source front-end client. Uniswap exchange allows easy trading and listing of ERC20 tokens.
This decentralized exchange is built around the values of decentralization, censorship-resistance, security, and permissionless utility. Hence, it has become Ethereum’s most popular Automated Market Maker (AMM) exchange after its launch in November 2018.
Uniswap allows the users to contribute to liquidity pools for any ERC20 tokens and get a commission in the form of exchange fees for doing so. Uniswap exchange has two features which are Swap and Pool.
The Swap feature of Uniswap allows users to swap Ethereum with different ERC-20 tokens. The Pool feature allows users to earn through providing liquidity, wherein the tokens are deposited into the smart contracts and the user will receive pool tokens in return.
Let’s now understand what are these liquidity pools.
What are the liquidity pools?
Liquidity pools are pools of tokens locked in a smart contract. They facilitate trading by providing liquidity and are used in some of the decentralized exchanges. Bancor was the first project to introduce liquidity pools, but Uniswap made them a trendsetter.
How do they work?
One liquidity pool holds a pair of tokens and each pool will create a new market. DAI/ETH can be a good example of a liquidity pool on the Uniswap exchange. When a pool is created, the first liquidity provider sets the initial price of assets in the pool. The liquidity provider will be rewarded with LP tokens for supplying an equal value of both tokens to the pool.
When a trade is assisted by the pool, a 0.3% fee is distributed uniformly among the LP token holders. If any liquidity provider wants to get their liquidity back, then they should their LP tokens. Each token swap facilitated by a liquidity pool results in a price adjustment. This mechanism is called the Automated Market Maker (AMM) and different protocols use slightly different market maker algorithms.
Some DEX like Uniswap uses a constant product market maker algorithm which ensures that the product of the quantities of the 2 supplied tokens always remains the same. So a pool can always provide liquidity irrespective of how large the trade is.
How does Uniswap work?
Uniswap is an automated liquidity protocol that is implemented in a system of non-upgradable smart contracts on the Ethereum Blockchain. Uniswap is open-source software licensed under the GPL. There are smart contracts associated with Uniswap, wherein each smart contract handles a liquidity pool made up of reserves of two ERC20 tokens.
In Uniswap exchange, anyone can be a liquidity provider for a pool just by depositing an equivalent value of each token in return for pool tokens. These pairs in the Uniswap exchange act as automated market makers to accept one token for another as long as the “constant product” formula is preserved.
This constant product formula is expressed as x*y=k, which depicts that the trades must not change the product (k) of a pair’s reserve balances (x&y). As k remains stable it is referred to as the invariant.
Now let’s see how token swaps, liquidity pools, and smart contracts work in practice.
Smart Contracts: Individual smart contracts manage Uniswap trading pairs. They run in the back-end. Each smart contract is responsible to manage a liquidity pool.
Liquidity Pools: Anyone can be a liquidity provider wherein they can create pair contracts for any two ERC20 tokens. These liquidity providers can then deposit an equivalent amount of ERC20 tokens in return for pool tokens.
Liquidity Tokens: Uniswap exchange mints the liquidity tokens to the liquidity provider’s address. It is equivalent to the liquidity provider’s contribution to the pool. The liquidity providers will burn the liquidity tokens to get rewarded in the form of fees paid by the trader. The liquidity provider can then redeem any ERC20 asset at any time.
Trading: In Uniswap, trading is replaced with swapping. The users will specify the input and output token of their interest. The amount of input tokens is also specified by them. Uniswap will then evaluate the total amount of output tokens that the user will receive. Hence, the swap takes place with just a click.
Uniswap Trading Fees: In the Uniswap exchange 0.30% of fees are applied to all trades. This amount is divided as:
- 83.3% (0.25% of the amount traded) which goes to the liquidity providers.
- 16.6% (0.05% of the amount traded) which goes to the protocol.
Uniswap Withdrawal Fees
Some exchanges offer low trading fees but they have high withdrawal fees. They have this mechanism because they know that once the user gets in, they can’t come out without paying the withdrawal fees. Uniswap is totally the opposite of the spectrum. Uniswap charges the network fees only when the user executes a transaction. The Ethereum network is too high. The average fee on the Ethereum network is $35 (that will change according to the network load. The high fee is because Uniswap is getting new traders daily and everyone wants to fast confirmations so they pay more fees than others.
How to use Uniswap?
To all the beginners using Uniswap, here is the step-by-step procedure of how to use Uniswap:
- Firstly, the user should install a Metamask (Web 3 Wallet). It is available to install as a Google Chrome extension. All the trading process is carried out through this decentralized wallet.
- Then, the user should visit the Official website of Uniswap and click on Launch App.
- After clicking the link, the user will be redirected to the Swap/Pool page. On visiting the page, the user has to select the version of Uniswap. Version 2 is the most preferred one.
- Later, the user can install and connect their Metamask wallet to Uniswap exchange using the “Connect to a wallet” option on the screen.
- Connecting the MetaMask wallet to Uniswap.
- Suppose the user wishes to Swap, then he/she should select the input token.
- A range of options of tokens will appear on the screen.
- Then, the user should select an output token.
- Suppose the user selects MATIC token.
- A swap occurs and the output token will be received in the Metamask wallet.
- Suppose, the user chooses pool, to add liquidity.
- The user can then select the tokens of their wish to put in a pool.
- Hence, Uniswap exchange is an easy and safe decentralized exchange platform.
How to add a token to the exchange?
Anyone can list a token on the Uniswap exchange for trading. They can follow the process given below with an example:
The user should first visit the swap page of the exchange, which appears like the one below:
The user should click on the “Select a token” option.
There is a “Search name or paste address” option on the screen. Here, the user can paste in the contract address of the ERC-20 token they would like to list.
For example, let’s say the user has minted 1 million B52 test tokens where the token address can be found on etherscan.io as 0xc47828014f40322fc24d9c2340ef29d754d67cf4. Then, the user will paste this address in the box and instantly find their 100,000 B52 tokens.
After selecting the token, there is a warning screen that appears on the screen.
After carefully reading the warning message, the user should click “I understand”. Now, the user will land on the main Uniswap trading interface where there are two buttons “Swap” and “Pool” appearing on the top. The user should then click on “Pool” and this screen appears:
The user should then press the “Add Liquidity” button. If prompted, the user should paste in their token contract token address again and select the respective token in the dropdown menu. Now, the page appears like this:
Now, the user should select the prominent token ratio set. After selecting the ration, the user should approve Uniswap to handle the B52 tokens. Let’s say the user selects a ratio of 0.1 ETH and 50,000 B52 tokens as a demonstration and then click the “Approve B52” button. Now, the user has to send a transaction so they need to press “Confirm” as prompted:
The final confirmation prompt will look like the one below:
Once the user is ready, he/she should press the “Create Pool & Supply” button, submit the transaction and wait for it to go through. After its done, the liquidity pool will be created resulting in the token being listed on the Uniswap exchange.
Now, the user can go to Uniswap’s “Pool” tab to visit the liquidity provider dashboard which looks like the one below:
How do Uniswap pools work?
Uniswap is mainly known for its crypto native utility and a crypto native earning opportunity. Uniswap’s liquidity pools consist of pools of tokens, wherein each token is secured by its own smart contract. As Ethereum is the foundational infrastructure of Uniswap, users can trade through these pools without any permission, 24*7, and without any account creation requirements. The rewards for liquidity providers is their ability to earn a part of the given Uniswap pool’s fees.
How to add liquidity to Uniswap?
Adding liquidity to an already existing Uniswap pool is similar to the listing sequence. Firstly, the user should navigate to their interested pool. Then, the user should go to the Uniswap “Pool” tab and click on it. After that, the user can click on the “Add Liquidity” button. The user should then submit a transaction according to their desired token allotments and after the transaction is confirmed, the liquidity will then be added to the pool.
How to remove liquidity from Uniswap?
Withdrawing liquidity from Uniswap is easy as well. The user should go to the Uniswap “Pool” tab, at the bottom of the widget there is a “Remove” button. The user can click on the button and he/she will be directed to the liquidity removal dashboard. In the dashboard, the user will have an option to remove 25%, 50%, 75%, 100%, or a more specific amount of their liquidity. The user should approve the transaction, submit their removal request transactions and finally, their assets will be returned into their wallet after the confirmation of the transaction.
How to check liquidity for a token on Uniswap?
The user can visit the uniswap.info website and paste the token address to see an expanded information dashboard on a particular Uniswap liquidity pool. Suppose the user submits the B52 contract address and click on the subsequent popup which appears like this:
This dashboard will display metrics like total liquidity, 24-hour volume, 24-hour fees, and all the transactions involved with the selected pool.
Uniswap Token (UNI)
The leading decentralized exchange has announced its native token UNI on 16 September 2020. Uniswap is the number 1 decentralized exchange according to the trading volumes. The UNI token gets listed on Binance on the launch day and on Coinbase proa day after the launch. Almost all major exchanges listed the UNI token.
UNI token is airdropped to the users of uniswap exchange those made a transaction on uniswap before 1 September. Every eligible user gets 400 UNI tokens. At the time of airdrop, the UNI token is trading around $3 price that means users get approx $1200 airdrop. If someone holds the 400 UNI tokens, it’s worth now $2600. The price of the UNI token is $6.5 (at the time of writing 19 September 2020).
UNI token is the native token of the Uniswap protocol. UNI token is a governance token and the holder can vote for the best results. Users can make changes and modifications by using their rights.
UNI holders are responsible for ensuring that governance decisions are made in compliance with applicable laws and regulations. To help facilitate this, the fee switch has been initialized to a contract UNI holders can use to vote on tokens for which they will collect fees. The community is encouraged to consult knowledgeable legal and regulatory professionals before implementing any specific proposal.
How is it unique from other exchanges?
- When compared to other decentralized exchanges, Uniswap offers various features mainly for small traders.
- It has no listing fees, does not require any native tokens, and some of the cheapest gas cost of any DEX.
- Uniswap is an open-source project on GitHub and is permissionless which means any individual can create any ERC market as long as they have an equal amount of ETH to back it.
- Uniswap is the most active decentralized exchange among all and has also become the de facto exchange for DeFi tokens to be traded on the platform.
Disadvantages of Uniswap
- Uniswap tolerates technical risks that are associated with smart contracts as they can be attacked or obstructed.
- Uniswap depends on arbitrage trading to constantly check the exchange rate, so, there will be a need for other forms of exchange to keep the rates balanced.
- Gas fees are required to be spent to perform swaps. As Ethereum scales, these gas prices will reduce gradually and become a non-issue.
- Uniswap is still under development and their documentation is yet to be completed.
Future of Uniswap
Uniswap is an open protocol of smart contracts where anyone can build a front-end user interface on top of it. For instance, InstaDApp allows the users to add funds into the Uniswap pools without the need for any access to the official Uniswap UI.
New interfaces such as DeFiZap allows users to add funds to the Uniswap pools using only ETH. The UI also offers simple one-click solutions for purchasing pool tokens in combination with bZx token strategies.
Uniswap is reaching greater heights and its stats are proof. At the time of writing, Uniswap powered approx $1,061,216,824 in daily trading volume. If the decentralized exchange can raise so rapidly, then it has a bright future. In the coming days, it will be interesting to see if Uniswap will gain traction as it gained in the last year.