Spain permits the deliberate realization of capital losses to offset gains. The strategy is legal. It has a name: compensación de pérdidas patrimoniales. It has constraints: the 25% cap on capital income, the four-year carryforward window, and the two-month anti-wash-sale rule. This manual is the version adapted to crypto portfolios.

🎯 What This Manual Solves

The three-number calculation. Before executing anything in December, compute: total realized capital gains, total positive capital income, total net loss available. The offset capacity is bounded by the first two, not by the third.

The 25% cap mechanics. The loss offsets gains first (no cap), then capital income (capped at 25%). A €14,000 loss against €2,400 in gains and €6,320 in capital income uses only €3,980 in year one.

The anti-wash-sale rule — two positions. LIRPF art. 33.5.f denies losses when identical assets are reacquired within two months. Does it apply to crypto? Kointax (April 2026) says strictly no, by analogy. Legal Core Labs (November 2025) says yes by extension. Both positions presented with their legal basis.

The four-year carryforward. Unused losses carry forward under LIRPF art. 49, usable against future savings-base gains and capital income, subject to the same 25% cap. The carryforward is not lost — it is deferred.

FIFO dictates the loss amount. The taxpayer cannot choose which lot to dispose of. The earliest acquired lot is deemed transferred first. A portfolio with mixed acquisition dates produces a loss that may be larger than the naive calculation suggests.

The December 31 cutoff. Trade date, not settlement date. Self-custody disposals need 24-hour buffer for confirmation.

The documentation the AEAT expects. Six documents: ledger, trade confirmations, FIFO computation, tax memo on the anti-wash-sale position, reacquisition log, carryforward schedule.

Three case files with exact numbers. Small portfolio (€30K — €39 saving, €2,670 carryforward). Mid portfolio (€150K — €285 or €1,425 saving depending on the BTC question). Large portfolio (€800K — €8,500 saving, Position B documented).

📘 Inside the Manual

📖

Inside This Codex — 9 Chapters

Front Matter
How to Use This Manual

Three steps, two categories, one carryforward

Ch 1
The Spanish Loss Offset Framework

General vs savings base, offset order, 25% cap, four-year carryforward

Ch 2
The Anti-Wash-Sale Rule

Two positions with legal basis; execution patterns for each

Ch 3
The Year-End Execution

Cutoff, sequence, FIFO lot selection, documentation

Ch 4
Case Files

Three taxpayers, three sizes, three outcomes

Appendix A
Glossary

Twenty terms

Appendix B
Sources and Verification Log

Six regulatory sources, four practitioner sources

❓ Questions Readers Ask Before Buying

Is this legal or tax advice?

No. This is an educational field manual. The author is not a licensed attorney, not a tax advisor. The two positions on the anti-wash-sale rule are documented with their legal basis. The taxpayer who adopts either position should document the reasoning in a memo, in consultation with a Spanish tax advisor.

Does the two-month anti-wash-sale rule apply to crypto?

Not settled. LIRPF art. 33.5.f refers to acciones o participaciones — shares. Crypto is classified as bienes inmateriales, not shares. Kointax (April 2026) says the rule strictly does not apply but the AEAT may argue by analogy. Legal Core Labs (November 2025) says the rule applies. Both positions documented in Chapter 2 with execution patterns for each.

How much loss can I use in one year?

Bounded by your realized gains and 25% of your capital income. A €14,000 loss with €2,400 in gains and €6,320 in capital income uses €3,980 in year one. The remaining €10,020 carries forward for four years. The offset order is: gains first (no cap), then capital income (25% cap), then carryforward.

What's the December 31 cutoff exactly?

The trade date, not the settlement date. A market order executed at 22:00 on December 31 belongs to the current tax year. A self-custody swap needs to be confirmed in a block before the block timestamp crosses midnight — execute at least 24 hours before December 31 to allow for gas spikes and network congestion.

Can I choose which lot to sell?

No. FIFO applies. LIRPF art. 37.2 mandates First-In-First-Out for homogeneous assets. The earliest acquired lot is deemed transferred first. A portfolio acquired in 2021, 2022, and 2023 will match the 2021 lot against any 2025 disposal, even if a later lot has a more favourable cost basis.

What records do I need if the AEAT audits?

Six documents. The FIFO ledger (11 fields per transaction), trade confirmations from each exchange or on-chain hash, the FIFO computation worksheet, the tax memo documenting the anti-wash-sale position, the reacquisition log (if applicable), and the carryforward schedule. Chapter 3 lists each.

📂 Reads Well With

The December 31st Protocol — the Modelo 721 snapshot manual, same year-end timing.

The Crypto Freelancer’s Autónomo Playbook — the actividad económica framework for freelancers with crypto portfolios.

The Source of Funds Dossier — proving origins when the year-end sale triggers a bank audit.

The Crypto Holder’s Bank Playbook — the fiat rails that year-end off-ramps pass through.


The companion volume

The December 31st Protocol covers the Modelo 721 snapshot. Crypto Loss Harvesting Spain covers the loss offset mechanics — the other half of the year-end tax decision.

Read The December 31st Protocol →


A note from the medina I am a publisher, not a lawyer, not a fiscal advisor. Nothing on this site is legal, fiscal, or tax advice. Verify every classification, every filing position, and every ledger calculation with a qualified Spanish tax advisor before filing. That is not a legal sentence I hide behind. It is the philosophy, repeated one more time.

“The harbour master does not fear the ship with clean papers.”

— Salah Nomad