Crypto Taxes and Accounting

The Complete DeFi & Yield Farming Crypto Tax Guide

March 23, 2021
Written By

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

What is Decentralized Finance (DeFi)?

Decentralized Finance, or DeFi, allows traders to access services like trading, borrowing, and lending without the use of a middleman (such as a Centralized Exchange, like Coinbase, Binance, or Gemini). DeFi exchanges utilize automated market-making - rather than depending on an exchange’s liquidity - by using liquidity provided by ordinary traders who pool their holdings together with other traders to create supply.

By eliminating middlemen from transactions, DeFi aims to make transactions cheaper, faster, and more efficient. 

What is DeFi
Source: DeFi Pulse

Protocols like Compound, Aave, and MakerDAO allow users to lend money and earn interest. Exchanges like Uniswap and dYdX enable users to trade crypto assets without using a centralized cryptocurrency exchange. And some wallets now integrate with both, such as Coinbase Wallet and Metamask with Uniswap.

Crypto investors are currently making money off of the DeFi ecosystem in three important ways: 

  • Yield Farming
  • Liquidity Pools
  • Loan Collateralization

Crypto investors also enjoy being able to obtain tokens without using the regular US or foreign exchange. Decentralized exchanges do not require traders to go through cumbersome identity checks or open accounts in other countries to obtain rare currencies; they just need to find an exchange that has liquidity in the trading pair they are interested in using.

What is Crypto Exchange Liquidity?

Liquidity is the lifeblood of DeFi, and finance in general. In textbook terms, liquidity is how quickly you can convert an asset into cash. For example, 1 GOOG stock in your portfolio is more liquid than a piece of rental property you own, because there are so many buyers available for the GOOG stock and not very many for your rental property. Cash is the most liquid asset you can have.

In the cryptocurrency world, liquidity means that every time you place an order to buy or sell a coin, there is a counterparty for that transaction.

Ethereum (ETH) is currently the most popular ecosystem for DeFi. Most coins, even those that are not on the ETH/ERC-20 ecosystem, can be traded with wrapped coins (more on this later). These platforms are rapidly gaining popularity amongst crypto investors as an alternative to the high fees charged by centralized exchanges. Some other crypto projects are making quick strides in this area, such as PolkaDOT (DOT). 

The easiest way to understand why liquidity pools exist and how they work is by drilling into one of the major use cases of liquidity pools ‑ a decentralized exchange. We’ll take the example of Uniswap to explain.

Decentralized exchanges and protocols still need liquidity, but using traditional methods to provide this supply would defeat the whole premise of being decentralized. The solution to the problem is creating liquidity pools governed by smart contracts. Liquidity pools are in place to provide liquidity to DeFi platforms (exchanges, lenders, borrowers, insurance, etc.) in a peer-to-peer fashion without using centralized exchange pools held by a custodian.

What is a Liquidity Pool?

A liquidity pool is a smart contract where crypto users’ funds are grouped together to provide liquidity for the market as a whole. Crypto holders who provide cryptocurrency tokens into liquidity pools are called Liquidity Providers (LPs). Uniswap uses a smart contract to provide this liquidity using deposits made by Yield Farmers, who are looking for a high rate of return in interest and a share of transaction fees.

The process is relatively straightforward.

First, many crypto holders, known as liquidity providers, collectively lock their funds in a Liquidity Pool administered by the Uniswap smart contract. In exchange for providing liquidity, these liquidity providers earn rewards. The greater the number of locked funds in these pools, the greater the liquidity the exchange, or the token pairs on the exchange, has. Liquidity pools facilitate cryptocurrency trades (trading one cryptocurrency to another) and cryptocurrency loans backed by collateral.

Liquidity Pool Example

For example, let’s say someone starts a Uniswap (decentralized exchange) liquidity pool for TUSD/USDC. They could start the pool by putting in 100 TUSD and 100 USDC — equal parts of both because they are both dollar stablecoins that are closely pegged to $1. Why would they do that? Because they will earn interest in the form of pool fees for users who use the pool. The open pool market makes it possible for there to essentially be a trading pair between any Ethereum pairs on Uniswap, and also highly liquid due to the clear arbitrage opportunities.

Liquidity Pool Taxes

There are many other advantages to providing liquidity, but for the purposes of this guide, it’s important to note that there are taxable consequences for both being an LP and using a DeFi platform for trades.

It is also important to note that the IRS has not issued specific guidance for DeFi taxes, so this article bases DeFi tax treatment off of existing crypto tax guidance. We will update this article as we learn more. The treatments below represent the most conservative approach based on current IRS guidelines regarding similar transactions.

What is Yield Farming?

Yield farming is any effort to put your crypto assets to work and generate the most returns possible on those assets. At the simplest level, a yield farmer might move assets around within several different DeFi protocols, constantly working to find the pool that is offering the best yield from week to week.

Several decentralized exchanges exist, such as Aave, Uniswap, Compound, and others. The return on liquidity provision varies depending on demand, so yield farmers are constantly looking to move to where they can get the best rate of return.

This year, Yearn Finance aimed to help liquidity providers find the best yield at any given time, giving rise to a class of specialty tools aimed at helping those with assets to stake find the best deals in exchange for providing their tokens to liquidity pools. 

How Are DeFi Transactions Taxed?

At a high level, cryptocurrencies are treated as property by the IRS and all the general rules applicable to property apply to cryptocurrency transactions. Every time you spend, sell, or exchange cryptocurrency, there is a taxable event.

So far, all the guidance issued by the IRS (Notice 2014-21, Rev. Rule 2019-24, 45 FAQs) has been generic and does not address DeFi at all. However, this is not an excuse not to report any of your DeFi related taxes. There is enough guidance in place to infer the tax implications of DeFi and yield farming transactions.

The process of DeFi and yield farming generally consists of several transactions. In the following sections, we will break down these different transaction types. Some DeFi transactions do not have any direct nor ancillary tax guidance. In these situations, we will present various tax positions you can take based on your risk tolerance.

The more aggressive the tax position, the higher the tax exposure. This means a greater risk of under-reporting and getting audited.

On the upside, more aggressive tax positions will generally result in lower taxes, more tax deferment, and lower upfront tax payments. The lower the aggressiveness level, the lesser the risk of getting into trouble with the IRS. However, you will report income sooner and likely pay more taxes in the process.

Below, we cover the types of DeFi transactions we commonly see, and how we treat each one for tax purposes.

DeFi Lending Taxes

1 ETH is locked into Compound, which Jim purchased a few years ago for $50. At the time of the deposit, 1 ETH is worth $100. Bruce receives 50 cETH, a protocol token, representing his contribution to the liquidity pool. cETH is tradable at other exchanges and is worth $1 per coin.

Our take: This is a taxable event. Jim is disposing of his original ETH and receiving a new crypto token called cETH in a 1:1 trade. Crypto-to-crypto trades are taxable according to the IRS (A15). Additionally, when Jim receives his collateral back later, he does not receive the same exact ETH coin he deposited. This could mean a sale of Jim’s original ETH in the eyes of the IRS. As a result, Jim would report $80 ($100 – $20) worth of capital gains from the transactions.

It can be argued that this is not taxable. Bruce is not actually selling his ETH. He is only depositing assets as collateral. His intention is to borrow funds against ETH. His intention is NOT to sell the protocol token, cETH.

DeFi Wrapping Taxes

Sometimes protocols require you to wrap coins before they can be deposited into a specific blockchain’s smart contract. For example, BTC operates on the Bitcoin blockchain, not on Ethereum. Therefore, to use bitcoin with Ethereum-based DeFi platforms, you can “wrap” BTC using a protocol like Ren, which essentially locks your BTC in escrow in exchange for an ERC-20 token version of your BTC called wBTC, or Wrapped Bitcoin.

An analogy to wrapping in the non-crypto world is a cashier’s check. It represents the value of dollars in your bank and whoever gets their hands on your cashier’s check owns the right to the underlying money in the bank.

Our take: wrapping is taxable. It could be argued that the wrapped version of the original coin is a new coin resulting in a sale of the original. Crypto-to-crypto trades are taxable.

It can also be argued that this is not a taxable sale of the BTC to receive wBTC. The intention of wrapping a coin is to add additional functionality to use the BTC on the ETH blockchain. You should be prepared to defend this intent to the IRS, however.

DeFi Borrowing Taxes

Let’s say Sara borrows 50 DAI which is worth $50 ($1 x $50)

This is likely not taxable. Generally speaking, funds received from a loan are not taxable because they are not income to the borrower.

Paying Interest Taxes

When you borrow funds from a DeFi protocol, you have to pay interest to the platform. Interest expense charged on loans is one of the main sources of income for DeFi platforms.

The deductibility of this interest expense depends on the use case of the loan proceeds. If the borrowed funds are used to buy a personal asset such as a new vehicle, that interest expense is considered personal so it is not deductible.

If you use the borrowed funds for investment purposes (yield farming for example) the interest expense you incur is classified as investment interest expense. Investment interest expenses are subject to special tax rules and are deductible only up to your net investment income.

Since special rules are applicable to investment interest expenses, it is important to track these separately. The amount you can deduct each year is calculated on IRS Form 4952. Your tax professional will be able to advise you on how to work with this situation to be accurate.

Earning Interest Taxes

Chris receives 0.1 ETH as interest for providing liquidity on Uniswap. At the time of the receipt, 1 ETH is worth $200.

This is taxable. Receiving interest rewards is a taxable event where you have to pay taxes based on the market value of the token at the time of the receipt. Chris will pay based on $20 worth of Schedule 1 Misc. Crypto Income for this example.

When he reports this income, the newly received 0.1 ETH will now have a cost basis of $20. If Chris were to later sell this coin on another platform for $30, he would incur a capital gain of $10 ($30 – $20).

Earning Governance Tokens Taxes

In addition to receiving more ETH interest income, Chris also gets an airdrop of 200 Uniswap tokens.

These are taxable on the value at the time Chris claims the airdrop as Schedule 1 Misc. income. Additionally, if Chris sells the Uniswap tokens, he will incur a capital gain or loss based on the difference between the price at the time of the airdrop, and the time of the sale.

Liquidation Taxes

Let’s say that the price of ETH drops and therefore Chris’s DeFi platform liquidates his collateral at $50.

We see this as taxable. Liquidation of his collateral is a disposition event, similar to a sale, of his ETH. In this case, Bruce will have to pay taxes on the difference between how much he originally paid for the ETH vs. the price at which the protocol liquidates it.

What Happens When You Move Your Collateral Back Into Your Wallet And Exit The Liquidity Pool?

This is not taxable. Paying off a loan and getting your collateral back is not a taxable event. In the yield farming world, as long as you recognize interest and governance token income along the way, there is no taxable event at the time you exit the pool.

With that said, if you unwrap your coin when you exit the pool, that could trigger a taxable event - the guidance on this from the IRS is less than clear. See the section on wrapping above.

Gas Transaction Fees Taxes

Transaction, or gas, fees on sales are deducted from proceeds. For example, if Joan sells 1 ETH for $400 and spends $10 for gas, her total proceeds on the transaction would be $390 ($400-$10).

The Bottom Line

As you can see, paying taxes on DeFi is a bit complicated and tricky to get right. Luckily, ZenLedger can help you with your cryptocurrency taxes, as we support over 300+ exchanges, 20+ DeFi Protocols, 3000+ tokens, and 30+ blockchains, the most of any crypto tax software! 

Want to try ZenLedger Crypto Tax Software for free? 

Get Started Now

If you have any questions about DeFi taxes or how ZenLedger can help you save money on your taxes, please email us at

Get Started Now

Join the ZenLedger mailing list.

Simplifying DeFi and Cryptocurrency Taxes for Investors and Tax Professionals

Copyright © 2021 ZenLedger
10400 NE 4th St, Floor #5,
Bellevue, WA 98004, USA