Do wash sale rules apply if a loss follows a gain (ESPP and RSUs)?

Discuss all general (i.e. non-personal) investing questions and issues, investing news, and theory.
Post Reply
Topic Author
ScaledWheel
Posts: 205
Joined: Sat Jul 23, 2011 8:06 pm

Do wash sale rules apply if a loss follows a gain (ESPP and RSUs)?

Post by ScaledWheel »

I have ESPPs that get purchased quarterly, and RSUs which disburse on anniversary dates.

Timing is:

12/31: Acquire 50 shares at a $43 cost basis through ESPP
1/15: Sell 250 shares at $50, incur a loss of about $1k (all short holding period)
3/1: Get another 250 shares of RSUs at whatever the price is on 3/1.

Does the 1/15 trade create a wash sale? I had always thought of wash sale rules as you can't lock in a loss if you go back into that position too quickly. But in my case the loss occurs after a purchase.
Afty
Posts: 1899
Joined: Sun Sep 07, 2014 5:31 pm

Re: Do wash sale rules apply if a loss follows a gain (ESPP and RSUs)?

Post by Afty »

Here’s what the IRS says (https://www.irs.gov/publications/p550#e ... k100010601):
You are an employee of a corporation with an incentive pay plan. Under this plan, you are given 10 shares of the corporation's stock as a bonus award. You include the fair market value of the stock in your gross income as additional pay. You later sell these shares at a loss. If you receive another bonus award of substantially identical stock within 30 days of the sale, you cannot deduct your loss on the sale.
Sounds like yes to me.
Gronnie
Posts: 290
Joined: Sun Oct 19, 2014 2:08 pm

Re: Do wash sale rules apply if a loss follows a gain (ESPP and RSUs)?

Post by Gronnie »

In your example it's more than 30 days post sale so no matter what it's not a wash sale.
tomsense76
Posts: 1316
Joined: Wed Oct 14, 2020 1:52 am

Re: Do wash sale rules apply if a loss follows a gain (ESPP and RSUs)?

Post by tomsense76 »

Does the sale on 1/15 include all the shares purchased on 12/31?
"Anyone who claims to understand quantum theory is either lying or crazy" -- Richard Feynman
User avatar
cchrissyy
Posts: 973
Joined: Fri May 05, 2017 10:35 pm
Location: SF bay area

Re: Do wash sale rules apply if a loss follows a gain (ESPP and RSUs)?

Post by cchrissyy »

ScaledWheel wrote: Thu Jan 13, 2022 4:10 pm
12/31: Acquire 50 shares at a $43 cost basis through ESPP
1/15: Sell 250 shares at $50, incur a loss of about $1k (all short holding period)
3/1: Get another 250 shares of RSUs at whatever the price is on 3/1.

Does the 1/15 trade create a wash sale? I had always thought of wash sale rules as you can't lock in a loss if you go back into that position too quickly. But in my case the loss occurs after a purchase.
if the january trade includes selling the 50 shares from december, there is no wash

if you did not sell those december shares, then in january you have a deductible loss on 200 shares and a wash on 50, where the amount you are not deducting is now part of the cost basis for your december shares.
comfortable being all stock until age 40, now working towards 60-20-20 us-intl-bond
Topic Author
ScaledWheel
Posts: 205
Joined: Sat Jul 23, 2011 8:06 pm

Re: Do wash sale rules apply if a loss follows a gain (ESPP and RSUs)?

Post by ScaledWheel »

tomsense76 wrote: Thu Jan 13, 2022 4:35 pm Does the sale on 1/15 include all the shares purchased on 12/31?
No, these would be shares acquired before 12/31, at a higher cost basis.
tomsense76
Posts: 1316
Joined: Wed Oct 14, 2020 1:52 am

Re: Do wash sale rules apply if a loss follows a gain (ESPP and RSUs)?

Post by tomsense76 »

ScaledWheel wrote: Thu Jan 13, 2022 4:45 pm
tomsense76 wrote: Thu Jan 13, 2022 4:35 pm Does the sale on 1/15 include all the shares purchased on 12/31?
No, these would be shares acquired before 12/31, at a higher cost basis.
Then it sounds like you have a wash sale. See cchrissyy's more detailed answer above ( viewtopic.php?p=6448073#p6448073 )
"Anyone who claims to understand quantum theory is either lying or crazy" -- Richard Feynman
TropikThunder
Posts: 3374
Joined: Sun Apr 03, 2016 5:41 pm

Re: Do wash sale rules apply if a loss follows a gain (ESPP and RSUs)?

Post by TropikThunder »

Gronnie wrote: Thu Jan 13, 2022 4:29 pm In your example it's more than 30 days post sale so no matter what it's not a wash sale.
The 30 days is both before and after the sale, so the relevant transaction is the one on Dec 31, not the one on Mar 1.
TropikThunder
Posts: 3374
Joined: Sun Apr 03, 2016 5:41 pm

Re: Do wash sale rules apply if a loss follows a gain (ESPP and RSUs)?

Post by TropikThunder »

cchrissyy wrote: Thu Jan 13, 2022 4:41 pm
ScaledWheel wrote: Thu Jan 13, 2022 4:10 pm
12/31: Acquire 50 shares at a $43 cost basis through ESPP
1/15: Sell 250 shares at $50, incur a loss of about $1k (all short holding period)
3/1: Get another 250 shares of RSUs at whatever the price is on 3/1.

Does the 1/15 trade create a wash sale? I had always thought of wash sale rules as you can't lock in a loss if you go back into that position too quickly. But in my case the loss occurs after a purchase.
if the january trade includes selling the 50 shares from december, there is no wash

if you did not sell those december shares, then in january you have a deductible loss on 200 shares and a wash on 50, where the amount you are not deducting is now part of the cost basis for your december shares.
This is the way. A lot of people think that a wash sale nullifies the entire loss when the truth is it's a share-for-share offset. The 50 shares purchased Dec 31 will offset the loss from the 50 youngest (oldest?) shares sold in Jan (is it FIFO or LIFO?).

ETA: someone check me on which shares get their loss offset, the oldest or the newest. I can't find the reference I had read before.
rkhusky
Posts: 11368
Joined: Thu Aug 18, 2011 8:09 pm

Re: Do wash sale rules apply if a loss follows a gain (ESPP and RSUs)?

Post by rkhusky »

ScaledWheel wrote: Thu Jan 13, 2022 4:10 pm I have ESPPs that get purchased quarterly, and RSUs which disburse on anniversary dates.

Timing is:

12/31: Acquire 50 shares at a $43 cost basis through ESPP
1/15: Sell 250 shares at $50, incur a loss of about $1k (all short holding period)
3/1: Get another 250 shares of RSUs at whatever the price is on 3/1.

Does the 1/15 trade create a wash sale? I had always thought of wash sale rules as you can't lock in a loss if you go back into that position too quickly. But in my case the loss occurs after a purchase.
You need to provide more detail on the share lots sold on 1/15. What was the purchase price and date of the lots?
User avatar
Lee_WSP
Posts: 6700
Joined: Fri Apr 19, 2019 5:15 pm
Location: Arizona

Re: Do wash sale rules apply if a loss follows a gain (ESPP and RSUs)?

Post by Lee_WSP »

ScaledWheel wrote: Thu Jan 13, 2022 4:45 pm
tomsense76 wrote: Thu Jan 13, 2022 4:35 pm Does the sale on 1/15 include all the shares purchased on 12/31?
No, these would be shares acquired before 12/31, at a higher cost basis.
Sold shares which were purchased within the sixty day window cannot cause a wash. Sounds like you sold other shares and still hold the December shares.

Shares which caused the wash have an adjusted basis.

Rev rule 56-602
26 USC 1091
Topic Author
ScaledWheel
Posts: 205
Joined: Sat Jul 23, 2011 8:06 pm

Re: Do wash sale rules apply if a loss follows a gain (ESPP and RSUs)?

Post by ScaledWheel »

TropikThunder wrote: Thu Jan 13, 2022 6:00 pm
cchrissyy wrote: Thu Jan 13, 2022 4:41 pm
ScaledWheel wrote: Thu Jan 13, 2022 4:10 pm
12/31: Acquire 50 shares at a $43 cost basis through ESPP
1/15: Sell 250 shares at $50, incur a loss of about $1k (all short holding period)
3/1: Get another 250 shares of RSUs at whatever the price is on 3/1.

Does the 1/15 trade create a wash sale? I had always thought of wash sale rules as you can't lock in a loss if you go back into that position too quickly. But in my case the loss occurs after a purchase.
if the january trade includes selling the 50 shares from december, there is no wash

if you did not sell those december shares, then in january you have a deductible loss on 200 shares and a wash on 50, where the amount you are not deducting is now part of the cost basis for your december shares.
This is the way. A lot of people think that a wash sale nullifies the entire loss when the truth is it's a share-for-share offset. The 50 shares purchased Dec 31 will offset the loss from the 50 youngest (oldest?) shares sold in Jan (is it FIFO or LIFO?).

ETA: someone check me on which shares get their loss offset, the oldest or the newest. I can't find the reference I had read before.
Hm this seems to be more complicated than I though it would be. If I can select the shares that are offset, then I'm in good shape.

Current share price: $51.25

Shares I'm selling:
3/2/21 - 39 shares @ $54
9/27/21 - 240 shares @ $56
11/20/21 - 72 shares @ $52

Shares I'm acquring (via ESPP):
12/31/21 - 60 shares @ $42 (approximately, hasn't come through yet)

Now, if I can select LIFO here, and have 11/20/21 lot be a wash sale I'm in pretty good shape because the loss I'm missing out on due to the wash sale is <$50, so no big deal.

Can I choose which shares are get chosen for the wash sale?
User avatar
Lee_WSP
Posts: 6700
Joined: Fri Apr 19, 2019 5:15 pm
Location: Arizona

Re: Do wash sale rules apply if a loss follows a gain (ESPP and RSUs)?

Post by Lee_WSP »

ScaledWheel wrote: Thu Jan 13, 2022 7:14 pm
Can I choose which shares are get chosen for the wash sale?
No.

It is based on the date acquired. See 26 CFR 1091.1 b or c or d
Topic Author
ScaledWheel
Posts: 205
Joined: Sat Jul 23, 2011 8:06 pm

Re: Do wash sale rules apply if a loss follows a gain (ESPP and RSUs)?

Post by ScaledWheel »

Lee_WSP wrote: Thu Jan 13, 2022 7:20 pm
ScaledWheel wrote: Thu Jan 13, 2022 7:14 pm
Can I choose which shares are get chosen for the wash sale?
No.

It is based on the date acquired. See 26 CFR 1091.1 b or c or d
Ah great, thank you. Here's a reference for others [0].
(b) Where more than one loss is claimed to have been sustained within the taxable year from the sale or other disposition of stock or securities, the provisions of this section shall be applied to the losses in the order in which the stock or securities the disposition of which resulted in the respective losses were disposed of (beginning with the earliest disposition). If the order of disposition of stock or securities disposed of at a loss on the same day cannot be determined, the stock or securities will be considered to have been disposed of in the order in which they were originally acquired (beginning with the earliest acquisition).

The below applies to me
(c) Where the amount of stock or securities acquired within the 61-day period is less than the amount of stock or securities sold or otherwise disposed of, then the particular shares of stock or securities the loss from the sale or other disposition of which is not deductible shall be those with which the stock or securities acquired are matched in accordance with the following rule: The stock or securities acquired will be matched in accordance with the order of their acquisition (beginning with the earliest acquisition) with an equal number of the shares of stock or securities sold or otherwise disposed of.

(d) Where the amount of stock or securities acquired within the 61-day period is not less than the amount of stock or securities sold or otherwise disposed of, then the particular shares of stock or securities the acquisition of which resulted in the nondeductibility of the loss shall be those with which the stock or securities disposed of are matched in accordance with the following rule: The stock or securities sold or otherwise disposed of will be matched with an equal number of the shares of stock or securities acquired in accordance with the order of acquisition (beginning with the earliest acquisition) of the stock or securities acquired.
So in my case (c), it is indeed FIFO.

[0]: https://www.law.cornell.edu/cfr/text/26/1.1091-1
Last edited by ScaledWheel on Thu Jan 13, 2022 7:38 pm, edited 1 time in total.
AnEngineer
Posts: 1133
Joined: Sat Jun 27, 2020 4:05 pm

Re: Do wash sale rules apply if a loss follows a gain (ESPP and RSUs)?

Post by AnEngineer »

Lee_WSP wrote: Thu Jan 13, 2022 7:20 pm
ScaledWheel wrote: Thu Jan 13, 2022 7:14 pm
Can I choose which shares are get chosen for the wash sale?
No.

It is based on the date acquired. See 26 CFR 1091.1 b or c or d
Well, one could actually sell some shares earlier to e effect the selection. But if it's done, it's done.
rkhusky
Posts: 11368
Joined: Thu Aug 18, 2011 8:09 pm

Re: Do wash sale rules apply if a loss follows a gain (ESPP and RSUs)?

Post by rkhusky »

ScaledWheel wrote: Thu Jan 13, 2022 7:14 pm Hm this seems to be more complicated than I though it would be. If I can select the shares that are offset, then I'm in good shape.

Current share price: $51.25

Shares I'm selling:
3/2/21 - 39 shares @ $54
9/27/21 - 240 shares @ $56
11/20/21 - 72 shares @ $52

Shares I'm acquring (via ESPP):
12/31/21 - 60 shares @ $42 (approximately, hasn't come through yet)

Now, if I can select LIFO here, and have 11/20/21 lot be a wash sale I'm in pretty good shape because the loss I'm missing out on due to the wash sale is <$50, so no big deal.

Can I choose which shares are get chosen for the wash sale?
If you haven't sold the shares yet, then you should be able to choose which ones to sell.

If you have already sold the shares (not sure what the 1/15 sell date meant in the OP - is that 1/15/22?), then which shares get matched up is set by the wash sale rules.
rkhusky
Posts: 11368
Joined: Thu Aug 18, 2011 8:09 pm

Re: Do wash sale rules apply if a loss follows a gain (ESPP and RSUs)?

Post by rkhusky »

If you sell the 11/20 shares first at $51, then you would have a loss of $1/sh. 60 of those shares' loss gets disallowed and the basis of the 60 shares from 12/31 gets bumped up to $43.

You can claim the loss on 12 shares at $1/sh.

If you then sell the other two lots at $51/sh, you can claim a loss of $3/sh for 39 shares and a loss of $5/sh for 240 shares.

You recoup the disallowed loss when you sell the 12/31 shares because of the bumped up basis.

Edit: redid the calculations with a sale price of $51, instead of $42
Last edited by rkhusky on Thu Jan 13, 2022 8:39 pm, edited 2 times in total.
rkhusky
Posts: 11368
Joined: Thu Aug 18, 2011 8:09 pm

Re: Do wash sale rules apply if a loss follows a gain (ESPP and RSUs)?

Post by rkhusky »

If you sell as one big order and it goes in chronological order, then the losses on the 39 shares from 3/2 are disallowed, as well as 21 shares from 9/27. Your 12/31 lot that remains is broken up into two lots, 39 shares with a basis of $45 and 11 shares with a basis of $47.

You can claim a loss of $5/sh for 229 shares and $1/sh for 72 shares.

This assumes (as in the previous post) that the selling price of all the shares is $51/sh.

As before, you recoup your disallowed losses by selling the 12/31 shares.

Edit: redid the calculations with a sale price of $51, instead of $42
User avatar
Lee_WSP
Posts: 6700
Joined: Fri Apr 19, 2019 5:15 pm
Location: Arizona

Re: Do wash sale rules apply if a loss follows a gain (ESPP and RSUs)?

Post by Lee_WSP »

Deleted see below
Last edited by Lee_WSP on Thu Jan 13, 2022 9:11 pm, edited 1 time in total.
User avatar
Lee_WSP
Posts: 6700
Joined: Fri Apr 19, 2019 5:15 pm
Location: Arizona

Re: Do wash sale rules apply if a loss follows a gain (ESPP and RSUs)?

Post by Lee_WSP »

OP
Just sell the newest shares for par. No wash sale. Even if they're sold under, no shares are within the 30 day period before iirc.
Topic Author
ScaledWheel
Posts: 205
Joined: Sat Jul 23, 2011 8:06 pm

Re: Do wash sale rules apply if a loss follows a gain (ESPP and RSUs)?

Post by ScaledWheel »

Lee_WSP wrote: Thu Jan 13, 2022 9:09 pm OP
Just sell the newest shares for par. No wash sale. Even if they're sold under, no shares are within the 30 day period before iirc.
The issue here is that the ESPP shares (newest) have a one year holding period after acquisition, so I won’t be able to sell those until 1/1/2023.

I was unaware before this that wash sale rules are share-weighted. I thought I’d lose the entire loss on any shares I sold, which isn’t the case. After knowing the rules, it seems like I can still capture about 80% of the loss even with the wash sale.

This is all a useful exercise because future grant sizes are much larger and value of potential losses could be several times what I’m dealing with here. Though I am leaning more and more towards just selling all shares as they vest, which is the Bogleheads consensus anyways.
AnEngineer
Posts: 1133
Joined: Sat Jun 27, 2020 4:05 pm

Re: Do wash sale rules apply if a loss follows a gain (ESPP and RSUs)?

Post by AnEngineer »

A one year holding requirement on the ESPP, are you sure it's worth it?
User avatar
Lee_WSP
Posts: 6700
Joined: Fri Apr 19, 2019 5:15 pm
Location: Arizona

Re: Do wash sale rules apply if a loss follows a gain (ESPP and RSUs)?

Post by Lee_WSP »

ScaledWheel wrote: Thu Jan 13, 2022 9:51 pm
Lee_WSP wrote: Thu Jan 13, 2022 9:09 pm OP
Just sell the newest shares for par. No wash sale. Even if they're sold under, no shares are within the 30 day period before iirc.
The issue here is that the ESPP shares (newest) have a one year holding period after acquisition, so I won’t be able to sell those until 1/1/2023.

I was unaware before this that wash sale rules are share-weighted. I thought I’d lose the entire loss on any shares I sold, which isn’t the case. After knowing the rules, it seems like I can still capture about 80% of the loss even with the wash sale.

This is all a useful exercise because future grant sizes are much larger and value of potential losses could be several times what I’m dealing with here. Though I am leaning more and more towards just selling all shares as they vest, which is the Bogleheads consensus anyways.
In that case, is waiting a further 20 days that terrible?
Gronnie
Posts: 290
Joined: Sun Oct 19, 2014 2:08 pm

Re: Do wash sale rules apply if a loss follows a gain (ESPP and RSUs)?

Post by Gronnie »

TropikThunder wrote: Thu Jan 13, 2022 5:58 pm
Gronnie wrote: Thu Jan 13, 2022 4:29 pm In your example it's more than 30 days post sale so no matter what it's not a wash sale.
The 30 days is both before and after the sale, so the relevant transaction is the one on Dec 31, not the one on Mar 1.
Whoops didn't see it was 50 bought and 250 sold.

Thought it was the only shares owned. My bad.
Topic Author
ScaledWheel
Posts: 205
Joined: Sat Jul 23, 2011 8:06 pm

Re: Do wash sale rules apply if a loss follows a gain (ESPP and RSUs)?

Post by ScaledWheel »

Lee_WSP wrote: Thu Jan 13, 2022 10:06 pm
ScaledWheel wrote: Thu Jan 13, 2022 9:51 pm
Lee_WSP wrote: Thu Jan 13, 2022 9:09 pm OP
Just sell the newest shares for par. No wash sale. Even if they're sold under, no shares are within the 30 day period before iirc.
The issue here is that the ESPP shares (newest) have a one year holding period after acquisition, so I won’t be able to sell those until 1/1/2023.

I was unaware before this that wash sale rules are share-weighted. I thought I’d lose the entire loss on any shares I sold, which isn’t the case. After knowing the rules, it seems like I can still capture about 80% of the loss even with the wash sale.

This is all a useful exercise because future grant sizes are much larger and value of potential losses could be several times what I’m dealing with here. Though I am leaning more and more towards just selling all shares as they vest, which is the Bogleheads consensus anyways.
In that case, is waiting a further 20 days that terrible?
I'll be receiving more RSUs on 3/1/22 (or therabouts) and then there will be another ESPP purchase at 3/31/22, so I would need to wait until May to avoid any wash sales.
AnEngineer
Posts: 1133
Joined: Sat Jun 27, 2020 4:05 pm

Re: Do wash sale rules apply if a loss follows a gain (ESPP and RSUs)?

Post by AnEngineer »

If you sell the RSUs immediately, then even if they cause a wash sale you'll get the loss back. Don't know why you want to hold them.
Topic Author
ScaledWheel
Posts: 205
Joined: Sat Jul 23, 2011 8:06 pm

Re: Do wash sale rules apply if a loss follows a gain (ESPP and RSUs)?

Post by ScaledWheel »

AnEngineer wrote: Fri Jan 14, 2022 8:38 am If you sell the RSUs immediately, then even if they cause a wash sale you'll get the loss back. Don't know why you want to hold them.
I am leaning towards selling at vest now. The reason I didn't sell these other shares at vesting was laziness, mostly...
Topic Author
ScaledWheel
Posts: 205
Joined: Sat Jul 23, 2011 8:06 pm

Re: Do wash sale rules apply if a loss follows a gain (ESPP and RSUs)?

Post by ScaledWheel »

AnEngineer wrote: Thu Jan 13, 2022 9:55 pm A one year holding requirement on the ESPP, are you sure it's worth it?
I am not sure. We are basically using these ESPPs as a savings vehicle to pay down the mortgage when they vest. I think the risk of losing that arbitrage is still worth it, and the amount going into the ESPP is <5% of our gross income.

I guess one could argue it's not worth the hassle.
AnEngineer
Posts: 1133
Joined: Sat Jun 27, 2020 4:05 pm

Re: Do wash sale rules apply if a loss follows a gain (ESPP and RSUs)?

Post by AnEngineer »

ScaledWheel wrote: Fri Jan 14, 2022 10:07 am
AnEngineer wrote: Thu Jan 13, 2022 9:55 pm A one year holding requirement on the ESPP, are you sure it's worth it?
I am not sure. We are basically using these ESPPs as a savings vehicle to pay down the mortgage when they vest. I think the risk of losing that arbitrage is still worth it, and the amount going into the ESPP is <5% of our gross income.

I guess one could argue it's not worth the hassle.
What are the other ESPP provisions? Discount and lookback period.
Topic Author
ScaledWheel
Posts: 205
Joined: Sat Jul 23, 2011 8:06 pm

Re: Do wash sale rules apply if a loss follows a gain (ESPP and RSUs)?

Post by ScaledWheel »

AnEngineer wrote: Fri Jan 14, 2022 10:11 am
ScaledWheel wrote: Fri Jan 14, 2022 10:07 am
AnEngineer wrote: Thu Jan 13, 2022 9:55 pm A one year holding requirement on the ESPP, are you sure it's worth it?
I am not sure. We are basically using these ESPPs as a savings vehicle to pay down the mortgage when they vest. I think the risk of losing that arbitrage is still worth it, and the amount going into the ESPP is <5% of our gross income.

I guess one could argue it's not worth the hassle.
What are the other ESPP provisions? Discount and lookback period.
15% discount with a one-quarter lookback (lesser value of the first or last trading day of the quarter).
Post Reply