FIFO Method for Cryptocurrencies: Complete Guide with Examples
The FIFO method (First In, First Out) is the valuation system that the Spanish Tax Agency requires to calculate capital gains and losses when selling or exchanging cryptocurrencies. Understanding it well can make a difference of thousands of euros in your tax return.
What is the FIFO Method?
FIFO means that when you sell cryptocurrencies, it is considered that you are selling the ones you purchased first. The oldest units in your wallet are always the first to "exit."
This is important because if you bought Bitcoin years ago at a very low price and it is now worth much more, the gain calculated using FIFO will be higher than if you could choose to sell the most recent lots (which you purchased at a higher price).
Legal Basis
The binding consultation V0999-18 from the DGT (General Directorate of Taxes) explicitly established that the FIFO criterion applies to cryptocurrencies, just as it does for homogeneous securities under Article 37.2 of the LIRPF.
Step-by-Step Example
Let's assume the following Ethereum purchase history:
| # | Date | Quantity | Total Price Paid |
|---|---|---|---|
| 1 | Feb-21 | 2 ETH | €2,400 |
| 2 | Sep-22 | 3 ETH | €3,600 |
| 3 | Jan-24 | 1 ETH | €2,200 |
Total stock: 6 ETH. Average cost is NOT used — FIFO is used.
If in October 2024 you sell 4 ETH at €2,800 each:
Sale value: 4 × €2,800 = €11,200
Acquisition cost using FIFO:
- From lot 1: 2 ETH × (€2,400/2) = €2,400
- From lot 2: 2 ETH × (€3,600/3) = €2,400
- Total cost: €4,800
Capital gain: €11,200 − €4,800 = €6,400
Lot 3 remains intact in the wallet with a base cost of €2,200.
Comparison: FIFO vs LIFO vs HIFO
| Method | Logic | Typical Result in a Bull Market |
|---|---|---|
| FIFO | First purchased, first sold | Higher gain (cheaper lots sold first) |
| LIFO | Last purchased, first sold | Lower gain (more expensive lots sold first) |
| HIFO | Highest cost sold first | Lower gain (most expensive first) |
Spain requires FIFO. However, running the numbers with other methods can help you understand how much the order of sales "costs" you in taxes.
Global FIFO by Asset
A critical point: FIFO is applied per asset globally across your entire portfolio, not exchange by exchange. If you have BTC in Binance and Coinbase, all your BTC form a single FIFO pool ordered chronologically.
This means that transfers between exchanges do not "reset" the FIFO — they simply move units between platforms without altering their original acquisition date.
Tools to Calculate FIFO
Manually tracking FIFO in Excel is possible for small portfolios but becomes unmanageable with:
- Multiple exchanges
- Swaps between cryptocurrencies
- Staking rewards
- DeFi operations
Crypto tax platforms automate this calculation and produce a detailed lot-by-lot report, ready for filing.
Conclusion
FIFO is not a choice in Spain: it is a legal obligation. Applying it correctly, with the complete history from the first day of purchase, is essential to avoid errors and penalties from the AEAT.


