Description: In this article we consider the issue of providing liquidity to Uniswap v3, namely what it is, how the process goes, how to choose fees and set ranges, what the risks are, and what to consider when making the decision.
Decentralized finance (DeFi) changes the way people use blockchain technology, and Uniswap is at the forefront of this revolution. Concentrated liquidity, as well as multiple fee tiers, among other new features, is now available for Uniswap v3 users. The new pool mechanic is designed to give more flexibility to providers of liquidity.
Image credit: LCX
You can earn a share of those trading fees by depositing your tokens into a liquidity pool in Uniswap v3, but that also introduces new concepts and risks. We’re going to guide you through how it works and how you can provide liquidity on Uniswap v3 in a step-by-step sequence that will help you to understand what it is you’re doing setting up your position and managing it.
Whether you’re a beginner or an experienced DeFi user interested in trying Uniswap v3’s more sophisticated features, this guide will give you the confidence to get started.
What Is Uniswap?
So, first of all, what’s Uniswap? Uniswap is an Ethereum (ETH)-based decentralized cryptocurrency exchange. It enables users to exchange cryptocurrencies without using an intermediary wallet or order book. These transactions are carried out through Uniswap v3 liquidity pools using Automated Market Maker (AMM) models.
The Uniswap exchange is not a conventional centralized platform, like Coinbase or Binance, meaning that there is no single entity that has complete control over it. This also means that the platform has no single point of control or failure.
Uniswap pools are smart contracts that contain reserves of two or more ERC-20 tokens. Users can deposit their tokens into these pools, allowing them to supply liquidity for them, and are compensated in fees from trades that happen in that pool.
Here’s a brief explanation of how it works:
User A and User B are interested in exchanging Token X with Token Y.
Instead of the case that provides a counterparty, User A interacts with the liquidity pool that includes Token X and Token Y.
The price is determined by the pool’s balance of Token X and Token Y.
User A's tokens are exchanged for the pool's other token, and the price reacts accordingly.
User A gets the tokens they wanted, and the pool's balance is adjusted accordingly.
What is Uniswap v3?
Now let’s consider what Uniswap v3 is. This is the third iteration of the widely popular decentralized exchange (DEX) operated by Uniswap, famous for its AMM system. The core innovation implemented in this novel mechanism is the concept of concentrated liquidity, which enables liquidity providers (LPs) to focus their capital in different price ranges and in turn drive substantial improvements in capital efficiency. This differs it from v2, in which liquidity was evenly distributed across all price points. Uniswapv3 also incorporates multiple fee levels, better price oracles, and the ability to gesture liquidity positions as non-fungible tokens (NFTs).
Uniswap v3 vs. Uniswap v2
Here’s a comparison of Uniswapv3 and Uniswapv2, their features, drawbacks, and the things they differ in and have in common.
Uniswap v3 and Uniswap v2 – a Comparison Table:
Feature
Uniswap v2
Uniswap v3
Liquidity Provision
Liquidity is fragmented over the entire price space (0, ∞). LPs collect fees on every trade, but when the price is held in a tight range, a large portion of the liquidity goes unused.
LPs can focus their liquidity within a bespoke price band where they anticipate trading activity, delivering capital more efficiently.
Capital Efficiency
Less: there is very thin liquidity at all prices, so only a small portion of it is actively being employed at any given moment.
More: concentration of liquidity near the present price earns more fees with less capital.
Earnings Potential
Lower: liquidity is used inefficiently.
Higher: if the price stays within your selected range, you will collect a higher fee vs. your capital.
Fee Tiers
Flat fee rate: 0.30% for all pools.
Several fee tiers (0.05%, 0.30%, 1%), and LPs can select one based on the pair volatility.
Flexibility & Risk Management
Easy and passive: deposit tokens and earn fees without much setup.
More flexible and more complicated: you need to understand about price range and risk, such as the impermanent loss that you face outside of the range you set.
Non-Fungible Positions
Liquidity positions are fungible (in the form of LP tokens, represented as ERC-20s).
Positions are non-fungible and are represented as unique NFTs since each LP position can have a unique range of price and fee tier.
Use Cases
Best for passive LPs who prefer simplicity and don’t want to be active in managing their position.
Best for advanced users and active managers looking to maximize capital efficiency and minimize fees.
What Is Concentrated Liquidity in Uniswap v3?
In Uniswap v2 tokens are allocated to all prices ranging from 0 to infinity, in equal proportion to their relative share of the pool. But for most pools, liquidity ends up never getting used. For example, only around 0.50% of the capital in the v2 DAI/USDC pair is available to trade between $0.99 and $1.01, the range in which LPs (liquidity providers) receive the most volume and fees.
Since v2 LPs earn fees only on a tiny portion of their capital, they are not getting adequately paid for the price risk they face by holding disproportionate amounts of both tokens. Meanwhile, traders get bad slippage because liquidity is not concentrated around any price range but spread too thinly.
Image credit: Medium
Uniswap v3 solves for these issues by enabling LPs to concentrate their capital in their own custom ranges of prices, therefore exposing more liquidity at preferred prices. This allows LPs to generate custom price curves that align with their strategies and preferences.
Choosing Range & Fee Tiers
In Uniswap V3, selecting the optimal fee tier and price selectivity before providing liquidity is a matter of balancing risk and reward. Fee tiers (0.05%, 0.3%, and 1%) give LPs a means to match their risk tolerance with the trading pair’s volatility, and specifying a price range defines when your liquidity participates and earns fees.
How Ranges Impact Fees & Risk
Liquidity providers (LPs) in Uniswap v3 collect fees from trades that are within their specified range:
Tighter levels means greater potential fees (assuming the price remains within levels)
Higher ranges means less Uniswap fees (but more moderate)
As for the risks, there are two major ones: impermanent loss (IL) and out-of-range risk.
Impermanent loss is a loss of profit due to the relative difference in price of the assets you initially deposit and the price of the assets at the time of withdrawal.
Out-of-Range Risk: the market is outside your chosen range, your entire position is shifted to one asset (the one that isn’t moving), and you’re earning no fees.
The main idea is to allow liquidity providers to accept impermanent loss is because it allows the AMM to generate profitable revenue.
Fee Tier Selection Explained
Uniswap V3 allows liquidity providers (LPs) to select a variety of fee tiers as they provide liquidity into the pool. This represents a key improvement over Uniswap V2, in which all trades carried a standard 0.30% fee. V3 provides several such fee levels: 0.05%, 0.30%, and 1.00%, to suit a variety of assets and trading behaviors:
0.05% should be used for highly correlated pairs such as stablecoins (e.g., USDC/DAI), where prices don’t move much and volume is high.
The default value is 0.30%, which works well for most liquid token pairs (e.g., ETH/DAI).
The 1.00% fee is intended for exotic or high-volatility assets where LPs require higher premiums for more risk.
When opening a new position, LPs choose the fee tier they think best reflects the risk/reward profile of the pair for which they are providing liquidity. Traders then pay the fee on any swap in that pool, and the fee is paid to the LPs, the percentual share of liquidity of which at that active price range is equal to the LP title’s percentual share of that pool.
This flexibility allows LPs the ability to mold their strategies to market conditions, maximizing gains while maintaining competitive trading costs.
Adding Liquidity Step-by-Step
And now let’s consider the sequence of actions of adding liquidity to the pool. Here’s a step-by-step guide on adding liquidity on Uniswap v3.
To connect your wallet, click on the “Connect Wallet” button in the top right corner, then select your wallet, e.g., MetaMask, Coinbase Wallet, etc. If you are using a browser wallet, scan the QR code with your mobile wallet, and approve the connection in your wallet.
Once you are linked, you can see your wallet address at the top right.
Go to the Pool Page. On the Uniswap interface, select Pool from the navigation bar. Click + New Position (or Add Liquidity).
Select Token Pair. Pick two tokens you would like to create liquidity of (for example: ETH and USDC).
Set Price Range. On Uniswap v3, you define the range of prices at which you’re willing to provide liquidity. Use the sliders or type in custom values.
The next step is to approve tokens. If you’re giving one of the tokens for the first time, you’ll need to approve it. Click Approve [Token] for each one. Then confirm the approval transaction within your wallet (this is a one-time action per token per smart contract). Let the approval transaction(s) confirm; you may need to wait for a little bit for confirmation on the blockchain.
Setting Ranges & Confirming
Once approved, click the Preview button. Check the specifics of your position: get-ons, price, and estimated contribution to the pool. If everything is fine, click the “Add Liquidity” button. Accept the transaction on your wallet.
That’s it! Your position has been created. When confirmed, your liquidity position is established. Your position in Uniswap v3 is an NFT. You may access it on the Pool page, or in your wallet (if it is Uniswap v3 position compatible).
Managing & Adjusting Positions
Handling and modifying liquidity positions in Uniswap V3 means working with the NonfungiblePositionManager contract to add liquidity and increase, decrease, and remove liquidity in specified price ranges. These actions are then implemented as function calls, such as mint, increaseLiquidity, decreaseLiquidity, and collect, that interact with the Uniswap V3 pool contract.
Image credit: CoinMENA
Adding Liquidity (Minting): When you want to add liquidity, you can do so by calling the NonfungiblePositionManager’s mint function with a pair address, fee tier, price range (in ticks), and the token amounts that will be deposited. The NonfungiblePositionManager contract then talks to the given Uniswap V3 pool contract to create a new position (which is an NFT).
Increasing Liquidity: To increase the liquidity of an existing position, you call the increaseLiquidity function on the NonfungiblePositionManager contract. As with minting, this function communicates with the pool contract to inject capital from investors into the existing price level.
Decreasing Liquidity: To reduce the liquidity of a position, you use the decreaseLiquidity function on the NonfungiblePositionManager contract. It decreases the liquidity available at the desired price, so you're actually subtracting some of your coins from the Uniswap liquidity pool.
How to Remove Liquidity
To remove liquidity from Uniswap V3, your wallet should be connected to the Uniswap app. Select the position, and to remove liquidity, click “Remove liquidity.” Then, click the percentage (or access the percentage) of the liquidity you would like to delete and approve the transaction in your wallet.
Here’s what is to be done to remove liquidity:
Connect your wallet: Head over to the Uniswap V3 interface and connect your wallet (for example, MetaMask).
Go to Pools: You can find your current LP positions from the markets in the “Pools” section.
Select position: Select the particular liquidity position from which you want to remove liquidity.
Start withdrawal: Press “Remove liquidity” to the chosen position.
Amount to remove: type the percent or total amount of liquidity you want to withdraw.
Approve removal: Press "Remove" and approve the transaction in the wallet (network fees will be applied).
That’s it! You have successfully removed your liquidity from the pool.
Impermanent Loss Overview
Impermanent loss (IL) refers to the loss of value that one experiences when they supply assets to an automated market maker (AMM) such as Uniswap, as opposed to holding those assets in a wallet.
It happens because the prices of the two tokens in liquidity providing can change independently of one another during market volatility, and the AMM’s constant product formula will automatically rebalance your position to maintain the desired price ratio.
IL occurs when the tokens’ price gets misaligned with their original ratio. The larger the price movement, the larger the impermanent loss. If prices revert to their original ratio while you’re withdrawing, the loss disappears – that is why it is called “impermanent.” You still receive trading fees during this period, which can make up for or exceed the impermanent loss if the pool has sufficient trading volume.
Example: You deposit $500 of ETH and $500 of USDC at $2,000/ETH. If ETH’s price soars to $3,000, the pool automatically rebalances your share to include a smaller percentage of ETH and more USDC.
Your position value would generally be lower than if you had simply held your ETH and USDC.
Is It Safe to Add Liquidity on Uniswap?
Uniswap liquidity hosting has certain risks that users should know before taking part. On the one hand, it presents an opportunity to earn rewards with protocol trading fees, but it also comes with the risk of impermanent loss, market volatility, and smart contract vulnerabilities, including impermanent loss, market volatility, out-of-range positions, and smart contract vulnerabilities.
Appreciating these risks is important if you want to make informed decisions on whether or not to provide liquidity on Uniswap. It is a potentially lucrative trade, but it’s important to be aware of the risks and manage your positions appropriately. For instance, in a sideways-trending market we can actively manage our position by changing the price spread to reduce the extent of impermanent loss.
Video Walkthrough
This brief video overview from Uniswap Labs shows you how to harness the power of concentrated liquidity on Uniswapv3. You will find out how to set your own price range to maximize the efficiency of your capital, add tokens and become an LP (liquidity provider), and control all active positions, monitor fee accrual, and learn when your liquidity becomes out-of-range.
Summary
Uniswap v3 users can benefit from many rewards by depositing in any of the pools as Uniswap V3 liquidity providers. Because of its novel, concentrated liquidity and configurable price ranges, Uniswap v3 affords liquidity providers a much higher degree of control over their capital and potential Uniswap liquidity pool returns relative to previous versions. But that also means there’s more to take into consideration, from how to find the right token pair and set the right price range to factoring in risks such as impermanent loss.
By using the above step-by-step guide, you can get started with liquidity provision on Uniswap v3 with confidence, optimize your position for your risk tolerance and market expectations, and get the most out of this powerful DeFi tool. And, as always, be sure to do your own research, keep an eye on your positions, and make adjustments as necessary to stay in line with your goals.