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.
Performing
Risk is about what it was when the loan was granted.
Counts: losses from the next 12 monthsRisk 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 lifeIn default
Over 90 days late, or the bank no longer expects to be paid in full.
Counts: the loss already expectedOne 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 owed | 100,000 |
| Repayment | monthly instalments, 36 left |
| Interest rate | 30 % |
| Chance of default in a year, today | 9 % |
| The same chance, as expected when granted | 3 % |
| Share lost if it defaults | 60 % |
| Days late | 0 |
2You set the policy
Once, for the whole book.
| Risk "has risen" when it is at least | 2 times the start |
| Scenario: base case | 60 % likely |
| Scenario: downturn | 25 % likely |
| Scenario: good years | 15 % likely |
| Late payment moves a loan to stage 2 after | 30 days |
| and to stage 3 after | 90 days |
3Chance of default, per scenario
Over the three years left.
4What is still owed
It falls with every instalment, so a late default costs less.
5Expected loss, per scenario
Chance of default × share lost × amount owed, month by month, in today's money.
6Has risk risen?
Yearly chance of default over the life left, today against the start.
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.
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.
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
Did the warning light work?
Stage 2 should catch a loan before it defaults. One year later you can count.
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.
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.
2Two ways it can go
Each with its likelihood. The provision is the weighted shortfall.
| Sale as planned · 60 % likely | collect 26.2 m |
| Slow market · 40 % likely 4 years, 30 % off, value down 10 % | collect 8.1 m |
| Shortfall, sale as planned | 68.8 m |
| Shortfall, slow market | 86.9 m |
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.
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.
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:
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.
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
Why "92, not 70" matters
Three views of the economy, each with its loss and its likelihood:
Taking only the most likely view misses the cost of the bad one.
Where no published example exists
A three-year loan, computed correctly and with two mistakes that are easy to make.
And the whole run against itself
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.
One borrower, all loans
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
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