eqlx.aiOpen research

eqlx.org / eqlx-ifrs9

Python library · MCP server · v0.2 · Apache-2.0

Expected credit loss, with the reason for every number.

A bank must set money aside today for loans that may not be repaid. eqlx-ifrs9 computes that amount for a whole loan book under IFRS 9, and says why for every single loan. It also checks a bank's own figures, explains what changed since last year, and works out a single troubled borrower. AI agents use it read-only.

What goes in, what comes out

No model inside. Same input, same answer.

You give

  • a file of loans
  • chance of default and loss rate per loan
  • economic scenarios and their weights
  • your thresholds

eqlx-ifrs9 computes

  • default risk month by month
  • what is owed each month
  • loss in every scenario
  • the stage of every loan

You get

  • the provision, loan by loan
  • the rule behind each stage
  • the effect of each scenario
  • warnings about weak policy choices

Three stages decide how much loss is counted

Every loan lands in one of them.

Stage 1

Performing

Risk is about what it was when the loan was granted.

Counts: losses from the next 12 months
Stage 2

Risk has risen

Default is clearly more likely than expected at the start, or a payment is over 30 days late.

Counts: losses over the whole remaining life
Stage 3

In default

Over 90 days late, or the bank no longer expects to be paid in full.

Counts: the loss already expected

One loan, start to finish

What you enter, what the tool computes, what comes back. A consumer loan from the sample portfolio.

1You enter the loan

One row in a file.

Amount owed100,000
Repaymentmonthly instalments, 36 left
Interest rate30 %
Chance of default in a year, today9 %
The same chance, as expected when granted3 %
Share lost if it defaults60 %
Days late0

2You set the policy

Once, for the whole book.

Risk "has risen" when it is at least2 times the start
Scenario: base case60 % likely
Scenario: downturn25 % likely
Scenario: good years15 % likely
Late payment moves a loan to stage 2 after30 days
and to stage 3 after90 days

3Chance of default, per scenario

Over the three years left.

Good years
16 %
Base case
21 %
Downturn
34 %

4What is still owed

It falls with every instalment, so a late default costs less.

Today
100,000
In a year
75,925
In two years
43,546

5Expected loss, per scenario

Chance of default × share lost × amount owed, month by month, in today's money.

Good years
4,190
Base case
6,136
Downturn
11,017
Weighted
7,065

6Has risk risen?

Yearly chance of default over the life left, today against the start.

Today
8.7 %
At the start
3 %
2.9 times above the limit of 2: stage 2
7,065provision · 7.1 % of the loan

What comes back

Stage 2, because default risk is 2.9 times what was expected at the start. So losses over the whole remaining life are counted. Had it stayed in stage 1, only the next 12 months would count: 4,644.

Stage 2

The same steps run for every loan in the file. Each figure above is what the tool returns when asked to explain this loan.

A result at a glance

The made-up sample portfolio that ships with the tool: 2,011 loans, 2.8 billion of exposure, a provision of 102.3 million.

Under 5 % of the lending carries 75 % of the provision.

Stage 1 · 1,607 loansStage 2 · 348 loansStage 3 · 56 loans · 4.9 % of lending

Why are 348 loans in stage 2?

The red bar is a question supervisors ask: how many loans were caught only when a payment was already late?

What if the economy turns?

The reported figure is 10 % above the base case: a downturn costs more than good years save.

Why did the provision change?

Give last year's loan file as well. Every loan is matched and the change is split into its causes.

From 63.3 m to 102.3 m in a year: +61.6 %.

1,667 loans in both files, 344 new, 167 gone. The pieces add up to the last decimal. This is the reconciliation accounting rules ask banks to publish (IFRS 7); how the change of one loan is split depends on the order of the steps, so the order is a setting and is printed with the result.

The loans behind it

+4.2 mL000601 · new loan to a borrower whose other loan is in default
−3.8 mL000417 · stayed in stage 3, partly repaid
+3.8 mL001750 · went from stage 1 to stage 3
+3.4 mL001672 · went from stage 1 to stage 3

Did the warning light work?

Stage 2 should catch a loan before it defaults. One year later you can count.

0.54 %of last year's stage 1 loans defaulted
18.4 %of last year's stage 2 loans defaulted34 times riskier
8 of 42new defaults came straight from stage 1no warning

And the forecast: 63 defaults were expected, 42 happened. Told what the economy actually did, the tool separates what the forecast got wrong from what the model got wrong.

Checking a bank's own numbers

The bank already has a stage and a provision for every loan. Put them in the file: every loan is computed again and the two are set side by side.

In total the bank is within 0.9 %. Two portfolios are not.

Under 5 % counts as immaterial, 5 to 10 % needs an explanation, above 10 % is investigated: the thresholds the European Central Bank uses when it reviews banks. The sample bank is made up, with differences planted on purpose.

33 loansthe bank keeps in stage 1; the risk test puts them in stage 2. Each is listed with the rule that fired.
926,433the gap in total
420,213of it from loans in the wrong stage
506,220of it from how the loss is measured

How hard does a downturn hit?

A step down costs 3.1 times what a step up saves. A provision that barely moves here is a question for the bank's model, not an answer.

One troubled borrower

A large loan in default does not get a portfolio rate. Someone works out what can still be collected, usually in a spreadsheet. Here it is a file and one command.

1What the land brings

A developer has stopped paying. The business is gone; the land is what is left.

Owedthe loan
95.0 m
Land todayvaluer's figure
120.0 m
Sold in 3 yearsin today's money, at 35 % interest
48.8 m
After discount and costs15 % off at auction, fees, upkeep
36.2 m
After the tax officeits claim is paid first
26.2 m

2Two ways it can go

Each with its likelihood. The provision is the weighted shortfall.

Sale as planned · 60 % likelycollect 26.2 m
Slow market · 40 % likely
4 years, 30 % off, value down 10 %
collect 8.1 m
Shortfall, sale as planned68.8 m
Shortfall, slow market86.9 m
76.0 mprovision · 80 % of the loan

What comes back

Every cash flow with its year and its value today. Most of the loss is time: at 35 % interest, 3 years turn 120.0 m into 48.8 m before any discount or cost.

Stage 3
Business is goneCollateral is sold: discount, costs, time, who is paid first
Business goes onOne steady year of cash flow, times a multiple
There is a planCash flow year by year, plus what is left at the end
The loan has a priceAn observable market price

Four ways to estimate, one per scenario. Cash is shared among all creditors by rank. The tool warns when an input departs from what the European Central Bank expects: an auction discount under 10 %, a valuation older than a year, a business still treated as alive 18 months past due. Whether the plan is credible stays a human judgement.

One loan, opened up

Any loan can be opened to see the steps. Two examples.

How much loss?

A three-year instalment loan of 100,000. 3 % yearly chance of default, 60 % lost if it defaults.

Year 1
1,407
Year 2
724
Year 3
220
Stage 1 1,407  ·  Stage 2 2,351

Later years add less: the loan is being repaid. In a downturn the lifetime figure becomes 4,226.

Has risk really risen?

Two years into a five-year loan. Chance of default over the three years left:

Today
16 %
Expected at the startfor these same 3 years
7.7 %
Wrong yardstickall 5 years at the start
10 %
2.1 times risk has doubled: stage 2

Against the wrong yardstick it looks like 1.6 times and the loan would stay in stage 1.

How an agent uses it

The agent decides what to look at. The tool computes. It reads one folder, writes nothing, sends nothing.

RunStages, provision, scenarios, warnings
ExplainOne loan, step by step
CheckThe bank's figures against a recalculation
Compare dates"Why did it rise since last year?"
AssessOne borrower in default, scenario by scenario

Eighteen tools in all, including calculators that need no file. To connect it to Claude Code:

pip install "eqlx-ifrs9[mcp]"
claude mcp add ifrs9 -- ifrs9 mcp --root /path/to/folder

How it was tested

Each calculation is compared with something that does not share its code.

Published examples, reproduced exactly

✓1,250IFRS 9 Example 8 · 12-month loss
✓750 and 675Example 9 · loss-rate approach
✓25,000 and 45,000Example 10 · credit lines
✓580,000Example 12 · provision matrix
✓114 and 145IFRS 7 guidance · two matrices
✓92, not 70Standard-setter's scenario example
✓0.002736Israel, Rosenthal, Wei 2001 · rating matrix
✓73.80 and 26.20ECB review manual · collateral sale
✓84 and 216ECB guidance · sale after five years
✓46,476ECB review manual · cash flow times six
✓141.70 and 103.50ECB review manual · project loan

Why "92, not 70" matters

Three views of the economy, each with its loss and its likelihood:

Good20 % likely
30
Most likely50 % likely
70
Bad30 % likely
170

Taking only the most likely view misses the cost of the bad one.

Most likely only
70
Weighted
92
+31 % what the standard asks for

Where no published example exists

A three-year loan, computed correctly and with two mistakes that are easy to make.

23.60Yearly steps on a monthly loan2.7 % too low
24.24Formula, plain loop and a simulation of two million loans agreecorrect
24.94Counting defaults of loans that have already defaulted2.9 % too high

And the whole run against itself

2 routesall loans at once, and each loan on its own with separate code; they must agree
14 decimalsan independent recalculation from scratch matched the results
356 testsrun on every change, including shuffled input files
3 secondsfor 200,000 loans and three scenarios on one laptop core
0.00left unexplained: the causes of a year's change add up to the closing figure, in any order of steps

Türkiye: the BDDK rules on top

Turkish banks sort loans into five groups by how late payments are. The tool applies them with the article number behind each decision.

30 days90 days180 days1 year late

One borrower, all loans

Loan A200 days lateGroup 4 · Stage 3
same borrower
Loan Bnever lateGroup 4 · Stage 3

From the sample portfolio: 5,000,000 that is not late on any payment, provision 2,750,000. The tool's reason: "another loan of the borrower is non-performing: same group 4 (Art. 5(5))". Follows the regulation as amended up to May 2022.

What it does not do

No estimating, no forecastingDefault chances, loss rates and scenarios are your inputs.
No choosing your policyThresholds and weights are settings you write down. It refuses to guess.
Not an accounting opinionA recalculation to check and explain, not an audited figure.
Not the whole standardNo classification, no hedge accounting, no loans bought already in default.
pip install "eqlx-ifrs9[mcp]"
ifrs9 sample demo        # a made-up portfolio with known answers
ifrs9 run demo/loans.csv --config demo/settings.json
ifrs9 loan demo/loans.csv CASE-PD-TRIPLED --config demo/settings.json
ifrs9 reconcile demo/loans.csv --config demo/settings.json
ifrs9 movement demo/loans_previous.csv demo/loans.csv --config demo/settings.json \
    --opening-config demo/settings_previous.json --write-offs demo/write_offs.csv
ifrs9 individual demo/case_gone_concern.json