you buy 2 at $5k it goes up to 10k and sell 1.
profit is current value - cost basis
10k - 5k = 5k profit that will be taxed
Because the 5k in the market is not a realized gain
Because the 5k in the market is not a realized gain