Product Management
DhanPlan: a retirement calculator that speaks Indian finance
· Updated · 4 min read
S
· Updated · 4 min read
Most retirement calculators are US-bound templates with a rupee symbol. DhanPlan treats Indian instruments — SIP, EPF, PPF, NPS, FIRE — as first-class columns, each with institutional-grade assumptions. It taught me that scope discipline and honest model math beat feature ceilings.
Every retirement calculator I tried asked me about my 401k. I don't have a 401k. Nobody in India has a 401k. What we have is EPF with a ₹2.5L interest-tax threshold, PPF with a 15-year lock-in, NPS with a 60/40 lumpsum-annuity split, and SIPs with step-ups — and not one mainstream calculator models any of it honestly. DhanPlan started as that irritation, and it became the clearest product lesson I've shipped: in a financial product, the model is the product.
We shipped four modules before adding anything else:
Each module gets its own projection logic; the UI is honest that no model predicts a market.
| Parameter | EPF | PPF |
|---|---|---|
| Contribution | 12% basic + DA (employer + employee) | ₹500–1.5L/year voluntary |
| Interest rate | EPFO declared (8.25% FY24) | Govt quarterly (7.1% Q1 FY25) |
| Tax regime (old) | EEE | EEE |
| Tax regime (new) | EET (interest >₹2.5L taxable) | EEE |
| Lock-in | Retirement / 2 months unemployment | 15 years (extendable 5-yr blocks) |
| Withdrawal | Partial: marriage, education, medical | Partial: year 7 onward (50% of balance 4 yrs prior) |
Sources: EPFO notifications, PPF Scheme 1968 (amended), Finance Acts 2020/2023.
Four variants, each with distinct math:
Each uses: target = annual_expenses × 25 (4% SWR) adjusted for Indian inflation (6–7% long-term).
The scoping rule was: a feature must be defensible by two public data points. If we couldn't cite the instrument's mechanics from an official source, it didn't ship. This killed feature-creep in week one.
Tests are part of the product. Breakage here loses trust along with money — we wrote 28 reconciliation tests covering:
| Test category | Count | Examples |
|---|---|---|
| Year-cap boundaries | 6 | EPF ₹2.5L interest threshold, PPF ₹1.5L contribution cap |
| Tax regimes | 8 | Old vs new regime for each instrument, LTCG grandfathering |
| Inflation scenarios | 5 | 4%, 6%, 7%, 8%, variable year-by-year |
| Year-cap transitions | 4 | EPF interest taxability at ₹2.5L, NPS Tier I lumpsum tax |
| FIRE variants | 5 | Coast/Lean/Fat/Barista convergence tests |
Each test is a known-input → expected-output assertion against the projection engine. CI runs them on every push.
We added a "real growth" column to every projection row: nominal_return - inflation. Users who saw their ₹1Cr corpus becoming ₹40L in today's money at 6% inflation over 20 years — that column drove 3× more return visits than the nominal projection alone. Mental accounting hates hidden inflation; surfacing it builds trust.
The engine is a pure TypeScript library — no framework dependencies, runs in browser or Node. Core abstraction:
// projection-engine.ts
interface Instrument {
project(inputs: Inputs, years: number): ProjectionRow[];
}
interface ProjectionRow {
year: number;
nominalValue: number;
realValue: number; // inflation-adjusted
contributed: number;
inflationRate: number;
realGrowth: number; // the retention wedge
}
class SIPEngine implements Instrument {
project(inputs: SIPInputs, years: number): ProjectionRow[] {
const rows: ProjectionRow[] = [];
let corpus = 0;
let contributed = 0;
for (let y = 1; y <= years; y++) {
const monthlySIP = inputs.monthlyAmount * Math.pow(1 + inputs.stepUpRate, y - 1);
const annualContribution = monthlySIP * 12;
contributed += annualContribution;
// Compound with inflation-adjusted return
const realRate = (1 + inputs.equityCAGR) / (1 + inputs.inflation) - 1;
corpus = corpus * (1 + inputs.equityCAGR) + annualContribution;
const realValue = corpus / Math.pow(1 + inputs.inflation, y);
rows.push({
year: y,
nominalValue: corpus,
realValue,
contributed,
inflationRate: inputs.inflation,
realGrowth: realValue - contributed
});
}
return rows;
}
}
Each module (SIP, EPF, PPF, NPS, FIRE) implements Instrument with its own rules — caps, tax regimes, withdrawal rules. The orchestrator just calls project() on each and merges by year.
# .github/workflows/test.yml
name: Projection Tests
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with: { node-version: '20' }
- run: npm ci
- run: npm test -- --coverage
- name: Check reconciliation
run: |
# EPF year-cap boundary
node -e "
const { EPFEngine } = require('./dist');
const out = new EPFEngine().project({basic: 15000, da: 5000}, 30);
const final = out[out.length-1];
// Interest cap at ₹2.5L/yr should trigger
console.assert(final.interestAccrued <= 250000 * 30);
"
Coverage threshold: 90% on projection logic, 100% on tax math.
DhanPlan lives on the projects page. For the product-method side, data decisioning and scope from discovery are the PM muscle this product practices.