TL;DR - SUMMARY
Uniswap is a set of computer programs that run on the Ethereum blockchain and allow decentralized "swaps." It works with the help of unicorns (as its logo shows).
On Uniswap, traders can trade their Ethereum tokens without needing to trust anyone with their funds. At the same time, anyone will be able to lend their crypto to special reserves called liquidity pools. In exchange for providing money to these reserves, they will earn commissions.
How do these magical unicorns convert one token into another? What is needed to use Uniswap? Keep reading.
Introduction
Centralized exchanges have been the cornerstone of the cryptocurrency market for years. They offer fast settlement times, high trading volume and constantly improving liquidity. However, a parallel world is being built in the form of "trustless" protocols (in which trust in third parties does not intervene). Decentralized exchanges (DEX) do not need intermediaries or custodians to facilitate trading.
Due to the inherent limitations of blockchain technology, creating DEXes that can meaningfully compete with their centralized counterparts has been a challenge. Most DEXes could improve both in terms of performance and user experience.
Many developers have considered new ways to create a decentralized exchange. One of the pioneers would be Uniswap. The way Uniswap works can be a little harder to understand than a more traditional DEX. However, we will soon see that this model has some very attractive benefits.
As a result of this innovation, Uniswap has become one of the most successful projects in the Decentralized Finance (DeFi) movement.
So let's see what Uniswap is, how it works and how it will allow you to exchange tokens with just an Ethereum wallet.
What is Uniswap?
Uniswap is a decentralized exchange protocol built on Ethereum. To be more precise, it is an automated liquidity protocol. It does not require an order book or any centralized actor to make trades. Uniswap allows users to trade without intermediaries, with a high degree of decentralization and resistance to censorship.
Uniswap is open source software. You can check it out yourself, on the Uniswap GitHub.
Ok, but how are trades carried out without an order book? Well, Uniswap works through a model in which liquidity providers create liquidity reserves. Such a system provides a decentralized pricing mechanism that essentially smoothes the depth of the order book. We will discuss how it works in more detail later. For now, just note that users can make exchanges between ERC-20 tokens, without the need for an order book.
As it is a decentralized protocol, there is no listing process in Uniswap. Basically, any ERC-20 token can be launched as long as there is a reserve of liquidity available to traders. Consequently, Uniswap also does not charge any commission for the listing process. In some ways, the Uniswap protocol acts as a type of public good.
The Uniswap protocol would be created by Hayden Adams in 2018. But the underlying technology that would inspire its implementation would be originally described by Vitalik Buterin, co-founder of Ethereum.
How does Uniswap work?
Uniswap leaves behind the traditional architecture of digital exchanges in that it does not have an order book. It works using a design called "Constant Product Market Maker", which is a variant of a model called "Automated Market Maker" (AMM).
"Automated market makers (AMM)" are smart contracts that contain liquidity reserves (liquidity pools), where traders can carry out operations. These reserves are financed by liquidity providers. Anyone can act as a liquidity provider, depositing an equivalent value of two tokens into a reserve. In exchange, traders will pay a commission to the pool, which will then be distributed to liquidity providers based on their participation in the pool. Let's see then how all this works in more detail.
Liquidity providers create a market by depositing an equivalent value of two tokens. These tokens can be either ETH and one ERC-20 token, or two ERC-20 tokens. Reserves are usually made up of stablecoins such as DAI, USDC or USDT, although it is not an essential requirement. In exchange, liquidity providers receive “liquidity tokens,” which represent their share of the total liquidity pool. These liquidity tokens can be claimed for the share of the reserve they represent.
Take the ETH/USDT liquidity pool as an example. We will call the portion of the reserve formed by ETH x, and that of USDT we will call it y. Uniswap takes these two amounts and multiplies them, to calculate the total liquidity of the reserve in question. We will call this variable k. The central idea of Uniswap is that k must remain constant, which means that the total liquidity of the reserve (pool) will also always be constant. Consequently, the formula for the total liquidity of the reserve will be:
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. Doing so will increase the USDT portion of the reserve, and reduce the ETH portion. This will mean, in practice, that the price of ETH will rise. Because? Because there will be less ETH in the reserve after the transaction, and we know that the total liquidity (k) must always remain constant. This mechanism is responsible for determining prices. So ultimately, the price paid for this ETH will depend on the level of movement of the average between x and y.
It should be noted that this model does not scale linearly. In practice, the higher the order, the greater the offset between x and y. This means that larger orders are exponentially more expensive than smaller ones, leading to increasing levels of slippage. It also means that the larger the liquidity pool, the easier it is to process large orders. Because? Because in this case, the displacement between x and y will be less.
Uniswap v3
Uniswap technology has gone through several iterations to date. It is very likely that, if you have tried Uniswap, what you have used is Uniswap v2. However, there are always improvements in development. Let's see then, what are the most notable updates that Uniswap v3 will bring with it.
Capital efficiency
One of the most significant changes that Uniswap v3 will bring is related to capital efficiency. Most AMMs are very capital inefficient – meaning that most of the funds they contain at any given time go unused. This is due to an inherent characteristic of the x*y=k model discussed above. Simply put, the more liquidity in the reserve, the more orders the system can support over a wider price range.
However, the liquidity providers (LPs) of these reserves will basically be providing liquidity to a price curve (range) that will span from 0 to infinity. All that capital remains there, reserved, in case one of the assets in the reserve multiplies by 5, 10 or 100.
If something like this were to happen, such idle assets would ensure that there was liquidity left in that part of the price curve. This means that only a small part of the liquidity reserve is located in the area where most of the trading occurs.
To give an example, Uniswap currently has about $5 billion of liquidity locked in escrow, but only processes a volume of $1 billion per day. You're probably thinking that this isn't a particularly elegant way of doing things, and from the looks of it, the Uniswap team agrees with you. Uniswap v3 solves this problem.
Liquidity providers will now be able to establish custom price ranges in which they want to provide liquidity. The result should be more concentrated liquidity in the price range where most trading activity occurs.
In a certain sense, Uniswap v3 is a rudimentary way of creating an "on-chain" order book in Ethereum, in which market makers can decide to provide liquidity in those price ranges that they themselves establish. It should be noted that this change will favor professional market makers, to the detriment of retail participants. The beauty of AMMs is that anyone can provide liquidity and put their funds to work.
However, with this extra layer of complexity, "lazy" LPs will earn far fewer trading commissions than professional players who can constantly optimize their strategy. At the same time, it is not difficult to imagine the possibility of aggregators like yearn.finance offering retail LPs a way to remain, in some way, competitive in this environment.
Uniswap LP tokens as NFTs
We now understand that each LP position on Uniswap is unique, as each depositor can set their own price range. This means that Uniswap LP positions are no longer fungible. Consequently, each LP position becomes represented by a non-fungible token (NFT).
One of the benefits of representing a Uniswap LP position using a fungible token was the ability to use it elsewhere in the DeFi ecosystem. Uniswap v2 LP tokens could be deposited as collateral in Aave or MakerDAO. This no longer occurs in v3, since each position is unique. However, this loss of composability could be solved by new classes of derived products.
Uniswap in a layer 2
Over the past year, the price of transaction fees on Ethereum has skyrocketed. This made using Uniswap economically unfeasible for many small users.
Uniswap v3 will also be implemented in a layer 2 scalability solution called Optimistic rollup. It is an excellent way to scale smart contracts, without giving up the security of the Ethereum network. This implementation should lead to a massive increase in transaction processing capacity, as well as much lower fees for users.
What is impermanent loss?
As we have already mentioned, liquidity providers earn commissions by providing liquidity so that traders can carry out token exchanges. Is there anything else liquidity providers should keep in mind? Yes. There is an effect called impermanent loss (non-permanent loss).
Let's say Alice deposits 1 ETH and 100 USDT into a Uniswap reserve. Since the pair of tokens will need to be of equivalent value, this will mean that the price of ETH will be 100 USDT. In turn, there is a total of 10 ETH and 1,000 USDT in the reserve – the rest contributed by other liquidity providers such as Alice. This means that Alice's share represents 10% of the reserve. Our total liquidity (k), in this case, will be 10,000.
What will happen if the price of ETH rises to 400 USDT? Remember that the total liquidity of the reserve must always remain constant. If ETH is now worth 400 USDT, this will mean that the average between the amount of ETH and the amount of USDT in the reserve will have changed. In fact, there will now be 5 ETH and 2,000 USDT in the reserve. Because? Well, because arbitrage traders will add USDT to the reserve and withdraw ETH, until the average reflects the exact price. It is for this reason that it is essential to understand that k is a constant.
Alice then decides to withdraw her funds and gets 10% of the pool according to her share. As a result, you get 0.5 ETH and 200 USDT, for a total of 400 USDT. It looks like he made a good profit. But wait, what would have happened if she hadn't put her funds in the pool? You would have 1 ETH and 100 USDT, for a total of 500 USDT.
In fact, it would have been better for Alice to simply HODL than to deposit into the Uniswap reserve. In this case, the "impermanent loss" is, basically, the opportunity cost of depositing a token that rises in value in a common reserve. This just means that by depositing funds into Uniswap expecting to earn commissions, Alice could miss out on other opportunities.
Note that this effect acts regardless of the direction in which the price changes from the moment of deposit. What does this mean? If the price of ETH falls compared to the time of deposit, losses could also be amplified. If you want a more technical explanation on the topic, check out Pintail's article.
But why is the loss impermanent (not permanent)? If the price of the tokens contributed to the common reserve returns to that of the moment they were deposited, the effect is mitigated. Additionally, since liquidity providers earn fees, the loss can be offset over time. Still, liquidity providers should be aware of this before contributing funds to a reserve.
How does Uniswap make money?
It doesn't. Uniswap is a decentralized protocol backed by Paradigm (a hedge fund, that is, a hedge fund, specialized in crypto). All commissions go to the liquidity providers, and none of the founders get anything from the operations carried out through the protocol.
Currently, the transaction fee paid to liquidity providers is 0.3% per trade. By default, these are added to the liquidity pool, but liquidity providers can redeem them at any time. Commissions are distributed according to the participation of each liquidity provider in the pool.
A portion of the fees can be dedicated to the development of Uniswap in the future. The Uniswap team has already implemented an improved version of the protocol called Uniswap v2.
➟ Are you thinking about getting started in the world of cryptocurrencies? Buy Bitcoin on Binance!
How to use Uniswap
Uniswap is an open source protocol, which means that anyone can create their own frontend application from it. However, the most used is https://app.uniswap.org or https://uniswap.exchange.
Go to the Uniswap interface.
Connect your wallet. You can use MetaMask, Trust Wallet or any other supported Ethereum wallet.
Select the token you want to change.
Select the token you want to change to.
Click Swap.
Preview the transaction in the pop-up window.
Confirm the transaction request in your wallet.
Wait for the transaction to be confirmed on the Ethereum blockchain. You can monitor its status at https://etherscan.io/.
The Uniswap token (UNI)
UNI is the native token of the Uniswap protocol, and grants its holders governance rights. This simply means that UNI "holders" can decide by vote what changes will be applied to the protocol. We have previously talked about the fact that the protocol acts as a kind of public good. The UNI token consolidates this idea.
1 billion UNI tokens were minted at genesis. 60% of these will be distributed to existing members of the Uniswap community, while the remaining 40% will be made available to team members, investors and advisors, over the course of 4 years.
Part of the distribution to the community will be carried out through liquidity mining. This means that UNI will be distributed to those who contribute liquidity to the following Uniswap reserves:
ETH/USDT
ETH/USDC
ETH/DAI
ETH/WBTC
But who are the members of the Uniswap community? Any Ethereum address that has interacted with Uniswap contracts. Let's see how you can claim your UNI tokens.
How to claim Uniswap (UNI) tokens
If you used Uniswap, you can likely claim 400 UNI tokens for each address you used the protocol with. To claim your tokens:
Go to https://app.uniswap.org/.
Connect the wallet you previously used Uniswap with.
Click on "Claim your UNI tokens" (claim your UNI tokens).
Confirm the transaction in your wallet (you can check the current gas price in Ethscan's Gas Tracker).
Congratulations, you are now a UNI holder!
Do you want to trade your UNI tokens? Binance makes it easy for you.
➟ Click here to trade UNI tokens on Binance!
How to buy UNI on Binance
To purchase UNI, you will need to swap for fiat or crypto using the Binance exchange view. It is not possible to use a debit/credit card to purchase UNI directly. Below are the available pairs, allowing you to choose between BNB, BTC, BUSD, USDT or EUR.
If you want to acquire UNI through crypto, you can transfer the tokens to your spot wallet, or buy a certain amount of them. BUSD is a recommended option due to its price stability. You can purchase BUSD with your card by going to the [Buy Crypto] page. Enter the amount you wish 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 will be able to change pairs by clicking on the current market pair at the top left.
In the search bar write the pair you have chosen. For our example, we need UNI/BUSD.
Now you can create an order to buy UNI. The quickest way is through a market order that gives you the current spot price. You could 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 exchange view and click [Spot]. Make sure you have selected [Market] as your order type under the [Buy] tab, and enter the amount of BUSD you would like to purchase. Finally, click on [Buy UNI] to place your order.
How to sell UNI on Binance
Selling UNI is a process similar to purchasing. Firstly, make sure your UNI is in your Binance Spot Wallet. If you haven't deposited your tokens, head to 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 guide on How to deposit on Binance if you need more help.
When you have successfully deposited your UNI, open the exchange view and select the UNI pair you want to trade. Let's look at 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 under the [Sell] tab. Enter the amount of UNI you want to sell and click [Sell UNI].
In conclusion
Uniswap is an innovative exchange protocol built on Ethereum. It allows anyone with an Ethereum wallet to trade tokens without the intervention of any central actor.
Although it has its limitations, this technology may have some interesting implications for the future of trustless token exchange (without the need to trust third parties). As soon as Ethereum 2.0 scalability solutions are live on the network, Uniswap can probably benefit from them as well.