Below is the procedure to follow for managing swap transactions that occured on wallets or other DeFi protocols, which may not be recognized as trades on the blockchain, but still correspond to an actual trade.
CryptoBooks will import them as deposits and withdrawals because that's how they appear on the blockchain, but users can manually link the two transactions and mark them as a trade.
Using this feature will exclude the outgoing transactions from capital gain calculation, unless the tax requirements of the country of the user's account require otherwise.
Enter the transaction details (deposit/withdrawal) and press Edit.
Select the Defi Swap category from the dropdown menu and press Save.
At this point, CryptoBooks will indicate the absence of the related transaction.
Repeat the procedure for the other transaction (if you worked on the deposit earlier, it will be the withdrawal, or vice versa).
On the Transactions page, you will see the banner to link the two transactions. Press the See DeFi Swap button.
In the new screen, you will see the transactions marked as DeFi Swap but not paired with the related transaction. Therefore, press Correct.
Press Choose to retrieve the transaction to pair.
Now press Pair Transactions next to the transaction you want to link.
Done! Now you will see the transactions in this way