Back to blog
DeFi & Advanced Protocols

Advanced DeFi Taxation in Spain 2025: How DEX Protocols Are Taxed (Uniswap, Curve, PancakeSwap)

Decentralized exchanges (DEX) like Uniswap pose unique tax challenges: swaps, liquidity pools, farming and impermanent loss. Learn how each operation is taxed by the AEAT and avoid tax mistakes that can cost you thousands of euros.

E

Cleriontax Team

Crypto Tax and Data Analysis Experts

22 min read
DEXUniswapPancakeSwapCurve FinanceAdvanced DeFi TaxationDEX SwapsLiquidity PoolsYield FarmingImpermanent LossLP TokensAEATForm 100Decentralized ProtocolsGas FeesFIFOMultichain
Fiscalidad DeFi avanzada - Cómo tributan los protocolos DEX como Uniswap, PancakeSwap y Curve ante la AEAT - Guía completa sobre impuestos en exchanges descentralizados
22 min de lectura
E

Equipo Cleriontax

Expertos en Fiscalidad Crypto y Análisis de Datos

What are DEX protocols and why do they complicate your tax return?

DEX protocols (Decentralized Exchanges) such as Uniswap, PancakeSwap, Curve or SushiSwap allow you to swap cryptocurrencies without centralized intermediaries. Unlike Binance or Coinbase, these platforms are powered by smart contracts on the blockchain.

The tax problem: Each swap on Uniswap generates a disposal of assets that must be reported. In addition, specific DeFi operations such as providing liquidity, receiving LP tokens (Liquidity Provider), doing farming or suffering impermanent loss have complex tax consequences that the AEAT does not explicitly contemplate in its regulations.

According to the general criteria of the Spanish Tax Agency, any crypto-to-crypto swap —whether on a centralized or decentralized exchange— triggers a taxable event. However, DEXs introduce operations that do not exist in traditional finance, creating an interpretative gap that you must address with specialized tax advice.

Definition: What is a DEX for tax purposes in Spain?

A DEX (Decentralized Exchange) is a blockchain protocol that allows you to exchange cryptocurrencies via smart contracts, without centralized custody of funds.

Tax-relevant characteristics:

  • No intermediary: You operate directly from your wallet (MetaMask, Trust Wallet, Ledger)
  • No KYC: You do not provide personal data, but transactions are public on the blockchain
  • On-chain transactions: Every operation is permanently recorded and auditable
  • Smart contracts: The swap is executed by automatic code, not by a company

Key tax consequence: For the AEAT, operating on Uniswap is tax-wise identical to operating on Binance. There is no special treatment or exemption for using decentralized protocols. The disposal of assets generates capital gains or losses regardless of the platform used.

Key data on DEX taxation in Spain

  • Type of platform: Decentralized exchange (no special tax treatment)
  • Swap operation ETH → USDT on Uniswap: Crypto-to-crypto swap that triggers a taxable event
  • Taxation: Savings tax base (19%-28% depending on bracket)
  • Calculation method: Mandatory FIFO
  • Tax form: Form 100 (IRPF)
  • Gas fees (Ethereum commissions): Deductible from the disposal value
  • LP tokens from liquidity pools: Capital asset that is taxed upon disposal
  • Impermanent loss: Not deductible until realized when selling the position
  • AEAT traceability: Transactions are public on the blockchain (Etherscan, BSCScan)
  • Form 721: Mandatory if total crypto balance > €50,000 on December 31
  • Statute of limitations without Form 721: 10 years

Types of DEX operations and their tax treatment

1. Basic swap (simple exchange)

Operation: Swapping one token for another on Uniswap/PancakeSwap (e.g. ETH → USDC).

Tax treatment:

  • Nature: Exchange (barter) of capital assets
  • Taxable event: Capital gains or losses
  • Timing: When the transaction is executed on-chain
  • Tax base: Disposal value (market value of the asset received) - Acquisition value (historical cost of the asset delivered)

Practical example: ` Initial purchase: 1 ETH at €2,000 (January 2024) Swap on Uniswap: 1 ETH → 3,500 USDC when ETH = €3,500 (March 2024) Gas fee paid: 20 USDC

Tax calculation:

  • Disposal value: €3,500 - €20 (gas) = €3,480
  • Acquisition value: €2,000
  • Capital gain: €1,480
  • Tax (21% bracket): €310.80 `

Common mistakes:

  • Not reporting the swap because "I still hold crypto"
  • Not subtracting gas fees from the disposal value
  • Not applying FIFO if you have multiple ETH purchases

2. Providing liquidity in pools (Liquidity Providing)

Operation: Depositing two tokens (e.g. ETH + USDC) into a Uniswap pool to facilitate swaps and receiving LP tokens (Liquidity Provider) as a participation certificate.

Tax treatment (interpretation applied by Cleriontax):

  • At the time of deposit: Exchange of ETH + USDC for LP tokens → Generates a capital gain
  • LP tokens received: New asset with acquisition value = market value of the assets deposited
  • Accrued fees: Investment income (19%-28%) when claimed

Practical example: ` Deposit into Uniswap ETH/USDC pool:

  • 1 ETH (bought at €2,000, now worth €3,000)
  • 3,000 USDC (bought at €1 each)
  • You receive: 100 UNI-V2 ETH/USDC tokens

Tax calculation for the deposit:

  • Gain on ETH: €3,000 - €2,000 = €1,000
  • Gain on USDC: €3,000 - €3,000 = €0
  • Total gain: €1,000 (to be reported)

LP token acquisition value:

  • 100 UNI-V2 = €6,000 (€3,000 ETH + €3,000 USDC)
  • Unit value: €60/LP token `

Important: This criterion is interpretative. Spanish regulations do not expressly regulate LP tokens. Consult specialized tax advice to apply the most conservative criterion for your situation.

3. Liquidity withdrawal (withdraw)

Operation: Burning LP tokens to recover your share of the pool (now affected by impermanent loss and accumulated fees).

Tax treatment:

  • Burning LP tokens: Disposal of the LP asset → Generates a gain/loss depending on current value vs acquisition value
  • Tokens recovered: The ETH/USDC tokens recovered have an acquisition value equal to their market value at the time of withdrawal
  • Materialized impermanent loss: If you recover less value than you deposited, it materializes as a capital loss

Practical example: ` Liquidity withdrawal from ETH/USDC pool:

  • You burn: 100 UNI-V2 tokens (acquisition value: €6,000)
  • You receive: 0.9 ETH (current value €3,500) + 3,150 USDC
  • Total value received: €3,150 + €3,150 = €6,300

Tax calculation:

  • Disposal value of LP tokens: €6,300
  • Acquisition value of LP tokens: €6,000
  • Gain: €300

New acquisition value:

  • 0.9 ETH acquired at €3,500/ETH = €3,150
  • 3,150 USDC acquired at €1/USDC = €3,150 `

4. Yield Farming (additional rewards)

Operation: Receiving reward tokens (e.g. UNI, CAKE, CRV) for providing liquidity in pools.

Tax treatment:

  • Nature: Investment income (similar to dividends)
  • Tax point: When you receive/claim the reward tokens
  • Amount to report: EUR market value of the token at the time you receive it
  • Taxation: 19%-28% depending on the savings tax base

Practical example: ` Farming on PancakeSwap (CAKE/BNB pool):

  • You provide liquidity for 3 months
  • You receive: 50 CAKE tokens as rewards
  • CAKE value at the time of receipt: €4/CAKE

Tax calculation:

  • Investment income: 50 × €4 = €200
  • Tax (19% bracket): €38

CAKE acquisition value:

  • 50 CAKE acquired at €4 = €200 (for future sales) `

Important: If you later sell the CAKE, you will apply FIFO using this acquisition value (€4/CAKE).

5. Impermanent Loss

What it is: Loss of value in liquidity pools when the price ratio between the two tokens changes. If you had simply held the tokens instead of depositing them, you would have more value.

AEAT tax treatment:

  • While funds remain in the pool: NOT deductible (unrealized loss)
  • Upon liquidity withdrawal: It materializes as a capital loss if the recovered value < value deposited
  • Offsetting: The fees earned may partially offset the impermanent loss

Visual example: ` Initial situation:

  • You deposit: 1 ETH (€3,000) + 3,000 USDC = €6,000 total

Three months later (ETH rises to €4,000):

  • If you had held: 1 ETH (€4,000) + 3,000 USDC = €7,000
  • Upon pool withdrawal: 0.866 ETH (€3,464) + 3,464 USDC = €6,928
  • Impermanent loss: €7,000 - €6,928 = €72
  • Fees earned: +€120
  • Net result: +€48

Tax calculation:

  • LP token gain: €6,928 - €6,000 = €928
  • Income (fees): €120
  • Total to report: €928 (capital gains) + €120 (investment income) `

Impermanent loss is NOT reported separately, but is embedded in the calculation of gains/losses on the LP tokens.

How to calculate capital gains on DEX operations

General formula (same as for CEXs):

Gain/Loss = Disposal Value - Acquisition Value - Costs

Step 1: Identify all DEX transactions

Use blockchain explorers:

  • Ethereum: Etherscan.io → connect your wallet address
  • Binance Smart Chain: BSCScan.com
  • Polygon: PolygonScan.com
  • Arbitrum: Arbiscan.io

Filter by:

  • Swaps on Uniswap, SushiSwap, 1inch
  • Deposits/withdrawals into liquidity pools
  • Reward claims

Step 2: Export transaction data

Options:

  1. Etherscan: "Export" → CSV (limited to 5,000 tx in the free version)
  2. Specialized tools: DeBank, Zerion, CoinTracking for multichain visualization
  3. Blockchain APIs: For very high volume (requires technical knowledge)

Step 3: Determine acquisition value (FIFO)

If you bought the same token several times:

  1. Sort all purchases chronologically
  2. Match each sale to the oldest remaining purchase
  3. If you sell more than the amount in the oldest purchase, move on to the second oldest, and so on

FIFO example with DEX swaps: ` Operations:

  1. 10/01/2024: Buy 2 ETH at €2,000/ETH = €4,000 (Coinbase)
  2. 15/02/2024: Buy 1 ETH at €2,500/ETH = €2,500 (Binance)
  3. 20/03/2024: Swap on Uniswap: 2.5 ETH → DAI (ETH worth €3,000)

FIFO calculation:

  • First 2 ETH sold → purchase of 10/01 (€2,000/ETH)
    • Gain: (€3,000 - €2,000) × 2 = €2,000
  • Next 0.5 ETH sold → purchase of 15/02 (€2,500/ETH)
    • Gain: (€3,000 - €2,500) × 0.5 = €250
  • Total gain: €2,250 `

Step 4: Subtract gas fees

Network fees (gas) are deductible:

  • Gas paid in the transaction = Deductible cost
  • Reduces the disposal value

` Swap: 1 ETH → 3,000 USDC Gas fee: 0.005 ETH (€15 at the exchange rate at the time)

Disposal value:

  • USDC received: €3,000
  • Gas paid: -€15
  • Net value: €2,985 `

Step 5: Classify each transaction

Correct classification of crypto transactions is critical:

  • Swaps: Capital gains/losses
  • Providing liquidity: Capital gains/losses (due to the swap)
  • Farming rewards: Investment income
  • Transfers between own wallets: No taxable event (internal movement)

Step 6: Apply IRPF brackets

Savings tax base (2025):

  • Up to €6,000: 19%
  • €6,000 - €50,000: 21%
  • €50,000 - €200,000: 23%
  • €200,000 - €300,000: 27%
  • More than €300,000: 28%

Tax differences between operating on DEX vs CEX

Although they are equivalent from a tax standpoint, there are important practical differences:

Traceability and evidence

AspectCEX (Binance, Coinbase)DEX (Uniswap, PancakeSwap)
Tax reportsSome exchanges provide CSVsYou must reconstruct them yourself via the blockchain
EUR valuationExchange shows historical EUR priceYou must calculate the exchange rate at each moment
Evidence before AEATOfficial exchange CSVTransaction hash + Etherscan
Technical complexityLow (download CSV)High (requires blockchain analysis)
KYC / identificationYes (exchange has your data)No (but transactions are public)

Practical implications

  1. Rebuilding transaction history: Operating on DEX requires advanced blockchain data analysis to correctly rebuild all operations.

  2. Asset valuation: You must determine the EUR value of each token at the exact time of the transaction using price APIs (CoinGecko, CoinMarketCap).

  3. Gas fees: On CEX, fees are clear. On DEX, you must convert gas paid in ETH/BNB to EUR.

  4. Exotic tokens: On DEX you can trade illiquid tokens not listed on CEX. Valuing illiquid tokens is complex from a tax perspective.

  5. Form 721: Both count towards the €50,000 threshold. Your funds in a MetaMask wallet with liquidity on Uniswap MUST be reported if they exceed the threshold.

Comparative example: ` CEX (Binance):

  • Swap BTC → USDT
  • Binance generates CSV: "Sold 0.1 BTC at 60,000 USD = 54,545 EUR"
  • You report: €54,545 as disposal value

DEX (Uniswap):

  • Swap WBTC → USDC (same economic value)
  • Etherscan shows: "Swapped 0.1 WBTC for 60,000 USDC, gas: 0.01 ETH"
  • You must calculate:
    • EUR value of 60,000 USDC at that time
    • EUR value of 0.01 ETH (gas)
    • Applicable USD/EUR exchange rate
  • You report: manually calculated value `

Main DEX protocols and their tax peculiarities

Uniswap (Ethereum, Polygon, Arbitrum)

Characteristics:

  • Leading DEX on Ethereum
  • V3 version with concentrated liquidity
  • High gas fees on Ethereum mainnet

Tax peculiarities:

  • Concentrated liquidity V3: The NFTs representing positions are NOT standard LP tokens. For tax purposes they are treated as NFTs + an economic right over the pool.
  • Multiple fee tiers: Pools with 0.05%, 0.3%, 1% fees. This affects yields.
  • Multichain: Operating on Uniswap Polygon vs Ethereum requires separate tracking.

PancakeSwap (Binance Smart Chain)

Characteristics:

  • Main DEX on BSC
  • Very low gas fees (cents in BNB)
  • Farming of the CAKE token

Tax peculiarities:

  • Syrup pools: Staking CAKE to receive other tokens. For tax purposes = investment income.
  • Lottery and Predictions: Gains would be taxed as capital gains or income depending on the interpretation.
  • Auto-compounding: Vaults that auto-reinvest. Each reinvest technically triggers a taxable event.

Curve Finance (multiple chains)

Characteristics:

  • Specialized in stablecoins
  • Low slippage for large volumes
  • veCRV (vote-escrowed CRV) for governance

Tax peculiarities:

  • Stablecoin pools: Swaps USDC → USDT generate a gain close to €0, but they are still taxable events.
  • CRV lock: Locking CRV for 4 years to receive veCRV. Tax-wise it is a conversion CRV → veCRV (swap).
  • Reward boost: Getting higher rewards requires veCRV. The extra rewards are still taxed as income.

Balancer (Ethereum, Polygon, Arbitrum)

Characteristics:

  • Pools with multiple tokens (not just pairs)
  • Configurable weight (e.g. 80% ETH / 20% USDC)
  • BAL token as reward

Tax peculiarities:

  • Multi-asset pools: Depositing 4 different tokens = 4 simultaneous swaps. Complex calculation.
  • Automatic rebalancing: The pool rebalances weights. For tax purposes it occurs within the LP token and does not generate individual events.
  • Liquidity mining: Receiving BAL is taxed as income.

Full practical cases with DEX calculations

Case 1: Active trader on Uniswap (swaps only)

Profile: Trader who makes frequent swaps on Uniswap V2.

Operations 2024:

  1. January: Buy 5 ETH at €2,000/ETH = €10,000
  2. February: Swap on Uniswap: 2 ETH → 5,500 USDC (ETH = €2,750, gas 0.015 ETH = €40)
  3. March: Swap on Uniswap: 5,500 USDC → 2.1 ETH (ETH = €2,600, gas 0.012 ETH = €30)
  4. April: Sell 3 ETH on Coinbase at €3,000/ETH = €9,000

Tax calculation:

Operation 2 (Feb - ETH → USDC): ` Disposal value: €5,500 - €40 (gas) = €5,460 Acquisition value (FIFO): 2 ETH × €2,000 = €4,000 Gain: €1,460

New state:

  • 3 ETH remaining (acquisition value: €2,000/ETH)
  • 5,500 USDC (acquisition value: €5,460 total = €0.9927/USDC) `

Operation 3 (Mar - USDC → ETH): ` Disposal value: 5,500 USDC × €0.9927 = €5,460 Gas in ETH: 0.012 ETH × €2,600 = €31.2 Net disposal value: €5,460 - €31.2 = €5,428.8

USDC acquisition value: €5,460 Loss: €31.2 (gas only)

New state:

  • 3 old ETH (acquisition value: €2,000/ETH)
  • 2.1 new ETH (acquisition value: €5,428.8 / 2.1 = €2,585/ETH) `

Operation 4 (Apr - ETH → EUR): ` Sale of 3 ETH at €3,000/ETH = €9,000

FIFO: First 3 ETH are the old ones (€2,000/ETH) Gain: (€3,000 - €2,000) × 3 = €3,000 `

Total year 2024:

  • Gains: €1,460 + €3,000 = €4,460
  • Losses: €31.2
  • Net gain: €4,428.8
  • Tax (19%): €841.47

Case 2: Liquidity provider on PancakeSwap with farming

Profile: Investor who provides liquidity in CAKE/BNB pool for 6 months.

Operations 2024:

  1. January: Buy 10 BNB at €300/BNB = €3,000
  2. January: Buy 150 CAKE at €20/CAKE = €3,000
  3. February: Deposit into CAKE/BNB pool:
    • 10 BNB (now worth €350/BNB)
    • 150 CAKE (now worth €18/CAKE)
    • You receive 1,000 CAKE-BNB LP tokens
  4. February-July: You accumulate 25 CAKE as rewards (average value €15/CAKE)
  5. August: Withdraw liquidity:
    • You burn 1,000 LP tokens
    • You receive 8 BNB (value €400/BNB) + 180 CAKE (value €12/CAKE)
  6. September: You sell everything for EUR

Tax calculation:

Operation 3 (Liquidity deposit): ` BNB disposal:

  • Disposal value: 10 BNB × €350 = €3,500
  • Acquisition value: 10 BNB × €300 = €3,000
  • Gain: €500

CAKE disposal:

  • Disposal value: 150 CAKE × €18 = €2,700
  • Acquisition value: 150 CAKE × €20 = €3,000
  • Loss: €300

Net gain on deposit: €200

LP tokens:

  • Acquisition value: €3,500 + €2,700 = €6,200 `

Operation 4 (Farming rewards): ` Investment income:

  • 25 CAKE × €15 = €375
  • Taxation: 19% × €375 = €71.25

CAKE rewards acquisition value: €375 total `

Operation 5 (Liquidity withdrawal): ` LP token disposal:

  • Disposal value: (8 BNB × €400) + (180 CAKE × €12) = €3,200 + €2,160 = €5,360
  • Acquisition value: €6,200
  • Loss: €840

New asset acquisition value:

  • 8 BNB at €400/BNB = €3,200
  • 180 CAKE at €12/CAKE = €2,160
  • 25 CAKE (rewards) at €15/CAKE = €375 `

Operation 6 (Sale to EUR): ` BNB sale:

  • 8 BNB × €400 = €3,200 (acquisition value = sale value)
  • Gain: €0

CAKE sale:

  • 180 CAKE × €12 = €2,160 (acquisition value = sale value)
  • 25 CAKE × €12 = €300 (acquisition value = €375)
  • Loss: €75 `

Summary year 2024:

  • Capital gains: €200 (deposit)
  • Capital losses: €840 (withdrawal) + €75 (sale) = €915
  • Net capital loss: €715 (offsettable against other gains)
  • Investment income: €375
  • Tax on income: €71.25

Tax result: Capital loss of €715 (reduces tax on other gains) + income of €375.

Case 3: Multichain operator with impermanent loss

Profile: Advanced user operating on Ethereum, Polygon and Arbitrum.

Operations 2024:

  1. January: Buy 5 ETH at €2,500/ETH = €12,500 (Coinbase)
  2. February: Bridge 3 ETH to Polygon (gas 0.02 ETH = €50)
  3. February: Swap on Uniswap Polygon: 3 ETH → 8,000 USDC (ETH = €2,666)
  4. March: Provide liquidity on Curve Polygon: 8,000 USDC + bridge additional 8,000 USDC
  5. June: Withdraw Curve liquidity: receive 16,500 USDC (gain from pool fees)
  6. July: Bridge 16,500 USDC to Ethereum (gas €25)
  7. August: Swap on Uniswap mainnet: 16,500 USDC → 5.2 ETH (ETH = €3,100)

Tax calculation:

Operation 2 (Bridge ETH → Polygon): ` Bridge does NOT trigger a taxable event (same asset, different chain) But gas IS a deductible cost:

  • Gas: €50 → Added to the acquisition cost of the ETH on Polygon
  • ETH Polygon acquisition value: (3 × €2,500) + €50 = €7,550 `

Operation 3 (Polygon ETH → USDC swap):

Disposal value: 8,000 USDC = €8,000 Acquisition value: €7,550 Gain: €450

Operations 4-5 (Curve liquidity): ` Deposit:

  • 8,000 USDC (acquisition value: €8,000)
  • 8,000 bridged USDC (acquisition value: €8,000 + bridge gas)
  • Total: €16,000 + gas

Withdrawal:

  • You receive 16,500 USDC
  • Gain: €500 (approx., minus gas) `

Operation 6 (Bridge USDC → Ethereum):

Bridge does NOT trigger a taxable event €25 gas is added to the acquisition cost of USDC on mainnet

Operation 7 (USDC → ETH swap): ` Disposal value: €16,500 + €25 (bridge gas) = €16,525 Acquisition value of ETH received:

  • 5.2 ETH with acquisition value = €16,525
  • = €3,178/ETH

No gain on this swap (USDC → ETH with no gain since USDC is stable) `

Total year 2024:

  • Polygon swap gain: €450
  • Curve pool gain: €500 (accrued fees)
  • Total gain: €950
  • Tax (19%): €180.50

Final state:

  • 2 original ETH (acquisition value: €2,500/ETH)
  • 5.2 ETH from the final swap (acquisition value: €3,178/ETH)

Common tax mistakes when operating on DEX

These are the most costly mistakes we see in analysis of complex DeFi portfolios:

Error 1: "I haven't sold to EUR, it doesn't get taxed"

Wrong belief: Swaps on Uniswap are not taxable because you remain in crypto.

Tax reality: Every swap is an exchange that generates capital gains/losses.

Consequence: Dozens or hundreds of unreported operations. Penalty of 50%-150% + interest.

Error 2: "DEX transactions are not traceable"

Wrong belief: Operating on Uniswap without KYC makes you fiscally invisible.

Tax reality: All transactions are public on the blockchain. The AEAT can trace your wallet if it identifies a single connection with your identity (withdrawal to an exchange, NFT purchase with your data, etc.).

Consequence: False sense of security. Once the Tax Agency links your wallet, it sees the ENTIRE history.

Error 3: "LP tokens are not taxed until I sell them"

Wrong belief: Depositing into a liquidity pool is like a bank deposit.

Tax reality: Depositing ETH + USDC on Uniswap is an EXCHANGE (ETH + USDC → LP tokens) that generates a gain if the market value has changed since your purchase.

Consequence: Unreported gain at the time of deposit.

Error 4: "Impermanent loss is deductible"

Wrong belief: If you lose due to impermanent loss, you can immediately deduct that loss.

Tax reality: The loss only materializes when you WITHDRAW liquidity. While funds remain in the pool, it is not deductible.

Consequence: Reporting unrealized losses (not accepted by AEAT).

Error 5: "I don’t subtract gas fees because they’re small"

Wrong belief: Gas fees of €10-€50 are not worth calculating.

Tax reality: Gas fees are DEDUCTIBLE expenses. Over hundreds of transactions, they can add up to thousands of euros.

Consequence: Paying more tax than you should.

Example: 200 transactions × €30 average gas = €6,000 of non-deducted expenses = €1,260 excess tax (at 21%).

Error 6: "I use global FIFO, not per token"

Wrong belief: I apply FIFO to all my crypto as a single asset.

Tax reality: FIFO is applied separately to each token. Each ETH, each USDC, each CAKE has its own FIFO.

Consequence: Incorrect gain calculations.

Error 7: "Airdrops/rewards are not taxed"

Wrong belief: Tokens received for free (UNI airdrop, CAKE farming) are not taxed.

Tax reality: They are taxed as investment income at market value at the time you receive them.

Consequence: Unreported income. Penalty + interest on unpaid tax.

Error 8: "Transfers between my wallets are taxed"

Wrong belief: Moving ETH from MetaMask to Ledger generates a gain.

Tax reality: Transfers between wallets you own DO NOT trigger a taxable event (internal movement).

Consequence: Reporting non-existent gains, paying excess tax.

Important: You must be able to PROVE that both wallets are yours (control of keys, consistent history).

What to do if you have not reported DEX operations

If you operated on Uniswap, PancakeSwap or other DEXs and did not report it, you have options:

Option 1: Amended tax return (until June 30 of the following year)

Applicable if: The filing deadline for the tax year has not yet passed.

Procedure:

  1. Rebuild all DEX transactions for the tax year
  2. Calculate gains/losses using FIFO
  3. File an amended return in Renta Web (AEAT)
  4. Pay the tax difference + late payment interest (4% per year)

Additional cost: Only interest, no penalty if filed voluntarily.

Option 2: Late return (after June 30, without prior notice)

Applicable if: The deadline has passed but the Tax Agency has not contacted you yet.

Procedure:

  1. Rebuild full history of DEX operations
  2. File a voluntary late return
  3. Pay tax + interest + surcharge:
    • 5% if filed within 3 months after the deadline
    • 10% between 3-6 months
    • 15% between 6-12 months
    • 20% after 12 months

Advantage: Avoids formal penalty (50%-150%) if done before a formal notice.

Option 3: Regularization after AEAT notice

Situation: The Tax Agency sends you a letter or starts an audit.

Consequences:

  • Unpaid tax
  • Late payment interest (4% per year from the due date)
  • Penalty of 50%-150% depending on seriousness:
    • 50%: Minor infringement (no concealment)
    • 100%: Serious infringement (concealment of means of payment)
    • 150%: Very serious infringement (use of tax havens, complex structures)
  • 30% reduction if you accept, do not appeal and pay within the voluntary period

Total cost example:

Unpaid tax: €10,000 Interest for 2 years (4%): €800 Serious penalty 100% with reduction: €7,000 Total: €17,800

Option 4: Preventive analysis and strategy

Recommended if:

  • You have hundreds or thousands of DEX transactions
  • You operated on multiple chains
  • You don’t know if you exceeded the €50,000 threshold (Form 721)
  • You received complex airdrops, farming rewards

Procedure:

  1. Request a DeFi portfolio analysis from specialists
  2. Complete reconstruction of blockchain history
  3. Calculation of pending tax obligations
  4. Regularization strategy minimizing penalties
  5. Coordinated filing of returns

Advantage: Minimizes risk, optimizes total tax cost, avoids mistakes that worsen penalties.

Form 721 and DeFi operations: Do I have to report my wallet funds?

Frequent question: If I have €80,000 in my MetaMask wallet with positions on Uniswap, do I need to file Form 721?

Answer: YES, with nuances.

Legal basis:

Form 721 requires reporting cryptocurrencies held abroad. The AEAT considers "abroad":

  • Non-Spanish centralized exchanges (Binance, Coinbase, Kraken)
  • Non-custodial wallets with funds in foreign protocols

Applied criterion:

If your wallet holds:

  • ETH on Ethereum (blockchain run by international nodes)
  • Liquidity on Uniswap (protocol deployed on an international public blockchain)
  • Positions in Curve, Aave, etc.

It is considered "abroad" because smart contracts are on a public international blockchain, not in Spain.

Threshold: €50,000

Calculating the balance on December 31: ` Example:

  • 15 ETH in MetaMask wallet: 15 × €3,500 = €52,500
  • 10,000 USDC in Curve pool: €10,000
  • 500 Uniswap LP tokens (underlying value): €8,000
  • Total: €70,500

→ EXCEEDS €50,000 → Form 721 obligation `

DeFi particularities:

  1. LP tokens: Report the underlying pool value, not the number of LP tokens.

    • Example: 1,000 UNI-V2 ETH/USDC representing 5 ETH + 15,000 USDC
    • Amount to report: (5 × €3,500) + €15,000 = €32,500
  2. Staking in protocols: If you have staked ETH on Lido (stETH), it counts.

  3. Lending: If you deposited USDC in Aave and hold aUSDC, it counts.

  4. NFTs: Uniswap V3 NFT positions are valued by underlying assets.

Filing deadline: Until March 31 of the following year.

Penalty for not filing:

  • Minimum: €10,000
  • Maximum: 150% of the unreported balance
  • Statute of limitations extended to 10 years (instead of 4)

Example penalty: ` Unreported balance: €70,500 Penalty: €10,000 (minimum)

If you also concealed related capital gains: Statute of limitations: 10 years (they can review very old years) `

Recommendation: If your total crypto balance (CEX + DEX + wallets) exceeds €45,000 at year-end, consult with specialized tax advice to assess preventive filing of Form 721.

Tools to track and calculate DeFi taxes

Tracking DEX operations manually is unfeasible at high volume. These tools help:

Level 1: Basic visualization (free)

DeBank (debank.com)

  • Connect wallets (MetaMask, Ledger, etc.)
  • View real-time positions on 50+ chains
  • Shows liquidity pools, lending, staking
  • Basic transaction history
  • Does NOT calculate taxes automatically

Zerion (zerion.io)

  • Similar to DeBank
  • More visual interface
  • Multichain portfolio tracking
  • NOT adapted to Spanish tax rules

Tax use: Identify which protocols you used and approximate balances. You must then calculate taxes manually.

Level 2: Data export (free/limited)

Etherscan / BSCScan / PolygonScan

  • Export CSV of your wallet transactions
  • Limit: 5,000 transactions in the free version
  • Requires subsequent manual analysis
  • Advantage: Primary official source (blockchain)

Tax use: Export CSVs, then process them with Excel/Python or send to your tax advisor.

Level 3: Tax calculation software (paid, not adapted to Spain)

CoinTracking (cointracking.info)

  • Imports transactions from exchanges and wallets
  • Calculates gains/losses
  • Problem: Uses generic FIFO/LIFO methods, not adapted to Spanish AEAT criteria
  • Cost: From €10/month

Koinly (koinly.io)

  • Similar to CoinTracking
  • Basic DeFi support (detects swaps, some pools)
  • Problem: US/UK tax classification, not Spain
  • Risk: Tax reports incorrect for AEAT

Tax use: Useful for operation inventory, but requires review by a Spanish tax advisor before filing.

Level 4: Specialized professional analysis (paid, AEAT-adapted)

Cleriontax - DeFi Portfolio Analysis

  • Full reconstruction of multichain history
  • Classification according to Spanish AEAT criteria
  • Proper FIFO applied per token
  • Gas fees automatically deducted
  • LP tokens correctly valued
  • Farming rewards treated as investment income
  • Auditable reports for Form 100
  • Review by a chartered tax advisor

Tax use: Complete solution to report complex DeFi operations in full compliance with AEAT.

Quick comparison

ToolCostAdapted to SpainAdvanced DeFiRecommended for
DeBankFreeNoYesPortfolio visualization
Etherscan CSVFreeNoPartialRaw data export
CoinTracking€10/monthNoPartialOperation inventory
Koinly€50/yearNoYesInformal pre-analysis
CleriontaxVariableYesYesAEAT tax filing

Recommendation:

Regulatory future: MiCA and DAC8 will affect DEX

MiCA regulation (Markets in Crypto-Assets)

Comes into force progressively in 2024-2025 in the EU.

Impact on DEX:

  • MiCA mainly regulates centralized exchanges and stablecoin issuers
  • Decentralized protocols without a legal entity (Uniswap, Curve) remain in a grey area
  • Web interfaces that access protocols (uniswap.org) could require licenses

Tax consequences:

  • MiCA does NOT change taxation (this is a national competence)
  • But it may force geoblocking of interfaces in Europe
  • Users will still be able to operate directly via contracts

DAC8 Directive (automatic crypto reporting)

Mandatory from 2026.

What it is: Exchanges and crypto service providers must automatically report user operations to tax authorities.

Impact on DEX:

  • CEX (Binance, Coinbase): Report all your operations to the AEAT
  • DEX without KYC: Cannot report because they don’t know your identity
  • BUT: Tax authorities can analyze the blockchain and cross-reference data

Flow example: `

  1. You buy ETH on Coinbase (reported to AEAT via DAC8)
  2. You withdraw to MetaMask (Coinbase reports the withdrawal)
  3. You operate on Uniswap from MetaMask (not reported)
  4. AEAT cross-checks data:
    • They know you bought X ETH
    • They know you withdrew to wallet address ABC
    • They can track wallet ABC on Etherscan
    • They see all your Uniswap swaps
    • They ask you for explanations `

Consequence: Even if DEX do not report, your operations are traceable if there is any touchpoint with your identity.

Near future (2025-2027)

Likely scenario:

  1. DAC8 fully operational: AEAT receives automatic reports from all CEXs
  2. Cross-checking with the blockchain: Blockchain analytics tools (Chainalysis, Elliptic) help AEAT track wallets
  3. Mass notices: Investors who used DEX receive letters from the Tax Agency requesting explanations
  4. Reverse burden of proof: You will have to prove that you filed correctly

Recommendation: File correctly from now on. In 2-3 years, the opacity of DEX will be history.

Recommended actions:

  • If you operated on DEX in 2020-2024 and did not report: Consider voluntary regularization options
  • If you operate now: Keep ongoing tracking, don’t wait until 2026
  • If you have high volume: Use continuous tax advice for preventive compliance

FAQ: Taxation of DEX protocols in Spain

Does doing a swap on Uniswap get taxed in Spain?

Yes. Exchanging any cryptocurrency for another on Uniswap (or any DEX) generates a capital gain or loss that must be reported in Form 100 (IRPF). Tax-wise it is identical to doing a swap on Binance.

Do I have to report if I only operate on DEX without KYC?

Yes. The absence of KYC does not remove your tax obligation. All DEX transactions are recorded on the public blockchain and the AEAT can trace them using data analysis. Operating without KYC does not make you fiscally invisible.

How is providing liquidity in a Uniswap pool taxed?

At the time of deposit, it is considered an exchange (you deliver ETH + USDC and receive LP tokens) that generates a capital gain if the market value of the assets has changed since you bought them. When you withdraw liquidity, the disposal of LP tokens generates another gain/loss. Fees accrued in the pool are taxed as investment income.

Is impermanent loss tax-deductible?

Only when you realize the loss by withdrawing liquidity from the pool. While your funds remain deposited in the pool, impermanent loss is a potential, unrealized loss and you cannot deduct it. Upon withdrawal, if the recovered value is lower than the deposited value (net of fees), the loss materializes.

How do I calculate the EUR value of a token with no liquidity on exchanges?

Use the DEX price at the time of the transaction, converted to EUR at the exchange rate at that time. For very illiquid tokens, you can use the actual transaction value (how much USDC/ETH you received when selling it). Always document your valuation methodology in case the Tax Agency asks for justification.

Do I need to report DEX transactions under €50?

Technically yes, every capital gain must be reported regardless of the amount. In practice, very small transactions can be aggregated. But note that hundreds of micro-operations can add up to thousands of euros in total gains, so systematically omitting them does create significant tax risk.

Are gas fees deductible from the disposal value?

Yes. Network fees (gas fees paid in ETH, BNB, etc.) are costs directly related to the transaction and reduce the disposal value of the asset. You must convert the gas paid to euros at the exchange rate at the time of the transaction and subtract it.

Do transfers of crypto between my own wallets get taxed?

No. Moving assets between wallets you own is an internal movement with no taxable event. But you must be able to prove that both wallets are yours (control of private keys, consistent usage patterns). Gas paid on these internal transfers can be added to the acquisition cost of the asset.

Is operating on PancakeSwap (BSC) taxed differently than on Uniswap (Ethereum)?

No. From a tax perspective, the blockchain does not matter. A swap on PancakeSwap is taxed exactly the same as a swap on Uniswap. The only practical difference is that BSC has much lower gas fees, which makes tracking easier (fewer expenses to deduct) but does not change the tax treatment of gains.

How do I prove the value of a DEX operation to the Tax Agency?

Provide: 1) The on-chain transaction hash (verifiable on Etherscan/BSCScan), 2) A screenshot of the blockchain explorer showing the tokens swapped, 3) The EUR token price in recognized sources (CoinGecko, CoinMarketCap) at the exact date/time of the transaction, 4) The USD/EUR exchange rate used. All this information is auditable and sufficient to justify valuations.

Do I have to file Form 721 for funds in my MetaMask wallet?

Yes, if the total value of your cryptocurrencies in wallets + foreign exchanges exceeds €50,000 on December 31. Funds in non-custodial wallets with positions in international DeFi protocols (Uniswap, Curve, Aave) are considered "abroad". Include in the calculation the underlying value of LP tokens, lending positions, etc.

How do I apply FIFO to multichain operations?

FIFO is applied per token, regardless of the blockchain. If you bought ETH on Ethereum and later on Polygon, when you sell/swap ETH on Polygon, you must match the sale with the oldest ETH (the one on Ethereum) under FIFO. Each token (ETH, USDC, BNB) has its own separate FIFO queue.

What should I do if I already operated on DEX in previous years and did not report it?

You have options: 1) Amended return (if the tax year deadline has not closed), 2) Voluntary late return (after the deadline, but before any notice), 3) Wait for a notice (risky, high penalties). The most advisable is to request a DeFi portfolio analysis to compute pending obligations and design a regularization strategy that minimizes penalties.

Can I use software like Koinly or CoinTracking to file taxes in Spain?

With caution. These tools are useful for inventorying operations, but they are NOT adapted to Spanish tax criteria (Spanish FIFO method, AEAT classification, Form 100). Their tax reports are designed for the US/UK. Use them for tracking, but review calculations with a Spanish tax advisor before filing.

Are yield farming rewards taxed as capital gains or income?

As investment income (19%-28% depending on bracket). Tokens you receive as farming rewards (e.g. UNI, CAKE, CRV) are taxed at their market value at the time you receive them. If you later sell those tokens, the additional gain/loss is taxed as a capital gain applying FIFO from the initial acquisition value (value when you received them).

Conclusion: Tax compliance in DeFi requires specialized advice

Operating on DEX protocols like Uniswap, PancakeSwap or Curve introduces tax complexities that do not exist in traditional finance: LP tokens, impermanent loss, multichain farming, transactions with no centralized records.

Key takeaways:

  1. Every DEX swap is taxable just like on centralized exchanges, with no exceptions
  2. Providing liquidity generates multiple taxable events: at deposit (swap), as fees accrue (income) and at withdrawal (LP disposal)
  3. Not reporting because you operate without KYC is a serious mistake: the blockchain is transparent, AEAT can trace it
  4. Gas fees are deductible and can amount to thousands of euros in tax savings
  5. FIFO is applied per token, regardless of which blockchain you use
  6. Form 721 is mandatory if your DeFi funds exceed €50,000
  7. Automatic tools (Koinly, CoinTracking) are NOT adapted to Spanish AEAT criteria
  8. Voluntary regularization is always cheaper than waiting for a Tax Agency notice

Recommended next steps:

Regulation is advancing (DAC8, MiCA) and the room to operate in the grey area is closing. Filing correctly from now on protects you from future penalties and extended statutes of limitations (10 years without Form 721).

Have you operated on Uniswap, PancakeSwap or Curve and are not sure you reported correctly?

Don’t wait for a Tax Agency notice. Preventive analysis can save you thousands of euros in penalties.

Cleriontax - DeFi Tax Specialists

Our team combines blockchain data engineering with chartered tax advice to rebuild your full history of DEX operations:

  • Multichain analysis (Ethereum, BSC, Polygon, Arbitrum, Optimism, etc.)
  • Classification of swaps, liquidity pools, farming, bridging
  • Certified FIFO calculation according to AEAT criteria
  • Correct valuation of LP tokens and impermanent loss
  • Gas fees automatically deducted
  • Auditable reports ready for Form 100
  • Review by a chartered tax advisor

Specialized DeFi services:

Request a free analysis of your case →

We analyze your situation within 24-48h and provide a no-obligation quote.

Did you find this article helpful?

Share it with other investors who might need it

Related articles

Continue learning about cryptocurrency taxation

Need help with your cryptocurrency tax return?

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

Request free analysis