RSUs when company has impermissible revenue

Asslaamu alikum,

I wanted to follow-up on an answer previously posted by @Mufti_Faraz_Adam where he said if a generally permissible company has some impermissible revenue, and the RSUs were defined in terms of a dollar amount, then we can keep the dollar amount but not the capital gains. I would like to confirm my understanding of this and ask some follow-up questions with an example.

Example: The company is a permissible business, but with ~15% revenue coming from haram sources. Let’s say I have an offer for $200,000 RSUs, vesting over 4 years, 25% each year. Around the time of the offer or shortly thereafter, they determine the units of shares for this value - let’s assume stock price is $100 per share so this means I will receive 2000 shares. Now we know 500 shares will vest after 1 year, 500 after year 2, etc. Prior to 1 year we do not really “own” any shares i.e. we can’t sell, etc and would lose them if we leave the company.

After 1 year:

  • let’s assume stock price has increased to $150 per share
  • 500 shares are vested
  • after vesting, stock price increases to $160 per share before I am able to sell
  • now I sell the 500 shares for $80,000
  • here the original value of these shares was $50,000, the value of the shares when they vested was $75,000, and the value of the shares when they were sold is $80,000

In this scenario:

  1. how much money are we allowed to keep, and how much do we have to purify?
  2. can taxes to be paid on the capital gains be deducted from the amount that needs to be purified? For example, if in some scenario $10,000 has to be purified, $5000 of this may have to be paid in tax, which means that we would have to pay the purification amount out of pocket and not from the capital gains (in this example, capital gains is $10,000, tax paid is $5K and purification amount is $10K so in total we pay $15,000 on a $10,000 capital gain, if there were huge gains this option could actually be impossible to satisfy).

JazakAllah