DEV Community

Cover image for I Built an Investment Simulator That Models the Journey - Not Just Compound Interest
Sambit Supriya Dash
Sambit Supriya Dash

Posted on AI-assisted

I Built an Investment Simulator That Models the Journey - Not Just Compound Interest

Most investment calculators answer a beautifully simple question:

“If I invest X every month at Y% for Z years, how much will I have?”

But an actual investment journey rarely behaves that neatly.

What happens if you increase your SIP later?

Pause contributions for a year?

Invest a lump sum during the journey?

Withdraw money midway?

Rebalance the portfolio?

Account for taxes?

Or simply start the same plan at a different point in time?

That was the problem that eventually became Investment Journey Simulator v4.4.4, an open-source Python project and interactive web application.

Decisions compound too.

Comparison of two 25-year investment journeys showing continuous contributions versus a 24-month pause after year 5, with final values of about ₹4.74 crore and ₹4.16 crore

The simulator models contributions, SIP step-ups, pauses, lump sums, withdrawals, rebalancing, taxation and changing timelines as part of one investment journey rather than treating investing as a single compound-interest equation.

One feature I particularly wanted was inflation-adjusted value.

Because ₹1 crore twenty years from now may look impressive on the screen — but the more useful question is:

What will that ₹1 crore actually be able to buy?

Nominal wealth tells us how many rupees we may have.

Real wealth asks how much life those rupees can still afford.

The simulator therefore lets the future amount be viewed in today's purchasing-power terms rather than allowing a large nominal number to create a false sense of wealth.

The timeline matters too.

Instead of looking only at one final year, I wanted to see the journey at multiple horizons.

What does the portfolio look like after the early years?

What changes around 5 years?

10 years?

15 years?

25 years?

And how does one decision made halfway through propagate through every later checkpoint?

That makes it possible to compare not only:

Plan A vs Plan B

but also:

the same plan at different moments in its life.

When several decisions change at once

Comparing two journeys gets harder when multiple things change together.

If I pause contributions, make a withdrawal, and rebalance, measuring each change independently can double-count interaction effects and produce explanations that add up to more than the actual difference.

For supported comparisons, the simulator therefore uses Shapley-based attribution: it evaluates how each decision contributes across different combinations, then allocates the interaction effects so the individual contributions reconcile with the actual outcome gap.

Why I open-sourced it

I originally started this for a practical investing problem of my own, but it gradually became much more serious: a simulation engine, interactive Streamlit application, packaged Python project, validation framework and documentation set.

The goal is not to tell anyone what to invest in.

It is to make the consequences of investment decisions easier to explore before those decisions become real money.

The current public release is:

Investment Journey Simulator v4.4.4

It is complete, validated and frozen while I collect real-world feedback.

▶ Try the live simulator: LIVE APP

★ Source, methodology and validation: GITHUB

📖 Project site: PROJECT SITE

⌨ Python package:

pip install investment-journey-simulator

It's open source, and I would especially value criticism around the modelling assumptions.

What real-life investment decision do you think most financial calculators fail to model properly?

Top comments (0)