In brief

Uniswap is a set of computer programs that run on the Ethereum blockchain and enable token swaps in a decentralized manner. Uniswap's symbol is a unicorn (likened to a "transporter" between cryptocurrency tokens).

Traders can trade Ethereum tokens on Uniswap without having to trust anyone with their funds. At the same time, they can also put loan money into reserve funds, which are liquidity pools. By providing funds to these pools, traders earn fees.

So, how do these "magic unicorns" convert from one token to another? What do you need to use Uniswap? Let's find out more.


Introduce

Centralized exchanges have been the backbone of the cryptocurrency market for many years now. They speed up transaction times, have high trading volumes, and continuously improve liquidity. However, there is a parallel world being built in the form of trustless protocols. Decentralized exchanges (DEX) do not require intermediaries or supervisors to control transactions.

Due to the inherent limitations of blockchain technology, decentralized exchanges still find it difficult to properly compete with centralized exchanges. Most decentralized exchanges have a lot of "room" for improvement in performance and user experience.

Many developers are already thinking about new ways to build a decentralized exchange. One of the pioneering developers in the segment is Uniswap. Uniswap's modus operandi can be a bit more confusing than traditional decentralized exchanges. However, we will soon see the advantages of this new model.

Thanks to its groundbreaking idea, Uniswap has become one of the most successful projects and a step forward in the Decentralized Finance (DeFi) movement.

Let's find out what Uniswap is, how it works, and how you can simply swap tokens on Ethereum with just one wallet.


What is Uniswap?

Uniswap is a decentralized exchange protocol on Ethereum. To be more precise, it is an automated liquidity protocol. There is no order book or intermediary through which transactions can be carried out. Uniswap allows users to buy and sell without intermediaries with a degree of decentralization and without censorship.

Uniswap is an open source software. You can learn more for yourself on the Uniswap GitHub.

Now, let's explain why we can make transactions without an order book? Uniswap operates on a model of crypto lenders - creating liquidity pools. This system provides a decentralized pricing mechanism, essentially smoothing out order book depth. We will learn in detail about how Uniswap works below. For now, you just need to remember that users can seamlessly exchange ERC-20 tokens without an order book.

Since the Uniswap protocol is decentralized, there is no listing process. Essentially, any ERC-20 token can be launched, as long as there is a liquidity pool available to traders. For this reason, Uniswap does not charge a listing fee. It can be said that the Uniswap protocol operates as a public good.

The Uniswap protocol was created by Hayden Adams in 2018. However, the underlying technology that inspired it was first described by Ethereum co-founder Vitalik Buterin.


How does Uniswap work?

Unlike the traditional structure, Uniswap has absolutely no order book. The protocol operates on a design called the Constant Product Market Maker, a variation of the Automated Market Marker model. AMM).

Automated market makers are smart contracts that hold liquidity reserves (liquidity pools) that traders can use to trade. These reserves are created by the amount of money injected into the pools of liquidity providers. Anyone can become a liquidity provider if they stake an amount equivalent to the value of two tokens in the pool. In return, traders will pay a fee, which will be distributed to liquidity providers in proportion to their holdings in the pool. Let's look at the example below to better understand how Uniswap works.

Liquidity providers create a market by depositing the equivalent value of two tokens. They can be one ETH token and one ERC-20 token or two ERC-20 tokens. These pools are typically made up of a stablecoin such as DAI, USDC, or USDT, however this is not a requirement. In return, liquidity providers receive “liquidity tokens,” represented by their market share of the entire liquidity pool. These liquidity tokens can be redeemed according to the portion they represent in the pool.

Let's look at the ETH/USDT liquidity pool. Call the ETH portion of the pool x and the USDT portion y. Uniswap will take these two quantities and multiply them together to calculate the pool's total liquidity. This product is called k. The idea of ​​Uniswap is that k is constant, meaning the total liquidity of the pool is a constant. The formula to calculate the group's total liquidity is as follows:

x * y = k

So, what happens when someone wants to make a transaction?

Let's say Alice buys 1 ETH for 300 USDT using the ETH/USDT liquidity pool. In this way, Alice increased the pool's USDT share and decreased the pool's ETH share. This means the price of ETH increases. Why is that? The reason is because the number of ETH after the group's transaction decreases but the total liquidity (k) of the group is always a constant. This mechanism is also what determines the final price. The price paid for this ETH is based on the proportional shift between x and y of a given transaction.

It should be noted that this form does not vary in linear proportion. In fact, the larger the trading volume, the greater the difference in the ratio between x and y. This means that larger trading volumes will make the cryptocurrency in the pool exponentially more expensive than trading with small volumes, leading to further slippage. This also means that the larger the liquidity pool, the more convenient it is to process large exchange orders. Why is that? The reason is, in this case, the ratio to balance between x and y is smaller.


Uniswap v3

The technology behind Uniswap has gone through many development iterations. Chances are if you've ever used Uniswap, you've used Uniswap v2. However, there are always new improvements. Let's take a look at the biggest impacts that Uniswap v3 brings.


Efficient use of capital

One of the most important changes coming to Uniswap v3 concerns capital efficiency. Most AMMs are very capital inefficient - meaning that most of the capital sitting in them at any given time is not being used. This is due to an inherent property of this x * y = k model discussed earlier. Simply put, the more liquidity there is in the pool, the larger orders the system can support over a larger price range.

However, liquidity providers (LPs) in these pools essentially provide liquidity for a price curve (range) from zero to infinity. All the capital that is there is reserved for the scenario where one of the assets in the 5x-s, 10x-s, 100x-s bucket.

If this happens, idle assets will ensure that there is still liquidity on that portion of the price curve. This means, only a small portion of the liquidity in the pool is where most of the transactions take place.

For example, on Uniswap there is currently about $5 billion in locked liquidity, while it only has about 1 billion in daily volume. You might think that this is not an effective way of doing things, and it seems the Uniswap team agrees. Uniswap v3 solves this problem.

Liquidity providers can now set custom price ranges for the liquidity they provide. This will lead to more concentrated liquidity in the price range where most trading activity takes place.

In a crude sense, Uniswap v3 created an on-chain order book on Ethereum, where market makers could decide to provide liquidity within the price range they set. It should be noted that this change favors professional market makers over retail participants. The advantage of AMM is that anyone can provide liquidity and put their money to work.

However, with this additional layer of complexity, “lazy” LPs will earn much less in trading fees than professional players who can continuously optimize their strategies. . At the same time, it's not hard to imagine aggregators like yearn.finance offering retail LPs as a way to stay somewhat competitive in this environment.


Uniswap LP Token as NFT

We now understand that each Uniswap LP position is unique as each depositor can set their own price range. This means Uniswap's LP position cannot be replaced. As a result, each LP position is now represented by a non-fungible token (NFT).

One of the advantages of representing a Uniswap LP position with a fungible token is how it can be used in other parts of DeFi. Uniswap v2 LP tokens can be deposited into Aave or MakerDAO as collateral. This is no longer the case with Uniswap v3 because each position is unique. However, this breakdown in composability can be addressed with new types of derivative products.


Uniswap on layer number 2

Transaction fees on Ethereum have skyrocketed in the last year. This makes using Uniswap economically impossible for many small users.

Uniswap v3 will also be deployed on a layer 2 scaling solution called Optimistic Rollup. It's a neat way to scale smart contracts while still maintaining the security of the Ethereum network. This implementation will result in a massive increase in transaction throughput and much lower fees for users.


What is temporary loss?

As we discussed, liquidity providers earn fees from providing liquidity to traders who swap tokens. So, is there anything else that liquidity providers should be concerned about? Have. That is a phenomenon called temporary loss.

Let's again assume that Alice deposits 1 ETH and 100 USDT into a pool on Uniswap. Since the above token pair needs to be of equal value, this means the price of 1 ETH is 100 USDT. In total, there are 10 ETH and 1,000 USDT in the pool – the rest is contributed by other liquidity providers like Alice. Thus, Alice has 10% of the shares in the group. Our total liquidity (k) in this case is 10,000.

What will happen if ETH price increases to 400 USDT? Remember, the total liquidity in the pool is a constant. If ETH is currently priced at 400 USDT, this means that the ratio between ETH and USDT prices in the pool has changed. In fact, currently in the pool there will be 5 ETH and 2,000 USDT. This practical outcome is because traders will add more USDT to the pool and withdraw ETH from it until the ratio reflects the correct price. This is why it is extremely important that we recognize k as a constant.

So, Alice decides to withdraw her money and gets 10% of the total amount as her share. As a result, she received 0.5 ETH and 200 USDT, for a total of 400 USDT. Looks like Alice made a big profit. But wait, what if she doesn't pump money into the tank? She will have 1 ETH and 100 USDT, for a total value of 500 USDT.

In fact, Alice can earn even more if she HOLDs this amount in her wallet, instead of placing it in the Uniswap pool. In this case, the temporary loss is essentially the opportunity cost of accumulating an appreciating token. It is understood that Alice may miss out on other earning opportunities if she deposits money into Uniswap hoping to profit from traders' fees.

You should note that this effect occurs whenever the price increases or decreases compared to the time the money was placed. What does this mean? If the price of ETH drops compared to the time of deposit, the loss can be much larger. If you want a more detailed explanation of this issue, you can read Pintail's article on Medium to learn more about it.

However, why is this loss temporary? If the price of the tokens returns to the price at the time they were added to the pool, this loss will be negated. At the same time, because liquidity providers can make a profit, this loss can be balanced out over time. However, liquidity providers need to be aware of this before pumping money into the pool.


How does Uniswap make money?

Uniswap doesn't make money. Uniswap is a decentralized protocol backed by Paradigm (a cryptocurrency hedge fund). All fees go to liquidity providers. No founder takes a cut of fees from transactions that take place through the protocol.

Currently, the trading fee paid to liquidity providers is 0.3% per trade. By default, this fee will be added to the liquidity pool but liquidity providers can take it out at any time. Fees are allocated according to the liquidity contribution of each liquidity provider in the pool.

Part of the fees may be contributed to future Uniswap development. The Uniswap team has been implementing an improved version of this protocol, named Uniswap v2.


➟ Want to get started with cryptocurrency? Buy Bitcoin on Binance today!


How to use Uniswap

Uniswap is an open source protocol, which means anyone can create applications from it. However, the most used applications today are https://app.uniswap.org and https://uniswap.exchange.

  1. Go to Uniswap's interface.

  2. Connect your wallet. You can use MetaMask, Trust Wallet or any cryptocurrency wallet that supports Ethereum.

  3. Select the token you want to exchange.

  4. Select the token you want to have.

  5. Click the Swap button.

  6. Preview transactions on a pop-up window.

  7. Confirm the transaction on the pop-up window.

  8. Wait for the transaction to be confirmed on the Ethereum blockchain. You can track transaction status on https://etherscan.io/.


Token Uniswap (UNI)

UNI is the native token of the Uniswap protocol and it gives the holder governance rights. This just means that UNI holders can vote and decide on protocol changes. We discussed how this protocol works as a public good earlier. The UNI token reinforces this idea.

1 billion UNI tokens were mined in the genesis block. 60% of it was distributed to current Uniswap community members, and the remaining 40% was provided to development team members, investors, and advisors over the past 4 years.

Part of the token distribution to the community occurs through liquidity mining. This means that UNI will be distributed to those providing liquidity to the following Uniswap pools:

  • ETH / USDT

  • ETH / USDC

  • ETH / DAI

  • ETH / WBTC

So, who are the members of the Uniswap community? The answer is any Ethereum address that has interacted with Uniswap contracts. Let's see how you can claim UNI tokens.


How to claim Uniswap tokens (UNI)

If you used Uniswap, you can claim 400 UNI tokens for each address you used Uniswap for. Steps to claim tokens:

  1. Visit https://app.uniswap.org/ .

  2. Connect the wallet you used Uniswap with before.

  3. Click “Claim your UNI tokens".

cách-yêu-cầu-token-uniswap

  1. Confirm the transaction in your wallet (you can check current gas prices at Ethscan Gas Tracker).

  2. Congratulations, you now own UNI!

Want to trade UNI tokens? Binance already offers this.


➟ Click here to trade UNI tokens on Binance!


How to buy UNI on Binance

To buy UNI, you need to swap fiat or cryptocurrency using Binance's exchange mode. You cannot use a debit/credit card to purchase UNI directly. Below are the UNI trading pairs you can choose from: BNB, BTC, BUSD, USDT or EUR.


If you want to buy UNI with cryptocurrency, you can buy it and transfer it to your Spot Wallet or buy it directly on Binance. BUSD is one of the recommended options because its price is stable. You can buy BUSD from your bank card by visiting the [Buy Crypto] page. Enter the amount you want to purchase and click [Continue] to fill in your card details.


Once you have your crypto, go to the exchange and select the UNI pair you want to trade. You can change trading pairs by clicking on the current market pair at the top left.


In the search bar, enter the pair you selected. In this example, we choose UNI/BUSD.


Now, you can create an order to buy UNI. The fastest way to buy is to use a Market order, which will help you buy UNI at the current spot price. You can also place a Limit or Stop-Limit order if you want to buy at a specific price or better.

To create your Market order, go to the right side of the platform interface and click [Spot]. Make sure you have selected [Market] as the order type under the [Buy] tab and enter the amount of BUSD you want to trade. Finally, click [Buy UNI] to place your order.


How to sell UNI on Binance

Selling UNI is a similar process to buying it. First, make sure you have UNI available in your Binance Spot Wallet. If you haven't deposited tokens yet, visit the [Fiat and Spot] page and search for UNI. Click [Deposit] for detailed instructions on how to transfer your UNI. You can also read our Binance Crypto Deposit Guide for more help.


Once you have successfully deposited your UNI, open the exchange interface  and select the UNI pair you want to trade. Take the UNI/BTC pair for example.


Use the search bar to find the pair you want. In this case, click [UNI/BTC].


To sell your UNI at the current market price, go to the right side of the screen. Click [Spot] and select [Market] as the order type in the [Sell] tab. Enter the amount of UNI you want to sell and click [Sell UNI].


summary

Uniswap is a groundbreaking exchange protocol built on Ethereum. It allows anyone with an Ethereum wallet to exchange tokens without the involvement of any intermediaries.

Despite its limitations, this technology opens up exciting avenues for trustless token exchange in the future. Once Ethereum 2.0 scaling solutions are live on the network, Uniswap will likely continue to have many desirable improvements.