If you have traded on an exchange that is no longer in existence then there is usually no way of finding your transaction history for it (unless you downloaded it before it was shut down).
However, there are some things you can do to minimize your gains:
Create a custom wallet from memory
if you have some idea about the kind of trades you made on the exchange then it may be worth creating a wallet for it and then manually turning any deposits in your other wallets to "Transfers" and doing the same for any withdrawals that originated from this exchange.
Once this is done you will be left with some "Missing purchase history" errors. These can be resolved by creating some trade transactions manually.
🔵Example. If you sent 1 BTC into Cryptopia then traded it for 10 ETH and then transferred the 10 ETH to another exchange, here's how you would handle this:
First, find the transaction in the wallet that you "sent" 1 BTC from and change it to a Transfer to Cryptopia,
Then you would find the deposit transaction in your other wallet for the 10 ETH that was received from Cryptopia and change it to a Transfer too.
Finally, you would create a manual trade transaction in your Cryptopia wallet for 1 BTC -> 10 ETH. The date for this transaction would be a best guess.
Tips for recovering your data
Create a custom wallet for the closed exchange
Go to the Wallets page and click on Add Wallet / Exchange
Type in the name of your wallet in the search bar
Click on the Create custom 'XYZ' wallet link
If you have any records or emails containing information about transactions in the account, you can add them manually
If you know the deposit address for the exchange, you can:
Change wallet type to this network
Add the deposit address and sync the wallet
Disable the API
Review the transactions imported - delete all withdrawals (those are withdrawals from your deposit address to the exchange’s hot wallet) and check if all deposits look like yours
You can repeat steps a to d (change type > sync > disable API) for every deposit address you used
Review all unpaired deposits and withdrawals on your other wallets - do any of them look like they were sent to/from this exchange? If yes, edit them into transfers to this wallet - this is a part of How to ensure your Tax Report is accurate
After that you end up with some balances on these closed exchanges - some may be negative. Negative balances indicate that some of the assets that do remain on this exchange were sold for the negative asset.
If you know what these trades are, you can add them manually to help correct the balances.
What do the tax agencies say?
Normally a tax agency will ask you to make your best effort when filing taxes. It is highly unlikely that your tax agency would be able to retrieve records for a defunct exchange (unless the exchange was based in the same country). If you do not have records for an exchange and there is no way to retrieve these records then you should consider declaring this on your tax return to avoid any kinds of fines.