Kointax.ioKointax.io

Cryptocurrency Trading: How the FIFO Method Works in Practice

The FIFO method is mandatory in Spain to calculate cryptocurrency profits and losses. Learn how it works with real examples, special cases and common errors.

··10 min read

Respuesta rápida

The FIFO method is mandatory in Spain to calculate cryptocurrency profits and losses. Learn how it works with real examples, special cases and common errors.

Cryptocurrency trading: how the FIFO method works in practice

The FIFO (First In, First Out) method is the only valuation method that Spanish regulations allow to calculate gains and losses on cryptocurrency transmissions. In this article we explain it with real examples.

What is FIFO?

FIFO means that when you sell units of a cryptocurrency, you are considered to sell the units you bought earlier in time first. The sales order is chronological from the oldest.

This is crucial because in volatile markets, the purchase price varies greatly and the order directly affects the calculated profit.

Basic example

Bitcoin purchase history:

  • Jan 1, 2024: Buy 0.5 BTC at €40,000 = Cost €20,000
  • Mar 1, 2024: Buy 0.5 BTC at €60,000 = Cost €30,000
  • Jun 1, 2024: Buy 0.3 BTC at €70,000 = Cost €21,000

Sale:

  • Dec 1, 2024: Sale 0.6 BTC at €90,000 = Income €54,000

Applying FIFO (oldest first):

  • First 0.5 BTC: cost €20,000
  • Next 0.1 BTC (from March purchase): cost 30,000 × (0.1/0.5) = €6,000
  • Total cost of the 0.6 BTC sold: 20,000 + 6,000 = €26,000

Profit = 54,000 - 26,000 = €28,000

If you had applied LIFO (last entries first), the gain would be less. But LIFO is not allowed in Spain.

Special cases of FIFO

Multiple exchanges

FIFO applies per cryptocurrency, not per exchange. If you have BTC on Binance and BTC on Coinbase, they are pooled into a single exchange and FIFO is applied to the total.

This means that you must maintain a unified record of all your purchases of each cryptocurrency, regardless of the exchange.

Crypto received by staking or airdrop

When you receive crypto by staking or airdrop:

  • Their acquisition cost is the market value at the time of receipt.
  • They enter the "FIFO queue" as if you had bought them at that price.

Exchanges between cryptocurrencies

When you exchange BTC for ETH, from the FIFO point of view:

  1. A "sale" of BTC is generated (removing the oldest units).
  2. A "buy" of ETH is generated at the current market price.

Commissions

Exchange commissions reduce the effective sale price:

  • Sale of 1 BTC at €80,000 with commission of €100 → net price: €79,900

Purchase commissions are added to the acquisition cost.

Common errors when applying FIFO

  1. Ignore minor exchanges: The AEAT can cross-reference data from Kraken, OKX, Coinbase, etc. All operations must be included.
  2. Not reporting crypto-to-crypto swaps: Many traders do not declare crypto-to-crypto exchanges.
  3. Mix FIFO by exchange instead of by currency: This is incorrect. The FIFO is per asset type, not per platform.
  4. Forget commissions: They underestimate the acquisition cost or overestimate the profit.

Tools for automatic FIFO

Doing the FIFO calculation manually with hundreds of operations is unfeasible. declaracrypto.es imports your CSVs from exchanges and automatically calculates the capital gain with FIFO, ready to transfer to the declaration.

Updated: April 2026 | Fiscal year: 2025

Sobre el autor

Verificado

Equipo editorial de Kointax

Equipo fiscal cripto · España

Detrás del contenido de Kointax hay un equipo de profesionales en fiscalidad española y desarrollo de software cripto. Revisamos cada guía contrastando con consultas vinculantes de la DGT, jurisprudencia de la Audiencia Nacional, normativa europea (MiCA, DAC8) y casos prácticos reales tratados en nuestra plataforma. El

Trabajo continuo con consultas vinculantes DGT actualizadas
Cobertura técnica directa de + 130 fuentes (exchanges + blockchains)

Especialidades: Fiscalidad cripto en España (IRPF, IVA, ISD) · Modelos 100, 172, 173, 720, 721 · Doctrina vinculante DGT cripto

Última revisión:

Preguntas y respuestas

Cargando preguntas…

Haznos tu pregunta

Las preguntas son moderadas antes de publicarse. No compartas información personal sensible.

Ready to calculate your crypto taxes?

Kointax — FIFO, LIFO, HIFO or WAC method. 80+ compatible exchanges. Excel + PDF report ready for your tax return.

Start free — no card needed