Please correct me if I am wrong but as I understand from glancing at the code:
Let's say you bought BTC with SEK then bought LTC with that BTC then sold that LTC for SEK.
The cost basis calculation always adds the column "value in SEK" price to the average. In the above scenerio The cost for buying that LTC is taken from the cointracking database in SEK on the trade day. But the actual cost is the SEK value of BTC you bought. Similar example is given on the https://www.skatteverket.se/privat/skatter/vardepapper/andratillgangar/kryptovalutor.4.15532c7b1442f256bae11b60.html third example down on the page.
