How does uniswap work and what is uniswap?
September 29, 2020
The inherent limitations of blockchain technology made it challenging to build DEXes that meaningfully rival their centralized counterpart. However, most of these DEXes we have currently, can improve with regards to user experience and performance. Consequently, developers are on the lookout to identify new ways to build a decentralized exchange. Concurrently, Uniswap, an open source decentralized and non-custodial protocol is one of the popular responses to liquidity, privacy and other related concerns. Therefore, it is at the forefront of building a DEX that will meet the demand and expectations of users.
Although its mechanism is unlike what we have seen in traditional DEX, we will explore its model of operations. In this article, we will answer the question; what is Uniswap? Leveraging innovation, Uniswap is becoming one of the most successful projects that joined the Decentralized Finance (DeFi) movement. Now let's go on to see what Uniswap is, how Uniswap works, and how you can exchange tokens on the platform.
What Is Uniswap Decentralized Exchange?
Uniswap is a decentralized exchange (DEX) protocol developed on the Ethereum blockchain. It is an automated liquidity protocol. The platform doesn't need a centralized party, and neither does it need an order book to facilitate transactions. It permits users to transact without intermediaries, while it ensures a high degree of decentralization and censorship-resistance.
Uniswap is an open-source platform, and you can verify this on the Unswap GitHub. You may be wondering how trade happens on the Uniswap platform without an order book. Uniswap decentralized exchange employs a model that allows liquidity providers to create liquidity pools. Its decentralized pricing system smooths out order book depth.
We will get into the modus of operations of the Uniswap decentralized exchange. At this moment, note that the users of Uniswap DEX can seamlessly swap between ERC-20 tokens without the need for an order. The decentralized system of Uniswap ensures there is no listing process.
Provided there is a liquidity pool for traders; any ERC-20 token can be launched. Therefore, Uniswap does not charge listing fees.
Hayden Adams created the Uniwap liquidity protocol in 2018. Meanwhile, the underlying technology that inspired the implementation of Uniswap was first described by Vitalik Buterin.
How Does The Uniswap DEX Protocol Work
Uniswap decentralized exchange (DEX) does not have the traditional architecture of digital exchange because it has no order book. It works with a model known as the Constant Product Market Maker (CPMM). The CPMM is a variant of the model called Automated Market Maker (AMM).
These AMMs are smart contracts that hold liquidity reserves or liquidity pools, and liquidity providers fund them. The Uniswap protocol allows users to become liquidity providers by depositing an equivalent of two tokens in the pool. Traders then pay a fee to the pool, and the fee is distributed to all liquidity providers according to their share of the pool.
Uniswap liquidity providers create a market by depositing an equivalent value of two tokens. The tokens can either be ETH and an ERC-20 token or two ERC-20 tokens. The liquidity pools consist mainly of stablecoins like AI, USDT, or USDC; but it isn't a requirement. In return, the liquidity providers are given "liquidity tokens" equivalent to their share of the liquidity pool. Liquidity providers can redeem these liquidity tokens for the share they represent in the pol.
For example, Dave buys 1ETH for 300 USDT using the ETH/USDT liquidity pool. By doing that, Dave increases the USDT portion of the pool and in turn, decrease the ETH portion of the same pool. Economically speaking, the price ETH goes up because of low supply because there will be less ETH in the pool. The total liquidity in the pool must remain constant, and this mechanism determines the pricing on the Uniswap DEX.
You need to note that this mechanism does not scale linearly. Hence the larger the order is, the more it shifts the balance between "x" and "y." It means that larger orders become invariably more expensive than smaller ones. Such occurrences on the liquidity pool leads to larger and larger amounts of slippage. Also, the larger the liquidity pool, the easier it becomes to process larger orders. It happens because the shift between "x" and "y" is smaller.
Flashswap allows you to withdraw up to the full reserves of any ERC-20 token on Uniswap. Using flashswap, you can execute arbitrary logic without upfront cost. However, it is possible if by the end of the transaction you either:
- Pay for the withdrawn ERC-20 tokens with the corresponding pair token.
- Return the withdrawn ERC-20 tokens with a small fee.
The Uniswap Decentralized Exchange Token (UNI)
The Uniswap exchange token (UNI) entitles its holders to have governance rights on the Uniswap protocol. It means that as a UNI holder, you can vote on changes to the protocol. Uniswap minted 1 billion UNI tokens at genesis. Sixty percent is distributed to the community members, while the remaining 40 percent are for team members, investors, and advisors over four years.
Part of this community distribution is through liquidity mining. In essence, UNI tokens will be distributed to those that provide liquidity to the following liquidity pools on Uniswap:
How To Use Uniswap Decentralized Exchange (DEX)
As an open-source protocol, anyone can create his/her frontend application for it.
- Go to the Uniswap interface and connect your wallet
- You can use MetaMask wallet, Trust Wallet, or any supported Ethereum wallet.
- Choose the token you'd like to exchange from
- Choose the token you would like to exchange to
- Click on the swap icon
- Ensure you preview the transaction in the pop-up window
- Then confirm the transaction request in your wallet
- Wait for your transaction to be confirmed on the Ethereum blockchain.
How To Claim Your Uniswap (UNI) Tokens
If you are a user on UNiswap, you can claim 400 UNI tokens per address that you used Uniswap with. You can claim your token by:
- Log on to the Uniswap app/site.
- Connect your wallet that you Previously used Uniswap with
- Click on "claim your UNI tokens."
- Ensure you confirm the transaction in your wallet
- Congrats! You are now a UNI token holder.
How To Use Uniswap With Ledger
The easier way to use ledger on Uniswap is by using MetaMask.
- Login to MetaMask or download MetaMask if you haven't got one.
- Go to my accounts
- Click on connect to Hardware Wallet
- Select Ledger
- Click connect and select from the list of addresses
- Go to Uniswap exchange
- Click connect to a wallet and select MetaMask
How Do Uniswap DEX Make Money?
All fees on the Uniswap DEX liquidity protocol go directly to liquidity providers on the platform. Hence, none of the money generated goes to the Uniswap system. Currently, 0.3% transaction fees are paid to liquidity providers. The fee is shared based on each liquidity provider's share of the pool. However, there is a possibility that a portion of these fees will be dedicated to Uniswap development in the future.
What is Impermanent Loss On Uniswap?
We will use an example to explain the impermanent loss effect. Let's assume that Dave deposits 1ETH and 100 USDT in a Uniswap liquidity pool. Since the token pair needs to have equivalent value, it means that the price of ETH id 100 USDT. Therefore, there is a total of 10ETH and 1,000 USDT in the pool; other liquidity providers like Dave fund the rest. It means that Dave has a 10 percent share of the pool.
Consider what happens if the price of ETH increases to 400 USDT, but remember that total liquidity in the pool must be constant. The current price of ETH means that the ratio of how much ETH and how much USDT in the pool has changed. It means that there are 5ETH and 2,000 USDT in the pool now. How does it happen? Arbitrage traders will add USDT to the pool and remove ETH until the ratio is a true reflection of the accurate price. This is why you need to understand that liquidity is constant.
So, Dave decides to withdraw his funds and get 10 percent of the pool according to his share. Meanwhile, he gets 0.5ETH and 200 USDT, a total of 400USDT. Although it seemed that he had made a great profit, what would have happened if he didn't put his funds in the pool? He would have had 1ETH and 100 USDT, a total of 500 USDT. Dave would have made a more significant profit by holding rather than depositing his funds in the Uniswap pool. Therefore, the impermanent loss is the opportunity cost of pooling a token that appreciates in price.
It means that by depositing funds in the Uniswap pool in hopes of making a profit, Dave may lose out on other opportunities. The impermanent loss works irrespective of the direction of the price from the time of deposit. The loss is impermanent because if the price returned to the original price when the funds were added, the effect would be aborted.
Uniswap decentralized exchange (DEX) does have its limitations, but its technology may have some exciting implications for the future of token swapping. The exchange is in a good position to benefit from Ethereum 2.0 scalability solutions once it goes live on the network. Register here https://mycryptoview.com/register on our platform to ask any question about Uniswap and earn MCV tokens!