Back to blog
Specific Practical Guides

How to export your crypto wallet and exchange transactions to CSV for tax (and why none of them include cost basis)

What to export from each exchange and wallet, where the CSV download is in Binance, Bybit, Kraken and Coinbase, how a self-custody wallet is rebuilt and what to check before you send your files to an advisor for your Spanish tax return.

E

Cleriontax Team

Crypto Tax and Data Analysis Experts

10 min read
Export HistoryCSVTransaction HistoryBinanceBybitKrakenCoinbaseMetamaskLedgerTrust WalletFIFOTax Authority
How to export your crypto exchange and wallet history to CSV for your tax return with the Spanish tax agency
13 de noviembre de 2026
10 min de lectura
Guías Prácticas Específicas
Export HistoryCSVTransaction HistoryBinanceBybitKrakenCoinbaseMetamaskLedgerTrust WalletFIFOTax Authority

The Spanish tax agency (Hacienda, the AEAT) does not ask you for a statement from your exchange. It asks for the gain or loss on every transaction you made during the year: every sale, every swap of one crypto for another, every reward. To work that out you need to know what you bought, when and at what price, and that information is spread across every place you have traded.

That is why the first step of any tax return is to gather the data from all your sources. In this guide we explain what to export from each type of platform, where the export lives in the exchanges most used in Spain and what to do with wallets, which have no tax CSV. If you would rather we did it, we use those files to prepare your crypto tax report.

What data you need from each source

Each type of platform stores the information differently. What you need, in every case, is the full history from your first transaction, not just the year you are declaring: the cost basis of what you sell this year may come from a purchase five years ago.

SourceWhat to exportUsual format
Centralised exchangesTrades (spot, conversions), deposits and withdrawals, rewards (earn, staking), derivatives if you use themCSV, sometimes several files by transaction type
Self-custody walletsHistory of each public address on each networkCSV from a block explorer or from the wallet app
DeFiSwaps, liquidity deposits and withdrawals, loans, stakingNo export of its own: it comes from the on-chain history of your address
Closed exchanges or lost accountsWhatever you kept: old exports, confirmation emails, bank statementsPDF, emails, dated screenshots
BanksIncoming and outgoing transfers to and from exchangesPDF or CSV from the bank

Bank statements look secondary, but they are not. They are the independent proof of how much money you put in and took out, and often the only way to rebuild old purchases.

Exchange by exchange: where the export is

All the big exchanges let you download your history, but none puts it behind a single button. These are the quirks of the ones most used in Spain. Each guide has the step-by-step with screenshots of the menu.

Binance

Binance splits the information into several exports: spot trades, conversions (Convert), Earn products, futures and deposits and withdrawals all come in separate files. If you only download the trade history, you will be missing quick conversions and rewards, which are usually numerous. Some exports also have a limit of months per file, so covering several years means repeating them.

Since 1 July 2026 Binance no longer serves customers in Spain, but it still lets you withdraw funds and download your history. It is worth doing it as soon as possible. The step-by-step is in how to export your Binance history.

Bybit

Bybit also splits the data by product: spot, derivatives, conversions, Earn and deposits and withdrawals. If you have traded futures or perpetuals, those files are essential, because every closed position creates a gain or a loss. Exports cover limited periods, so a full year usually takes several files. We explain it in how to export your Bybit history to CSV.

Kraken

Kraken offers two main exports: trades and the ledger. For tax, the important one is the ledger, because it records everything: purchases, sales, deposits, withdrawals, fees and rewards.

There is one detail that confuses almost everyone: Kraken records staking as transfers between sub-accounts (from spot to staking and back). If a tool reads them as sends or sales, your report comes out wrong. We cover it in how to get your Kraken CSV.

Coinbase

Coinbase lets you generate your transaction history as a CSV from the reports section of your profile. It includes purchases, sales, conversions, sends and rewards. It operates in the European Union from Luxembourg, which matters for form 721, and since 2026 it reports your transactions under DAC8. We explain it in Coinbase and the Spanish tax agency.

Self-custody wallets: why there is no tax CSV and how the history is rebuilt

A self-custody wallet is not an account with a company: it is a tool for signing transactions with your keys. That is why it has no "tax history" to download. What exists is the blockchain record, which is public and complete, and you look it up with your public address.

  • MetaMask: it has no export of its own. The history comes from explorers such as Etherscan for each network you have used (Ethereum, Polygon, Arbitrum, BNB Chain...), including token transfers and internal transactions. We walk you through it in how to export your MetaMask history.
  • Ledger: Ledger Live lets you export your accounts' transactions, but it does not always capture what you do when you connect your Ledger to DeFi applications. We complete it with each network's explorer. We cover it in how to export your Ledger history.
  • Trust Wallet: it does not report to anyone either and has no tax CSV, and it is usually used on several networks at once. We explain how to handle it in Trust Wallet and the Spanish tax agency.

To rebuild a wallet, all you need is the public address. You never need to hand over your seed phrase or your private keys, not to an advisor and not to any tool. Anyone who asks for them is not doing your tax return.

What no CSV includes: the cost basis

Here is the underlying problem. Each exchange knows the transactions you made on it, but knows nothing about what happened elsewhere. If you bought bitcoin on Coinbase, sent it to your Ledger and sold it on Kraken, Kraken records a sale of units that, as far as it knows, "arrived" with no cost basis.

Hacienda requires you to calculate cost basis with the FIFO method per asset and across your whole portfolio: the first units in are the first units out, wherever they are. That can only be done by combining every source and matching each withdrawal with its deposit. No exchange does it for you.

And sometimes the cost basis simply is not there: an exchange that shut down, a purchase from years ago with no record, or rewards that a tool values at zero. We explain how to deal with it in what to do if you have no cost basis for your crypto.

How to check you are not missing a source

It is easy to leave something out: an exchange you used for two months in 2021, a network where you made three transactions, an Earn product that switched itself on. Three simple checks tell you whether your exports are complete.

The final balance matches. If you add up every inflow and subtract every outflow for an exchange or a wallet, the result must match what you see in the account today, asset by asset. If it does not, a file is missing: almost always rewards, conversions or fees paid in another crypto.

Every withdrawal has a destination. Every time you move crypto out of one place, it has to appear somewhere else: another exchange, a wallet of yours or a sale. If a withdrawal does not land anywhere you have exported, either that source is missing or it was a payment to a third party, which for tax purposes is a disposal.

It matches the bank. The total euros you sent to exchanges and the total you received from them must match your bank statements. If your bank shows a transfer to a platform that is not on your list, you know which source is missing.

These checks are also the first thing Hacienda looks at when it cross-checks your figures against what exchanges report. If they add up for you, they are much more likely to add up for the tax agency too.

Checklist before you send your CSVs to an advisor

Before you send your files, to an advisor or to a tool, go through this list. It will save you weeks of back and forth.

  • Every source. Every exchange, every wallet and every network you have ever used, even if it is empty today.
  • From your first purchase. Not just the year you are declaring. Without the full history, FIFO cannot be applied.
  • Every export type from each exchange: trades, conversions, rewards, derivatives, deposits and withdrawals.
  • The original files, unedited. Not even opened and saved in Excel, which sometimes changes dates and decimals. If you need to work with them, make a copy.
  • The public addresses of your wallets, with the network for each one.
  • Your bank statements with the transfers to and from exchanges.
  • Whatever you have from closed platforms: old exports, confirmation emails, dated screenshots.

Frequently asked questions

Can I use the tax report Binance generates?

It is useful as a starting point, but it is not the figure you declare. It only knows what you did on Binance, so it cannot apply FIFO across your whole portfolio and it does not know the cost basis of what you brought in from other platforms. If your entire history is on Binance and you never moved anything out, it will be closer; if not, it almost certainly will not add up.

What do I do if the exchange I used has shut down?

Recover everything you can: exports you downloaded at the time, confirmation emails for purchases and sales, and your bank statements. With that and the on-chain trail of the withdrawals, a good part of your activity can be rebuilt, documenting where each figure comes from.

Is it better to export to Excel or to CSV?

CSV, and without opening it in Excel before you send it. CSV is the format tools read and the one that keeps the data exactly as the exchange provides it. Excel can change the format of dates, decimals and long numbers when it saves.

How many years back do I need to export?

All of them, from your first purchase. Hacienda can review the last four tax years that have not become time-barred, but to calculate the cost basis of what you sell today you need to know when and at what price you bought it, even if that was many years ago.

Do I have to give my private keys for my wallet to be rebuilt?

No, never. The public address is enough to look up the entire blockchain history. Private keys and the seed phrase are not needed for any tax return.

Send us your exports and get a fixed quote

With your files, we combine every source, match every movement between platforms and calculate your gains with FIFO per asset, with each figure traceable in case Hacienda asks. The price depends on the number of sources, not on how much you have made, and we fix it before we start. See how we work in the crypto tax report or get in touch.

Topic

Specific Practical Guides

Step-by-step tutorials for specific tax operations: export exchange histories, download wallet data, document swaps, generate AEAT reports and prepare declarations.

export Binancedownload CoinbaseKraken historyMetaMask datadocument swapsexport Uniswap
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.