I have trades for several years tracked on Koinly. One coin has had a higher cost basis for many trades during 2021. lets say 1 USD per coin. So when I sell it for 80 cent I make a loss of 20 cent. But then all of a sudden the cost basis goes down significantly, like to 0.1 USD. So when I sell the second trade I make a gain of 70 cents. There is no other trade inbetween and the trades are 3 min appart (on uniswap).
What could be the reason that the cost basis changes between two sells that is close after each other? I thought the cost basis was an average of all trades up to that point and that it wouldn’t change unless I bought more at a different price.