Résumé

Uniswap is a set of computer programs that run on the Ethereum blockchain and allow the exchange of decentralized tokens. It all works thanks to the unicorns (as illustrated by their logo).

Traders can trade Ethereum tokens on Uniswap without having to trust anyone with their funds. Meanwhile, anyone can lend their cryptocurrency to reserves called “liquidity pools.” In exchange for contributing money to these pools, they earn commissions.

How do these magical unicorns convert one token into another? What do you need to use Uniswap? Let's continue reading.


Introduction

For years, centralized exchanges have been the backbone of the cryptocurrency market. They ensure fast settlement times, high trading volume and constantly improving liquidity. However, there is a parallel world built in the form of protocols without trusted third parties. Decentralized exchanges (DEXs) do not require any intermediaries or custodians to facilitate trading.

Due to the inherent limitations of blockchain technology, it has been difficult to create DEXs that meaningfully compete with their centralized counterparts. Most DEXs could improve both performance and user experience.

Many developers have been thinking about new ways to build a decentralized exchange. Uniswap is one of the pioneers in this field. How Uniswap works can be a little more difficult to understand than a more traditional DEX. However, we will soon see that this model has some interesting advantages.

As a result of this innovation, Uniswap has become one of the most successful projects in decentralized finance (DeFi).

Let's take a look at what Uniswap is, how it works, and how you can trade tokens on it simply with an Ethereum wallet.


What is Uniswap?

Uniswap is a decentralized exchange protocol based on Ethereum. To be more precise, it is an automated liquidity protocol. There is no order book or centralized party needed to place trades. Uniswap allows users to trade without an intermediary, with a high degree of decentralization and censorship resistance.

Uniswap is free software. You can check it out for yourself on the Uniswap GitHub.

Okay, but how do trades take place without an order book? Uniswap operates under a model that involves liquidity providers creating liquidity pools. This system provides a decentralized pricing mechanism that essentially smoothes order book depth. We will see how this works in more detail. For now, it is enough to note that users can seamlessly trade ERC-20 tokens without the need for an order book.

Since the Uniswap protocol is decentralized, there is no registration process. Essentially, any ERC-20 token can be made available as long as a liquidity pool is created for traders. Therefore, Uniswap also does not charge listing fees. In a sense, the Uniswap protocol acts as a kind of public good.

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


How does Uniswap work?

Uniswap deviates from the traditional architecture of digital exchanges in that it does not use an order book. It works with a model called Constant Product Market Maker, which is a variation of a model called Automated Market Maker (AMM).

Automated Market Makers are smart contracts that hold liquidity reserves that traders can trade. These reserves are financed by liquidity providers. Anyone can be a liquidity provider who deposits an equivalent value of two tokens into the pool. In return, traders pay a commission to the pool which is then distributed to liquidity providers based on their share of the pool. We will see how this works in more detail.

Liquidity providers create a market by depositing an equivalent value divided into two tokens. This can be ETH and one ERC-20 token, or two ERC-20 tokens. These pools usually consist of stablecoins such as DAI, USDC or USDT, but this is not a requirement. In return, liquidity providers obtain “liquidity tokens”, which represent their share of the entire liquidity pool. These liquidity tokens can be exchanged for the share they represent in the pool.

So let’s take the ETH/USDT liquidity pool as an example. We will call the ETH part of the pool x and the USDT part y. Uniswap takes these two quantities and multiplies them to calculate the total liquidity of the pool. Let's call this k. The key idea of ​​Uniswap is that k should remain constant, meaning that the total liquidity of the pool is constant. So the formula for total liquidity in the pool is:

x * y = k

So what happens when someone wants to make a trade?

Let's say Alice buys 1 ETH for 300 USDT using the ETH/USDT liquidity pool. It thus increases the USDT part of the pool and decreases the ETH part of the pool. This means that the price of ETH is increasing. For what ? There is less ETH in the pool after the transaction, and we know that the total liquidity (k) must remain constant. This mechanism therefore aims to determine the price. Ultimately, the price paid for this ETH is based on the change in the ratio between x and y.

It should be noted that this model does not have a linear scale. Indeed, the larger the order, the more it unbalances the balances of x and y. This means that larger trades become exponentially more expensive relative to smaller orders, leading to larger and larger price slippages. This also means that the larger a liquidity pool, the easier it is to process large orders. For what ? In this case, the offset between x and y is smaller.


Uniswap v3

The technology behind Uniswap has undergone several evolutions. It's likely that if you've used Uniswap, you've used Uniswap v2. However, there are always new improvements in the pipeline. Let's review the most important improvements brought by Uniswap v3.


Capital efficiency

One of the biggest changes Uniswap v3 brings is capital efficiency. This is because most AMMs are very capital inefficient, that is, most of the funds placed there at any given time are not used. This is due to an inherent feature of this x x y = k model, which we discussed previously. Simply put, the more liquidity in the pool, the more the system can support larger orders within a wider price range.

However, the liquidity providers (LPs) in these pools essentially offer liquidity for a price curve (range) between 0 and infinity. All of this capital is present in the pool to be used during a scenario where one of the assets in the pool is 5x-s, 10x-s, 100x-s.

If this happens, these inactive assets ensure that there is still liquidity remaining on this part of the price curve. This means that only a small portion of the pool's liquidity is located where most trades take place.

As an example, Uniswap currently has around $5 billion in locked liquidity, while only doing around $1 billion in volume per day. You might think that this way of doing things isn't particularly elegant, and it seems the Uniswap team agrees. Uniswap v3 fixes this problem.

Liquidity providers can now set custom price ranges for which they want to provide liquidity. This should lead to a greater concentration of liquidity in the price range where the bulk of trading activity takes place.

In a way, Uniswap v3 is a rudimentary way to create an order book on an Ethereum blockchain, where market makers can decide to provide liquidity in the price ranges they desire. It should be noted that this change favors professional market makers over individuals. The advantage of AMMs is that anyone can provide liquidity and put their funds to work.

However, with this added layer of complexity, “lazy” LPs will earn significantly less in trading fees than professionals who can continue to optimize their strategy continuously. At the same time, it's not hard to imagine aggregators like yearn.finance offering individual investors a way to remain somewhat competitive in this environment.


Uniswap LP tokens in the form of NFTs

We now understand that each Uniswap LP position is unique, as each custodian can set their own price range. This means that Uniswap LP positions are no longer fungible. As a result, each LP position is now represented by a non-fungible token (NFT).

One of the benefits of representing a Uniswap LP position as a fungible token was knowing how to use it in other parts of DeFi. LP Uniswap v2 tokens can be deposited into Aave or MakerDAO as collateral. This is no longer the case with v3, since each position is unique. However, this break in compatibility can be resolved by new types of derivative products.


Uniswap on Layer 2

Transaction fees on Ethereum have increased over the last year. This makes using Uniswap economically unviable for many small users.

Uniswap v3 will also be deployed on a second layer solution called “Optimistic rollup”. This is an excellent way to adapt smart contracts while benefiting from the security of the Ethereum network. This deployment is expected to result in a significant increase in transaction throughput and reduced fees for users.


What is an impermanent loss?

As we have seen, liquidity providers earn fees when they provide liquidity to traders who can trade tokens. Is there anything else liquidity providers should be aware of? Yes. There is an effect called non-permanent loss.

Let's say Alice deposits 1 ETH and 100 USDT into a Uniswap pool. As the token pair must be of equivalent value, this means that the price of ETH is 100 USDT. Meanwhile, there are a total of 10 ETH and 1,000 USDT in the pool, with the rest provided by other liquidity providers like Alice. This means that Alice has a 10% share of the pool. Our total liquidity (k), in this case, is 10,000.

What happens if ETH price rises to 400 USDT? Remember that the total liquidity of the pool must remain constant. If ETH is now worth 400 USDT, this means that the ratio between the amount of ETH and the amount of USDT in the pool has changed. Truth be told, there are 5 ETH and 2,000 USDT in the pool now. For what ? Arbitrage traders will add USDT to the pool and remove ETH from it until the ratio reflects the exact price. This is why it is essential to understand that k is constant.

So Alice decides to withdraw her funds and get 10% of the total, representing her share. As a result, she gets 0.5 ETH and 200 USDT, making a total of 400 USDT. It seems she made a nice profit. But what could have happened if she had not paid her funds into the pool? She would have 1 ETH and 100 USDT, for a total of 500 USDT.

In fact, Alice would have been better off HODLing rather than providing liquidity on Uniswap. In this case, the intermittent loss is essentially the opportunity cost of supplying a token whose price increases. This simply means that by depositing funds into Uniswap in the hopes of earning fees, Alice may miss out on other opportunities.

Note that this effect works regardless of the direction in which the price changes from the time of deposit. What does that mean ? If the price of ETH decreases compared to the time of deposit, losses may also be magnified. If you want a more technical explanation on this, check out Pintail's article that covers this topic.

But why is the loss intermittent? If the prices of the tokens in the pool return to the price used at the time of deposit, the effect is canceled. Additionally, since liquidity providers earn commissions, the loss can be made up over time. Despite this, liquidity providers should consider this before adding funds to a pool.


How does Uniswap make money?

This is not the case. Uniswap is a decentralized protocol backed by Paradigm (a cryptocurrency hedge fund). All fees are paid to the liquidity providers, and none of the founders receive any compensation related to trades that take place through the protocol.

Currently, the transaction fees paid to liquidity providers are 0.3% per trade. By default, they are added to the liquidity pool, but liquidity providers can withdraw them at any time. Fees are distributed based on each liquidity provider's share of the pool.

Part of the fee could be spent on developing Uniswap in the future. The Uniswap team has already deployed an improved version of the protocol called Uniswap v2.


➟ Do you want to get into crypto? Buy Bitcoin on Binance!


How to use Uniswap

Uniswap is an open-source protocol, which means that anyone can create their own application that uses this protocol. However, the most commonly used implementation is https://app.uniswap.org or https://uniswap.exchange.

  1. Go to the Uniswap interface.

  2. Connect your wallet. You can use MetaMask, Trust Wallet, or any other supported Ethereum wallet.

  3. Select the token you want to sell.

  4. Select the token you wish to purchase.

  5. Click Swap.

  6. Preview the transaction in the pop-up window.

  7. Confirm the transaction request in your wallet.

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


Le Token Uniswap (UNI)

UNI is the native token of the Uniswap protocol, and it grants its holders governance rights. This simply means that UNI holders can vote for changes to the protocol. We've already talked about how the protocol is a kind of public good. The UNI token brings this idea to life.

1 billion UNI tokens have been issued. 60% of these are distributed to existing Uniswap community members, while 40% will be made available to team members, investors and advisors over four years.

Part of the community distribution is done through distribution to liquidity providers. This means that UNI will be distributed to those who provide liquidity to the following Uniswap pools:

  • ETH/USDT

  • ETH/USDC

  • ETH/DAI

  • ETH/WBTC

But who are the members of the Uniswap community? Well, any Ethereum address that has interacted with Uniswap contracts. Let's see how you can collect UNI tokens.


How to recover Uniswap tokens (UNI)?

If you used Uniswap, you can probably grab 400 UNI tokens per address you used Uniswap with. To collect your tokens:

  1. Go to https://app.uniswap.org/.

  2. Connect the wallet you previously used Uniswap with.

  3. Click on “Claim your UNI tokens”.

how-to-claim-uni-tokens-uniswap

  1. Confirm the transaction in your wallet (you can check current gas prices on the Etherscan Gas Tracker website).

  2. Congratulations, you now hold UNI!

Do you want to exchange your UNI tokens? Binance has everything you need.


➟ Click here to trade UNI on Binance!


How to buy UNI on Binance

To purchase UNI, you will need to trade either fiat or crypto using Binance's Exchange view. You cannot use a debit card to purchase directly from UNI. Below are the possible pairs, leaving you to choose between BNB, BTC, BUSD, USDT or EUR.


If you want to purchase UNI using cryptocurrencies, you can either transfer funds to your spot wallet or purchase them. BUSD is a recommended option due to its price stability. You can buy BUSD with your card by going to the [Buy cryptocurrencies] page. Enter the amount you want to purchase and click [Continue] to fill in your card information.


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


In the search bar, type your chosen pair. In our example, we need the UNI/BUSD pair.


You can now create a purchase order for UNI. The quickest way is a market order which gives you the current spot price. You can also set a Limit order or a Stop-limit order if you want to buy at a specific price or higher.

To create your market order, head to the right side of the Exchange view and click [Spot]. Make sure you have chosen [Market] as your order type under the [Buy] tab and enter the amount of BUSD you wish to trade. Finally, click [Buy UNI] to place your order.


How to sell UNI on Binance

Selling UNI is done in a similar way. First, make sure your UNI is in your spot wallet on Binance. If you have not deposited your tokens, go to the [Fiat and spot] page and search for UNI. Click [Deposit] for detailed instructions on how to transfer your UNI. You can also check out our How to Deposit on Binance guide for help.


Once you have deposited your UNI, open the Exchange view and select the UNI pair you wish to trade. Let's take a look at the UNI/BTC pair.


Use the search bar to find the pair that suits you. In our case, click on [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 under the [Sell] tab. Enter the amount of UNI you want to sell and click [Sell UNI].


To conclude

Uniswap is an innovative exchange protocol built on Ethereum. It allows anyone with an Ethereum wallet to exchange tokens without the intervention of a centralized authority.

Although it has its limitations, this technology may have exciting implications for the future of token trading without a trusted third party. Once Ethereum 2.0 scaling solutions go live on the network, Uniswap will likely benefit from them as well.