Back to Blog

FIFO Method in Spain: Article 37.2

If you've ever tried to figure out your crypto taxes in Spain, you know it gets messy fast. You buy Bitcoin at one price, Ethereum at another, maybe unload some during a bull run, and suddenly the fiscal office wants to know exactly what you gained. 

But here's the catch: you do not get to choose which assets you sold. Tax regulation makes that decision for you using the First In, First Out method.

The FIFO rule comes straight from Article 37.2 of the Income Tax Law. It applies to blockchain assets just like it does to stocks and funds. This often either shrinks your debt to the government or inflates it. 

So how does this work and why does it matter for your portfolio? Let's find out.

💵 Tax
In This Article

Virtual Asset Obligations

The First In, First Out fixed rule essentially means the budgetary office will consider the initial units you ever procured to be the initial ones you sold. It holds no bearing which batch you thought you were vending.

Why does this matter? Because the purchase price (or acquisition value) of those initial coins or shares is used to determine your profit. Your increases you’ll pay the state on will seem bigger if your early procurements were cheap. Similarly, the system could actually work in your favor if you bought high in the past and rates later dropped. It directly affects the numbers on your return either way.

The principle applies broadly to stocks, mutual funds, and, increasingly, to virtual cash. Traders should particularly heed this statute because they handle so many transactions across different rates and platforms. 

Legal Basis: Article 37 

The statute is enshrined in Spanish regulation. Article 37 lays down the rule for calculating capital accumulation when vending valores homogéneos (identical securities) bought at different times. 

The law says: “Cuando existan valores homogéneos, se considerará que los transmitidos por el contribuyente son los adquiridos en primer lugar.” This essentially means the law will consider the initial thing you procured as what you initially sold. 

This statute was originally written with stocks and funds in mind, but its language is broad enough to cover a much broader range of virtual securities. The phrase "valores o participaciones homogéneos" has been stretched by the Agencia Tributaria to include virtual cash as well. The budgetary office shall match your oldest digital currency or token against your disposals. 

Let's use Ken's example. The lad picked up BTC in 2018 and again in 2021. He later sold them in 2023. The budgetary department counted the coins acquired in 2018 initially.

Article 37 also spells out that increases are measured using your original acquisition cost (valor de adquisición) of those earliest units. 

How the Method Works

This regulation is one way this fairness is enforced: it standardizes how increases are calculated so that every payer, regardless of strategy, is treated equally.

Here's how it plays out. Suppose you procured 1 BTC in 2018 for €5K, another in 2020 for €15K, and then unloaded 1 BTC in 2023 for €25K. FIFO requires that your 2023 disposal be matched with the 2018 Bitcoin. Result: a gain of €20K (€25K – €5K) to be paid on. The 2020 Bitcoin stays untouched for now.

Every purchase goes to the "back of the line," and every sale pulls from the "front." This conveyor-belt logic reflects the constitutional goals of legal certainty (seguridad jurídica, Article 9.3 CE) and equal treatment before the law (Article 14 CE).

For traders, this means there’s no cherry-picking favorable acquisitions. The Constitution guarantees equality, and the regimen delivers it in practice — simple rule, serious consequences.

Special Considerations

Digital asset prices tend to trend upward over the long run, so regulation doesn't always work in your favor when it comes to government obligation. The calculation method shall pair your disposals with those low purchase rates since the oldest coins you procured are often the cheapest. This results in bigger increases on paper and a higher government debt.

Let's ground it.

Jean bought 0.5 BTC in 2017 for €2K, then 0.5 BTC for €6K three years later. She unloaded 0.5 BTC in 2023 for €12K. 

The fiscal office matches the sale with your 2017 acquisition under this regimen. That's a €10,000 win. Your income you’d have to pay on would only be €6,000 if you could instead choose the 2020 coins. But you do not get that choice in the Spanish case. 

On the flip side, it shall reduce your debt in years when digital asset rates are falling. Your earliest acquisitions might be more expensive than your recent ones in that case. 

Say you bought 1 ETH in 2021 for €4,000 and another in 2022 for €2,000. You then unloaded 1 ETH in 2023 for €2,200. This means the 2021 coin is considered sold. Your result subject to government payment shall be a loss of €1,800 (€2,200 – €4,000). The loss would only be €200 if you could choose the 2022 coin. It actually works in your favor by locking in the bigger loss.

Records

An understanding of this calculation is only half the battle. The real challenge is proving your numbers when the fiscal office asks. 

The government expects every investor to keep a traceable history of their trades. This is because the system relies on exact data. Your return could be questioned should you prove unable to show that order.

At a minimum, you should log:

  • Date/time for every purchase/alienation
  • The quantity of coins or tokens involved
  • The euro quantity you forked over (valor de adquisición)
  • The takings upon letting go of securities
  • Any fees paid to exchanges or platforms
  • The wallets or platforms where the transactions took place

All these might sound excessive for casual procurers, but active traders never make record-keeping mistakes. They understand that platforms do not always provide full reports, and wallets often miss details like network fees. That's why many investors rely on state blockchain debt software to pull data from multiple sources and prepare compliant reports. Some also go as far as to apply the system automatically.

Spanish statutes also stress seguridad jurídica (legal certainty). You must be ready to justify every figure in your return. 

Keeping accurate records for compliance may be challenging, especially with multiple wallets and exchanges. 8lends helps Spanish crypto investors stay organized by tracking every purchase, disposal, and transfer automatically. It applies legislation to your trades, calculates wins and losses accurately, and generates reports that align with Agencia Tributaria requirements. 

8lends also provides guidance on carry-forward losses and allowable deductions. Whether you trade occasionally or frequently, 8lends ensures your taxes on virtual currency are handled efficiently and correctly, minimizing mistakes and stress.

Advantages and Drawbacks

The system has its strengths and weaknesses like any legislation. The method offers clarity for investors, but also some challenges. 

Let's start with the advantages:

  • It applies one universal framework where the oldest securities are unloaded initially. 
  • There's no ambiguity since the method is written into Article 37. You know exactly how your increases shall be calculated.
  • The rule creates consistency in reporting. It's more difficult for unscrupulous payers to cherry-pick transactions and manipulate the results.
  • It has the ability to lower your increases to be paid on or even create deductible losses when rates fall. 
  • Most digital currency software for government payment automatically applies FIFO across multiple wallets and exchanges. The method saves you time and reduces the chances of human error.

You must also brace for a few setbacks. These include:

  • It increases a payer’s wins when crypto prices rise. 
  • The approach requires meticulous records to prove the order of purchases and alienations. Missing data may lead to disputes with the fiscal office.
  • Methods such as HIFO or LIFO let you choose which assets to unload for a better result.  It locks you into the oldest-first rule.

Penalties for Incorrect Application

A simple math error is a compliance issue that can cost you. The Agencia Tributaria treats mistakes in reporting capital increases as state obligation infractions. Penalties are capable of escalating quickly.

The government fiscal office may demand the unpaid debt plus late-payment interest if you misapply the regimen and underreport your earnings. 

Spain's law requires that errors be corrected even when no fine is imposed. This often means reopening past returns. This gets messy if you've made many trades across multiple years and didn't keep proper records.

Digital wallet holders face an extra risk. Platforms do not always provide complete histories, and the fiscal office is likely to assume the worst-case scenario for calculating your wins without documentation. 

Practical Tips

The right habits and tools shall make it easy for you to navigate FIFO in Spain. Here are some practical steps:

Keep Complete Records

The system requires knowing the exact order of your procurements and sales. Save every trade confirmation and exchange statement. These records are your proof if the fiscal office questions your filing.

Use Software

Manual spreadsheets get messy, but reliable software reduces errors and saves time. Tools like CoinTracking, Koinly, or native exchange exports can automatically apply the statute and generate Spanish-compatible reports. 

Track Across Multiple Wallets

The framework doesn't care where your assets are stored. If you bought Bitcoin on Binance and later moved it to a hardware wallet, it's still part of the same "pool." Always consolidate your records across platforms.

Plan Sales Strategically

Think about the impact before you sell. Unloading older, cheaper assets in a bull market will likely generate higher wins to be paid on. Sometimes waiting or unloading in a dip can reduce your bill.

Remember Carryforward Losses

You can usually offset a FIFO-generated loss against future gains for up to four years (compensación de pérdidas). Don't waste this opportunity.

Final Thoughts

Be sure to consult a professional when you're in doubt. Spanish regulation has layers like PIT framework and crypto-specific criteria. You'll also grapple with constitutional principles like equality and legal certainty. An advisor can help ensure you apply this outline correctly and claim every deduction available.

Navigating FIFO and Spanish tax regulation doesn’t have to be complicated. 8lends gives you everything you need to stay compliant while optimizing your position. From automatically tracking trades and calculating FIFO gains to advising on carry-forward losses and allowable deductions, 8lends makes reporting simple and accurate. Protect yourself from penalties, save time on record-keeping, and ensure your crypto income is reported correctly. 

Share Article