A token swap is generally not considered a taxable event since you have not sold the coins. Instead, the token has been swapped/migrated to another blockchain or contract address, or the ticker symbol and/or total supply have changed.
The token swap ratio is most commonly 1:1, meaning that if you owned 100 tokens before the swap, you would own 100 tokens also after the swap. However, some projects have done token swaps with a ratio different than 1:1, and it's important that this is tracked correctly and that the cost basis is carried over without realizing any capital gains. Here are a few examples of prior token swaps:
EOS (June 2018, 1:1 ratio)
VeChain - VEN → VET (July 2018, 1:100 ratio)
Elrond - ERD → EGLD (November 2020, 1000:1 ratio)
Let's look at Elrond as an example:
You bought 25,000 ERD tokens and paid 0.01 BTC on July 15th, 2020. At the time of the transaction, 0.01 BTC was worth $500, which also becomes the cost basis of the acquired ERD tokens.
The tokens were automatically swapped on Binance on September 10th, 2020. After the swap, you now have 25 EGLD tokens, which take on the original cost basis of $500.
To track this correctly, you must add a manual Trade (Swap) transaction if the swap is not imported from the Binance API so that Coinpanda will track the cost basis correctly. You can add the manual transaction and then change the transaction tag to Swap.
This is what it looks like after the transaction has been tagged as a Swap:
The original cost basis of $500 will now be tracked correctly for the EGLD tokens received after the swap, and no gains will be realized.