AI prompts
base on Automated Personal Tax Preparing Tool for VMW-AVGO Merger ## Automated Personal Tax Preparing Tool for VMW-AVGO Merger
This is a Python-based tool that automatically calculates the cost basis of the VMW-AVGO merger. It can generate all
data without the need for manually inputting per-lot information; you just need to download two files from E*Trade.
This tool processes the Gain&Loss file downloaded from E*TRADE. For each row (lot), it generates tax information,
including the cost basis for cash received during the merger as well as for converted AVGO shares. Additionally,
it calculates the cost basis for AVGO cash-in-lieu fractional shares and provides a tax summary across all lots.
The tool supports VMW shares acquired via ESPP, RSU, NSO, and brokerage purchases, as well as VMW shares sold before
and on the merger date.
Note:
This tool is applicable only to US holders of VMware shares. It appears that non-US holders have received the cash
component as a dividend instead of a share sale, leading to substantially different implications for tax computation.
## USAGE
```text
usage: tax.py [-h] [-c CASH] [-s STOCK] [-q] input output
positional arguments:
input gain&loss csv file path
output output file path, without file extension
options:
-h, --help show this help message and exit
-c CASH, --cash CASH vmware share count liquidated for cash
-s STOCK, --stock STOCK vmware share count liquidated for stock
-q, --qualifying force espp lot to use qualifying disposition, default to false
```
#### Usage example
```text
cd tax-tool
python3 tax.py gain-loss.csv output -c 459 -s 500 -q
```
#### Prepare Input Parameter
- Gain&Loss file: from E*TRADE website, select `Stock Plan (AVGO) ACCOUNT` -> `My Account` tab -> `Gains&Losses` ->
click `Download`. Either `Download Collapsed` or `Download Expanded` are ok.
- A xlsx file will be downloaded.
- Open it in Excel, Numbers, or Google Sheets and save/download it as a CSV file. Choose the
`Comma Separated Values` option if applicable.
- If you're using macOS, use Numbers instead of Microsoft Excel to export the .xlsx file as a CSV.
- `-c & -s` options: the VMware share count liquidated for cash and stock is used to calculate the precise cash/stock
allocation ratio. From E*TRADE website, select `Stock Plan (AVGO) ACCOUNT` -> `Tax Information` tab -> `statements`
-> download 12/31/2023 `Single Account Statement`. On the last page of this statement:
- find row with `UNACCEPTED SHARES` comments, the `Quantity` number is the share count liquidated for cash
- find row with `TENDER PAYMENT` comments, the `Quantity` number is the share count liquidated for stock
- `-q` option: please refer to the section titled `Potential AVGO Cost Base Adjustment For Last ESPP Lot`
#### Adjusting ESPP Offer Date for Mid-Year Joiners at VMware
For ESPP shares, the tool utilizes the `data/espp-date.csv` file to track acquire_date and offer_date for each ESPP
period offered by VMware. Some of the periods are one year long. If you joined the company in the middle of the year,
it is possible you enrolled in the second half of the ESPP plan. Please check your first enrolled ESPP period and
update the offer_date accordingly. For example: in espp-date.csv, there is one period as following:
```text
acquire_date,offer_date
...
02/28/2021,03/01/2020
```
If a person joined VMware in mid-2020, they could be enrolled in the second half of the 2020 ESPP plan. Thus, based on
the ESPP confirmation, they need to update the espp-date.csv file to change the offer_date from 03/01/2020 to
09/01/2020. No need to change acquired_date which is the date you actually own the shares.
#### Output
This tool generates two files: one in text format and another with the same name in CSV format. Both files contain tax
information for each lot. Additionally, the text file contains cost basis for AVGO cash-in-lieu fractional shares and
provides a tax summary across all lots. In the generated files, each lot has a "Row ID" field, which corresponds to the
ID of the corresponding row from the Gain&Loss input file. This correlation allows for easy matching between computed
lots from the output and reported lots from the input.
#### Gain&Loss File Fields Consumed by Script
Although the Gain&Loss file contains many fields, the script only utilizes the following fields:
- Record Type: `Sell`
- Symbol: `VMW` | `AVGO`
- Plan Type: `ESPP` | `RS` | `SO`
- QTY.: `<number of shares>`
- Date Acquired: `<vest or purchase date>`
- Date Sold: `<merge or sold date>`
- Total Proceeds: `<total proceeds>`
#### Potential AVGO Cost Base Adjustment For Last ESPP Lot
The generated AVGO cost basis can be used as is, except for the last ESPP lot acquired on 08/31/2022, which is the
only one with a disqualifying disposition as of the merge date. Its ESPP disposition status will transition to
qualifying after 03/01/2024. If you didn't sell the converted AVGO shares of that lot before 03/01/2024, include `-q`
as a command line input, which will force the ESPP to be considered as a qualifying disposition. This adjustment will
result in AVGO shares of this lot having a more favorable (higher) cost basis.
#### Handle VMW Shares Acquired Through Brokerage Purchase (Advanced Usage)
VMW shares acquired through brokerage purchases will not be included in the downloaded Gain&Loss file. Users can
create their own Gain & Loss file by making a copy of the downloaded one and wiping out the existing content except
for the header. Then, manually enter purchase information into this new Gain & Loss file, allocating one row per
transaction. Please refer to the section titled `Gain & Loss Fields Consumed by Script` for fields that need to
be populated. Please set `Plan Type` to `BUY` and populate one additional field:
- Plan Type: `BUY`
- Acquisition Cost: `<total purchase price including commission>`
If there is an associated AVGO fractional share sell, add a row with the following fields populated
- Record Type: `Sell`
- Symbol: `AVGO`
- QTY.: `<fractional share number>`
- Date Acquired: `<The acquisition date of the above-added VMW lot for AVGO fractional share cost basis calculation>`.
- Date Sold: `11/22/2023`
- Total Proceeds: `<total proceeds>`
When running the tool, if you can determine the `-c` and `-s` values, enter them in the command line as usual.
Otherwise, you can skip these optional parameters, and the script will use the default ratio of 0.479 for cash and
0.521 for stock, respectively. The `-q` option is not needed, as these are not ESPP shares.
## Turbo Tax Filing
For each stock transaction reported on Form 1099-B, locate the corresponding row (lot) in the generated tax file by
acquisition date and share count.
- Use `Box 1d Proceeds` value generated by script to populate Turbo Tax `Box 1d - Proceeds` field. If you already
imported from E*TRADE, verify value generated by script matches imported one.
- Use `Filing Cost Basis` value generated by script to populate Turbo Tax `Cost basis or adjusted cost basis` field
![Alt text](img/tt-1.png?raw=true "enter total proceeds")
![Alt text](img/tt-2.png?raw=true "enter total cost base")
## Frequently Asked Questions
#### [Q] My lot cost base is still 0, is this expected? <br />
Yes, the merge transaction is different from a normal sale. In general, if the VMW cost basis is lower than $128
(VMW FMV at merge date $196 - Cash received $68) per share, the cost basis is 0. Please refer to the following link for
guidelines on computing
the `filing cost base`: https://investors.broadcom.com/static-files/7720c4c1-c940-4d9d-800c-66819bfdc7a0,
Page 3, 2nd to the last paragraph. Following is an illustrative example:
VMware's FMV at the merge date is $196 per share. Assuming you have 1 VMware share:
- If your cost base is $100, your gain is $196 - $100 = $96. However, you only receive $68 per share, so your capital
gain is $68. Etrade reports total proceeds as $68. If you set the cost base to 0, your capital gain remains $68, for
which you need to pay tax.
- If your cost base is $150, your gain is $196 - $150 = $46. So, your capital gain is $46, even though you receive $68
per share. Etrade reports total proceeds as $68. If you set the cost base to $22, your capital gain remains $46, for
which you need to pay tax.
#### [Q] How do I correct the share acquisition date listed as 1970 in my lot? <br/>
VMware IPOed on August 14, 2007. It's evident that shares acquired in 1970 are incorrect. Please contact E*TRADE to
rectify this issue. In the meantime, if you know the share acquisition date from this lot (row), please update the
Gain&Loss CSV file to set the `Date Acquired` field to the correct value. Also, ensure that the values of other fields
mentioned in the section `Gain&Loss File Fields Consumed by Script` are correct, and update them if needed. Then,
rerun the tool.
## Reference
https://investors.broadcom.com/financial-information/tax-information
## License
This repository is free for non-commercial use. If you intend to use any part of it commercially, please reach out to
me for further discussion.
## Disclaim
The tool is intended for informational and knowledge-sharing purposes only. The author is not a tax professional and
assumes no responsibility or liability for any errors or omissions in the content of this tool.
", Assign "at most 3 tags" to the expected json: {"id":"9313","tags":[]} "only from the tags list I provide: [{"id":77,"name":"3d"},{"id":89,"name":"agent"},{"id":17,"name":"ai"},{"id":54,"name":"algorithm"},{"id":24,"name":"api"},{"id":44,"name":"authentication"},{"id":3,"name":"aws"},{"id":27,"name":"backend"},{"id":60,"name":"benchmark"},{"id":72,"name":"best-practices"},{"id":39,"name":"bitcoin"},{"id":37,"name":"blockchain"},{"id":1,"name":"blog"},{"id":45,"name":"bundler"},{"id":58,"name":"cache"},{"id":21,"name":"chat"},{"id":49,"name":"cicd"},{"id":4,"name":"cli"},{"id":64,"name":"cloud-native"},{"id":48,"name":"cms"},{"id":61,"name":"compiler"},{"id":68,"name":"containerization"},{"id":92,"name":"crm"},{"id":34,"name":"data"},{"id":47,"name":"database"},{"id":8,"name":"declarative-gui "},{"id":9,"name":"deploy-tool"},{"id":53,"name":"desktop-app"},{"id":6,"name":"dev-exp-lib"},{"id":59,"name":"dev-tool"},{"id":13,"name":"ecommerce"},{"id":26,"name":"editor"},{"id":66,"name":"emulator"},{"id":62,"name":"filesystem"},{"id":80,"name":"finance"},{"id":15,"name":"firmware"},{"id":73,"name":"for-fun"},{"id":2,"name":"framework"},{"id":11,"name":"frontend"},{"id":22,"name":"game"},{"id":81,"name":"game-engine "},{"id":23,"name":"graphql"},{"id":84,"name":"gui"},{"id":91,"name":"http"},{"id":5,"name":"http-client"},{"id":51,"name":"iac"},{"id":30,"name":"ide"},{"id":78,"name":"iot"},{"id":40,"name":"json"},{"id":83,"name":"julian"},{"id":38,"name":"k8s"},{"id":31,"name":"language"},{"id":10,"name":"learning-resource"},{"id":33,"name":"lib"},{"id":41,"name":"linter"},{"id":28,"name":"lms"},{"id":16,"name":"logging"},{"id":76,"name":"low-code"},{"id":90,"name":"message-queue"},{"id":42,"name":"mobile-app"},{"id":18,"name":"monitoring"},{"id":36,"name":"networking"},{"id":7,"name":"node-version"},{"id":55,"name":"nosql"},{"id":57,"name":"observability"},{"id":46,"name":"orm"},{"id":52,"name":"os"},{"id":14,"name":"parser"},{"id":74,"name":"react"},{"id":82,"name":"real-time"},{"id":56,"name":"robot"},{"id":65,"name":"runtime"},{"id":32,"name":"sdk"},{"id":71,"name":"search"},{"id":63,"name":"secrets"},{"id":25,"name":"security"},{"id":85,"name":"server"},{"id":86,"name":"serverless"},{"id":70,"name":"storage"},{"id":75,"name":"system-design"},{"id":79,"name":"terminal"},{"id":29,"name":"testing"},{"id":12,"name":"ui"},{"id":50,"name":"ux"},{"id":88,"name":"video"},{"id":20,"name":"web-app"},{"id":35,"name":"web-server"},{"id":43,"name":"webassembly"},{"id":69,"name":"workflow"},{"id":87,"name":"yaml"}]" returns me the "expected json"