Skip to content

AEAT Compliance (Spanish IRPF Criteria)

🏛️ AEAT Compliance (Spanish IRPF Criteria)

Section titled “🏛️ AEAT Compliance (Spanish IRPF Criteria)”

Tax reporting for digital assets in Spain is subject to strict guidelines issued by the Agencia Estatal de Administración Tributaria (AEAT) and binding consultations from the Dirección General de Tributos (DGT).

Kryptofolio was specifically architected to satisfy these rigorous regulatory requirements.


1. Mandatory Global FIFO (Homogeneous Assets)

Section titled “1. Mandatory Global FIFO (Homogeneous Assets)”

Under Article 33 et seq. of the Spanish IRPF Law (Ley 35/2006):

  • Cryptocurrencies of the same class (e.g., Bitcoin) are considered homogeneous financial assets.
  • When an asset is sold or exchanged, capital gains must be computed by consuming the oldest acquired lot across all accounts and custody locations (First-In, First-Out).
  • Kryptofolio implements this via v_fifo_matches in DuckDB, matching sales globally against historical acquisitions.

2. Crypto-to-Crypto Swaps are Taxable Events (Permutas)

Section titled “2. Crypto-to-Crypto Swaps are Taxable Events (Permutas)”

Exchanging one cryptocurrency for another (e.g. trading ETH for SOL on a DEX or CEX) is legally classified as a barter exchange (permuta):

  • Consisting of two concurrent transactions:
    1. The disposal of Asset A at its current fair market value in EUR.
    2. The acquisition of Asset B with an initial cost basis equal to that same fair market value.
  • Realized gains or losses must be integrated into the Base Imponible del Ahorro for that tax year.
  • Staking Rewards: Classified as capital yields (Rendimientos del Capital Mobiliario), valued at fair market price in EUR on the date received. This valuation sets the acquisition cost basis for future sales.
  • Airdrops / Hard Forks: Classified as capital gains not derived from transfers (Ganancia Patrimonial en la Base General).

4. Wallet Transfers are Strictly Non-Taxable

Section titled “4. Wallet Transfers are Strictly Non-Taxable”

Moving tokens between personal accounts (e.g., from an exchange to a hardware cold wallet) constitutes a mere change in custody location, never a taxable transfer of title. Kryptofolio’s custody ledger ensures these movements never trigger capital gains or alter lot acquisition dates.


🚨 Honest Rendering of null Gains (Quality Flags)

Section titled “🚨 Honest Rendering of null Gains (Quality Flags)”

A major flaw in commercial crypto tax software is “guessing” missing prices or defaulting missing cost bases to zero without alerting the taxpayer.

In Kryptofolio, if an FX conversion rate or historical price is unavailable:

  1. lot_history_events.sale_price_fiat and gain_loss_fiat are set strictly to NULL.
  2. A diagnostic flag is attached:
    • quality_flag: MISSING_FX_RATE
    • quality_flag: UNRESOLVED_VALUATION
  3. The UI prominently displays a neutral badge requiring manual user resolution, rather than manufacturing artificial tax liabilities.

  • Modelo 721 (Informative Declaration on Foreign Virtual Currencies): Kryptofolio tracks exchange geographical custody (exchange_location and non-custodial flags), laying the data foundation to calculate whether foreign holdings exceed the €50,000 threshold on December 31.
  • Modelo 714 (Wealth Tax): Real-time snapshot of worldwide net crypto assets at year-end valuation for regional wealth tax filings.