Back to blog
Taxation & Investment

No purchase price for your crypto? How to work out the cost basis for Spanish tax

Without a cost basis, the Spanish tax agency treats everything you receive when you sell as a gain. The four cases where it goes missing, how to rebuild it with evidence and what to do if you have already filed with a zero cost basis.

E

Cleriontax Team

Crypto Tax and Data Analysis Experts

8 min read
FIFOCapital GainsCapital LossesCryptocurrency ValuationTax EvidenceTax DocumentationStakingAirdropsKoinlyCoinTrackingVoluntary Regularisation
How to rebuild the cost basis of your crypto when the purchase price is missing
13 de noviembre de 2026
8 min de lectura
Fiscalidad e Inversión
FIFOCapital GainsCapital LossesCryptocurrency ValuationTax EvidenceTax DocumentationStakingAirdropsKoinlyCoinTrackingVoluntary Regularisation

When you sell or swap a crypto, what is taxed is not what you receive: it is the difference between what you get and what it cost you. If you cannot prove that cost basis, the Spanish tax agency (Hacienda) treats it as zero, and the whole amount of the sale becomes a gain.

It is one of the most common problems we see, and it is almost never the taxpayer's fault. Exchanges that shut down, purchases from years ago, rewards that tools value at zero. If your Koinly, CoinTracking or similar report is full of sales with a zero cost basis, our service helps you fix your Koinly or CoinTracking report. Here we explain where the problem comes from and how the missing cost basis is rebuilt.

What cost basis is and why FIFO per asset applies

The cost basis is what you paid for a crypto, plus the fees on the purchase. When you sell it, you subtract that cost basis from the sale value (minus its fees) and the result is your gain or your loss.

Since you usually buy the same asset several times at different prices, you need a rule to know which units you are selling. In Spain the rule is FIFO per asset: the first units of each crypto you bought are the first ones you sell, counting everything you hold on every platform. We explain it with examples in the complete guide to declaring crypto.

The consequence matters: the cost basis of a sale today may depend on a purchase years ago on another exchange. If that data is missing, the whole calculation for that asset breaks, not just one transaction.

The four cases where cost basis goes missing

Closed exchange or lost account

Platforms that shut down (FTX, Celsius, small exchanges), accounts you can no longer access, or exchanges that delete old history. If you bought there and then withdrew the crypto, it shows up on your new platform as a deposit with no price.

Old purchases with no record

Purchases from 2017 or 2018, sometimes on platforms that no longer exist, sometimes from another person (P2P, in cash, at an ATM). You know you bought, but you have no file that says so.

Staking, airdrops and forks

Crypto you receive without buying it also has a cost basis: its market value on the date you receive it. That value is what you declare as income (for staking) or as a gain (for an airdrop) in the year it arrives, and it is what you use as cost basis when you sell.

Many tools record it with a zero cost basis. The result is double taxation: the staking was already taxed when you received it and, if you sell it with a zero cost basis, it is taxed in full again. For forks, the tax treatment is less settled, and it is worth documenting carefully which value you use and why.

Transfers between your own wallets that break the trail

This is the most common case and the easiest to fix. You buy on one exchange, send to your wallet and from there to another exchange to sell. If the tool does not match the withdrawal with the deposit, it reads the deposit as a new inflow with no cost basis, and the final sale shows a full gain. The same happens with many DeFi transactions; we explain how to document them in how to document DeFi transactions for the Spanish tax agency.

How to rebuild it

The good news is that there is almost always a trail. No single piece of evidence is usually enough, but together they let you rebuild the cost basis on solid ground.

SituationEvidenceWhere to get it
Closed exchangeEuro transfers to the exchange and later withdrawalsYour bank statements and any old exports you kept
Old purchase with no filePurchase confirmation emailYour inbox: search for the exchange's name and "order", "purchase" or "trade"
P2P or cash purchaseContract, receipt, messages with the counterparty and the on-chain trail of the receiptYour files, chats and the block explorer
Staking rewards or airdropsDate and amount of each receipt, with that day's priceExchange history or block explorer, plus a historical price source
Transfers between your walletsThe withdrawal at the origin and the deposit at the destination, with the same transaction IDExports from both platforms or the block explorer

For historical prices, use a recognised source and always the same one, such as CoinGecko or CoinMarketCap historical data or the exchange's own price, and note which one you use. What makes a reconstruction solid is that it is consistent and documented: anyone can follow where each figure comes from.

If you are missing the history from a platform, start by recovering the exports: we explain where each one is in how to export your crypto history to CSV.

A worked example

You bought 1 BTC in 2019 for €8,000 on an exchange that has since shut down. You moved it to your Ledger and in 2026 you sell it on Kraken for €60,000. Kraken records the sale, but as far as it knows the bitcoin "arrived" with no cost basis.

With a zero cost basis:
  Gain: €60,000
  Tax in the savings base:
    €6,000 × 19%  = €1,140
    €44,000 × 21% = €9,240
    €10,000 × 23% = €2,300
  Total: €12,680

With the rebuilt cost basis (€8,000):
  Gain: €52,000
    €6,000 × 19%  = €1,140
    €44,000 × 21% = €9,240
    €2,000 × 23%  =   €460
  Total: €10,840

Difference: €1,840 more for not being able to prove the purchase

To prove those €8,000, the 2019 transfer from your bank to the exchange, the purchase confirmation email and the on-chain trail of the transfer to your Ledger are enough. With a portfolio of several assets and years of purchases, the difference multiplies.

What happens if you declare a zero cost basis

Declaring a zero cost basis is not illegal: it is simply the most expensive option. It has three consequences:

  • You overpay. The whole amount of the sale is taxed as a gain, in the savings base, at rates from 19% to 30%.
  • You lose losses. If you actually sold for less than you paid, you had a loss you could offset against other gains, that year or in the following four. With a zero cost basis that loss disappears. We explain it in how to offset crypto losses.
  • It complicates the future. The units you have not sold still have no cost basis, and the problem repeats every year you sell.

If you have already filed your return with a zero cost basis, you can correct it with a corrective self-assessment (autoliquidación rectificativa) and claim a refund of what you overpaid, within the four-year window. It also works the other way: if you declared costs you cannot prove, it is best to correct it before Hacienda asks. We help you do it in regularise your crypto taxes.

If what you have received is a letter from Hacienda asking you to justify the cost basis of some sales, the first thing is the deadline to reply. We explain how to act in tax agency request about crypto.

Frequently asked questions

Can I just put a zero cost basis and be done with it?

You can, and Hacienda will not dispute it, because it is the option where you pay the most. But it rarely makes sense: with a little reconstruction work you can usually prove a good part of the cost basis, and the difference in tax can be large.

What price do I use for an airdrop or for staking rewards?

The market value on the day you receive them, taken from a recognised historical price source and always applied with the same criterion. If the token had no market when you received it, its value at that moment was nil: there is no income on receipt and its cost basis, when you sell it, will be zero. Keep the evidence that it was not trading.

Does Hacienda accept screenshots as evidence?

A screenshot can serve as support, but on its own it is weak evidence: it has no verifiable date and it is easy to manipulate. It carries much more weight alongside other evidence, such as the movement in your bank, the confirmation email or the on-chain trail of the transaction.

What if the exchange no longer exists?

Your bank statements show how much money you sent and when, and the blockchain shows when the crypto left for your next platform. With that, plus any emails you kept, a reasonable and documented cost basis can be rebuilt even if the exchange has disappeared.

How long do I need to keep this evidence?

For as long as you hold the crypto, and afterwards until the tax year in which you sell it becomes time-barred: four years from the end of the filing period for that year's return. If you bought in 2018 and sell in 2026, the evidence for the 2018 purchase is still needed.

We review your report and rebuild the missing cost basis

We start from your Koinly, CoinTracking or other tool's report, find every sale with a zero or doubtful cost basis, match the transfers between your platforms and rebuild the cost basis with documented evidence. We give you the corrected figures and the reasoning behind each one, in case Hacienda asks. Start with our Koinly and CoinTracking report review or tell us about your case.

Topic

Cryptocurrency Taxation

Complete guide on cryptocurrency taxation in Spain: tax forms, obligations to the AEAT, capital gains calculation and digital asset declaration.

cryptocurrency taxationform 100form 721form 714AEATcrypto tax return
See all articles on this topic →

Does this sound like your case?

If the above matches your situation, see how we handle it before deciding anything. Or tell us about it directly, if you prefer.