Your country

Tools that support it use your country for local currency, number formats, units and paper size. Your choice is saved only in this browser.

Type a name or a two-letter code. Use the up and down arrow keys to move through the countries, Enter to choose one and Escape to close.

Personal Finance for India  Module 7 – Investing foundations (education only)

SIPs, STPs and SWPs: mechanics and behaviour

How SIPs, step-up SIPs, STPs and SWPs buy and sell units, how to find a SIP's XIRR, what rupee-cost averaging cannot do, and why withdrawals fear early falls.

  • Intermediate
  • 20 minutes
  • Examples run with Python 3.14.8
  • By MySmartCoPilot
Free: 20 minutes

What you will learn

  • Model the cash flows of a SIP, a step-up SIP, an STP and an SWP
  • Set up the dated cash flows that give a SIP's XIRR when instalments change, arrive late or fail
  • Explain what rupee-cost averaging does, without overstating it
  • Work out the taxable gain inside an SWP payment
  • Test whether a withdrawal plan survives a bad sequence of returns

Before you start

Twelve instalments of ₹5,000 into an invented fund whose NAV fell from ₹20 to ₹12 and recovered only to ₹16 were worth ₹65,027 at the end of the year. The same ₹60,000 invested at once in the first month was worth ₹48,000: same fund, same money, and the only difference is when the units were bought.

This lesson takes apart four ways of moving money on a schedule: the SIP, the step-up SIP, the STP from one scheme to another and the SWP that pays you from a scheme. It works out units, XIRR and the taxable gain inside a withdrawal, shows what rupee-cost averaging can and cannot do, and tests a withdrawal plan against bad years. It is education only: every scheme, NAV and return in it is invented or synthetic, it names no fund, and nothing in it is a forecast or a recommendation.

A SIP is a way of paying, not a product

A systematic investment plan (SIP): The same amount invested at regular intervals, usually every month. Its value at the end is the future value of an annuity due, because each instalment goes in at the start of its month. More in “Time value of money: PV, FV and annuities” is an instruction, not an investment of its own: it buys units of an ordinary scheme, at that scheme’s NAV, with the same costs as any other purchase. SEBI’s investor site lists the SIP, and the SWP that works the other way, among the facilities for investing or redeeming “in a systematic manner”, and the format SEBI sets for a scheme information document lists SIP, STP and SWP as facilities a scheme may offer. Each instalment is a separate purchase. SEBI’s consolidated circular for mutual funds (paragraph 9.4.3) gives a purchase in most schemes the closing NAV of the day its money reaches the scheme’s account by 3 p.m.; money that arrives later buys at the next business day’s NAV. Step through a year of one invented SIP:

Interactive · message by message One SIP, month by month Step through a year of ₹5,000 instalments into an invented scheme and watch the same money buy more units when the NAV is low.
One SIP, month by month, step 6 of 6. Messages so far: Your bank to The scheme: ₹5,000; The scheme to Your folio: 250.000 units; The scheme to Your folio: 416.667 units.Your bankmandate registeredThe schemeNAV ₹16.00Your folio4,064.179 units₹5,000250.000 units416.667 units

The drawing shows the whole scene; its 6 steps are listed below.

Every step as text
  1. The mandate. You register a SIP of ₹5,000 a month and a mandate that lets the fund house debit your bank account on the SIP date. Nothing is bought yet.
  2. Month 1. ₹5,000 is debited and reaches the scheme's account before 3 p.m., so it buys at that day's closing NAV of ₹20.00.
  3. Units for month 1. Units are the amount divided by the NAV, ₹5,000 ÷ ₹20.00 = 250.000 units, added to your folio.
  4. Month 5, a low NAV. The NAV has fallen to ₹12.00. The same ₹5,000 now buys 416.667 units, two thirds more than in month 1.
  5. A failed debit. Suppose a debit fails because the account is short. No money reaches the scheme, so no units are bought that month; whether the plan carries on is set by the fund house's SIP terms.
  6. Month 12. With all twelve instalments paid, ₹60,000 has bought 4,064.179 units, worth ₹65,027 at the last NAV of ₹16.00. The units differ every month; the amount never did.

The amount stayed at ₹5,000 every month while the units changed with the NAV: 250.000 at ₹20.00, 416.667 at ₹12.00. A debit that fails buys nothing, so a missed month is simply a month with no units. Whether the plan carries on after one or more failed debits is set by the fund house in its SIP terms, so read them before you register the mandate.

Checkpoint

Check: How a SIP instalment buys units

  1. Question 1 of 2 An instalment of ₹5,000 reaches the scheme by 3 p.m. on a day the NAV closes at ₹12.50. How many units does it buy?

    Type a number.

    A hint

    Units are the amount divided by the NAV of the day.

    Show the answer: Question 1 of 2

    Answer: 400 units

    ₹5,000 ÷ ₹12.50 = 400 units. At ₹20.00 the same instalment bought 250 units; the amount stays the same and the units change with the NAV.

  2. Question 2 of 2 An instalment for a non-liquid scheme reaches the scheme's account at 4 p.m. on a business day. Which NAV does it buy at?

    Choose one answer.

    Show the answer: Question 2 of 2

    Answer: The closing NAV of the next business day

    SEBI's consolidated circular gives a purchase in schemes other than liquid and overnight ones the closing NAV of the day its money is available to the scheme, with a 3 p.m. cut-off for the credit.

Rupee-cost averaging lowers the average cost, and promises nothing more

A fixed amount buys more units at a low NAV and fewer at a high one. So the average cost of your units, the money paid divided by the units bought, always ends up below the plain average of the NAVs, unless every NAV was the same. That effect is rupee-cost averaging: Investing the same amount at regular intervals, so that low prices buy more units and high prices fewer. The average cost of a unit ends below the average price, but no gain is promised: that depends on the price at the end.. The program runs the SIP of the figure above and then two more invented paths, each against the same ₹60,000 invested in month 1:

Twelve instalments against one lump sum, on three invented NAV paths Python · averaging.py
"""Rupee-cost averaging: twelve SIP instalments against one lump sum, on three invented NAV paths.

A SIP instalment buys units at the NAV of its day: units = instalment ÷ NAV. A fixed amount buys more units when the
NAV is low and fewer when it is high, so the average cost of a unit (money paid ÷ units bought) is the harmonic mean
of the NAVs, which is never above their plain average. Whether the plan gains still depends only on the last NAV
against that average cost. The NAVs are invented; units are rounded to three decimals; stamp duty and tax are left
aside. Decimal arithmetic, rounding half up.
"""

from decimal import ROUND_HALF_UP, Decimal

INSTALMENT = Decimal(5000)
PATHS = {
    "A, falls and partly recovers": ["20", "18", "16", "14", "12", "12", "13", "14", "15", "15", "16", "16"],
    "B, rises steadily": ["20", "20.5", "21", "21.5", "22", "22.5", "23", "23.5", "24", "24.5", "25", "25.5"],
    "C, falls and stays down": ["20", "19", "18", "17", "16", "15", "14", "13", "12", "12", "12", "12"],
}


def inr(amount):
    value = int(Decimal(amount).quantize(Decimal("1"), rounding=ROUND_HALF_UP))
    sign, digits = ("−" if value < 0 else ""), str(abs(value))
    head, tail = digits[:-3], digits[-3:]
    groups = []
    while len(head) > 2:
        groups.insert(0, head[-2:])
        head = head[:-2]
    if head:
        groups.insert(0, head)
    return sign + "₹" + ",".join(groups + [tail])


def pct(x):
    value = (x * 100).quantize(Decimal("0.1"), rounding=ROUND_HALF_UP)
    return ("+" if value > 0 else "−" if value < 0 else "") + f"{abs(value)} %"


def money2(x):
    return "₹" + str(Decimal(x).quantize(Decimal("0.01"), rounding=ROUND_HALF_UP))


def units_for(amount, nav):
    return (amount / nav).quantize(Decimal("0.001"), rounding=ROUND_HALF_UP)


# Part 1: path A month by month.
navs = [Decimal(n) for n in PATHS["A, falls and partly recovers"]]
print(f"1. Path A: {inr(INSTALMENT)} at the NAV of each month")
print(f"{'Month':>5}{'NAV':>8}{'Units bought':>14}{'Units so far':>14}")
total = Decimal(0)
for month, nav in enumerate(navs, start=1):
    units = units_for(INSTALMENT, nav)
    total += units
    print(f"{month:>5}{money2(nav):>8}{units:>14}{total:>14}")
paid = INSTALMENT * len(navs)
print(f"Paid in {inr(paid)}; {total} units, worth {inr(total * navs[-1])} at the last NAV of {money2(navs[-1])}.")
lump_units = units_for(paid, navs[0])
print(f"The same {inr(paid)} at once in month 1: {lump_units} units, worth {inr(lump_units * navs[-1])}.")

# Part 2: the three paths side by side.
print()
print("2. Average NAV, average cost of a unit and the result, path by path")
print(f"{'Path':<30}{'Avg NAV':>9}{'Avg cost':>10}{'SIP end':>11}{'SIP':>9}{'Lump end':>11}{'Lump':>9}")
for name, path in PATHS.items():
    navs = [Decimal(n) for n in path]
    units = sum(units_for(INSTALMENT, nav) for nav in navs)
    paid = INSTALMENT * len(navs)
    avg_nav = sum(navs) / len(navs)
    avg_cost = paid / units
    sip_end = units * navs[-1]
    lump_end = units_for(paid, navs[0]) * navs[-1]
    print(
        f"{name:<30}{money2(avg_nav):>9}{money2(avg_cost):>10}{inr(sip_end):>11}{pct(sip_end / paid - 1):>9}"
        f"{inr(lump_end):>11}{pct(lump_end / paid - 1):>9}"
    )
print("In every path the average cost is below the average NAV; the SIP gains only where the last NAV is above it.")

Output

1. Path A: ₹5,000 at the NAV of each month
Month     NAV  Units bought  Units so far
    1  ₹20.00       250.000       250.000
    2  ₹18.00       277.778       527.778
    3  ₹16.00       312.500       840.278
    4  ₹14.00       357.143      1197.421
    5  ₹12.00       416.667      1614.088
    6  ₹12.00       416.667      2030.755
    7  ₹13.00       384.615      2415.370
    8  ₹14.00       357.143      2772.513
    9  ₹15.00       333.333      3105.846
   10  ₹15.00       333.333      3439.179
   11  ₹16.00       312.500      3751.679
   12  ₹16.00       312.500      4064.179
Paid in ₹60,000; 4064.179 units, worth ₹65,027 at the last NAV of ₹16.00.
The same ₹60,000 at once in month 1: 3000.000 units, worth ₹48,000.

2. Average NAV, average cost of a unit and the result, path by path
Path                            Avg NAV  Avg cost    SIP end      SIP   Lump end     Lump
A, falls and partly recovers     ₹15.08    ₹14.76    ₹65,027   +8.4 %    ₹48,000  −20.0 %
B, rises steadily                ₹22.75    ₹22.62    ₹67,644  +12.7 %    ₹76,500  +27.5 %
C, falls and stays down          ₹15.00    ₹14.50    ₹49,672  −17.2 %    ₹36,000  −40.0 %
In every path the average cost is below the average NAV; the SIP gains only where the last NAV is above it.

Recorded with Python 3.14.8 on macOS 26 arm64. To run it yourself: mise exec python@3.14.8 -- python3 averaging.py

On every path the average cost is below the average NAV: ₹14.76 against ₹15.08 on path A. Now look at what decides the result. On path A, which fell and partly recovered, the SIP gained 8.4 % while the lump sum lost 20.0 %. On path B, which rose steadily, the lump sum gained 27.5 % and the SIP only 12.7 %, because most of the SIP’s money went in at higher prices. On path C, which fell and stayed down, the SIP still lost 17.2 %.

Believing a SIP cannot lose money

Wrong: “a SIP averages out the falls, so it cannot end in a loss”. Right: path C fell and stayed down, and its SIP lost 17.2 %. Averaging made the loss smaller than the lump sum’s 40.0 % on that path, but it was still a loss, and on the steadily rising path the lump sum ended ahead.

A SIP gains when the last NAV is above its average cost, and nothing in the plan makes that happen. What averaging does give is a lower cost for the units you end up holding, and a plan that keeps buying in the months when buying feels hardest.

Key idea

Rupee-cost averaging makes your average cost lower than the average price; whether you gain still depends on the price at the end against that cost.

Checkpoint

Check: What rupee-cost averaging does

  1. Question 1 of 2 Three instalments of ₹6,000 buy at NAVs of ₹10, ₹15 and ₹30. What is the average cost of a unit, in rupees?

    Type a number.

    A hint

    Add the units bought (600, 400 and 200), then divide the money paid by them.

    Show the answer: Question 1 of 2

    Answer: 15 rupees a unit (anything from 14.99 to 15.01 counts)

    ₹18,000 bought 600 + 400 + 200 = 1,200 units, so a unit cost ₹15.00 on average. The plain average of the three NAVs is ₹18.33: the cheap month bought the most units.

  2. Question 2 of 2 A SIP's units cost ₹14.50 on average, below the average NAV of ₹15.00 over the same months. The NAV today is ₹13.00. What is the position?

    Choose one answer.

    Show the answer: Question 2 of 2

    Answer: A loss of about 10.3 %: the NAV today is below the average cost

    The value of the units is units × ₹13.00 and what they cost is units × ₹14.50, so the plan is down 10.3 %, as path C of the lesson's program was down 17.2 % although its average cost was below its average NAV.

A step-up SIP raises the instalment, and a projection is only an assumption

A step-up SIP: A SIP whose instalment rises by a set percentage or amount every year, for example ₹5,000 a month in the first year and 10 % more in each later year, so that saving can follow a rising income. raises the instalment every year, by a percentage or an amount, so that saving can follow a rising salary. ₹5,000 a month stepped up 10 % a year is ₹11,790 a month by the tenth year, and puts in ₹9,56,245 over ten years against a flat plan’s ₹6,00,000. What either plan will be worth is not known: a projection takes an assumed return and does the arithmetic. The model below is the flat plan at an assumed 9 % a year. With interest added yearly it treats 9 % as an effective yearly rate, as this lesson does, and adds each ₹5,000 at the end of its month. Move the rate to 6 % and then to 12 %, and read the balance each time:

Interactive · change it and see ₹5,000 a month for 10 years at an assumed yearly return Set a starting amount, a yearly rate, how often interest is added and an amount added at the end of every month.
Balance and money paid in, year by year: amount (INR) against years.024681002 L4 L6 L8 L10 Lyearsamount (INR)balancepaid in

₹0 plus ₹5,000 a month at 9 % a year grows to ₹9,48,593 in 10 years; ₹3,48,593 of it is interest.

Balance after 10 years ₹9,48,593
Paid in ₹6,00,000
Interest earned ₹3,48,593
Effective yearly rate 9.00 %
The numbers as a table
Balance at the end of each year
YearPaid inBalance
1₹60,000₹62,436
2₹1,20,000₹1,30,492
3₹1,80,000₹2,04,673
4₹2,40,000₹2,85,530
5₹3,00,000₹3,73,664
6₹3,60,000₹4,69,731
7₹4,20,000₹5,74,443
8₹4,80,000₹6,88,579
9₹5,40,000₹8,12,988
10₹6,00,000₹9,48,593

At 6 % the model shows ₹8,12,367, at 9 % ₹9,48,593 and at 12 % ₹11,09,650, from the same ₹6,00,000 paid in. The program projects both plans with instalments at the start of each month, as SIP instalments usually are, and then takes three instalments away:

A flat and a step-up SIP at three assumed returns, and three missed instalments Python · stepup_projection.py
"""A flat SIP and a step-up SIP projected at three assumed returns, and what missed instalments do.

Every projection here is arithmetic on an assumption, not a forecast. The convention is stated: the assumed return is
an effective yearly rate, so the monthly rate is (1 + r)^(1/12) − 1 and twelve months multiply to exactly 1 + r;
instalments go in at the start of each month (an annuity due). The step-up raises the instalment by 10 % at the start
of every year. Part 3 also gives the end-of-month values, the convention of the model on the lesson's page. Decimal
arithmetic, rounding half up to the rupee.
"""

from decimal import ROUND_HALF_UP, Decimal, getcontext

getcontext().prec = 40
START = Decimal(5000)
YEARS = 10
STEP_UP = Decimal("0.10")
RATES = [Decimal("0.06"), Decimal("0.09"), Decimal("0.12")]


def inr(amount):
    value = int(Decimal(amount).quantize(Decimal("1"), rounding=ROUND_HALF_UP))
    sign, digits = ("−" if value < 0 else ""), str(abs(value))
    head, tail = digits[:-3], digits[-3:]
    groups = []
    while len(head) > 2:
        groups.insert(0, head[-2:])
        head = head[:-2]
    if head:
        groups.insert(0, head)
    return sign + "₹" + ",".join(groups + [tail])


def monthly_rate(r):
    return (1 + r) ** (Decimal(1) / 12) - 1


def project(rate, step_up=Decimal(0), skip=(), start_of_month=True):
    """Corpus after YEARS, with instalments rising by step_up each year; months in skip pay nothing."""
    g = 1 + monthly_rate(rate)
    balance = paid = Decimal(0)
    for month in range(1, YEARS * 12 + 1):
        amount = START * (1 + step_up) ** ((month - 1) // 12)
        if month in skip:
            amount = Decimal(0)
        if start_of_month:
            balance = (balance + amount) * g
        else:
            balance = balance * g + amount
        paid += amount
    return balance, paid


print(f"1. {inr(START)} a month for {YEARS} years, flat or stepped up 10 % every year (start of each month)")
print(f"{'Assumed return':<16}{'Flat: paid':>13}{'Flat: corpus':>15}{'Step-up: paid':>16}{'Step-up: corpus':>18}")
for r in RATES:
    flat, flat_paid = project(r)
    step, step_paid = project(r, STEP_UP)
    print(f"{f'{r * 100:.0f} % a year':<16}{inr(flat_paid):>13}{inr(flat):>15}{inr(step_paid):>16}{inr(step):>18}")
print(f"The instalment of the step-up plan in year {YEARS}: {inr(START * (1 + STEP_UP) ** (YEARS - 1))} a month.")

print()
print("2. Three instalments missed in year 2 (months 13 to 15), at an assumed 9 %")
full, full_paid = project(RATES[1])
missed, missed_paid = project(RATES[1], skip={13, 14, 15})
print(f"All 120 paid: {inr(full_paid)} in, {inr(full)} at the end.")
print(f"117 paid:     {inr(missed_paid)} in, {inr(missed)} at the end: {inr(full - missed)} less, the {inr(full_paid - missed_paid)} not paid and its growth.")

print()
print("3. The flat plan with each instalment at the end of its month instead (one month less growth for each)")
for r in RATES:
    end, _ = project(r, start_of_month=False)
    print(f"{f'{r * 100:.0f} % a year':<16}{inr(end):>15}")

Output

1. ₹5,000 a month for 10 years, flat or stepped up 10 % every year (start of each month)
Assumed return     Flat: paid   Flat: corpus   Step-up: paid   Step-up: corpus
6 % a year          ₹6,00,000      ₹8,16,321       ₹9,56,245        ₹12,43,135
9 % a year          ₹6,00,000      ₹9,55,430       ₹9,56,245        ₹14,23,617
12 % a year         ₹6,00,000     ₹11,20,179       ₹9,56,245        ₹16,34,449
The instalment of the step-up plan in year 10: ₹11,790 a month.

2. Three instalments missed in year 2 (months 13 to 15), at an assumed 9 %
All 120 paid: ₹6,00,000 in, ₹9,55,430 at the end.
117 paid:     ₹5,85,000 in, ₹9,23,084 at the end: ₹32,346 less, the ₹15,000 not paid and its growth.

3. The flat plan with each instalment at the end of its month instead (one month less growth for each)
6 % a year            ₹8,12,367
9 % a year            ₹9,48,593
12 % a year          ₹11,09,650

Recorded with Python 3.14.8 on macOS 26 arm64. To run it yourself: mise exec python@3.14.8 -- python3 stepup_projection.py

At 9 % the flat plan reaches ₹9,55,430 and the step-up plan ₹14,23,617; at 12 % the step-up plan reaches ₹16,34,449. Three instalments missed in the second year leave ₹32,346 less at the end at 9 %: the ₹15,000 not paid and the growth it would have earned. In the program the plan carries on with three fewer purchases.

Read every projection as a range

A projection should state the assumed return, whether that rate is effective or divided by 12, and whether instalments come at the start or the end of the month. Then look at two or three rates, not one: the flat plan above ends anywhere from ₹8,16,321 to ₹11,20,179 on the same instalments.

SIP Calculator (India) Project a SIP or a step-up SIP at the rates you choose, with the rate taken as effective or divided by 12.

Checkpoint

Check: Step-up SIPs and projections

  1. Question 1 of 2 A step-up SIP starts at ₹4,000 a month and rises 10 % at the start of every year. What is the monthly instalment in the third year, in rupees?

    Type a number.

    A hint

    Two step-ups have happened by the third year.

    Show the answer: Question 1 of 2

    Answer: 4840 rupees a month

    ₹4,000 × 1.10 × 1.10 = ₹4,840. The lesson's ₹5,000 plan reaches ₹5,000 × 1.10⁹ = ₹11,790 in its tenth year.

  2. Question 2 of 2 Which of these should a SIP projection state beside its result? Choose all that apply.

    Choose every answer that is right.

    Show the answer: Question 2 of 2

    Answer:

    • Whether the rate is effective or divided by 12
    • The assumed return
    • Whether instalments come at the start or the end of each month

    A projection is only as honest as what it states: the assumed rate, its convention and the timing of instalments, and ideally two or three rates rather than one.

XIRR measures a SIP whose dates and amounts vary

Real SIPs are untidy. Instalments change with a step-up, a debit goes through a few days late, another fails. XIRR: The yearly rate at which dated cash flows, each discounted to the first date on a 365-day year, add up to zero. It fits SIPs and any money paid in or taken out on different days. More in “Measuring returns: absolute, CAGR and XIRR” handles all of it, because it works on the cash flows themselves: each amount with its own date, money paid in as a negative number and today’s value as a positive one, as measuring returns set out. The program builds the flows of an invented step-up SIP of 24 monthly instalments, ₹5,000 in the first year and ₹5,500 in the second, with instalments 5 and 9 late and instalment 15 failed, and values the holding two years after the first instalment:

The XIRR of an invented step-up SIP with late and failed instalments Python · xirr_stepup.py
"""The XIRR of an invented step-up SIP with two late instalments and one that failed.

Twenty-four instalments were due a month apart: ₹5,000 in the first year and ₹5,500 in the second, a 10 % step-up.
Instalment 5 went in 4 days late, instalment 9 six days late, and instalment 15 failed, so it bought nothing and is
not a cash flow at all. Each instalment bought units at the invented NAV of its day; the holding is valued on day 730.
Days are counted from the first instalment. XIRR, as the spreadsheet function defines it, is the yearly rate at which
every dated flow, discounted to day 0 on a 365-day year, adds up to zero (money paid in negative, the value positive).
Decimal arithmetic, units to three decimals, rounding half up.
"""

from decimal import ROUND_HALF_UP, Decimal, getcontext

getcontext().prec = 40
DUE = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365, 396, 424, 455, 485, 516, 546, 577, 608, 638, 669, 699]
LATE = {5: 4, 9: 6}   # instalment number: days late
FAILED = {15}         # instalment numbers whose debit failed
NAVS = ["40.00", "39.10", "38.40", "37.20", "36.10", "35.40", "34.60", "34.00", "34.90", "36.20", "37.10", "38.30",
        "39.00", "39.80", "40.60", "41.20", "40.10", "41.70", "42.90", "43.60", "44.20", "45.10", "45.80", "46.40"]
VALUE_DAY, VALUE_NAV = 730, Decimal("46.80")


def inr(amount, paise=False):
    q = Decimal("0.01") if paise else Decimal("1")
    value = Decimal(amount).quantize(q, rounding=ROUND_HALF_UP)
    whole, _, frac = str(abs(value)).partition(".")
    head, tail = whole[:-3], whole[-3:]
    groups = []
    while len(head) > 2:
        groups.insert(0, head[-2:])
        head = head[:-2]
    if head:
        groups.insert(0, head)
    return ("−" if value < 0 else "") + "₹" + ",".join(groups + [tail]) + (("." + frac) if paise else "")


def pct(x, places="0.01"):
    value = (x * 100).quantize(Decimal(places), rounding=ROUND_HALF_UP)
    return ("−" if value < 0 else "") + f"{abs(value)} %"


def xnpv(rate, flows):
    return sum(Decimal(p) / (1 + rate) ** (Decimal(d) / 365) for d, p in flows)


def xirr(flows):
    lo, hi = Decimal("-0.99"), Decimal(1)
    while hi - lo > Decimal("0.0000001"):
        mid = (lo + hi) / 2
        if xnpv(mid, flows) > 0:
            lo = mid
        else:
            hi = mid
    return (lo + hi) / 2


flows, units = [], Decimal(0)
print(f"{'No.':>4}{'Day':>6}{'Amount':>10}{'NAV':>9}{'Units':>10}")
for n, (day, nav) in enumerate(zip(DUE, NAVS), start=1):
    amount = Decimal(5000 if n <= 12 else 5500)
    if n in FAILED:
        print(f"{n:>4}{day:>6}{'failed':>10}{nav:>9}{'—':>10}")
        continue
    day += LATE.get(n, 0)
    bought = (amount / Decimal(nav)).quantize(Decimal("0.001"), rounding=ROUND_HALF_UP)
    units += bought
    flows.append((day, -amount))
    print(f"{n:>4}{day:>6}{inr(amount):>10}{nav:>9}{bought:>10}")
value = units * VALUE_NAV
flows.append((VALUE_DAY, value))
paid = -sum(p for _, p in flows if p < 0)
print(f"Paid in {inr(paid)} in {len(flows) - 1} instalments; {units} units worth {inr(value)} on day {VALUE_DAY}.")
print()
rate = xirr(flows)
print(f"Absolute return: {pct(value / paid - 1)} over the whole plan.")
print(f"XIRR: {pct(rate)} a year; XNPV at that rate {inr(xnpv(rate, flows), paise=True)}.")

# The two common mistakes when the flows are typed in.
wrong_failed = flows[:-1] + [(DUE[14], Decimal(-5500)), (VALUE_DAY, value)]
print(f"Entering the failed instalment as if it was paid: {pct(xirr(wrong_failed))}, too low.")
on_schedule = [(DUE[n - 1], Decimal(-(5000 if n <= 12 else 5500))) for n in range(1, 25) if n not in FAILED] + [(VALUE_DAY, value)]
print(f"Ignoring the two late days and using the due dates: {pct(xirr(on_schedule))}.")

Output

 No.   Day    Amount      NAV     Units
   1     0    ₹5,000    40.00   125.000
   2    31    ₹5,000    39.10   127.877
   3    59    ₹5,000    38.40   130.208
   4    90    ₹5,000    37.20   134.409
   5   124    ₹5,000    36.10   138.504
   6   151    ₹5,000    35.40   141.243
   7   181    ₹5,000    34.60   144.509
   8   212    ₹5,000    34.00   147.059
   9   249    ₹5,000    34.90   143.266
  10   273    ₹5,000    36.20   138.122
  11   304    ₹5,000    37.10   134.771
  12   334    ₹5,000    38.30   130.548
  13   365    ₹5,500    39.00   141.026
  14   396    ₹5,500    39.80   138.191
  15   424    failed    40.60         —
  16   455    ₹5,500    41.20   133.495
  17   485    ₹5,500    40.10   137.157
  18   516    ₹5,500    41.70   131.894
  19   546    ₹5,500    42.90   128.205
  20   577    ₹5,500    43.60   126.147
  21   608    ₹5,500    44.20   124.434
  22   638    ₹5,500    45.10   121.951
  23   669    ₹5,500    45.80   120.087
  24   699    ₹5,500    46.40   118.534
Paid in ₹1,20,500 in 23 instalments; 3056.637 units worth ₹1,43,051 on day 730.

Absolute return: 18.71 % over the whole plan.
XIRR: 17.65 % a year; XNPV at that rate ₹0.00.
Entering the failed instalment as if it was paid: 12.99 %, too low.
Ignoring the two late days and using the due dates: 17.63 %.

Recorded with Python 3.14.8 on macOS 26 arm64. To run it yourself: mise exec python@3.14.8 -- python3 xirr_stepup.py

₹1,20,500 went in through 23 instalments, and the holding is worth ₹1,43,051: an absolute return of 18.71 % over the whole plan and an XIRR of 17.65 % a year. The two are close here only because the money was invested for about a year on average. Two mistakes are common when the flows are typed in. Entering the failed instalment as if it had been paid adds money that never went in, and the XIRR falls to 12.99 %. Using the due dates instead of the two late ones moves it only to 17.63 %: a few days barely matter, a missing flow matters a lot.

Typing in the instalments that were due

Wrong: copying the SIP schedule into a spreadsheet’s XIRR. Right: copy the account statement, which lists only the instalments that bought units, each on its own date, then add today’s value as the last flow. One failed instalment typed in as paid took this plan’s XIRR from 17.65 % to 12.99 %.

XIRR Calculator Enter each instalment and today's value with their dates to get the XIRR of your own SIP.

Checkpoint

Check: The XIRR of an untidy SIP

  1. Question 1 of 2 Instalment 15 of a SIP failed and bought no units. How does it go into the XIRR?

    Choose one answer.

    Show the answer: Question 1 of 2

    Answer: It is left out; only money that actually went in is a cash flow

    Copy the flows from the account statement, which lists only the instalments that bought units, and add today's value as the last, positive flow.

  2. Question 2 of 2 In the XIRR of a SIP, how are the instalments and today's value entered?

    Choose one answer.

    Show the answer: Question 2 of 2

    Answer: Instalments as negative amounts and today's value as a positive one, each with its own date

    XIRR discounts every dated flow to the first date on a 365-day year and finds the rate at which they add up to zero; the signs say which way the money moved.

An STP is a sale from one scheme and a purchase in another, every month

A systematic transfer plan (STP): A plan that moves a set amount from one scheme to another at regular intervals. Each transfer sells units of the first scheme and buys units of the second, each at its own NAV, so each can realise a taxable gain., or STP, starts with a lump sum in one scheme, often a liquid or other debt scheme, and moves a set amount from it into another scheme at regular intervals. Each transfer is a switch: Selling units of one mutual fund scheme and using the money to buy units of another scheme of the same fund house in one instruction. It counts as a sale and a purchase, each at its own scheme's NAV.: units of the first scheme are sold back at its NAV, and the money buys units of the second at its NAV. The consolidated circular’s cut-off rules treat the two halves of a switch as a sale and a purchase. Step through an invented STP of ₹6,00,000 from a liquid scheme to an equity scheme, ₹50,000 a month:

Interactive · step by step An STP moves money between two schemes Step through a year of ₹50,000 transfers from an invented liquid scheme to an invented equity scheme.
An STP moves money between two schemes, step 7 of 7. Showing You, Tax on the gains (₹22,333 of gains), Liquid scheme (0 units), Equity scheme (12,640.764 units). In focus: Tax on the gains.monthly switchYou₹6,00,000 to investTax on the gains₹22,333 of gainsLiquid scheme0 unitsEquity scheme12,640.764 units

The drawing shows the whole scene; its 7 steps are listed below.

Every step as text
  1. The lump sum. ₹6,00,000 buys 240.000 units of the liquid scheme at ₹2,500.0000. It will wait there and move in twelve steps.
  2. The first sale. In month 1 the liquid NAV is ₹2,513.7500, so ₹50,000 needs 19.891 units. They are sold back to the scheme, as in any redemption.
  3. The first purchase. The same ₹50,000 buys units of the equity scheme at its NAV of ₹50.00, 1,000.000 units. An STP is these two transactions every month.
  4. A gain is realised. The 19.891 units sold had cost ₹2,500.0000 each, so the sale realised a gain of ₹274. Units of a debt-heavy scheme bought from 2023-24 on give a short-term gain, taxed at your slab rate.
  5. A low NAV. In month 4 the equity NAV is ₹45.90, and ₹50,000 buys 1,089.325 units, the most of the year. The STP averages the entry, as a SIP does.
  6. The last transfer. The units left in the liquid scheme kept earning, so the twelfth transfer moves ₹72,327, not ₹50,000. The liquid scheme is empty and the equity scheme holds 12,640.764 units.
  7. The year's tax. The twelve sales realised ₹22,333 of gains. At an assumed marginal rate of 20.8 %, the 20 % slab with the cess, they add ₹4,645 to the year's tax.

The program prints all twelve transfers, with the gain on every sale:

An STP of ₹6,00,000 in twelve transfers, with the gain on every sale Python · stp_flows.py
"""An STP of ₹6,00,000 from an invented liquid scheme to an invented equity scheme, ₹50,000 a month for 12 months.

Every transfer is two transactions: units of the source scheme are sold back at its NAV, and the money buys units of
the target scheme at its NAV. The sale realises the gain on the units sold: (NAV now − NAV paid) × units. Units of a
scheme with more than 65 % in debt and money market instruments, bought in or after the financial year 2023-24, give a
short-term gain whatever the holding period (Income-tax Act, 2025, section 76), taxed with the rest of the income at
the slab rate; here an assumed marginal rate of 20.8 % (the 20 % slab and the 4 % cess). The NAVs are invented; units
are rounded to three decimals and NAVs of the liquid scheme to four. Decimal arithmetic, rounding half up.
"""

from decimal import ROUND_HALF_UP, Decimal

LUMP, TRANSFER, MONTHS = Decimal(600000), Decimal(50000), 12
SOURCE_START = Decimal("2500.0000")
SOURCE_GROWTH = Decimal("0.0055")  # an invented 0.55 % a month for the liquid scheme
TARGET_NAVS = ["50.00", "48.70", "47.20", "45.90", "46.80", "48.10", "47.40", "49.20", "50.60", "51.30", "52.00", "53.10"]
MARGINAL = Decimal("0.208")


def inr(amount):
    value = int(Decimal(amount).quantize(Decimal("1"), rounding=ROUND_HALF_UP))
    sign, digits = ("−" if value < 0 else ""), str(abs(value))
    head, tail = digits[:-3], digits[-3:]
    groups = []
    while len(head) > 2:
        groups.insert(0, head[-2:])
        head = head[:-2]
    if head:
        groups.insert(0, head)
    return sign + "₹" + ",".join(groups + [tail])


def q3(x):
    return x.quantize(Decimal("0.001"), rounding=ROUND_HALF_UP)


source_units = q3(LUMP / SOURCE_START)
print(f"Day 0: {inr(LUMP)} buys {source_units} units of the liquid scheme at ₹{SOURCE_START}.")
print()
print(f"{'Month':>5}{'Source NAV':>11}{'Sold':>8}{'Moved':>9}{'Gain':>8}{'Target NAV':>11}{'Bought':>10}{'Left':>10}")
target_units, gains = Decimal(0), Decimal(0)
for month in range(1, MONTHS + 1):
    nav = (SOURCE_START * (1 + SOURCE_GROWTH) ** month).quantize(Decimal("0.0001"), rounding=ROUND_HALF_UP)
    amount = TRANSFER if month < MONTHS else min(TRANSFER, source_units * nav)
    sold = source_units if month == MONTHS else q3(amount / nav)
    amount = sold * nav if month == MONTHS else amount
    gain = sold * (nav - SOURCE_START)
    source_units -= sold
    gains += gain
    tnav = Decimal(TARGET_NAVS[month - 1])
    bought = q3(amount / tnav)
    target_units += bought
    print(f"{month:>5}{nav:>11}{sold:>8}{inr(amount):>9}{inr(gain):>8}{tnav:>11}{bought:>10}{inr(source_units * nav):>10}")
print()
print(f"The last transfer moved what was left, {inr(amount)}: the liquid units kept earning while they waited.")
print(f"Moved into the equity scheme: {target_units} units, worth {inr(target_units * Decimal(TARGET_NAVS[-1]))} at its last NAV.")
print(f"Gains realised in the liquid scheme over the 12 sales: {inr(gains)}.")
print(f"Tax on them at an assumed marginal rate of 20.8 %: {inr(gains * MARGINAL)}.")
lump_units = q3(LUMP / Decimal(TARGET_NAVS[0]))
print(f"For comparison, {inr(LUMP)} straight into the equity scheme on day 0: {lump_units} units, worth {inr(lump_units * Decimal(TARGET_NAVS[-1]))}.")

Output

Day 0: ₹6,00,000 buys 240.000 units of the liquid scheme at ₹2500.0000.

Month Source NAV    Sold    Moved    Gain Target NAV    Bought      Left
    1  2513.7500  19.891  ₹50,000    ₹274      50.00  1000.000 ₹5,53,299
    2  2527.5756  19.782  ₹50,000    ₹546      48.70  1026.694 ₹5,06,342
    3  2541.4773  19.674  ₹50,000    ₹816      47.20  1059.322 ₹4,59,125
    4  2555.4554  19.566  ₹50,000  ₹1,085      45.90  1089.325 ₹4,11,651
    5  2569.5104  19.459  ₹50,000  ₹1,353      46.80  1068.376 ₹3,63,915
    6  2583.6427  19.353  ₹50,000  ₹1,619      48.10  1039.501 ₹3,15,915
    7  2597.8528  19.247  ₹50,000  ₹1,883      47.40  1054.852 ₹2,67,652
    8  2612.1410  19.141  ₹50,000  ₹2,146      49.20  1016.260 ₹2,19,125
    9  2626.5077  19.037  ₹50,000  ₹2,408      50.60   988.142 ₹1,70,329
   10  2640.9535  18.933  ₹50,000  ₹2,669      51.30   974.659 ₹1,21,265
   11  2655.4788  18.829  ₹50,000  ₹2,928      52.00   961.538   ₹71,932
   12  2670.0839  27.088  ₹72,327  ₹4,607      53.10  1362.095        ₹0

The last transfer moved what was left, ₹72,327: the liquid units kept earning while they waited.
Moved into the equity scheme: 12640.764 units, worth ₹6,71,225 at its last NAV.
Gains realised in the liquid scheme over the 12 sales: ₹22,333.
Tax on them at an assumed marginal rate of 20.8 %: ₹4,645.
For comparison, ₹6,00,000 straight into the equity scheme on day 0: 12000.000 units, worth ₹6,37,200.

Recorded with Python 3.14.8 on macOS 26 arm64. To run it yourself: mise exec python@3.14.8 -- python3 stp_flows.py

The equity scheme ended with 12,640.764 units bought at twelve NAVs, as a SIP would have bought them, and the money still waiting in the liquid scheme kept earning, so the last transfer moved ₹72,327. Every sale realised a gain, ₹22,333 in all. Under section 76 of the Income-tax Act, 2025, units of a scheme with more than 65 % in debt and money market instruments, bought in the financial year 2023-24 or later, give a short-term gain however long they were held, taxed at your slab rate: at an assumed 20.8 %, ₹4,645. On this invented path the STP ended ahead of the lump sum, ₹6,71,225 against ₹6,37,200 before that tax, because the equity NAV dipped first. On a path that rose steadily it would have ended behind, as the SIP did on path B.

Checkpoint

Check: How an STP moves money

  1. Question 1 of 2 What happens in each monthly transfer of an STP?

    Choose one answer.

    Show the answer: Question 1 of 2

    Answer: Units of the source scheme are sold at its NAV, and the money buys units of the target scheme at its NAV

    In the lesson's STP, 19.891 liquid units sold at ₹2,513.7500 gave ₹50,000, which bought 1,000.000 equity units at ₹50.00.

  2. Question 2 of 2 A transfer sells 20.000 units of a liquid scheme at a NAV of ₹2,600.0000. The units were bought at ₹2,500.0000. What gain does the transfer realise, in rupees?

    Type a number.

    Show the answer: Question 2 of 2

    Answer: 2000 rupees

    20 × (₹2,600 − ₹2,500) = ₹2,000. Units of a debt-heavy scheme bought in 2023-24 or later give a short-term gain however long they were held, so it is taxed at the slab rate.

An SWP sells units, so only the gain inside each payment is taxed

A systematic withdrawal plan (SWP): A plan that pays a set amount out of a scheme at regular intervals by selling units at each day's NAV. Part of every payment is the cost of the units sold; only the rest is a capital gain., or SWP, is a SIP run backwards: a set amount is paid out of a scheme at regular intervals, and each payment sells units. SEBI’s consolidated circular sets the price of units sold back as the applicable NAV less any exit load: A charge on units sold back within a period a scheme sets, taken as a share of the NAV and kept in the scheme for the investors who stay. For an open-ended scheme it may not exceed 3 %. More in “Mutual funds: structure, NAV, plans and costs” (paragraph 9.2.1), and the money must reach you within 3 working days of the redemption (paragraph 15.3.1). Because each payment is a sale, it is part your own money coming back and part gain. Follow the first payment of an invented SWP of ₹20,000 a month, from ₹20,00,000 that bought 40,000 units at ₹50.00 eighteen months before it:

Interactive · stage by stage One SWP payment, from units to your bank Step down the column through the first ₹20,000 payment of an invented SWP and see which part of it is a gain.
One SWP payment, from units to your bank, step 6 of 6. Showing The payment date, Units sold at the NAV (333.333 units sold), Cost and gain (₹16,667 + ₹3,333 gain), Short or long term (held 18 months, long term), Money in your bank (₹20,000 credited). In focus: next.next monthThe payment date₹20,000 dueUnits sold at the NAV333.333 units soldCost and gain₹16,667 + ₹3,333 gainShort or long termheld 18 months, long termMoney in your bank₹20,000 credited

The drawing shows the whole scene; its 6 steps are listed below.

Every step as text
  1. The date comes. On the SWP date the fund house acts on your standing instruction to pay ₹20,000. Nothing has to be filled in each month.
  2. Units are sold. The scheme buys back units at the day's NAV of ₹60.00, less any exit load; this invented scheme charges none after 12 months. ₹20,000 ÷ ₹60.00 = 333.333 units.
  3. Cost and gain. Those units cost ₹50.00 each, ₹16,667 in all. That part of the payment is your own money coming back; only the other ₹3,333 is a gain.
  4. Which tax rule. Units of an equity-oriented fund held more than 12 months give a long-term gain, taxed at 12.5 % on the year's gains above ₹1,25,000; held 12 months or less, short-term, at 20 %.
  5. The money arrives. The ₹20,000 reaches your bank within 3 working days of the sale. 39,666.667 units stay invested and keep rising or falling with the NAV.
  6. And again. Next month the cycle repeats at a new NAV. Over twelve payments ₹2,40,000 is paid out and ₹45,897 of it is gain.

The program runs the first year of payments and works out the tax on the gains:

Twelve SWP payments: units sold, cost, gain and the tax on it Python · swp_tax.py
"""An SWP of ₹20,000 a month from an invented equity-oriented scheme: units sold, and the gain inside each payment.

₹20,00,000 bought 40,000 units at a NAV of ₹50.00, 18 months before the first payment. Every payment sells units at
the NAV of its day (this invented scheme charges no exit load after 12 months), so a payment is part money you paid
in (the cost of the units sold) and part gain. Only the gain is a capital gain. Income-tax Act, 2025: units of an
equity-oriented fund are short-term if held 12 months or less (section 2(101)), and the gain is taxed at 20 %
(section 196); held longer, the year's long-term gains above ₹1,25,000 are taxed at 12.5 % (section 198). The Finance
Act, 2026 adds a 4 % cess. The last part shows the tax if the same units had been held 12 months or less. The NAVs
are invented; units to three decimals; decimal arithmetic, rounding half up.
"""

from decimal import ROUND_HALF_UP, Decimal

COST_NAV, UNITS = Decimal("50.00"), Decimal(40000)
PAYMENT = Decimal(20000)
NAVS = ["60.00", "61.20", "59.80", "58.90", "60.40", "62.10", "63.00", "61.70", "62.80", "64.10", "63.50", "65.00"]
LTCG_EXEMPT, CESS = Decimal(125000), Decimal("0.04")


def inr(amount):
    value = int(Decimal(amount).quantize(Decimal("1"), rounding=ROUND_HALF_UP))
    sign, digits = ("−" if value < 0 else ""), str(abs(value))
    head, tail = digits[:-3], digits[-3:]
    groups = []
    while len(head) > 2:
        groups.insert(0, head[-2:])
        head = head[:-2]
    if head:
        groups.insert(0, head)
    return sign + "₹" + ",".join(groups + [tail])


units = UNITS
print(f"{inr(COST_NAV * UNITS)} bought 40,000 units at ₹{COST_NAV}, 18 months before the first payment.")
print(f"{'Payment':>7}{'NAV':>8}{'Units sold':>12}{'Cost of them':>14}{'Gain':>9}{'Units left':>12}")
total_cost = total_gain = Decimal(0)
for n, nav in enumerate((Decimal(x) for x in NAVS), start=1):
    sold = (PAYMENT / nav).quantize(Decimal("0.001"), rounding=ROUND_HALF_UP)
    cost = sold * COST_NAV
    gain = PAYMENT - cost
    units -= sold
    total_cost += cost
    total_gain += gain
    print(f"{n:>7}{nav:>8}{sold:>12}{inr(cost):>14}{inr(gain):>9}{units:>12}")
paid_out = PAYMENT * len(NAVS)
print()
print(f"Paid out {inr(paid_out)}: {inr(total_cost)} of it was the cost of the units sold, {inr(total_gain)} was gain.")
print(f"Still invested: {units} units, worth {inr(units * Decimal(NAVS[-1]))} at the last NAV.")
print()
print("Tax on that gain (no other capital gains that year, no surcharge):")
long_tax = max(Decimal(0), total_gain - LTCG_EXEMPT) * Decimal("0.125") * (1 + CESS)
print(f"  Held over 12 months, so long-term: {inr(long_tax)}; {inr(total_gain)} is within the ₹1,25,000 exemption")
short_tax = total_gain * Decimal("0.20") * (1 + CESS)
print(f"  Had they been held 12 months or less: {inr(short_tax)}, 20.8 % of the gain")
print(f"Taxing all {inr(paid_out)} as income at 20.8 % would wrongly give {inr(paid_out * Decimal('0.208'))}.")

Output

₹20,00,000 bought 40,000 units at ₹50.00, 18 months before the first payment.
Payment     NAV  Units sold  Cost of them     Gain  Units left
      1   60.00     333.333       ₹16,667   ₹3,333   39666.667
      2   61.20     326.797       ₹16,340   ₹3,660   39339.870
      3   59.80     334.448       ₹16,722   ₹3,278   39005.422
      4   58.90     339.559       ₹16,978   ₹3,022   38665.863
      5   60.40     331.126       ₹16,556   ₹3,444   38334.737
      6   62.10     322.061       ₹16,103   ₹3,897   38012.676
      7   63.00     317.460       ₹15,873   ₹4,127   37695.216
      8   61.70     324.149       ₹16,207   ₹3,793   37371.067
      9   62.80     318.471       ₹15,924   ₹4,076   37052.596
     10   64.10     312.012       ₹15,601   ₹4,399   36740.584
     11   63.50     314.961       ₹15,748   ₹4,252   36425.623
     12   65.00     307.692       ₹15,385   ₹4,615   36117.931

Paid out ₹2,40,000: ₹1,94,103 of it was the cost of the units sold, ₹45,897 was gain.
Still invested: 36117.931 units, worth ₹23,47,666 at the last NAV.

Tax on that gain (no other capital gains that year, no surcharge):
  Held over 12 months, so long-term: ₹0; ₹45,897 is within the ₹1,25,000 exemption
  Had they been held 12 months or less: ₹9,546, 20.8 % of the gain
Taxing all ₹2,40,000 as income at 20.8 % would wrongly give ₹49,920.

Recorded with Python 3.14.8 on macOS 26 arm64. To run it yourself: mise exec python@3.14.8 -- python3 swp_tax.py

Of the ₹2,40,000 paid out in the year, ₹1,94,103 was the cost of the units sold and only ₹45,897 was gain. The Income-tax Act, 2025 treats units of an equity-oriented fund held more than 12 months as long-term (section 2(101)), and taxes a year’s long-term gains above ₹1,25,000 at 12.5 % (section 198), so here the tax is nil. Had the same units been held 12 months or less, the gain would have been short-term, taxed at 20 % (section 196) plus the 4 % cess of the Finance Act, 2026: ₹9,546.

Treating every SWP payment as income

Wrong: “₹2,40,000 a year from an SWP is ₹2,40,000 of taxable income”. Right: only the gain on the units sold is a capital gain, here ₹45,897. Taxing the whole amount at 20.8 % would give ₹49,920, five times the short-term tax and far above the nil long-term tax.

SWP Calculator (Systematic Withdrawal Plan) See how long a corpus lasts with a fixed or rising monthly withdrawal, and the gain inside each payment.

Checkpoint

Check: The gain inside an SWP payment

  1. Question 1 of 2 An SWP pays ₹15,000 on a day the NAV is ₹75.00, with no exit load. How many units does the payment sell?

    Type a number.

    Show the answer: Question 1 of 2

    Answer: 200 units

    ₹15,000 ÷ ₹75.00 = 200 units. Every payment of an SWP is a sale of units at the NAV of its day.

  2. Question 2 of 2 Those 200 units had been bought at ₹60.00 each. How much of the ₹15,000 payment is a capital gain, in rupees?

    Type a number.

    A hint

    The cost of the units sold comes back as your own money.

    Show the answer: Question 2 of 2

    Answer: 3000 rupees

    The units cost 200 × ₹60 = ₹12,000, so ₹12,000 of the payment is your money coming back and ₹3,000 is gain. Only the ₹3,000 is taxed as a capital gain.

The order of returns works for a SIP and against an SWP

The same returns in a different order leave a different result once money moves in or out, which is sequence-of-returns risk: The risk that the order of returns, not only their average, decides the outcome once money is being withdrawn: falls that come early leave less to recover. More in “Asset allocation, diversification and rebalancing”. Asset allocation showed it year by year; the program below does it month by month, in both directions. Part 1 takes ten invented yearly returns, two bad years and eight good ones, in two orders. Part 2 tests a withdrawal plan on 10,000 synthetic 25-year paths, drawn from a bell curve with an average of 8.8 % and a volatility of 11.5 %, the figures the synthetic 60 : 40 mix measured in that lesson. Part 3 keeps only the paths that grew at about the same rate over the 25 years, so that only their order differs:

The order of returns for a SIP and an SWP, and a plan tested on 10,000 synthetic paths Python · sequence_test.py
"""The order of returns for a SIP and for an SWP, then a withdrawal plan tested on 10,000 synthetic paths.

Part 1 takes ten invented yearly returns, two bad years and eight good ones, and spreads each year's return evenly over
its twelve months. Order A meets the bad years first; order B is the same list reversed. A SIP pays ₹10,000 in at the
start of every month; an SWP takes ₹15,000 out of ₹20,00,000 at the start of every month, while money is left.
Part 2 draws 10,000 synthetic 25-year paths of yearly returns from a bell curve with an average of 8.8 % and a
volatility of 11.5 % (seeded, so every run gives the same paths) and withdraws a share of the starting ₹50,00,000
each year, raised by an assumed 5 % a year for rising prices. Nothing here is a forecast; no real investment is
described. Floats for the 10,000 paths, rounded only for printing.
"""

import random
import statistics

RETURNS = [-0.25, -0.15, 0.05, 0.08, 0.10, 0.12, 0.14, 0.16, 0.18, 0.22]


def inr(amount):
    value = round(amount)
    sign, digits = ("−" if value < 0 else ""), str(abs(value))
    head, tail = digits[:-3], digits[-3:]
    groups = []
    while len(head) > 2:
        groups.insert(0, head[-2:])
        head = head[:-2]
    if head:
        groups.insert(0, head)
    return sign + "₹" + ",".join(groups + [tail])


def monthly(order):
    for r in order:
        for _ in range(12):
            yield (1 + r) ** (1 / 12)


orders = {"A, bad years first:": RETURNS, "B, bad years last: ": RETURNS[::-1]}
print("1a. A SIP of ₹10,000 at the start of each month, ₹12,00,000 paid in over ten years")
for name, order in orders.items():
    sip = 0.0
    for g in monthly(order):
        sip = (sip + 10000) * g
    print(f"   Order {name} ends at {inr(sip)}")
print("1b. An SWP of ₹15,000 at the start of each month from ₹20,00,000")
for name, order in orders.items():
    swp, taken, month_out = 2000000.0, 0.0, None
    for month, g in enumerate(monthly(order), start=1):
        take = min(15000.0, swp)
        swp, taken = (swp - take) * g, taken + take
        if swp <= 0 and month_out is None:
            month_out = month
    end = f"runs out in month {month_out}" if month_out else f"ends with {inr(swp)}"
    print(f"   Order {name} {end}, after paying {inr(taken)}")

print()
print("2. ₹50,00,000 on 10,000 synthetic 25-year paths, withdrawn monthly at a starting")
print("   yearly rate of the corpus, raised 5 % every year")
rng = random.Random(2026)
paths = [[rng.gauss(0.088, 0.115) for _ in range(25)] for _ in range(10000)]
print(f"{'Starting rate':<15}{'First year':>12}{'Lasts 25 years':>16}{'Median left':>14}")
runs_out = {}
for rate in (0.04, 0.06, 0.08):
    lasted, ends = 0, []
    for i, path in enumerate(paths):
        balance, yearly = 5000000.0, 5000000.0 * rate
        for year, r in enumerate(path):
            g = (1 + r) ** (1 / 12)
            take = yearly * 1.05 ** year / 12
            for _ in range(12):
                balance = max(0.0, balance - take) * g
            if balance <= 0:
                break
        lasted += balance > 0
        ends.append(balance)
        if rate == 0.06:
            runs_out[i] = balance <= 0
    print(f"{f'{rate * 100:.0f} %':<15}{inr(5000000 * rate):>12}{f'{lasted / 100:.1f} %':>16}{inr(statistics.median(ends)):>14}")


def growth(returns):
    product = 1.0
    for r in returns:
        product *= 1 + r
    return product ** (1 / len(returns)) - 1


print()
print("3. At 6 %, the paths whose 25 years grew at 7.5 % to 8.5 % a year, split by their")
print("   first five years")
similar = [i for i, path in enumerate(paths) if 0.075 <= growth(path) <= 0.085]
for label, test in (("grew under 3 % a year", lambda g: g < 0.03), ("grew over 12 % a year", lambda g: g > 0.12)):
    group = [i for i in similar if test(growth(paths[i][:5]))]
    share = sum(runs_out[i] for i in group) / len(group)
    print(f"   First five years {label}: {len(group):>4} paths, {share * 100:5.1f} % ran out")
print(f"   ({len(similar)} of the 10,000 paths grew at 7.5 % to 8.5 % a year over the 25 years.)")

Output

1a. A SIP of ₹10,000 at the start of each month, ₹12,00,000 paid in over ten years
   Order A, bad years first: ends at ₹23,40,562
   Order B, bad years last:  ends at ₹11,28,559
1b. An SWP of ₹15,000 at the start of each month from ₹20,00,000
   Order A, bad years first: runs out in month 113, after paying ₹16,88,430
   Order B, bad years last:  ends with ₹16,98,247, after paying ₹18,00,000

2. ₹50,00,000 on 10,000 synthetic 25-year paths, withdrawn monthly at a starting
   yearly rate of the corpus, raised 5 % every year
Starting rate    First year  Lasts 25 years   Median left
4 %               ₹2,00,000          88.9 %  ₹1,09,61,557
6 %               ₹3,00,000          44.7 %            ₹0
8 %               ₹4,00,000          10.9 %            ₹0

3. At 6 %, the paths whose 25 years grew at 7.5 % to 8.5 % a year, split by their
   first five years
   First five years grew under 3 % a year:  225 paths,  99.1 % ran out
   First five years grew over 12 % a year:  328 paths,  21.6 % ran out
   (1729 of the 10,000 paths grew at 7.5 % to 8.5 % a year over the 25 years.)

Recorded with Python 3.14.8 on macOS 26 arm64. To run it yourself: mise exec python@3.14.8 -- python3 sequence_test.py

For the SIP, bad years first was the better order: the early instalments bought cheap units, and ₹12,00,000 became ₹23,40,562 against ₹11,28,559. For the SWP from ₹20,00,000, the same order ran the money out in month 113, while bad years last left ₹16,98,247 after every payment. On the 10,000 paths, withdrawals that start at 4 % of the corpus and rise 5 % a year lasted 25 years in 88.9 % of them, at 6 % in 44.7 % and at 8 % in 10.9 %. Part 3 isolates the order: of the paths that grew 7.5 % to 8.5 % a year over 25 years, 99.1 % of those with a weak first five years ran out, against 21.6 % of those with a strong start.

Key idea

Money paid in welcomes early falls, because it buys cheap; money taken out fears them, because units sold low are gone. Test a withdrawal plan on bad early years, not on the average return.

Checkpoint

Check: The order of returns in and out

  1. Question 1 of 2 The same ten yearly returns can come with the two bad years first or last. Which order is better for a SIP, and which for an SWP?

    Choose one answer.

    Show the answer: Question 1 of 2

    Answer: Bad years first for the SIP, bad years last for the SWP

    Returns multiply, so order matters only through the money moving in or out: paid in, early falls help; taken out, they do lasting harm.

  2. Question 2 of 2 Two synthetic 25-year paths both grew at 8 % a year overall. One had a weak first five years, the other a strong start. A plan withdraws 6 % a year, rising 5 % a year. What does the lesson's test say?

    Choose one answer.

    Show the answer: Question 2 of 2

    Answer: The weak start is far more likely to run out, though both paths grew at the same rate overall

    With withdrawals, the first years decide how much is left to recover: a fall early sells many units at low prices, and the later good years work on a smaller corpus.

Choose the plan from how your money arrives and leaves

The four plans differ less in what they are than in which way they move money: in every month, in at once, across from one scheme to another, or out every month. Answer three questions about money of your own; the table marks the plans whose mechanics match it and says why the others do not:

Interactive · answer and compare Which plan matches how your money moves? Answer three questions about money of your own. The table marks the plans that match it and says why the others do not.
How does the money reach you?
Will the amount you can set aside rise each year?
If you have a lump sum, do you want to spread its entry over months?

Answer the questions above: the table then marks what fits your case and says why the rest does not.

Five ways of moving money into or out of a scheme, against what each does with the money
Plan Money that arrives monthly A lump sum in hand A regular payout Sales that can be taxed
Lump sum Moves money: in, all at once Poor needs the whole amount on day one Good all in at once: ahead when prices rise, as in path B Poor pays nothing out Good nothing is sold until you redeem
SIP Moves money: in, the same amount every month Good ₹5,000 from each month's income buys units that day Mixed a lump sum would wait elsewhere while the SIP runs Poor pays nothing out Good buying sells nothing
Step-up SIP Moves money: in, a little more every year Good grows with income: ₹5,000 became ₹11,790 a month by year 10 Poor built for money that keeps arriving, not a sum in hand Poor pays nothing out Good buying sells nothing
STP Moves money: from one scheme to another, in steps Poor needs a lump sum already in a source scheme Good enters in 12 steps; the waiting money earned ₹22,333 Poor moves money between schemes, pays nothing out Mixed every transfer is a sale: ₹22,333 of short-term gains
SWP Moves money: out, a set amount every month Poor takes money out; it does not invest any Mixed needs a corpus already invested in the scheme Good ₹20,000 a month from units sold at each NAV Mixed every payment is a sale; only ₹45,897 of ₹2,40,000 was gain
How the answers decide
  • “How does the money reach you?” Some of each month's income: rules out Lump sum, STP and SWP. Money that arrives every month is invested as it arrives: each instalment buys units at the NAV of its day.
  • “How does the money reach you?” A lump sum, in hand now: rules out SIP, Step-up SIP and SWP. A sum already in hand goes in at once, or moves across in steps through an STP from a source scheme.
  • “How does the money reach you?” It is invested; I need income from it: rules out Lump sum, SIP, Step-up SIP and STP. A regular payout from money already invested is an SWP: every payment sells units at the NAV of its day.
  • “How does the money reach you?” Some of each month's income and “Will the amount you can set aside rise each year?” No, it stays about the same: adds a caveat to Step-up SIP. A step-up raises the debit every year. Without a rising income a debit can fail, and a failed debit buys nothing.
  • “How does the money reach you?” A lump sum, in hand now and “If you have a lump sum, do you want to spread its entry over months?” Yes, over months: adds a caveat to Lump sum. Investing at once ends ahead when prices rise steadily, as in path B, and behind when they fall first, and nobody knows in advance which path will come.
  • “How does the money reach you?” A lump sum, in hand now and “If you have a lump sum, do you want to spread its entry over months?” No, all at once: rules out STP. An STP spreads a lump sum over months, which you do not want, and each of its transfers is a sale whose gain is taxed that year.

In short: income that arrives monthly fits a SIP, or a step-up SIP if the income rises; a lump sum goes in at once or through an STP, and every STP transfer is a taxable sale; a regular payout from money already invested is an SWP, taxed only on the gain inside each payment. None of them changes what the scheme itself earns.

Checkpoint

Check: Matching the plan to the money

  1. One question Meena has ₹12 lakh invested in a scheme and wants ₹15,000 a month from it. Which plan does that?

    Choose one answer.

    Show the answer: One question

    Answer: An SWP, which sells units each month to pay her

    SIPs and step-up SIPs move money in, an STP moves it across, and an SWP moves it out, one sale of units at a time.

Practise: instalments, transfers and withdrawals

These questions cover all eight ideas, from units to the order of returns, and the first comes from the idea your answers have found hardest. Give amounts in whole rupees unless a question asks otherwise:

Practice that adapts to you

Practise this lesson

16 questions about 8 ideas of this lesson. Each answer is explained at once, and what you get right is kept in this browser.

  1. Question 1 of 16 What does a SIP change about a mutual fund investment?

    Choose one answer.

    Show the answer: Question 1 of 16

    Answer: Only how the money is paid, in instalments; the scheme, its NAV and its costs are the same as for any purchase

    SEBI's investor site calls the SIP a facility for investing in a systematic manner: same scheme, same NAV, same costs, paid in instalments.

  2. Question 2 of 16 A SIP of ₹4,500 buys at NAVs of ₹18.00 and then ₹15.00 in two months. How many units does it hold after the second instalment?

    Type a number.

    Show the answer: Question 2 of 16

    Answer: 550 units

    ₹4,500 ÷ ₹18.00 = 250 units and ₹4,500 ÷ ₹15.00 = 300 units, 550 in all. The lower NAV bought more.

  3. Question 3 of 16 What is rupee-cost averaging?

    Choose one answer.

    Show the answer: Question 3 of 16

    Answer: Investing the same amount at regular intervals, so that low prices buy more units and the average cost falls below the average price

    Because the amount is fixed, the units bought rise as the NAV falls, which pulls the average cost below the plain average of the NAVs.

  4. Question 4 of 16 A NAV rises steadily every month for a year. Which ends ahead: ₹60,000 invested in month 1, or ₹5,000 a month for 12 months?

    Choose one answer.

    Show the answer: Question 4 of 16

    Answer: The lump sum, because all of its money was in from the lowest price

    In a steady rise every later instalment buys fewer units than the first, so the lump sum, bought entirely at the first NAV, holds the most units.

  5. Question 5 of 16 A SIP of ₹5,000 a month is stepped up 10 % at the start of each year. How much is paid in over its first three years, in rupees?

    Type a number.

    Show the answer: Question 5 of 16

    Answer: 198600 rupees

    12 × ₹5,000 + 12 × ₹5,500 + 12 × ₹6,050 = ₹60,000 + ₹66,000 + ₹72,600 = ₹1,98,600.

  6. Question 6 of 16 In the lesson's program, what did three missed instalments in year 2 cost by the end of ten years at an assumed 9 %?

    Choose one answer.

    Show the answer: Question 6 of 16

    Answer: ₹32,346: the ₹15,000 not paid and the growth it would have earned

    A missed instalment costs its own amount and all the growth it would have had: ₹9,55,430 became ₹9,23,084.

  7. Question 7 of 16 Why is XIRR, not CAGR, the measure for a SIP?

    Choose one answer.

    Show the answer: Question 7 of 16

    Answer: Each instalment went in on its own date and was invested for its own time, and XIRR uses every flow with its date

    XIRR finds the yearly rate at which every dated flow, discounted to the first date, adds up to zero.

  8. Question 8 of 16 A SIP statement shows 12 months of instalments, of which one failed. Counting today's value, how many cash flows go into the XIRR?

    Type a number.

    Show the answer: Question 8 of 16

    Answer: 12 flows

    Eleven instalments bought units, so there are eleven negative flows, and today's value adds one positive flow: twelve in all.

  9. Question 9 of 16 What is an STP?

    Choose one answer.

    Show the answer: Question 9 of 16

    Answer: A plan that moves a set amount from one scheme to another at regular intervals, selling units of the first to buy units of the second

    An STP spreads a lump sum's entry into a scheme over months, one switch at a time.

  10. Question 10 of 16 Rahul's STP sells units of a liquid scheme he bought in the financial year 2025-26, held for 14 months by the last transfer. How is the gain on that transfer taxed?

    Choose one answer.

    Show the answer: Question 10 of 16

    Answer: As a short-term gain at his slab rate, however long the units were held

    Units of a scheme with more than 65 % in debt and money market instruments, acquired in or after the financial year 2023-24, give short-term gains taxed at the slab rate, whatever the holding period.

  11. Question 11 of 16 What does each payment of an SWP do?

    Choose one answer.

    Show the answer: Question 11 of 16

    Answer: It sells units at the NAV of its day, less any exit load, and pays the money to your bank

    The repurchase price is the applicable NAV less any exit load, and the money reaches the bank within 3 working days.

  12. Question 12 of 16 In a tax year, an SWP from an equity-oriented scheme realises ₹1,40,000 of long-term gains, and there are no other capital gains. What is the tax with the 4 % cess, in rupees, ignoring any surcharge?

    Type a number.

    A hint

    Only the long-term gains above ₹1,25,000 are taxed, at 12.5 %.

    Show the answer: Question 12 of 16

    Answer: 1950 rupees

    ₹1,40,000 − ₹1,25,000 = ₹15,000 is taxed at 12.5 %: ₹1,875, and the 4 % cess makes it ₹1,950.

  13. Question 13 of 16 Two SIPs of ₹10,000 a month get the same ten yearly returns, one with the falls first and one with them last. Which ends with more, and why?

    Choose one answer.

    Show the answer: Question 13 of 16

    Answer: Falls first, because the early instalments bought units cheaply and the later rises worked on them

    For money paid in, early falls are cheap buying; for money taken out, they are forced selling.

  14. Question 14 of 16 In the lesson's test on 10,000 synthetic paths, what share of the paths lasted 25 years when withdrawals started at 6 % of the corpus and rose 5 % a year, in per cent?

    Type a number.

    Show the answer: Question 14 of 16

    Answer: 44.7 % (anything from 44.65 to 44.75 counts)

    44.7 % lasted at 6 %, against 88.9 % at 4 % and 10.9 % at 8 %: the starting rate and the early years decide a withdrawal plan.

  15. Question 15 of 16 Asha has ₹6 lakh in hand and wants it in an equity scheme over the next year, not on one day. Which plan moves it that way?

    Choose one answer.

    Show the answer: Question 15 of 16

    Answer: An STP from a liquid or other debt scheme into the equity scheme

    An STP spreads a lump sum's entry; whether that ends ahead of investing at once depends on the path the NAV takes.

  16. Question 16 of 16 Which plan matches money that arrives from a salary each month and is expected to rise each year?

    Choose one answer.

    Show the answer: Question 16 of 16

    Answer: A step-up SIP

    Money that arrives monthly fits a SIP; a step-up lets the instalment follow a rising income.

Interview questions

Warm-up (fresher): Does rupee-cost averaging guarantee a profit on a SIP?

No. A fixed instalment buys more units when the NAV is low and fewer when it is high, so the average cost of the units always ends below the average NAV: ₹14.76 against ₹15.08 in one invented year. That lowers the cost of what you hold; it does not decide the result. A SIP gains only if the NAV at the end is above that average cost. In an invented year that fell and stayed down, a SIP of ₹60,000 lost 17.2 %, less than the lump sum’s 40.0 %, but still a loss. In a steadily rising year the lump sum ended ahead, 27.5 % against 12.7 %, because most of the SIP’s money went in at higher prices.

Warm-up (fresher): Why is only part of an SWP payment taxed?

Because every SWP payment is a sale of units, not income. Part of the money is the cost of the units sold, your own money coming back; only the rest is a capital gain. ₹20,000 paid at a NAV of ₹60 from units bought at ₹50 sells 333.333 units that cost ₹16,667, so the gain is ₹3,333. For units of an equity-oriented fund held more than 12 months, a year’s long-term gains above ₹1,25,000 are taxed at 12.5 %; in an invented year of twelve such payments, ₹2,40,000 held a gain of ₹45,897, so the tax was nil. Held 12 months or less, the gain is taxed at 20 % plus the 4 % cess.

Key takeaways

  • A SIP is a way of paying for an ordinary scheme: each instalment buys units at the NAV of the day its money arrives, and a failed debit buys nothing.
  • Rupee-cost averaging keeps the average cost below the average NAV, but a SIP gains only when the last NAV is above that cost, and on a steadily rising path a lump sum ends ahead.
  • A step-up SIP raises the instalment every year, and any projection of it is an assumption, best read as a range of rates with its convention stated.
  • XIRR gives a SIP’s yearly return from its real dated flows, so a failed instalment is left out, never typed in as paid.
  • An STP sells units of one scheme and buys another every month, so every transfer can realise a taxable gain; an SWP sells units every month, and only the gain inside each payment is taxed.
  • For a SIP early falls help, and for an SWP they do lasting harm, so a withdrawal plan is tested on bad early years, not on the average return.

Terms in this lesson

rupee-cost averaging
Investing the same amount at regular intervals, so that low prices buy more units and high prices fewer. The average cost of a unit ends below the average price, but no gain is promised: that depends on the price at the end.
step-up SIP
A SIP whose instalment rises by a set percentage or amount every year, for example ₹5,000 a month in the first year and 10 % more in each later year, so that saving can follow a rising income.
switch
Selling units of one mutual fund scheme and using the money to buy units of another scheme of the same fund house in one instruction. It counts as a sale and a purchase, each at its own scheme's NAV.
systematic transfer plan (STP)
A plan that moves a set amount from one scheme to another at regular intervals. Each transfer sells units of the first scheme and buys units of the second, each at its own NAV, so each can realise a taxable gain.
systematic withdrawal plan (SWP)
A plan that pays a set amount out of a scheme at regular intervals by selling units at each day's NAV. Part of every payment is the cost of the units sold; only the rest is a capital gain.

References

Related tools

Report a problem with this lesson

Quick answers and tool search

Type to search tools or to get a quick answer, for example 18% of 2500. Use the up and down arrow keys to move through the results, Enter to choose, and Escape to close.