Yield farming: taxation in Spain and how to declare it
Yield farming is one of the most popular strategies in DeFi to generate returns on crypto assets. But its operational complexity translates into fiscal complexity. In Spain, the AEAT expects you to declare each income generated.
What is yield farming?
Yield farming consists of depositing cryptocurrencies in DeFi protocols (such as Aave, Compound, Yearn Finance, Convex) to obtain returns in the form of:
- Interest on loans.
- Protocol reward tokens (AAVE, COMP, YFI...).
- Liquidity commissions.
Unlike simple staking, yield farming typically involves multiple layers of protocols and automatic reinvestment of returns.
How are yield farming returns taxed?
The General Directorate of Taxes (DGT) classifies returns from DeFi activities as returns on movable capital (when there is no business regularity). This implies:
- They are declared in the savings tax base.
- Tax rate: 19% up to €6,000, 21% up to €50,000, 23% up to €200,000, 28% from €200,000.
When are they taxed?
- At the time of receiving them or when they are available (you can withdraw them).
- Valued at the market price at that moment.
Automatic rollover (auto-compounding): problems?
Protocols like Yearn Finance or Beefy Finance automatically reinvest interest. This creates complexity:
- Technically, each rollover is a "cash out" followed by a "deposit."
- The DGT could interpret that each rebase/reinvestment is a tax event.
The most widespread practical criterion among crypto tax advisors is:
- Declare the accumulated returns at the time of withdrawing the position.
- The increase in value of the token vault (xToken, yToken) is declared as capital gain upon withdrawal.
This is not confirmed by binding consultation, so it is recommended to be conservative and consult an advisor.
Reward Tokens: Double Taxation
When a protocol pays you reward tokens (like CRV for yield farming on Curve):
- Upon receipt: return on capital at market price.
- When selling them: capital gain or loss (sale price - price upon receipt).
This double tax event is what is called "double taxation" of yield farming and is one of the main complaints of the sector.
Practical example
You deposit 10,000 USDC into Aave on January 1st. During the year:
- You receive 500 USDC of interest = yield on movable capital: €500
- You receive 100 AAVE tokens (value upon receipt: €8/token) = return on movable capital: €800
At the end of the year you sell the 100 AAVE at €12/token:
- Profit = (12 - 8) × 100 = €400 → equity gain (savings base)
Total to declare: 500 + 800 + 400 = €1,700 in different categories.
Formal obligations
- If your DeFi returns exceed €1,600 annually, you must fill out Form D-6 (operations with non-residents, if the protocol is foreign).
- If the total assets in foreign exchanges exceed €50,000, Form 720 is necessary.
Recommended registration
For each yield farming operation, write down:
- Exact date and time of the event.
- Tokens received.
- Market price at that time.
- Protocol and contract.
declaracrypto.es allows you to import transactions from DeFi protocols and automatically calculate the returns on capital gains and capital gains.
Updated: April 2026 | Fiscal year: 2025


