Ported from the open-source IFRS 17 Calculation Engine —
ifrs17-template/PracticalUseCases/SingleVsMultipleCsmSwitch/CsmSwitchReports.ipynb —
originally written for Systemorph Cloud.
The CSM / loss-component switch
Theory
A fundamental concept of IFRS 17 is the contractual service margin (CSM): the unearned profit an entity expects to earn as it provides service. It is defined at the smallest granularity, the group of insurance contracts (the unit of account), and applies to every approach for the liability for remaining coverage except the premium allocation approach.
Four principles govern the CSM and the loss component:
Principle 1. When an insurer writes profitable business, it may not recognise the expected profit immediately; it must spread that profit over time.
Principle 2. When an insurer writes loss-making business, it may not spread the expected loss over time; it must recognise that loss immediately.

Principle 3. The CSM is adjusted for every change — every AoC step — that relates to future service. A favourable mortality update increases it; unfavourable lapse experience decreases it.
Principle 4. When business previously expected to be profitable is now expected to be loss-making — because of a change relating to future service, say — the insurer may not spread the expected loss either. It first extinguishes the CSM and then establishes a loss component (LC) for the remaining excess. That is a switch from CSM to LC.

Two switch logics
The technical margin gives, for each AoC step, an amount that is either asset-like (negative, allocated to the CSM) or liability-like (positive, allocated to the loss component). Which side a step goes to depends on the sign of the margin accumulated from the opening to that step. Along the chain the accumulated margin can cross zero several times. How its steps are then allocated is the switch logic, and there are two reasonable ones:
- Multiple switches — the allocation may change at every step, whenever the accumulated margin changes sign. This is the open-source engine's standard methodology.
- Single switch — the allocation changes at most once per period, and only if the accumulated margin at the opening and at the closing have different signs (an odd number of crossings). With an even number of crossings there is no switch at all.
The original's case study compares two groups with identical inputs — the same parameters, cash flows and actuals — that differ only in the switch logic.
What the comparison shows
The standard implementation computes the margin separately for in force and new business: many analysts treat the new-business part of the CSM as a key performance indicator.
In the case study the opening and the closing margin have the same sign (negative), so
intuitively there is no switch. But per novelty the closing balances have opposite signs: in force
is always negative, new business always positive. In force is larger in magnitude, so the combined
margin is negative, and the combined steps after CL are too small to change that.
- Single switch. No loss component is ever recognised, because the opening and the closing are
both negative. The new-business contributions are forced onto the CSM side, with a negative sign
to show that they reduce it. In the LRC view they cancel the corresponding fulfilment-cash-flow
steps, and the
CLstep is zero — there is nothing to balance. - Multiple switches. New business is recognised in the loss component — it is liability-like
on its own — while in force sits in the CSM. The combined liabilities step
CLresolves the discrepancy: it adds the two novelties, releases the liability-like amount and allocates the same amount to the CSM.
Both approaches give the same opening and closing LRC; only the AoC steps between differ. In the financial performance the total comprehensive income is the same, and so is the OCI. The insurance service result and the insurance finance income/expense differ, and the differences cancel in profit and loss. The multiple-switch logic shows an explicit loss-component contribution and larger CSM changes, financial and non-financial.
Splitting every figure of the financial performance into financial and non-financial parts creates extra rows that cancel in aggregate. Some find that confusing; others find it transparent. Without that split for the loss component, the financial performance would show no loss-component rows and the same totals. KPIs built on the CSM or the loss component, however, can look very different under the two logics even though the financial performance agrees.
In the MeshWeaver port
The port implements the multiple-switch logic, per novelty: AllocateTechnicalMargin
classifies the accumulated margin before and after every step and switches whenever the class
changes. There is no single-switch option. How the port treats the CL step, and what is not
established there, is on Technical margin.
The financial performance, in which the original's comparison shows its differences, is not ported
(see Reports and financial performance).