Awingfu / web-finance-app

2 stars 1 forks source link

feature request: consider adding after-tax contribution option to 401k calculators #25

Open davidxia opened 1 year ago

davidxia commented 1 year ago

Some 401(K) plans allow after-tax contributions. This might be a useful feature to add to the two 401(K) calculators. I added here to the frontloader. Here's the code.

Awingfu commented 1 year ago

Thanks! The code looks good, and I'll try to integrate the logic in the next few weeks. I hope my original code wasn't too hard to read haha.

My next 3 priorities are:

  1. Abstracting the table data logic into it's own class/function to make the code easier to read and to account for different strategies and options.
  2. Add the After-tax option
  3. Potentially consolidate the 401k calculators and just have a strategy option/toggle.
davidxia commented 1 year ago

It was pretty easy to follow. I don't know React or JS that much so was just pattern-matching to get it working. Feel free to ask me any questions on my code. It's not polished. Your next steps sgtm. I can help test out stuff too.

I have a Google sheet where I modified the front-loading strategy to prioritize front-loading after-tax contributions before 401(K) contributions. Here's the reasoning. For plans that don't allow in-service withdrawals like ours, 401(K) contributions are locked up until employee quits. The fund selections aren't great. After-tax contributions can be rolled out anytime to IRAs (principal to Roth, gains to traditional IRA to avoid taxes). One can invest in more things with IRAs and can be more aggressive. My sheet's formulae were a lot more complicated though, and I haven't figured out how to simplify it and translate it into this calculator logic.

Here's an example with $180K annual salary. Lmk if you want me to file another feature request with this idea.

image

image

Awingfu commented 1 year ago

Thanks for the info! Yeah, prioritizing the MBD roth makes sense. Do you mind making a copy of the doc and sending it over to me? The math was already non intuitive without the MBD, so looking at a working implementation may help me formulate how we can add that logic in.

davidxia commented 1 year ago

Public copy here. The formula in C28 down can probably be simplified. Lmk if you need anything else!

Awingfu commented 1 year ago

Thanks I cloned it to my own drive. Yeah I think I have to take a different approach to my table logic to reflect that excel sheet.

Also, in theory, one could only put the needed contributions to pretax/roth to get the match, then max the after tax portion (and not try to hit the 22500 max on the pretax/roth) which may add additional complexity.

Edit: But users can set the max for the traditional/roth in the calculator separately anyways so its a non issue.