Uniswap is a decentralized and permissionless exchange, the first version of which was launched back in November 2018 on the top of the Ethereum blockchain (ERC20 -ETH Pool) as a proof of concept for automated market makers (AMMs). The DeFi protocol was founded by the mechanical engineer Hayden Adams to allow anyone to compile the assets into shared market-making strategies.
The super-quick growth of the first version led to the development of the second version, which was launched in May 2020 with the addition of ERC20/ERC20 liquidity on the top of the first version’s ERC20-ETH.
The second version observed an explosion in the project’s growth. Within a year since the launch of v2, Uniswap facilitated a trading volume worth a whopping $135 billion, which crowned this DeFi project as the largest cryptocurrency spot exchange all across the globe.
Uniswap has started evolving into a much wider platform that not only provides a robust architecture for decentralized finance but has also helped developers, crypto traders, and liquidity providers to participate in a safe and reliable financial marketplace.
Now, the next version, i.e., v3 of Uniswap, has been recently released as of May 5, 2021. So today, in this article, we have uncovered all the corners of this release to help you develop a 360 degree understanding of this update.
What is Uniswap v3
Even before releasing the v2, the development team at Uniswap had kick-started designing the blueprint for v3. The launch of Uniswap v3 shall be done on Ethereum mainnet as well as Optimism which is an Ethereum Layer 2 scaling solution. The v3 intends to revolutionize the AMM world with some major features like Concentrated Liquidity, Capital Efficiency, Active Liquidity, Range Orders, Non-Fungible Liquidity, and much more. Let’s explore.
What is Improved and New in Uniswap v3?
A lot of new features have arrived with this new version of Uniswap that can transform the AMM forever. These features or additions have been outlined and discussed below:
Concentrated Liquidity
Concentrated liquidity is the prime ingredient of v3. To understand better, we will have to step back to a version where the liquidity is evenly distributed along the price curve when LPs provide liquidity to a v2 pool. There is no doubt in the fact that this behavior helped in controlling all the prices that ranged in between 0 and ∞ but it doesn’t make the capital-efficient because most of the assets are always trading within a specific price range.
Let’s take an example to understand better. Can you guess the price range where most of the trading is executed? It falls between $0.99 and $1.01. You should also know that this same range generates the maximum trading fees for the LPs? However, the v2 DAI/USDC pair makes use of only 0.5% of the capital for all the trading that happens in between this range of $0.99 and $1.01. Result? The remaining capital, i.e., 99.5%, is never used.
Although v3 has now joined the club to help users concentrate on the unused capital by allowing them to select a custom price range and providing greater liquidity, to make this happen, LPs make individualized price curves for each of the liquidity providers.
Capital Efficiency
Concentrated liquidity helps to provide smoother capital efficiency in favor of liquidity providers. Let’s take an example to understand better. Ashley and Barbara mutually decided to provide liquidity in Uniswap v3’s ETH/DAI pool. Both of them have $10000 each, and let’s assume the existing price of ETH to be $1,750.
Now Ashley segregates all her capital between DAI and ETH and pushes it across the whole price range (just like v2), and deposits 2.85 ETH along with 5000 DAI. However, Barabra follows an entirely different route by concentrating her liquidity and rendering capital in the price range of $1,500 to $2,500. She decides to deposit the combination of 600 DAI and 0.37 ETH, which makes the total investing sum to be $1200, and keep the balancing sum of $8800 with her for some other purpose.
Now in this example, both Ashley and Barbara would earn an equal trading fee only if the price of ETH/DAI stays in the range of $1,500 to $2,500. To put it in other words, Barbara will be able to provide only 12% of Ashley’s capital and still earn the same returns, which would ultimately make her capital 8.34x more efficient in comparison to Ashley’s capital.
Not to forget that Barabara is investing less of her total capital at risk. So if we assume a situation where the value of ETH goes down to $0, then the entire liquidity of Barabara and Ashley would move to the ETH. Both of them would lose all their capital, but the pain will be less for Barbara as she had invested a smaller amount at risk.
In a more stable pool, LP would be in a good position to provide liquidity in narrow ranges. Let’s suppose that $25 million worth of investment pushed into the Uniswap v2 DAI/USDC pool is rather concentrated in the price range of 0.99 – 1.01in v3, then it will generate the same depth that $5B in Uniswap v2 would have generated provided that the prices rest within this range. Interesting right?
The launch of v3 has allowed the maximum capital efficiency to be 4000 times better in comparison to v2. The same can be achieved if the liquidity is provided within a single 0.1% price range. Also, the pool factory of v3 can support as small price ranges as 0.02%.
Active Liquidity
Active liquidity is also an important part of the Uniswap v3 that solves a major problem of v2. If an asset’s price trading in a particular liquidity pool exits the price range of LP, then the liquidity of LP is removed from the pool, as a result of which the investor stops earning the trading fees.
In this kind of situation, the liquidity of the LPs moves unidirectional towards one of the assets, and they are left with no choice but to hold only one of them. As such, the LPs can exercise two options:
Option 1: To wait before the market price jumps back into its particular range.
Option 2: To update their account’s range for existing prices.
However, with v3, it is possible for zero liquidity to exist in a particular price range. This would invite a tonne of opportunities for liquidity providers to offer liquidity to such particular price ranges and initiate earning all the trading fees.
Range Orders
The customizability feature of v3’s LP has opened the gates for a unique feature to help market orders. Uniswap has labeled this new feature as ‘range orders,’ which can help the LPs to deposit a single token in a custom configured price range above or below the existing price. So, if a market price is to enter into the custom price range, then one asset would be sold for another asset along a smooth price curve, and the traders would still earn swap fees during the process.
If the traders use this feature by clubbing it along with a narrow price range, then it would help them to achieve a goal similar to a standard limit order that can be easily configured at a particular price.
Let’s take an example to understand better. Assume that DAI/USDC is currently trading below 1.001. Now in this situation, an LP can decide to deposit their DAI to a narrower price range between 1.001 and 1.002. Once the DAI starts trading above 1.002 DAI/USDC, then the liquidity of the entire LP shall be converted into USDC. Now the LP would need to withdraw their liquidity at this point to avoid the automatic conversion back into DAI if DAI/USDC dives back to trading at a price below 1.002.
Non-Fungible Liquidity
Since every LP can set a custom price curve in v3, the liquidity positions are not fungible anymore and are also not represented as ERC 20 LP tokens. Instead, the liquidity offered is now tracked through non-fungible ERC721 tokens.
However, in spite of this update, it seems that the LP positions falling in between the same price range shall be represented by ERC 20 tokens through peripheral contracts or partner protocols.
Apart from that, the trading fees shall not get automatically invested anymore back into the liquidity pools on behalf of LP. Rather than that, the peripheral contracts can be formed to provide such functionality.
Flexible Fees
The next feature in the Uniswap v3 is “flexibility in the trading fees,” which has proven to be an advantage for the users. In the Uniswap v2, the users were offered the standard trading fee of 0.3%, but v3 has categorized the trading fees into three different tiers – 0.05%, 0.3%, and 1%. As a result of this categorization, the LPs can now select the pools based on the risks they want to take in the trading game.
According to the team at Uniswap, the trading fees of 0.05% would be used majorly for the pools having similar assets like different stable coins. The trading fees of 0.3% would be used for the standard pairs such as ETH/DAI and the 1% trading fee for the blue-chip pairs.
Just like v2, the protocol fee switch can be activated in v3 as well, where the specific portion of the trading fees would be re-routed from the LPs to UNI token holders. Rather than the fixed percentage as it was in v2, the v3 enables flexibility by offering between 10% to 25% of the LP fees based on each pool.
Advanced Oracles
The last feature in Uniswap’s v3 is Advanced Oracles which is an upgrade to the TWAP (time-weighted average price) Oracles of the v2. The TWAP Oracles have been a vital part of DeFi infrastructure and have also been used in a plethora of projects like Compound and Reflexer. These Oracles store the cumulative sum of the Uniswap trading pair prices every second, and the same can be verified on two occasions only, i.e., once at the beginning of a period and once at the end of it so that the accurate TWAP can be calculated for such period.
With Advanced Oracles in place, it would become possible to calculate the recent TWAPs that happened in the last nine days in a single on-chain call. This has been made possible because Advanced Oracles store an array of cumulative sums rather than just one.
How to Migrate liquidity from v2 to v3
It is easy to migrate liquidity from v2 of Uniswap to the latest v3 by following the steps as outlined below:
Step 1: Launch your browser and visit the Uniswap v3 pool page https://app.uniswap.org/#/pool
Step 2: You will need to click on the “More” button and select “Migrate” from the dropdown to initiate the transfer process.
Step 3: You will need to select a Uniswap v2 or Sushiswap LP position to migrate.
To begin, click on the “Migrate V2 liquidity?” button to check your current Uniswap v2 pools. After that, click on the “Manage” to expand the details for the pool you want to move to Uniswap v3. Once done, then click on the “Migrate” button to process the request.
Note: The Uniswap v3 shall identify your existing Uniswap v2 and Sushiswap LP positions and offer several variables before processing your migration request.
Step 4: Now, you will need to select the fee tier. As already discussed, Uniswap v3 multiple fee tiers per pool. You can choose the type of fee-based on the pool type.
Step 5: You will need to set the price range now for which you wish to provide liquidity.
Based on the fee tier you select, the interface shall provide you with the option to adjust prices in either 0.10%, 0.60%, or 2.00% increments. If you have manually entered the prices, then the same shall automatically adjust to the nearest associated price tick.
In this article, the minimum and maximum prices have been set in the range of 0.1x–100x compared to the current price.
Step 6: Now, you will need to complete two more steps for migration approval. First, you will need to approve the transfer of your Uniswap v2 LP tokens. To make this happen, you will have to click on the “Allow LP token migration” button and confirm the transaction in Metamask.
Now you will need to approve the final migration of your liquidity from v2 to v3 pool. To make this happen, click on the “Migrate” button and confirm the transaction in Metamask.
Note: Please ensure to set a high gas fee that is sufficient enough to satisfy the Ethereum miners.
How to Trade on Uniswap v3
It is easy to trade on the Uniswap v3 by following the steps outlined below.
Step 1: Visit Uniswap and connect an Ethereum wallet such as MetaMask.
Step 2: Click on the Use Uniswap button appearing at the right top corner of the interface.
Step 3: Click on the Connect Wallet button.
Step 4: A modal window will appear on the interface requesting you to select a wallet. We have selected MetaMask here.
Step 5: You will receive a notification in MetaMask to confirm adding it with Uniswap. Click on the Next button and then hit the Connect button.
Step 6: Select the token from the dropdown menu you want to convert and the cryptocurrency you want to swap it for.
Note: If you cannot find your preferred token on the list, you can paste the contract address of the same.
Step 7: Once the details are ready, then click on the “Swap” button, preview the transaction in a pop-up window, and then confirm the request directly from your wallet.
Note: You will be provided with a link to Etherscan, where you can verify your transaction details.
How To Set Limit Orders On Uniswap V3
Setting the Limit Orders on Uniswap v3 is easy provided that you follow the steps as outlined below:
Step 1: Visit Uniswap from your browser and click on the Use Uniswap button appearing at the right top corner of the interface.
Step 2: Click on the Pool option from the top.
Step 3: Click on the New Position button.
Step 4: Now you will need to add the pair. We have considered the ETH/HEX pair as an example.
Step 5: Select the Fee Tier from the three options provided. We have selected a 0.3% fee.
Step 6: Now you will need to set your price range i.e. Minimum Price and Maximum Price.
Note: You will be able to observe the current price of the pair for which you have set the price range.
Step 7: You will need to deposit the amount. Set the amount and click on the Add button.
Step 8: A pop-up window will appear for the final confirmation. Click on the Add button and you will receive the notification on MetaMask for the transaction approval. Click on the Confirm button and the transaction shall be completed.
Conclusion
Uniswap v3 is an amazing upgrade of the v2 version. With the unique features provided in this latest release like concentrated liquidity, capital efficiency, active liquidity, range orders, non-fungible liquidity, flexible fees, and advanced oracles, the users shall have a lot of benefits to upscale their cryptocurrency trading and investments experience.
Post Contents