DeFi Crypto Tax Guide: Lending, Liquidity Pools, Yield Farming, and Loans Tax

Learn how your activities with Decentralized Finance (DeFi) are taxed. We explain the tax treatment of lending, liquidity pooling, yield farming, and loans.

Table of Contents

This article is part of TokenTax's Cryptocurrency Tax Guide. Get help with cryptocurrency tax filing.

What is Decentralized Finance (DeFi) and how is it taxed?

Decentralized Finance is a quickly growing field of cryptocurrency that allows people to access financial services, like trading, borrowing, and lending, without delays or extra prices incurred by a middleman like with traditional financial institutions. DeFi also utilizes automated market making (AMM) and liquidity pools in order to provide decentralized trading.

Ethereum is currently the most popular ecosystem for DeFi, with a number of platforms rapidly gaining popularity amongst crypto investors. This article will focus on ETH-based DeFi platforms, but the concepts we explain can also apply to similar platforms on other blockchains.

Like with any cryptocurrency activity, it’s important that you understand the tax implications of Decentralized Finance activities. In this guide, we’ll cover the specific tax treatment of various DeFi transactions.

Note that the IRS and other countries’ tax authorities have not given specific guidance for DeFI taxes, so this article bases DeFi tax treatment off of existing crypto tax guidance. Existing guidance dictates that you recognize capital gain or loss on a crypto asset when you sell or exchange it away; furthermore, crypto earned directly is recognized as income and taxed as such. Many DeFi activities explained below fall within these situations and guidelines.

If you’re not familiar with cryptocurrency capital gains and income tax treatment, we recommend you first read our guide on how cryptocurrency is taxed.

DeFi lending income taxes

  • If you lend your crypto or contribute it to a platform that supplies loans of crypto, you will be liable for taxation on whatever you earn from lending your crypto.
  • Whether this lending income is treated as ordinary income (like income on salary) or as capital gains (gains from trading) depends on your DeFi platform.

Ordinary income

  • Traditionally, lending platforms pay earnings from interest directly to your crypto balances; i.e. for lending ETH, you’d earn ETH and see your wallet balance increase accordingly.
  • If you earn crypto tokens for lending (i.e. your balance increases when you earn interest income), then you recognize this as ordinary income (like income earned as payment / salary).

Capital gains

  • Newer DeFi platforms, however, have issued their own tokens, also known as Liquidity Pool Tokens (LPTs), where you may recognize this income as capital gains.
  • This is because adding/removing liquidity is structured like a trade or token swap. In these cases, such as with cTokens, the value of your LPTs increases — but the quantity shown in your ETH wallet remains the same.
  • When you convert your cTokens back to the original asset, the cost basis of your cTokens is compared to the amount of the original asset you receive in return to calculate your gain from interest accrued by the pool.

Consult the list of DeFi platforms and their tax treatments at the end of this article to learn more.

There are advantages to lending income being treated as capital gains rather than as ordinary income, which we explain in the “tax advantages of Decentralized Finance” section of this article.

DeFi governance and incentive token taxes

  • Many DeFi platforms are now distributing governance and/or incentive tokens in exchange for activity on their platform.
  • A large component of yield farming is pursuing platforms that offer these tokens, to earn income.
  • When you are distributed these tokens, the tokens are taxed as income per their current market value.
  • When you sell these tokens, you recognize any capital gain or loss your crypto has accrued since you acquired it.

For example:

  1. If you earn 1 COMP when COMP is $140, you owe income tax on that $140 of income per your income tax rates.
  2. If you sell that 1 COMP when it reaches $170, you will then owe taxes on that $30 of capital gains.
  3. However, if you sell the 1 COMP at $100, you’ll have a capital loss of $40 which will not directly offset the COMP income.

Tokens you may receive include:

Compound: COMP

  • Compound’s governance token COMP is distributed to anyone who supplies or borrows crypto to/from Compound.
  • You realize income tax on the COMP received and are liable for tax of your income tax rate times the market value of COMP received.

Balancer: BAL

  • BAL tokens are distributed to those who provide liquidity to Balancer pools. Balancer refers to this as liquidity mining.
  • You are liable for income tax on BAL received, for the market value of the BAL you receive.

Yearn.finance: YFI

  • YFI is the governance token for Yearn.finance. While its creator originally stated that the coin had no value, its price quickly soared upon release.
  • If you earn YFI, you are liable for income tax on the market value of YFI earned.

Are transfers into aTokens, cTokens, liquidity pools, and similar taxable events?

Tl;dr: We don’t know for sure yet, but the safe route is to see these as crypto to crypto exchanges that realize capital gains. You may also elect to file these as non-taxable exchanges if you wish. We recommend that you consult with a tax professional.

Certain DeFi transactions, like depositing to a platform that mints a token for your assets (e.g. ETH -> aETH on Aave), may or may not be a taxable event. This question also applies to entering and exiting liquidity pools.

A taxable event means that the transaction will realize a capital gain or loss on the asset being exchanged away. In these circumstances, tax treatment is a gray area; there has been no specific guidance from the IRS as to how to treat these transactions.

Examples of such transactions include:

  • If you deposit LINK into Aave, you receive aLINK in return.
  • If you deposit USDC into Compound, you receive cUSDC in return.
  • If you add to Uniswap’s DAI/ETH liquidity pool, you send DAI and ETH and receive UNI-V2 tokens representing your share of the pool in return.

The most relevant IRS guidance states that a crypto to crypto exchange is a taxable event that realizes capital gain or loss on the exchanged asset. Per the IRS's cryptocurrency tax FAQ, Answer 16: "If you exchange virtual currency held as a capital asset for other property, including for goods or for another virtual currency, you will recognize a capital gain or loss."

Consider a deposit of LINK into Aave as an example. When you deposit LINK to Aave, you receive aLINK in return. This is where the gray area lies — is this a crypto to crypto exchange of LINK to aLINK? Or is it just a deposit (i.e. transfer) of LINK into Aave’s platform and a receipt of the aToken?

We are awaiting more guidance from the IRS on the best way to treat these transactions. Currently, TokenTax defaults to treatingr these transactions as taxable events.

TokenTax has the functionality to classify these transactions as non-taxable, via the Migration transaction type. This transaction type does not trigger a capital gain or loss, and it will transfer the cost basis from asset to asset.

It’s important to know that treating these transactions as taxable does not automatically mean you are paying more in taxes total. When you eventually cash out your tokens to BTC or fiat, you would realize capital gains or losses based on how the asset changed in value between acquisition and disposal. Here’s how it may look in the taxable and non-taxable scenario:

Taxable:

  1. You buy 1 ETH at $200.
  2. Within 1 year, you exchange 1 ETH for 1 aETH when ETH is $1800. You realize a $1600 short term capital gain.
  3. Within this same year, you then exchange 1 aETH back to 1 ETH when ETH is $1500. You realize a $300 short term capital loss.
  4. You sell the 1 ETH at $1400 for a $100 short term capital loss.
  5. Your total capital gains between these transactions is $1600 - $300 - $100 = $1200.

Non-taxable:

  1. You buy 1 ETH at $200.
  2. Within 1 year, you exchange 1 ETH for 1 aETH when ETH is $1800. You choose to not realize taxes on this transaction.
  3. Within this same year, you exchange 1 aETH back to 1 ETH. You again choose not to realize taxes on this transaction.
  4. You sell the 1 ETH at $1400 for a $1200 short term capital gain.
  5. Your total capital gains between these transactions is $1200.

There will only be additional tax liability in an instance where the holding period may have been long term (1 year or greater), thus meaning a lower tax rate. Taxable events will reset this holding period.

Taxable or non-taxable: Pros and Cons

Taxable Pros:

  • Treating these transactions as taxable events aligns most closely with existing IRS guidance. If the IRS later says that these transactions are taxable events, you won’t need to worry about amending and possible paying more taxes.
  • Accounting is easier when you treat these transactions as taxable events — it’s very similar to how crypto to crypto trades are treated.

Taxable Cons:

  • These transactions may result in realizing capital gains earlier than you expected.
  • If you use long term holdings, you may disrupt your holding period, resulting in less long term capital gains at a lower tax rate.

Non-taxable pros:

  • Your holding period on your assets won’t be reset when you have transactions like Aave deposits or liquidity pool entries/exits.
  • Your taxes will be deferred, so you won’t have a capital gain or loss realized yet on these assets.

Non-taxable cons:

  • There has been no guidance from the IRS to say that these shouldn’t be taxable events. New guidance could be released that states that taxes are owed in this instance, or this treatment may not stand up to an audit.
  • This treatment only defers capital gains or losses — you will still need to eventually pay taxes on your gains.
  • The accounting is more complex because cost basis needs to be transferred across different assets.

Overall: you will need to pay taxes on your capital gains — no matter what. Different treatments only affect when you have capital gains or losses as well as the holding periods for these assets. If you believe that these exchanges should not be taxable, your best approach is to consult with a tax professional.

Liquidity pool taxes

  • In DeFi, anyone can supply liquidity to decentralized markets like Uniswap and Balancer.
  • In exchange for supplying crypto to a liquidity pool, suppliers receive Liquidity Pool Tokens (LPTs) that represent their shares in the pool.
  • If you treat transfers into a liquidity pool as a taxable event, you recognize any capital gain or loss on assets that you exchange for their LPT equivalents at the time of the transfer . You may also elect to file these as non-taxable exchanges if you wish. We recommend that you consult with a tax professional.

Your income via liquidity pools is typically taxed in one of two ways:

  1. As ordinary income taxes, if you are receiving interest on the underlying asset directly and seeing the balance increase in your wallet.
  2. As capital gains, if your balance of liquidity pool tokens stays constant but increases in value as the pool accrues interest due to demand / fee collection. This is the case for Uniswap and Balancer pools.

cToken and aToken tax treatment

  • As discussed above, many DeFi platforms have their own tokens that represent balances in their protocol.
  • Platforms with these tokens include Compound (cTokens) and Aave (aTokens).
  • As we discussed in the above sections, you may have income tax or capital gains tax liability for earnings from these protocols.
  • If you treat transfers into cTokens or aTokens as taxable events, you recognize any capital gain or loss on assets that you exchange for their cToken equivalents. You may also elect to file these as non-taxable exchanges if you wish. We recommend that you consult with a tax professional.

Compound: cTokens

  • Per Compound, "As a market earns interest, its cToken becomes convertible into an increasing quantity of the underlying asset."
  • That means that as you earn interest with cTokens, you aren’t actually receiving more cTokens, but rather, your balance of cTokens — which represents your share in the protocol — increases in value.
  • From a tax perspective, this means that when you exchange your cTokens back to the underlying cryptocurrencies, you recognize your income as capital gains, rather than as direct ordinary income like you would for more traditional interest earned.
  • If you treat transfers into cTokens as a taxable event, you recognize any capital gain or loss on assets that you exchange for their cToken equivalents. You may also elect to file these as non-taxable exchanges if you wish. We recommend that you consult with a tax professional.

Aave: aTokens

  • Aave’s aTokens, like aDAI, are minted at a 1:1 ratio to the underlying asset.
  • Whereas with cTokens and yTokens your DeFi token balance remains the same but increases in value, representing your share in the pool, with aTokens you recognize income tax when your aToken balance increases.
  • If you treat transfers into aTokens as a taxable event, you recognize any capital gain or loss on assets that you exchange for their aToken equivalents. You may also elect to file these as non-taxable exchanges if you wish. We recommend that you consult with a tax professional.

Here are the methods by which you would owe taxes with aTokens, if you are choosing the taxable route:

  1. When you earn interest for lending out your crypto on Aave, you receive more of that asset’s aToken. The aTokens you receive are taxed as income. So if you earn 50 aDAI and each aDAI is $1.00, you are ill owe tax according to your capital gains tax rates.
  2. Over the next month, you lend via your aETH, earning an equivalent of $10 in aETH. You owe tax on this $10 of income per your income tax rates.
  3. ETH drops to $300, and you decide to convert your aETH back to ETH. Because the price of your aETH is matched to the price of ETH, you’d recognize a capital loss here. However, this capital loss would only subtract from any capital gains you have, not from the income you recognized on the aTokens received for lending.

Taxes for loans, interest paid, collateral liquidations

Crypto loans have noteworthy tax advantages.

If you borrow using crypto as collateral without receiving a different token in return, like putting ETH up for collateral to borrow stablecoins, you don’t realize any tax on that crypto set as collateral. You can borrow crypto or stablecoins and even convert that crypto into fiat.

  • As long as your collateral is not sold or exchanged, then no taxes will be triggered.
  • This is useful for things like making tax payments without triggering more taxes by selling your crypto.

Crypto margin calls / liquidation sales

  • If the value of your collateral crypto goes down too far, or if the value of assets borrowed increases too much compared to your collateral, then you’ll trigger a margin call / liquidation.
  • This is treated as if you had sold that crypto for fiat, meaning that you realize any capital gain or loss on those assets.

Tax on loan crypto collateral

  • Putting crypto up for collateral is normally not taxable unless you receive a different cryptocurrency in return.
  • But, if you give ETH as collateral, but receive back DAI when you close out your loan, it may be a taxable event because there was an exchange of ETH for DAI.

Other DeFi assets (TokenSets, tokenized assets, etc)

Other tokenized assets, like tokens that represent your investment in a TokenSet, or tokens that represent a real-world asset like gold, are taxed as per normal cryptocurrency capital gain/loss treatment.

The tax advantages of Decentralized Finance

If you’ve been reading through this article, you’ve probably noticed a few mentions of advantageous tax treatment with DeFi. You can indeed potentially save on your taxes via DeFi: here’s how.

Better tax treatment for income via technology like cTokens

This advantage only applies to those electing to treat these transfers as taxable events. If you do not treat them as taxable events, you will not be able to start the capital gains clock up front.

Traditionally, when you earn income for lending your crypto, you receive that income directly in the form of tokens received. When you are paid in tokens, you recognize said tokens’ market value at time of receipt as income. This means you owe tax up front, even if you later sell those tokens at a loss — capital losses don’t directly offset direct ordinary income.

  • With Compound’s cTokens, however, you earn lending income not via direct token payments, but rather via your cTokens gaining in value as you earn.
  • This means that you recognize this lending income as capital gains, not ordinary income.
  • Thus, you can offset these capital gains with capital losses, and if you hold the cTokens for a year or more, in the U.S. and in other countries you may be able to get lower long term capital gains tax rates.

Rebalance a portfolio without triggering tax liability

With TokenSets, a token represents your investment in a periodically rebalanced portfolio. You do not rebalance assets yourself.

  • Normally if you rebalance your portfolio, you buy, sell, and trade crypto in order to have your holdings adhere to the new portfolio rebalancing. This triggers taxes on your investments, and you may also lose out on long term capital gains treatment (holding an asset for over a year).
  • If you are invested in a rebalancing portfolio with TokenSets, your investment in the token remains unchanged.
  • That means that you only trigger capital gains and tax liability once you sell or trade away your TokenSets token.
  • Because it makes it easier to handle your capital gains, and if you hold for a year or more, you’ll be able to more cleanly access lower long term capital gains rates.

Borrow coins to keep long term holdings intact

Recall that long term holdings in the U.S. and in other countries are taxed at a lower rate. You may want to preserve holdings so their holding time is not reset.

  • Let’s say you are holding some ETH, but want some stablecoins in order to make use of DeFi protocols. You don’t want to trade away the ETH for stablecoins, because then you’ll trigger taxes on them and reset the holding period.
  • If you take out a loan on your ETH, you don’t trigger taxes on this ETH and the holding period continues to count towards long term holdings. You can then use whatever asset you borrowed as you see fit!

The tax disadvantages of Decentralized Finance

Minting DeFi tokens may trigger tax liability

This disadvantage only applies to those electing to treat these coin conversions as taxable events. If you do not treat them as taxable events, you will not trigger tax liability by minting tokens.

As discussed above, some tax preparers treat minting tokens, like converting ETH to wrapped ETH (WETH) or converting coins to cTokens or aTokens, as crypto-to-crypto exchanges. If this is the chosen treatment, the event would considered a taxable event that triggers capital gains liability.

  • Some platforms may even offer to automatically swap your coins to mint DeFi tokens, so be sure that you’re aware of what actions these platforms will take with your coins.
  • Note that this does not apply if you are minting tokens in a loan, using your holdings as collateral.

Unexpected income from token distributions

Many DeFi platforms are distributing their own tokens, like Compound and COMP. While these distributions may certainly be possible, it’s good to keep in mind that these distributions are taxed as income, for the market value of the tokens at time of receipt.

  • Thus if you are distributed $100 equivalent of COMP, you owe taxes on that $100 of income per your income tax rates.
  • Your cost basis is also set to $100 for this COMP, so you’ll only pay capital gains tax on however much the coin gains in value by the time you sell or trade it away.
  • However, if you sell or trade away the COMP at a loss, then these capital losses do not subtract from the income tax liability for the COMP earned.

How to file DeFi taxes

With TokenTax's tax software for cryptocurrency, you can import data from Decentralized Finance platforms to calculate your interest / lending income as well as to account for capital gains and losses, like collateral sell offs and exchanges between crypto and cTokens.

Just enter in your ETH address(es) into TokenTax, and the platform will automatically import your activity from all supported DeFi platforms. See below for a list of how activities on each DeFi platform are treated.

How taxes work for your DeFi platform

Maker / Oasis

With Maker and their Oasis platform, you can trade between assets as well as earn DAI by either by locking ETH / other supported currencies as collateral in a CDP or by depositing DAI and earning interest on it via the DAI savings rate.

Maker and Oasis tax treatment

  • Trades are taxed like normal cryptocurrency trades, where you trigger - capital gain or loss on assets you trade away.
  • DAI earned via savings is treated as income taxed per your income tax rates.

Compound

Compound is a decentralized finance (DeFi) interest rate protocol allowing users to lend or borrow assets. Compound’s mission is to allow all crypto holders to easily earn interest on their holdings (as you typically would with fiat currency), instead of letting their assets sit in wallets and exchanges without earning any interest. The protocol is used for borrowing and lending, and you can easily view the total supply and total borrowed of each market pool.

Compound tax treatment:

  • DAI earned via savings is treated as income taxed per your income tax rates.
  • As you lend, your cTokens increase in value. You realize capital gains when you trade back these cTokens.
  • Any COMP earned is taxed as income.
  • If you treat transfers into cTokens as a taxable event, you recognize any capital gain or loss on assets that you exchange for their cToken equivalents. You may also elect to file these as non-taxable exchanges if you wish. We recommend that you consult with a tax professional.

1inch Exchange

1inch Exchange is a DEX aggregator, meaning it automatically finds you the best rates with lowest price slippage across many decentralized exchanges.

1inch Exchange tax treatment:

  • Trades made on 1inch are taxed like any other crypto trade, where you realize a capital gain or loss on the asset you trade away.
  • Liquidity and lending pools are taxed according to which DeFi service you pick, as per the taxation structure of lending and liquidity pooling described earlier in this article.

Balancer

Balancer allows you to swap tokens as well as to contribute to liquidity pools. Balancer liquidity pools are composed of different weightings of crypto assets depending on the chosen pool, with up to 8 different assets in a pool.

Fees are earned each time the pool is used to facilitate a swap on Balancer, with payouts to liquidity providers proportional to the share of total liquidity deposited. Each pool on Balancer has a different swap fee.

Balancer tax treatment:

  • Swaps / trades made in Balancer are treated as per normal crypto trade tax treatment.
  • Profits made from liquidity pooling are capital gains, because BPTs (Balancer Pool Tokens) representing your shares in the pool increase in value. When you cash out of the pool, you trade the BPTs back for your assets, recognizing capital gains.
  • BAL is distributed to all liquidity providers via disperse.app on a regular basis. These rewards are taxed as income based on the value of BAL on the date it was received.
  • If you treat transfers into liquidity pools as a taxable event, you recognize any capital gain or loss on assets that you exchange for their BPT equivalents. You may also elect to file these as non-taxable exchanges if you wish. We recommend that you consult with a tax professional.

Wrapped ETH (WETH)

Wrapped ETH is an ERC-20 equivalent of ETH, where one WETH is equal to one ETH.

Wrapped ETH tax treatment:

  • If you treat transfers into WETH as a taxable event, you recognize any capital gain or loss on assets that you exchange for their WETH equivalents. You may also elect to file these as non-taxable exchanges if you wish. We recommend that you consult with a tax professional.

Uniswap

Uniswap lets you either swap between tokens or contribute tokens to liquidity pools to earn income.

Uniswap tax treatment:

  • Token swaps are taxed like typical cryptocurrency trades, where you realize any capital gain or loss on the asset you are trading away.
  • When you contribute to a liquidity pool, you receive UNI tokens that represent your share in the pool. Your UNI tokens increase in value to represent your earnings from the liquidity pool. When you divest from the liquidity pool, you give back the UNI tokens and realize any capital gains on those UNI tokens.
  • If you treat transfers into Uniswap liquidity pools as a taxable event, you recognize any capital gain or loss on assets that you exchange for corresponding LPTs. You may also elect to file these as non-taxable exchanges if you wish. We recommend that you consult with a tax professional.

Set Protocol / TokenSets

Set Protocol’s TokenSets allow you to make a tokenized investment in a portfolio, trading algorithm, or individual trader.

Set Protocol tax treatment:

  • Set tokens increase or decrease in price, like an ETF. You realize any gains via capital gains when you trade your Set tokens back to another cryptocurrency.
  • As mentioned earlier in this article, this can be advantageous because you only recognize tax when you cash out, not while you are trading or rebalancing your portfolio.

We're always adding tax information for more Decentralized Finance platforms. Don't see your DeFi platform here? Ask us on our live chat (click the icon at the lower right of the page) — we probably know how tax works for it!

Learn how to save money on your crypto taxes

We’ll send you tips that smart investors use when filing their taxes

Calculate your crypto taxes now

TokenTax does the hard work so you don’t have to.