DeFi by d: How to earn passive income with Uniswap V3

Intro

gm! It’s Derek & welcome to my blog where I write about random topics that interest me and share some personal experiences that I’ve had the pleasure to be a part of.

I currently provide liquidity to a Uniswap V3 pool and wanted to share my learnings and experience with others. This post will be part of a series called DeFi by d where I share my learnings about various DeFi projects, how you can use them to make money, and the risks and considerations involved. This guide is broken into 3 sections:

  • What is Uniswap V3?* → read this to understand what Uniswap V3 even is*

  • [Guide] How to make passive income on Uniswap V3* → read this for the step-by-step, tactical guide on providing liquidity and how to generate passive income*

  • Derek’s Recommendations → read this for some recommendations on how to minimize risks while being an LP

  • Risks and Considerations* →* a brief overview of the risks involved with being an LP

None of this content is financial advice and there are risks involved with investing in cryptocurrencies. I am not a financial advisor nor am I affiliated with any of the organizations mentioned. Do your own research. You are responsible for the risks.

What is Uniswap V3?

Uniswap V3 is the third and latest iteration of the Uniswap Protocol - a series of open-source and immutable smart contracts that, together, create an Automated Market Maker (AMM) when deployed on a blockchain. Uniswap is the largest AMM in the world according to DeFi Llama by value locked on their protocol. The Uniswap Protocol is deployed on many popular blockchains like Ethereum, Arbitrum, and Polygon. V3 of the Uniswap Protocol introduces the concept of Concentrated Liquidity, among other things, that we’ll cover later when we talk about how to make money. But first, let’s understand AMMs.

AMMs like Uniswap serve two users: (1) Liquidity Providers (LPs) and (2) traders. AMMs are entirely automated using code and math - as the name (and cover photo) implies.

AMMs function by setting up a pool of assets where cryptocurrencies, like $ETH and $USDC, are supplied by people who play the role of a Liquidity Provider (LP). Traders can then use this pool (called a Liquidity Pool) to exchange assets, like $ETH for its monetary equivalent in $USDC, for a fixed fee. Traders will pay this fixed fee to the protocol to use the assets in the Liquidity Pool when they make a trade. Meanwhile, LPs who lock up their assets into the Liquidity Pool will receive a portion of the fees - effectively compensating the LPs for locking their assets in the pool for traders to use.

Basic diagram showcasing how AMMs work at a high level.
Basic diagram showcasing how AMMs work at a high level.

AMMs, often also referred to as Decentralized Exchanges (DEXes), have many benefits over traditional exchange models like Order Books that I won’t cover in this article, but at a high level: AMMs are easier for people to access, are more transparent, and offer greater autonomy and price efficiency to both LPs and traders since AMMs cannot be controlled by a single entity.

Most importantly, however, is the fact that since AMMs are permissionless, anyone can be an LP and earn the fees paid by traders as passive income: including you.

How to earn passive income on Uniswap V3

This section will walk you through how to earn passive income on Uniswap V3 by playing the role of an LP. I highly recommend following Steps 1 and 2 below using the following calculators: PoolFish.xyz, Unispark, or Flipside Crypto’s Uniswap V3 calculator. I’ve included the risks and considerations as a separate section after this guide that I strongly recommend reviewing to know what you’re getting into as a new LP - especially when it comes to impermanent loss.

Disclaimer: I am not affiliated with, nor sponsored by, the amazing teams behind these calculators. While these calculators provide an excellent UX, the numbers they give you are estimates. Each of the calculators include sections that outline the Uniswap V3 mathematical formulas they use to derive the final results. I would recommend running the numbers yourself using the raw formulas to sanity check any results you see.

Step 1: Choose a pool to provide liquidity for

Go here to see all the top pools on Ethereum - you can switch blockchains using a drop down menu at the top!

At the core of all AMMs is the pool of assets that traders and LPs will interact with. You must, therefore, begin by choosing a pool to provide liquidity for. You must hold both of the assets in a pool’s asset pair to be a liquidity provider for that pool. The exact amount of each asset that you need is determined by the price range that you set (details in Step 2).

You can browse the top pools on any of the supported blockchains on Uniswap. In this blog, I will be using Ethereum and this link will take you to see the top Uniswap pools on Etheruem. For convenience, I have provided a screenshot of that page below.

Screenshot of the top Uniswap pools on Ethereum, sorted by TVL. I have highlighted the USD/ETH 0.05% pool for the examples below.
Screenshot of the top Uniswap pools on Ethereum, sorted by TVL. I have highlighted the USD/ETH 0.05% pool for the examples below.

There are 3 important attributes to keep track of for each pool and I will use the ETH/USDC 0.05% pool as an example to explain each of them (boxed in red above):

  • The fee tier: this is the fee that the trader will pay to exchange assets for a given pool, calculated as a percentage of the value of the trade. At the time of writing, all fees go directly to Liquidity Providers, proportional to how much they have contributed to the pool. There is a separate protocol fee that traders pay to the Uniswap Protocol - this is not related to the fee percentage you see when browsing pools and is a fee that only applies to traders.

    • In the screenshot above, the USDC/ETH 0.05% pool has a 0.05% fee tier, meaning a trader will pay 0.05% of each trade’s value when using the liquidity in this pool. The fees will go to the LPs for that pool.
  • Total Value Locked (TVL): this represents the total value of the assets locked into a given liquidity pool.

    • In the screenshot above, the TVL of the the USDC/ETH 0.05% pool at the time of writing is $175.68 million USD. This means that LPs have deposited a total of $175.68 million USD worth of $USDC and $ETH into that particular pool. Each of those LPs (in that pool) are agreeing to provide liquidity to traders at a fee tier of 0.05% for swaps between $USDC and $ETH.
  • Volume: the total value of assets that have been traded to and from a given pool.

    • In the screenshot above, the USDC/ETH 0.05% pool at the time of writing has seen $387.25 million USD in volume in the last 24 hours and a whopping $1.82 billion USD over the last 7 days. This is by far the most used liquidity pool on Uniswap by a wide margin.

Great, that is a lot of information. You must now be wondering: “cool, so… how do I pick a pool?” Well, as with all things related to investing, there are varying degrees of risks and accompanying rewards with each choice. Below are a few general guidelines to use when selecting a pool. At the end of this post, I also share some recommendations too in case you’re really stumped.

  • You will generally earn more money by picking pools that have higher volume or TVL because you, as an LP, get paid as a percentage of the size of the trades. More money being exchanged (higher volume) will mean more fees collected (higher income) will mean more money will be deposited in the pool by LPs (higher TVL). The trade off is that pools with high volumes will generally have lower fee tiers, but the fees you earn from the high volume normally offset the lower fees. Example: USDC/ETH 0.05%

  • You will generally need to be less active in monitoring or rebalancing your position in pools that have less volatile asset pairs or pairs that are highly price-correlated. This is because the likelihood of large relative price fluctuations (i.e. prices between the assets) in these pools is lower, resulting in a lower risk of impermanent loss. Example of a low-volatility pool: DAI/USDC 0.01%.

Let’s go ahead and choose a pool. Once you’ve chosen a pool, go ahead and click on “Add Liquidity”. As an example, I will select the USDC/ETH 0.05%pool (link here).

Once you select a pool, you will see a dashboard with the important metadata about that pool. Select the "Add Liquidity" icon to begin adding liquidity.
Once you select a pool, you will see a dashboard with the important metadata about that pool. Select the "Add Liquidity" icon to begin adding liquidity.

Step 2: Determine your price range

Next, you’re going to be taken to the “Add Liquidity” page (screenshot below). In the first red box, you’ll see the pool attributes we talked about earlier. The second red box is where you can set the “price range”.

A screenshot of
A screenshot of

Choosing a price range is very important and is the hallmark feature of Uniswap V3, under the concept of “Concentrated Liquidity”. There are many high quality, detailed articles on this topic that I would recommend to folks who want to dive deep into this topic (go here, here, or here for 3 examples).

However for this article, I am going to keep it simple: the price range you select is the lower and upper bound with which you will allow traders to use your assets to trade with. As an LP, you will earn fees when the exchange rate between two assets fall within the range you set and you will make no fees when the exchange rate is not within the range.

This is the hallmark feature of Uniswap V3 and is beneficial to both LPs and traders:

  • LPs get higher capital efficiency when concentrating their liquidity because the market forces of supply and demand will converge on a specific price where the vast majority of trades will take place. By concentrating your liquidity around this price, you’re making your capital more efficient. However, concentrating liquidity magnifies the risk and size of any impermanent loss: this is essentially an opportunity cost where you would have made more money had you just held the assets if the assets change in value.

  • Traders, in turn, get access to deeper liquidity and minimize slippage in their trades (i.e. price impacts). There isn’t really a downside for traders assuming that the LPs are acting in their own best interest (this is the beauty of web3 - using code to incentivize behavior!).

Similar to my remarks about choosing a pool, I will drop general guidelines to follow here and will attach some recommendations at the end of this article:

  • Generally, a narrower price range (+/- 5%) will make you more money because that specific price point is where trades are happening. You will be exposed to greater risks of impermanent loss and will likely have to manage your position more actively.

  • Generally, a wider price range (+/- 20%) will make you less money because you’re effectively spreading your capital across a larger range of exchange rates for traders to use. The risk of impermanent loss is lower and this is usually best for folks who desire a more passive strategy (since you’re less likely to need to rebalance anything)

Step 3: Provide liquidity on the Uniswap interface

Let’s go ahead and provide liquidity now! Once you have selected your pool and the price range, simply select the amount of assets you’d like to deposit into the pool and connect your wallet to deposit.

Screenshot
Screenshot

There are a few things that I want to highlight as you do this:

  • You will need a wallet to interact with the Uniswap interface. I would recommend Rainbow for newer crypto users or Rabby.io for more crypto-native folks. You may have been using MetaMask before but I would recommend ditching it - there are way better wallets nowadays.

  • As with many dApps, you will need to sign 2 transactions with your private key: one to approve a particular spend amount for a specific token and another to actually deposit the assets. This is normal.

  • Depending on your selected price range, you will need to deposit different amounts of each asset. This is normal. You must deposit two different assets to enable trades to do swaps. You can provide 50/50 liquidity if your price range is equal in both directions (above and below).

  • On any blockchain, gas is required to cover the cost to execute your transaction. On Ethereum, these gas fees may be quite high when the network is busy. I would recommend staying on Ethereum because no other EVM chain comes close to Ethereum in terms of volume and liquidity.

Step 4: Monitor and collect income

Once you deposit money into the Uniswap liquidity pool, the protocol will mint an NFT that gets transferred to your wallet. This NFT will represent your position in the liquidity pool.

Screenshot of a position on Uniswap.
Screenshot of a position on Uniswap.

Congratulations! You have successfully opened a liquidity position! Now sit back, relax, earn, and then eventually collect fees! You’ll notice that you will earn the fees in real time but this interest does not automatically compound - you’ll have to do that yourself every now and then (which will cost you gas!). Also note that you get paid in equal amounts of both assets.

For the math nerds, the actual way you accrue interest from the Uniswap protocol is calculated using the formula below:

Super simplified version of how Uniswap generates income for LPs
Super simplified version of how Uniswap generates income for LPs

Risks and considerations

This section covers the risks and considerations when it comes to being an LP, including Impermanent Loss.

I want to make it very clear that there is no such thing as a “free lunch”. It is common and entirely possible to lose money by being an LP (article). In this section, I’m going to review some incredibly important Risks and Considerations:

Security risks

There is a non-zero chance that the Uniswap Protocol and it’s suite of smart contracts get hacked and your money gets stolen. There is also a non-zero chance that block re-orgs or bugs in the underlying blockchain could occur, resulting in a loss. To make you feel better, Uniswap has been around since 2018 and has never been hacked.

Value risks

The assets that you purchase and use when interacting with Uniswap will fluctuate and could go to $0. Large price movements between assets can cause your position to appreciate and depreciate violently - quicker than you have time to react.

Approval risks

Be very careful with what applications and smart contracts you give approval to to move your assets. Visit sites like revoke.cash to revoke access from unknown entities who you may have approved in the past. This is the most common way to get your wallet drained.

The constant product formula & the risk of impermanent loss:

Before we can understand impermanent loss, we must first understand the constant product formula. All Uniswap pools use the constant product formula to determine market prices (source):

Constant product formula used by Uniswap
Constant product formula used by Uniswap

For example, a pool with 2 tokens of A (x=2) and 2 tokens of B (y=2), will mean that k=4. As the value of token A and token B fluctuate, the pool will be rebalanced to ensure that k=4 always. If this happens, this means that x and/or y will change to ensure k=4 no matter what.

Impermanent loss is an unrealized loss that occurs when the value of your assets in the liquidity pool change in such a way that you would have made more money if you just held the asset and did nothing. This loss is only realized if you choose to exit the liquidity pool at a different price ratio than when you entered. The loss is also impermanent because if the asset prices return to where they were originally, your loss is $0.

Real example: let’s say that 1 ETH = 100 USDC on Day 1 and you have 1 ETH and 100 USDC. The price of ETH quadruples on Day 2 and 1 ETH = 400 USDC now. Let’s explore 2 scenarios - one where you be an LP and one where you just hold the assets.

Some people are visual learners, so here you go!
Some people are visual learners, so here you go!
  • Scenario A: you deposit all your assets into a liquidity pool that has 9 ETH and 900 USDC in it. You are now providing 10% of the liquidity for that pool, meaning you will earn 10% of the fees generated from traders using the pool (awesome!). Following the x*y=k constant product formula, k=10,000. On Day 2, the pool has now rebalanced to now have a total of 5 ETH and 2000 USDC to ensure that k=10,000. You decide to exit the liquidity pool on Day 2 and since you contributed 10% to the liquidity pool, you will withdraw 10% of the pool’s value which equals to 0.5 ETH and 200 USDC. Your assets on Day 2 if you exit are now worth $400.

  • Scenario B: you just hold on to your ETH and USDC and do nothing with it. On Day 2, your assets are worth $500!

Note that if you did nothing with your assets (Scenario B), your assets would be worth $100 more! This $100 difference is referred to as impermanent loss and it became permanent when you exited the liquidity pool. You might have noticed that I did not mention anything about the fees though - you’ll likely made some income being an LP in Scenario A. Therefore, the catch with being an LP is that to be profitable, you need to collect enough fees to cover the risk of impermanent loss!

Minimizing risks:

  • Always read and sanity check every transaction that you sign with your wallet’s private key! I recommend Rainbow or Rabby.io wallets as they do a great job of highlighting what is actually going on in each transaction

  • Pick pairs that are highly correlated to minimize impermanent loss

  • Only use protocols that have a solid track record and have been audited by multiple security firms

  • Pick pairs that have a large market capitalization behind it

  • Regularly visit revoke.cash to revoke access from unknown entities who you may have approved in the past.

Derek’s recommendations:

I currently provide liquidity to the USDC/ETH 0.05% with a small price range on Ethereum. I have experimented with various price ranges, asset pairs, fee tiers, and even different chains. I strongly recommend using one of the calculators I mentioned earlier.

For pools:

  • If your risk tolerance is lower and/or you’re just starting out, I would recommend a pool with only stablecoins, like theDAI/USDC 0.01% pool. This will usually yield the lowest returns but has the lowest risk, since both assets are pegged to the US dollar. This pool is also going to require the least amount of active rebalancing and monitoring (if at all).

  • If you have an intermediate risk tolerance and are looking for a decent balance between risk and reward, I would recommend the USDC/ETH 0.05% pool. The returns on this are decent, due to the high volume, and both assets enjoy very high liquidity across the DeFi ecosystem - making it very

  • If you have a larger risk tolerance, I would recommend the WBTC/ETH 0.3% pool or the LINK/ETH 0.3% pool. These pools command higher fees and both assets have the opportunity to appreciate (compared to just 1 of the assets like in a USDC/ETH pool). This opportunity exposes your position to potential upside should the value of the assets appreciate (but also downside too if the value depreciates). It is also worth noting that these pools have a higher risk of impermanent loss because of relative price volatility between the pairs (i.e. when one asset becomes more valuable relative to the other).

  • If you’re someone who is seeking the maximum returns and are willing to accept outsized risk, I would recommend you choose pools with a high fee tier or low TVL since both of those traits will lead to higher rewards in general. Otherwise, maybe consider not being an LP at all on Uniswap and try other DEXes on different blockchains, or just all-in on a meme coin trending on Twitter. You do you.

For price ranges:

  • If your risk tolerance is lower, pick a large price range like +/- 20%. This will earn you less fees (because your capital is less efficient) but requires you to do less active management and monitoring

  • If your risk tolerance is higher, pick a narrow range like +/- 5%. This will earn you more fees (because your capital is more efficient) but requires you to keep closer tabs on the price of the assets. You also may be more susceptible to impermanent loss.

For calculators:

I really like poolfish.xyz - it uses live data from the blockchain, has a great impermanent loss calculator, and a sleek click-and-drag interface to simulate your returns based on selected price ranges and upfront capital deposited. I encourage you to play with it to your heart’s content to better understand the concepts I presented in this article!

Fin

Thanks for reading this far. I know this is a lot of information. I prioritized explaining every concept at a high level to get you started. Each of the concepts, however, definitely deserves its own article to explore it in depth. Please hit me up if you got questions! Depending on feedback, I may write more articles about being an LP!

if you enjoyed this post, please consider minting it! The fees will go to myself (the content creator) and to sponsor the publication of content by other content creators!

Disclaimer

I do not work for Uniswap Labs or any of the organizations mentioned in this article. I do have Uniswap V3 positions open.

NOT FINANCIAL ADVICE STATEMENT - The Information on this blog, DeFi by d: Uniswap V3, is for educational, informational, and entertainment purposes only, without any express or implied warranty of any kind, including warranties of accuracy, completeness, or fitness for any particular purpose. The Information contained in or provided from or through this blog and any referenced resources are not intended to be and does not constitute financial advice, investment advice, trading advice, or any other advice.

You understand that you are using any and all Information available on or through this blog at your own risk.

RISK STATEMENT – There are risks associated with investing in and purchasing cryptocurrencies, including assets like Ethereum, Bitcoins, and even “stablecoins”. Investing or buying these assets involve risk of loss - including the full loss of principal. Trading may not be suitable for all people. Anyone wishing to invest should seek his or her own independent financial or professional advice.

Subscribe to derek
Receive the latest updates directly to your inbox.
Mint this entry as an NFT to add it to your collection.
Verification
This entry has been permanently stored onchain and signed by its creator.