Purification of RSUs

Assalamu Alaikum,

My company is a permissible business, but with ~6% revenue coming from haram sources.

Let’s say I have an offer from the company 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 and would lose them if we leave the company.

After 1 year: let’s assume the stock price has increased to $150 per share and 500 shares are vested (I owned). The company sells 50% of shares at $150 (50.53% to be exact which is the top Federal + Ontario combined tax marginal rate, so they are withholding the tax and I will get a refund according to my actual tax rate). Assuming 50% to explain the calculation easily, they sell for $37,500. Say, I get back $10,000 as tax refund, so my actual salary tax on $75,000 I paid would be $27,500.

After vesting, stock price increases to $160 per share before I am able to sell now I sell the 250 shares for $40,000.

Here the original value of all 500 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 was $80,000.

If I take deduct salary tax, then the original value of these shares was $25,000 plus $10,000 (tax return), the value of the shares when they vested was $37,500 plus $10,000 (tax return), and the value of the shares when they were sold is $40,000 plus $10,000 (tax return).

Please note that I was taxed on the complete salary of $75,000 and I will be taxed for the capital gain of $40,000-$37,500=$2500.

Is the 6% purification on the 30k, or on just the 5k capital gain (not taking any tax into account)?

Is the 6% purification on the 30k (minus the capital gain tax and actual salary tax), or on just the 2.5k capital gain (minus the capital gain tax)?

Jazak Allah Khairan.