Design a SIP Calculator and Investment Tracker

Problem

Design an OOP model for a SIP (Systematic Investment Plan) calculator and portfolio tracker.

Requirements

  • createSIP(userId, fundId, monthlyAmount, startDate, duration) → sipId
  • processMonthlyInstalment(sipId, navOnDate) — buys units at current NAV
  • getPortfolioValue(userId, currentNAVMap) — total current value
  • getXIRR(sipId) — annualised return
  • pauseSIP(sipId) / stopSIP(sipId)

Key classes

SIP, Fund, Transaction, Portfolio, NAVHistory, XIRRCalculator

Design considerations

  • Floating point precision for NAV and units (use BigDecimal)
  • Immutable transaction records
  • XIRR computed via Newton-Raphson iteration

Extension

Add lump sum investment support alongside SIP.

added …
LeaderboardSalaryAccount