Background:​
​
I’ve been dabbling in investments since the early days of my professional career, but like many, much of these early investments were depleted in my late twenties and early thirties catering to life’s various milestones , like — paying off my B-School loan, financing my wedding, my first car, and a house down payment. Now, as I approach my mid-thirties, my investment portfolio looking leaner than what I’d want it to, I find my social media feeds increasingly inundated with ‘fin-fluencers’ sharing how economic-doom is just around the corner (with the courses they are selling pitched as the only salvation). This constant barrage has led to more than a few sleepless nights.
​
While I always had a rough idea of the numbers, I couldn’t find a tool that effectively calculated and visualized the corpus I need to build over time for a semblance of financial security. Existing ‘FIRE’ and retirement calculators were either too simplistic or lacked the interactive features necessary to model different scenarios.
​
I NEEDED TO BUILD MY OWN TOOL…
​
The problem? My coding skills were practically nonexistent.
​
Enter ChatGPT-4o and a suite of other GenAI bots available through Poe.com’s GenAI aggregator, along with the ‘Carnets’ Python environment on my iPad.
So one fine evening, after wrapping up work and dinner, with ChatGPT as my guide and Python as my vessel, I embarked on a late-night coding adventure. What emerged from that journey is the interactive “FIRE” calculator I’m excited to share with you below.
​
If you want to explore the prompts that I used and the actual code that was generated for the Python application, head over to my Medium blog
For a little less visually appealing, but equally functional and ready-to-use version, check out the app below.
P.S. : This version was created using HTML, CSS and Javascript code (based on the original Python script) that was generated using ChatGpt as well.​​
​​​​
Assumptions:
​
-
Earning Toggle: The user is assumed to be earning a salary (and investing a fixed % of it based on the slider input) until the ‘target_retirement_age’. After this age, the user is considered retired and no longer earning a salary (or making any further active investments into the corpus).
-
Salary Growth Rate: The annual salary grows at the ‘salary_growth_rate’ until retirement.The initial growth rate (for the first 5 years) is set using the slider and subsequently, it reduces by 1/5th every 5 years, starting from the 6th year.
-
Annual Investments and Expenses: A fixed percentage (percent_earnings_invested) of the annual salary is invested each year until retirement. The remaining salary is spent as pre-retirement annual expenses. Note that the post-retirement annual expenses (at current prices), whose inflation adjusted value would determine the post-retirement withdrawals, would be much lesser and is set as a fixed value using the slider input.
-
Future Value of Investments: The future value of investments is calculated based on the returns on the investments made till retirement (annual_returns_pre_retirement). The sum of all the FVs of annual investments till the ‘target_retirement_age’ determines the corpus at retirement.
-
Annual Inflation Rate: The initial inflation rate (initial_inflation_rate) set using the slider input, decreases by 1/6th every 5 years (as the economy maures) starting from the 6th year.
-
Future Value of Estimated Expenses: The equivalent post retirement annual expenses (set at current prices at year 0, using the slider input) adjusted for inflation each year using the annual inflation rate.
-
Spending Toggle: After retirement, the user is assumed to start spending from their corpus based on the inflated post-retirement expenses.
-
Total Corpus Calculation: The total corpus initially consists of the cumulative future value of investments at retirement.
Post-retirement, the corpus grows based on passive annual returns (annual_returns_post_retirement) and decreases due to withdrawals (for the inflation adjusted post-retirement expenses).