Back to blog
DeFi & Advanced Protocols

Crypto Lending and Borrowing: How DeFi Loans Are Taxed in Spain

Everything you need to know about cryptocurrency lending and borrowing taxation in Spain. Correctly declare interest, collateral and liquidations to the AEAT.

E

Cleriontax Team

Crypto Tax and Data Analysis Experts

16 min read
DeFi LendingCrypto BorrowingCollateralized LoansAaveCompoundMakerDAOVenusDeFi LiquidationsCrypto CollateralDeFi InterestFlash LoansAdvanced DeFi TaxationInvestment IncomeAEATForm 100Form 721
Tributación de lending y borrowing de criptomonedas en España - Guía completa sobre cómo declarar préstamos DeFi, intereses, colateral y liquidaciones ante la AEAT
19 de enero de 2026
16 min de lectura
DeFi y Protocolos Avanzados
DeFi LendingCrypto BorrowingCollateralized LoansAaveCompoundMakerDAOVenusDeFi LiquidationsCrypto CollateralDeFi InterestFlash LoansAdvanced DeFi TaxationInvestment IncomeAEATForm 100Form 721

Lending and borrowing of cryptocurrencies has become one of the most popular activities within the DeFi ecosystem. Protocols like Aave, Compound, MakerDAO or Venus allow users to lend their cryptocurrencies in exchange for interest, or borrow using their assets as collateral.

But behind this apparent simplicity lies considerable tax complexity. Each lending operation generates yields that must be declared, and borrowing, although not a sale, has tax implications that many users are unaware of.

In this guide we analyze in depth how these operations are taxed in Spain, what criteria the AEAT applies, and how to correctly document your lending activities to avoid surprises with the Tax Authority.

What is cryptocurrency lending

Lending of cryptocurrencies consists of depositing your digital assets in a protocol or platform so that other users can borrow them. In return, you receive interest proportional to the time and amount deposited.

Types of lending

There are different lending modalities in the crypto ecosystem:

Centralized lending (CeFi):

  • Platforms like Nexo, BlockFi, Celsius (now defunct) or the Earn section of exchanges
  • You deposit your cryptocurrencies and the platform manages the loans
  • You receive fixed or variable interest depending on the asset
  • The platform acts as intermediary and custodian

Decentralized lending (DeFi):

  • Protocols like Aave, Compound, Venus or Benqi
  • You deposit directly into smart contracts
  • Interest is calculated algorithmically based on supply and demand
  • You receive representative tokens (aTokens, cTokens) of your deposit
  • Greater control but also greater responsibility

How DeFi lending works

When you deposit cryptocurrencies in a protocol like Aave:

  1. Deposit: You send your ETH, USDC or other asset to the protocol's smart contract
  2. Representative token: You receive an equivalent token (aETH, aUSDC) that represents your deposit plus accumulated interest
  3. Interest accumulation: The value of your aTokens increases continuously as interest accumulates
  4. Withdrawal: When you want to recover your funds, you return the aTokens and receive your original deposit plus the generated interest

This mechanism has specific tax implications that we will analyze later.

What is cryptocurrency borrowing

Borrowing (or collateralized loan) allows you to obtain liquidity without selling your cryptocurrencies. You deposit an asset as collateral and, in exchange, you can borrow another asset up to a percentage of the deposited value.

How borrowing works

Suppose you have 10 ETH and need liquidity but don't want to sell them:

  1. Collateral deposit: You deposit your 10 ETH in Aave as guarantee
  2. Borrowing capacity: The protocol allows you to borrow up to 80% of the value (for example, 8,000 USDC if ETH is worth $1,000)
  3. Loan: You request 5,000 USDC borrowed
  4. Interest: You pay variable interest on the borrowed USDC
  5. Repayment: To recover your collateral, you return the USDC plus accumulated interest

Liquidation risk

If the value of your collateral falls below the minimum health ratio (health factor), the protocol can liquidate part or all of your collateral to repay the debt. This has important tax consequences that we will explain later.

Collateralization ratio

Each protocol establishes different ratios:

  • Aave: Between 50% and 85% depending on the asset
  • Compound: Between 60% and 85%
  • MakerDAO: Minimum 150% collateralization

Maintaining sufficient collateral is crucial to avoid liquidations.

Lending taxation: how to declare interest

Interest generated by lending cryptocurrencies is taxed as investment income in Spanish IRPF. This is clearly established by AEAT doctrine.

Legal basis

According to Article 25.2 of the IRPF Law, income obtained from the transfer of own capital to third parties is considered investment income. Cryptocurrency lending fits perfectly into this definition: you transfer your assets to a third party (the protocol or platform) and receive remuneration.

Accrual moment

The key question is: when is the tax obligation generated?

In DeFi lending with aTokens, interest accumulates continuously and materializes when:

  1. You withdraw your funds: The moment you recover your deposit plus interest
  2. You exchange aTokens: If you sell or exchange your aTokens for other assets
  3. On December 31: Some experts argue that the accumulated value should be declared annually

Recommended conservative criterion: Declare interest at the moment of actually receiving the funds (withdrawal or exchange), as this is when the yield materializes.

Interest valuation

Interest must be valued in euros at market price on the day they are received. If you deposit ETH and receive interest in ETH, you must value those additional ETH at the price of the withdrawal day.

Practical example:

  • You deposit 10 ETH in Aave on January 1
  • You withdraw 10.5 ETH on June 30 (0.5 ETH in interest)
  • ETH price on June 30: 2,000 EUR
  • Yield to declare: 0.5 ETH × 2,000 EUR = 1,000 EUR

This yield is taxed in the savings base with rates from 19% to 28%.

Where to declare interest

Lending yields are declared in Form 100 (IRPF), specifically in the box corresponding to investment income derived from the transfer of own capital to third parties.

Borrowing taxation: does it generate tax obligation?

Borrowing presents a more complex tax situation. Here we must distinguish several events:

1. Depositing collateral: is it taxed?

Depositing cryptocurrencies as collateral does not generate taxation by itself. You are not selling or exchanging your assets; you are simply locking them as guarantee. Ownership remains yours.

Important: Although you receive representative tokens (like aETH), if these tokens simply represent your deposit and do not imply a real exchange, no taxable event is generated.

2. Receiving the loan: is it taxed?

Receiving borrowed cryptocurrencies also does not generate direct taxation. A loan is not income or capital gain; it is a debt that you will have to repay.

Analogy: Taking out a mortgage to buy a house does not generate IRPF. Similarly, borrowing USDC against your ETH does not generate taxation.

3. Using borrowed funds: here there are implications

If you use the borrowed funds to perform operations, those operations may have tax consequences:

  • Buying another cryptocurrency: If you buy SOL with borrowed USDC and then sell the SOL, that operation is taxed normally
  • Converting to fiat: Does not generate taxation itself (it's a loan), but keep documentation of the origin

4. Paying interest: is it deductible?

This is one of the most frequent questions. Interest paid for borrowing is not deductible as a general expense in IRPF for individuals.

However, if you operate as an economic activity (self-employed or company), they could be deductible as a business expense. Consult a tax advisor for your specific case.

5. Repaying the loan: is it taxed?

Repaying the loan principal does not generate taxation. You are simply fulfilling your debt obligation.

Liquidations: the most critical tax event

Liquidations are the most fiscally complex aspect of borrowing. When the value of your collateral falls and a liquidation occurs, important tax events are generated.

What happens in a liquidation

When your health factor falls below the threshold (generally 1.0):

  1. A liquidator pays part of your debt
  2. In exchange, the liquidator receives a part of your collateral with a discount (liquidation bonus)
  3. Your collateral is reduced and your debt decreases proportionally

Tax treatment of liquidation

From a tax perspective, a liquidation equals a forced sale of part of your collateral:

  • Capital gain or loss: The difference between the acquisition value of the liquidated collateral and the value at which it is liquidated
  • Accrual moment: The moment of liquidation
  • Acquisition cost: The price at which you originally acquired the liquidated collateral (applying FIFO if you have multiple lots)

Liquidation example:

  • You deposited 10 ETH as collateral (acquisition cost: 1,500 EUR/ETH = 15,000 EUR total)
  • You borrowed 10,000 USDC
  • ETH falls to 1,200 EUR and partial liquidation occurs
  • 5 ETH are liquidated at a value of 6,000 EUR (1,200 EUR × 5)
  • Capital loss: 6,000 - 7,500 = -1,500 EUR

This loss can be offset against other capital gains.

Documenting liquidations

It is essential to obtain and keep:

  • Hash of the liquidation transaction
  • Amount of liquidated collateral
  • Value at the time of liquidation
  • Amount of debt repaid
  • Original acquisition cost of collateral

Special case: representative tokens (aTokens, cTokens)

The representative tokens you receive when depositing in DeFi protocols deserve special analysis.

What are aTokens and cTokens?

  • aTokens (Aave): Represent your deposit + accumulated interest. Their quantity increases constantly.
  • cTokens (Compound): Represent your deposit. Their value (exchange rate) increases relative to the underlying asset.

Tax treatment of initial exchange

Conservative position: Depositing ETH and receiving aETH could be considered an exchange with capital gain/loss.

Pragmatic position: If the tokens simply represent your deposit (like a receipt), there is no real exchange. It's like depositing money in a bank and receiving a statement.

Recommendation: Follow the pragmatic criterion but thoroughly document all operations to defend any position.

Sale or exchange of representative tokens

If you sell or exchange your aTokens/cTokens for another asset before withdrawing, a capital gain or loss is generated:

  • Acquisition value: The value of the original deposit
  • Transfer value: The market value of the tokens at the time of sale/exchange

Specific protocols: tax particularities

Aave

  • aTokens model with increasing balance
  • Interest is reflected in the increase of aTokens balance
  • Supports multiple networks (Ethereum, Polygon, Arbitrum, etc.)
  • Offers flash loans (without collateral, for arbitrage)

Tax consideration: Flash loans, if they generate profit, are taxed as capital gain from the arbitrage operation.

Compound

  • cTokens model with increasing exchange rate
  • Governance with COMP token
  • May distribute COMP as additional incentive

Tax consideration: COMP tokens received as incentive are investment income, valued at market price on the day of receipt.

MakerDAO

  • Loan system with DAI (stablecoin)
  • Collateral in ETH, WBTC and other assets
  • Minimum collateralization ratio of 150%
  • Variable stability fees

Tax consideration: Generating DAI against collateral is not a sale. Stability fees paid are not deductible for individuals.

Venus (BNB Chain)

  • Similar to Compound but on BNB Chain
  • vTokens representative tokens
  • Additional incentives in XVS

Common strategies and their taxation

Leverage farming (recursive lending)

Some users deposit collateral, borrow, deposit what they borrowed as additional collateral, and repeat the cycle to maximize protocol incentives.

Taxation:

  • Each collateral deposit: not taxed
  • Each loan received: not taxed
  • Interest received from deposits: investment income
  • If there is liquidation: capital gain or loss
  • If you receive governance tokens as incentive: investment income

Loans for arbitrage

Borrowing to take advantage of price differences between exchanges.

Taxation:

  • The arbitrage profit: capital gain
  • Loan interest: not deductible (for individuals)

Loans to avoid tax sale

Some investors borrow against their Bitcoin to obtain liquidity without selling (and without generating taxation for the sale).

Consideration: This strategy is legitimate. You don't sell, you don't pay taxes. But be careful with liquidations.

Common errors in lending/borrowing taxation

Error 1: Not declaring lending interest

Many users assume that as long as they don't convert to euros, there is no tax obligation. Incorrect. Interest generates yields that must be declared.

Error 2: Believing borrowing has no tax impact

Although the loan itself is not taxed, liquidations and the use of borrowed funds can generate tax obligations.

Error 3: Not documenting operations

DeFi protocols do not send reports to the Tax Authority (yet), but the DAC8 directive will change this. Document everything from now.

Error 4: Ignoring incentive tokens

COMP, AAVE or other tokens received as incentive are taxable yields, not "gifts" without tax obligation.

Error 5: Not considering correct acquisition cost in liquidations

When your collateral is liquidated, you must apply FIFO to determine the correct acquisition cost.

How to document lending and borrowing operations

To correctly comply with your tax obligations, you need to document:

For lending:

  • Date and time of deposit
  • Amount deposited and asset
  • Protocol used
  • Representative tokens received (if applicable)
  • Date and time of withdrawal
  • Amount withdrawn (principal + interest)
  • Market price at time of withdrawal
  • Transaction hashes

For borrowing:

  • Date and time of collateral deposit
  • Amount and asset deposited as collateral
  • Original acquisition cost of collateral
  • Date and time of loan
  • Amount and asset borrowed
  • Interest paid during the loan
  • Loan repayment date
  • If there were liquidations: complete details

Recommended tools

You can use specialized tools to track these operations, although none perfectly manages the particularities of DeFi lending/borrowing. It is always advisable to maintain your own record.

Form 721: should I declare my lending positions?

If the total value of your cryptocurrencies abroad (including lending positions in DeFi protocols) exceeds 50,000 euros on December 31, you must file form 721.

Important: DeFi protocols are considered located abroad, so your lending deposits count towards the form 721 threshold.

What to declare

  • Total value of your lending deposits on December 31
  • Include both principal and accumulated interest
  • Value in euros at the exchange rate of the day

Summary: tax checklist for lending and borrowing

Lending:

  • Interest is taxed as investment income
  • Declare at the time of withdrawal or exchange of representative tokens
  • Value interest at market price on the day of receipt
  • Incentive tokens (COMP, AAVE) are also yields
  • Include positions in form 721 if you exceed the threshold

Borrowing:

  • Depositing collateral is not taxed
  • Receiving the loan is not taxed
  • Interest paid is not deductible (individuals)
  • Liquidations generate capital gain or loss
  • Apply FIFO to liquidated collateral cost
  • Thoroughly document all operations

Conclusion

Cryptocurrency lending and borrowing offers interesting opportunities but carries tax obligations that should not be ignored. Lending interest is clearly investment income, while borrowing, although it does not generate direct taxation, can lead to significant tax events in case of liquidation.

The key is thorough documentation and conservative criteria in interpreting the rules. With the upcoming implementation of DAC8, the Tax Authority will have increasingly more information about user operations, so maintaining an orderly record from now is essential.

If your lending and borrowing operations are complex or high volume, consider requesting a professional analysis of your portfolio to ensure correct compliance with your tax obligations.

Request your DeFi tax report

Our team of experts will analyze your lending, borrowing and other DeFi activities to generate a complete tax report ready to file with the AEAT.

Legal disclaimer: This article is for informational and educational purposes only. It does not constitute personalized tax advice or investment recommendation. Tax regulations are subject to change and each personal situation is unique. Always consult with a certified professional tax advisor for your specific case.

Article updated periodically

Published by: Cleriontax Team - Cryptocurrency Taxation and Data Analysis Experts

Did you find this article helpful?

Share it with other investors who might need it

Need help with your cryptocurrency tax return?

Our team of experts can analyze your case and prepare your complete tax return

Request free analysis