I understand wash sale rules in the simple case: If I sell stock at a loss and then buy it back in 30 days or less, I can't take a deduction on the loss and must instead add the loss to the cost basis of the repurchased shares, deferring the deduction (if any) until those shares are eventually sold.
I also understand the situation where someone increases their long position just before selling shares at a loss. For example, if someone had 100 shares of something, wanted to keep 100 shares, but also wanted to take a loss when the stock dipped, if not for the wash sale rule they could buy 100 shares and then immediately or soon after sell the original for 100 shares at a loss while maintaining their 100 share position.
Here's where I get confused: how does it work when the previous purchase's position has already been closed out?
Let's say, for example, that :
- on day 0 I bought 10 shares of X for $10 each ($100 total), and sold them the same day at $11 each ($110), for a gain of $10.
- 15 days later, again purchase 10 shares at $10, and then sell them for $8 each ($80), for a loss of $20.
Since there was a purchase within 30 days of the sale on day 15 (the purchase on day 0), my understanding is that that sale is a wash, and the $20 loss is disallowed.
But then it gets weird: if we add that $20 to the cost basis of the purchase on day 0, that $10 gain becomes a $10 loss. Furthermore, wouldn't that loss also be a wash, because shares were purchased just 15 days later?
If so, which cost basis does that $10 loss get added to? The sale on day 15 that was already a wash? When does that washing and the basis changing stop?
For context, I get stock compensation that vests monthly and then is immediately sold the same day. This means that almost every transaction that is a loss is a wash (with the exception of vesting in August and January, where the lengths of the months mean that the transactions are 31 days away from the trades in July and September(for the August trade) and the trades in December and February (for the January trade). So I want to make sure I understand this!