Ask someone how long their retirement money will last, and most calculators answer with an average: assume 10% returns, assume 6% inflation, divide, and hand over a number of years. The SWP Simulator on this site refuses to do that. Instead it replays history — your fund's actual, day-by-day price record — and sells units, withdrawal by withdrawal, until the money runs out or the record ends. There is no average anywhere in the machine. Here is what it actually does, step by step, because this is the tool's own code, read and described as it runs.
Every simulation starts the same way a real investment does: with a lump sum on a date. You enter the amount and the date, and the tool looks up the fund's Net Asset Value — the per-unit price — on that date, from the fund's full NAV history supplied by the mfapi.in public API. If the date you picked was a Sunday, a holiday, or any other day the market was shut, there is no NAV for that day, so the tool takes the nearest previous NAV instead — the price you would actually have paid. Your lump sum is divided by that NAV to give the units you own. A ₹10 lakh investment in a fund priced at ₹100 buys 10,000 units, and from here on the tool thinks in units, not rupees, exactly the way a mutual fund does.
Next the tool builds your withdrawal calendar. The dates are anchored to your chosen start date, so a monthly plan starting on the 5th withdraws on the 5th of every month, with no drift toward month-end — and the end date is inclusive, with no overshoot past it. The schedule supports monthly, quarterly, yearly, weekly and fortnightly plans. Then it walks the calendar one date at a time. At each withdrawal date it again takes the nearest previous NAV, works out what your remaining units are worth at that price, and computes the withdrawal: either a fixed rupee amount, or a percentage of the current balance. If you set an annual step-up — say 5% — the withdrawal grows by that much once every twelve months from the start date, compounding quietly in the background, the way rising living costs do in real life.
Each withdrawal is a sale. The tool divides the withdrawal amount by the NAV on that date to find how many units must be sold, subtracts them from your holding, and records the whole event in a table: the withdrawal date, the NAV used, the units sold, the units remaining and the balance left. If a withdrawal is bigger than what is left — the moment every retiree quietly dreads — the tool sells everything, pays out the remaining balance, and stops. The plan is over, and the table shows exactly when. If the money survives to the end of the schedule, the units still held are valued at the latest available NAV. Nothing in the simulation is smoothed or averaged: every number in the table comes from a real NAV on a real date, and the wobbles of the market — the crashes, the rallies, the flat years — are all in there, because they were in the price history.
Every simulation ends with an XIRR — the annualised return of the whole plan, computed from the dated cashflows. And here is the small, honest bug that the web version fixed. The original Python app that this site was ported from computed XIRR from the withdrawals alone, leaving out the corpus still held at the end. For a plan that ran dry, that was fine — there was nothing left to count. But for a plan that ended with money still in it, the leftover corpus simply vanished from the return calculation, which made the XIRR meaningless for exactly the plans that had done well. The web version adds the remaining value, at the latest NAV, as a final cashflow — the code even carries a comment explaining why. It is a one-line fix with an outsized effect: the difference between a return that describes your whole plan and one that quietly ignores the money you kept.
A replay is not a forecast, and the tool is honest about that in its design. Past NAV is history, not a promise — a fund that survived twenty years of withdrawals may not survive the next twenty. The simulation ignores taxes and exit loads, and it can only replay as far back as the fund's NAV record goes. What it gives you instead of a prediction is a stress test against reality: pick a fund, pick a start date in a bad year, and watch what actually would have happened to your money. That is the whole point of building it this way — not to tell you the future, but to show you the past, withdrawal by withdrawal, so you can judge the plan with your eyes open.
The SWP Simulator is a replay machine, not a crystal ball: real NAV history in, units out, one withdrawal at a time, with the balance tracked to the rupee and the return computed on everything — including what is left at the end. If you want to see what your own plan would have survived, the tool is free, runs entirely in your browser, and your numbers never leave your device.
Related on Poptani Labs: Step-up SIPs: the small annual bump that can add lakhs to your corpus, Credit scores: what actually moves the number (and the myths that don't). More in this category: Built in the Lab.
Sources: Poptani Labs, 'SWP Simulator', mfapi.in, NAV history API used by the simulator