SENIORCHAPTER 28

Lending dashboards and management reports: what a lending team reads every day

A lending report is a set of definitions with a table on top. Fix the definitions, rebuild the position from events, tie it to the book, and three people can quote one number

60 MINLENDING AND CREDITUPDATED 2026-11-14
PREDICT

At the close of 30 June Owoleaf's gross book (what borrowers still owe on loans that are not written off) was ₦438,468,149.27 and PAR30, the share of it on loans more than 30 days overdue, was 1.2%. By the cut-off it was ₦94,772,179.30 and PAR30 was 16.7%, because no new loans were made after June. Roughly how much more money was 30 or more days past due at the cut-off than on 30 June?

Most lending teams do not lack data. They lack agreement about what a number means. A report is the point where the loan book meets a reader who has two minutes, and a reader with two minutes cannot see the definitions. So the definitions have to be right before the table is printed.

The pack in this chapter’s lab prints the day, the last seven days and the month to date side by side, with the book at close beneath them. It runs on the two folders the module uses. data/ is the scale 0.1 book (372 loans): enough to read, too small for a ratio to be steady. data1/ is the scale 1 book (3,645 loans) the modelling chapters use. Every figure below came out of that code.

Three readers, three rhythms

A lending team does not need one dashboard. It needs a few reports, each written for one reader and one question.

Cadence Reader The question What is in it
Daily, before the day starts Lending operations, collections lead, treasury What happened yesterday, and what is due today? Applications and decisions, loans disbursed, instalments due and paid, cash in and out, loans that crossed into 30 or more days past due
Weekly Head of lending, credit risk, product Is the book drifting? Approval and decline reasons by product and channel, collections by rail, PAR and its trend, the largest accounts in arrears, vintages (the collections chapter has roll rates; the portfolio metrics chapter in this module builds vintage curves)
Monthly Finance, credit committee, board How much is at risk, and what does it cost us? PAR and the non-performing ratio, provisions and their movement, write-offs, cash and funding, commentary, policy exceptions

Three rules keep the three reports consistent. Every number has one definition, in one place, with an owner. Every ratio is printed beside the amounts it divides. Every report says the date it describes and when it was produced.

The pack follows one convention for dates. The pack for the morning of a date D describes the position at the close of the day before D, and reports the activity of that day. Nothing from D leaks in, and the same command next week gives the same answer. The lab’s position() function enforces this: a payment counts if it was made before D, an instalment is overdue if it fell due before D.

The daily pack: what moved yesterday

Four sections make up the daily view: the funnel, disbursements, collections and cash. Each is a flow, a count of events in a window.

The funnel counts applications by the day they were made and splits them into approved, declined and withdrawn. The loan lifecycle chapter defines the stages. The pack prints two rates, because “approval rate” has several meanings. The offer rate is applications that ended in an offer (approved plus withdrawn) divided by all applications. Take-up is approved divided by offered. On 15 June in the scale 1 book, 158 applications arrived, 69 were approved, 86 declined and 3 were withdrawn. The offer rate was (69 + 3) ÷ 158 = 45.6%, and take-up was 69 ÷ 72 = 95.8%.

Disbursements count loans by the day the money left. Approved is not disbursed: 69 loans were approved on 15 June and 68 were disbursed that day, because the lab’s loans leave the same day or the next. In a real lender the gap is a queue, a failed identity check or a payout that did not go. On 15 June the 68 loans carried ₦9,475,000.00 of principal and ₦125,130.00 of fees kept, so ₦9,475,000.00 − ₦125,130.00 = ₦9,349,870.00 left the building.

Collections compare the instalments that fell due with what arrived. The pack prints three things that look alike and are not:

  • Due: instalments whose due date is in the window, at their scheduled amount.
  • Paid on the day: those same instalments, paid in full on or before their due date. This has a count rate and a value rate.
  • Cash in: every payment received in the window, including instalments due earlier and late fees.

On 27 October (the cut-off book, data1/) eight instalments fell due, worth ₦760,661.28. Seven were paid on the day, worth ₦742,018.03. That is 7 ÷ 8 = 87.5% by count and ₦742,018.03 ÷ ₦760,661.28 = 97.5% by value. The instalment that was missed was worth only ₦18,643.25. Cash in was ₦839,427.79, ₦97,409.76 more than the instalments paid on the day, because payments for earlier due dates and late fees arrived as well. All three figures are true. A collector reads the count (how many customers did not pay), a treasurer reads the value, and a manager reads whichever one the pack labelled first. The pack prints both and says which is which.

One day is also a small sample. When eight instalments fall due, one payment moves the count rate by 12.5 points. Use the day for worklists and the seven-day and month-to-date columns for conclusions.

Cash is the lending cash flow: net paid out against received. On 15 June the pack shows ₦9,349,870.00 out and ₦3,343,403.14 in, a net of −₦6,006,466.86 (₦3,343,403.14 − ₦9,349,870.00). A growing book consumes cash, which is why treasury reads this line first. At the cut-off the sign has reversed, because the book is running off. A lender’s wider cash and funding position is the subject of the treasury chapter in module 4; the daily line only shows what lending did to it.

There is one more daily trap on the pack for 28 October. The funnel and disbursement rows read zero. They are right, because the lab’s applications stopped on 30 June (loan_book_meta says so). But a zero in a daily pack has two meanings: nothing happened, or nothing arrived. A reader cannot tell them apart unless the pack shows where each source was last loaded and how many rows it held. The controls section below returns to that.

The book at close: stocks and the ageing table

Flows tell you what happened. A stock tells you where you stand. The central stock is the principal outstanding on each loan, and how late its oldest unpaid instalment is: days past due, DPD (the loan lifecycle chapter defines it).

The pack groups loans into buckets by DPD: current, 1 to 29, 30 to 59, 60 to 89 and 90 to 179. A loan at 180 days is written off in this book and leaves the table, which the pack keeps as a memo. Here is the cut-off position of the scale 1 book:

Bucket Loans Outstanding Share
Current 462 ₦75,217,147.92 79.4%
1 to 29 23 ₦3,737,824.04 3.9%
30 to 59 8 ₦2,718,812.74 2.9%
60 to 89 11 ₦2,444,078.78 2.6%
90 to 179 310 ₦10,654,315.82 11.2%
Gross book 814 ₦94,772,179.30

Portfolio at risk (PAR) with a number after it, such as PAR30, is the principal outstanding on every loan that is that many days past due or more, divided by the gross book. The portfolio metrics chapter counts the same way.

The September 2003 microfinance consensus guidelines of the Consultative Group to Assist the Poor (CGAP) are a set of standard definitions for ratios such as portfolio at risk, and say they are not a template for financial reporting. Search results did not show the PAR wording itself, and a vendor blog that reports a day count of more than 30 could not be checked, so read the definition in the PDF before you quote itas of 2026-11. The usual practice, which this chapter and the portfolio metrics chapter follow, is that the whole balance of a late loan counts, not its overdue instalment. Take the lab’s worked loan, L000043 in data/. It is a ₦310,000 personal loan with six instalments of ₦60,102.30. Instalment 1 was paid and instalments 2, 3 and 4 (due 19 August, 18 September and 18 October) were not, so the oldest unpaid instalment is 70 days past due. The overdue amount is 3 × ₦60,102.30 = ₦180,306.90. The principal outstanding is ₦310,000 − ₦46,152.30 = ₦263,847.70, and that whole amount sits in the 60 to 89 bucket and in PAR30. Sources differ on whether a loan that has been rescheduled stays in the numerator; the restructuring chapter in this module returns to it. Decide, and write the decision into the definition.

The non-performing loan (NPL) ratio is PAR at the point where the lender stops expecting payment. The pack uses 90 days, PAR90. For banks the Central Bank of Nigeria (CBN) is generally described as using the same line: the CBN published Prudential Guidelines for deposit money banks in 2010, with a final text of 30 June 2010 that took effect on 1 July 2010 and superseded a May 2010 version. Search results confirmed the document but not its wording: the description of a non-performing loan as one with scheduled payments missed for at least 90 days comes from a press article, which is not a source for a ruleas of 2026-11. The CBN’s site also carries an August 2019 exposure draft for deposit money banks, and press coverage mentions later revisions. This chapter has not confirmed which text is in force, so check the CBN’s current list and read the classification section before you cite either. Which rules bind Owoleaf is a licensing question for module 4. The pack’s PAR90 is the lab’s own definition. It is not a regulatory return.

Three traps live in these ratios.

The write-off trap. Loans are written off at 180 days past due, and a written-off loan leaves both the numerator and the denominator. At the cut-off the pack’s PAR90 on the gross book is ₦10,654,315.82 ÷ ₦94,772,179.30 = 11.2%. Keep the 58 written-off loans in, and the same book reads (₦10,654,315.82 + ₦2,945,038.89) ÷ (₦94,772,179.30 + ₦2,945,038.89) = ₦13,599,354.71 ÷ ₦97,717,218.19 = 13.9%. Those are the 11.2% and the 13.9% from the Why. The portfolio metrics chapter keeps the written-off loans in its base throughout, so it reports PAR30 of 19.2% for the same cut-off book and 1.1% for 30 June, where this chapter’s gross book gives 16.7% and 1.2%. The first gap is the write-off basis. The second is the date: that chapter’s 30 June is the start of the day and this one’s is the close, so an instalment due on 30 June and unpaid counts here as one day late. Neither is wrong; a pack states its basis. A lender that writes off sooner reports a lower ratio from the same behaviour by its borrowers. Report the headline on one stated basis and show the other beside it.

The run-off trap. The trend table below shows the book at each month end. Lending stopped after June, so the gross book fell from ₦438,468,149.27 to ₦94,772,179.30 as borrowers repaid.

Close of Gross book 30+ days past due PAR30 PAR90
30 June ₦438,468,149.27 ₦5,057,872.58 1.2% 0.2%
31 July ₦307,134,617.39 ₦8,446,296.54 2.8% 1.0%
31 August ₦207,639,828.76 ₦14,568,459.89 7.0% 2.3%
30 September ₦135,854,631.49 ₦15,617,670.12 11.5% 5.7%
27 October ₦94,772,179.30 ₦15,817,207.34 16.7% 11.2%

From 30 September to the cut-off the amount 30 or more days past due moved by ₦199,537.22 and PAR30 moved by five points. The denominator did the work. The memo column also grows: loans that reach 180 days leave the table (₦2,945,038.89 written off by the cut-off against ₦875,383.19 at 30 September), which is one reason the amount past due stopped growing. A growing book does the reverse: it flatters PAR, because new loans have not had time to go late. On 15 June, with the book still growing, PAR30 was 1.1%. Always read the amount next to the ratio, and read vintages (loans grouped by month of disbursement, the subject of the portfolio metrics chapter) when the book is changing size.

The small-book trap. Run the pack on data/ and the book is ₦8,164,579.00 across 82 loans. The largest loan, ₦600,719.56, is 7.4% of it. On data1/ the largest is ₦1,234,572.47, 1.3% of a book more than eleven times larger. A daily PAR on 82 loans moves several points when one loan goes late. Quote a small book’s ratio with the number of loans behind it.

Provisions in the pack

A provision is money set aside against loans that may not be repaid. The pack applies a provision matrix: a rate per bucket, applied to the principal outstanding in that bucket. The rates are ILLUSTRATIVE (1% current, 3% for 1 to 29 days, 10% for 30 to 59, 25% for 60 to 89, 60% for 90 to 179), set in stock.py. They are not IFRS 9’s and not the CBN’s: the provisioning chapter’s expected credit loss on this same book at the cut-off is ₦18,807,964.35 (70/30 scenario weights), more than twice the matrix’s ₦8,139,796.64, because the matrix gives a loan under 30 days late 1% to 3% and does not look forward. The arithmetic for the largest line: ₦10,654,315.82 × 60% = ₦6,392,589.49. That is 78.5% of the whole provision of ₦8,139,796.64, from 310 loans out of 814. The provision cover is the provision divided by the gross book: ₦8,139,796.64 ÷ ₦94,772,179.30 = 8.6%.

A matrix like this is a monitoring tool. An accounting provision under IFRS 9 is built differently. IFRS 9 is described (paragraph 5.5.11) as presuming that credit risk has increased significantly when contractual payments are more than 30 days past due, and (paragraph B5.5.37) as presuming that default does not occur later than 90 days past due, each rebuttable with reasonable and supportable information; the entity uses a default definition consistent with its internal credit risk management. The search results that say this were commentaries, not the standard’s own text, so check the wording and paragraph numbers in the standardas of 2026-11. Those two lines are why the pack’s buckets start at 30 and 90. The standard says more than 30 days, so a loan at exactly 30 days sits in the pack’s 30 to 59 bucket although the standard’s presumption does not yet reach it. The provisioning chapter uses the standard’s wording; write your convention down. The stages, the forward-looking scenarios and the expected credit loss calculation are in the provisioning under IFRS 9 chapter.

Two traps for a monthly pack:

  • A balance is not a charge. The pack’s provision rose from ₦7,469,966.61 at 30 September to ₦8,139,796.64 at the cut-off, a change of ₦669,830.03. That is the change in the balance. The charge to profit is that change plus the provision used up by loans written off in the month, and loans written off took 60% provision with them. The monthly portfolio review project builds the roll-forward. A pack that prints only the balance change understates the cost.
  • Cover moves for reasons that are not risk. Provision cover rose from 1.3% at 30 June (₦5,758,201.66 ÷ ₦438,468,149.27) to 8.6%, because the book aged and shrank. The matrix did not change.

Build it so the number can be trusted

A report that cannot be reproduced is an opinion. Four habits make it a record.

Rebuild the position from events. The loans table carries status, days_past_due and outstanding_principal_kobo as at the cut-off. Ask it about an earlier date and it rewrites history. The lab tests this: it reports the close of 31 July from the schedule and the repayments, 1.0%, and from today’s status column, 11.2%. The second number counts loans that were current in July and went bad in September. The pack’s position() replays schedule and repayments up to the date and is correct for any date. A production lender keeps dated snapshots for the same reason. The reconciliation chapter in Payments makes the same point about ledgers: the record that decides is the one you can replay.

Tie out to the source, in more than one way. The controls section checks that the buckets and the written-off memo add up to the position, and, at the cut-off, that the rebuilt principal outstanding and every loan’s DPD equal the loans table. A control on the total alone is not enough. The lab’s break step shows a plausible rule that keeps the total right and moves 63 loans into the wrong bucket. A pack that fails a control is not sent.

Keep definitions in one place. The buckets, the write-off line and the provision rates are constants at the top of two files, not figures typed into a spreadsheet cell. When a definition changes (a new write-off policy, a different DPD convention), restate the history on the new basis and say so on the page. A trend line that changes basis halfway is a break in the series that looks like a change in the book.

Show the denominator, the count and the freshness. Print amounts beside ratios, counts beside values, the number of loans behind a small cell, and the date each source was loaded. That is how a reader tells a zero from a missing feed. Large banks have a supervisory document on this problem: the Basel Committee’s principles for effective risk data aggregation and risk reporting, published on 9 January 2013, set 14 principles in four groups (overarching governance and infrastructure, risk data aggregation, risk reporting and supervisory review) for banksas of 2026-11. They are written for banks, with the largest in mind, and are not a requirement on Owoleaf. Read them as a list of questions a careful reporting process answers.

Then the commentary. A pack is numbers first and one paragraph second: what moved, why we think so, what we do. A named person signs the paragraph, and it has to survive a check against the table. “PAR30 rose to 16.7%” is a number. “PAR30 rose to 16.7% because the book repaid from ₦135,854,631.49 to ₦94,772,179.30 while the amount past due stayed between ₦15,617,670.12 and ₦15,817,207.34, and we will watch the amount” is a statement a reader can use.

What goes wrong

Trap How it misleads The check
Approval rate with the wrong denominator The scale 1 book shows 43.5% (approved ÷ applications), 44.6% (approved ÷ decided) and 46.1% (offered ÷ applications) at once; in naira, only 31.5% of what was asked was approved Name the numerator and the denominator on the page
Collection rate by count against value 87.5% and 97.5% for the same day Print both, labelled
The window the collection rate is measured over For August’s instalments, 87.7% by count were paid on the day, 91.2% within 3 days, 92.3% within 7 and 95.3% within 30. Last week’s rate is always lower than it will be Compare like with like: the same days after the due date
PAR as the overdue amount ₦180,306.90 overdue, ₦263,847.70 in PAR Write the definition under the table
Write-offs flatter the NPL ratio 11.2% against 13.9% Print the memo beside the headline
A shrinking or a growing book The ratio moves with the denominator Show the amount and the vintages
A past date from today’s status 1.0% rebuilt against 11.2% from the status column Rebuild from events, or keep dated snapshots
A small book One loan is 7.4% of the scale 0.1 book Show the loan count
Provision balance read as the charge ₦669,830.03 is a change in balance, not the month’s cost Roll the provision forward
LAB Build the morning pack from the loan book and break it ~50 MIN
YOU NEEDPython 3.9 or later (standard library only)labs/finance with data/ (scale 0.1) and data1/ (scale 1) builtAbout 720 MB of disk and about 40 seconds to build data1 if you do not have itNo Docker, no packages

You work in labs/finance. Every step runs Python from that folder and only reads the databases. You write five small files into the folder: state.py, flows.py, stock.py, pack.py and traps.py.

1. Check both folders. If data1/ does not exist, build it with the README’s command (about 40 seconds), then check it. The check takes about 30 seconds. The Python prints the shape of each book and the two dates that matter: when applications stopped and the cut-off.

cd labs/finance
python3 generate.py --scale 1 --out data1 && python3 loans.py --out data1 \
  && python3 cards.py --out data1 && python3 collect.py --out data1
python3 check.py --db data1/finance.sqlite
python3 - <<'PY'
import sqlite3

for folder in ("data", "data1"):
    db = sqlite3.connect(f"{folder}/finance.sqlite")
    meta = dict(db.execute("SELECT key, value FROM loan_book_meta"))
    counts = {t: db.execute(f"SELECT COUNT(*) FROM {t}").fetchone()[0]
              for t in ("applications", "loans", "schedule", "repayments")}
    last = db.execute("SELECT MAX(disbursed_at) FROM loans").fetchone()[0]
    print(folder, meta)
    print("   ", counts, "last disbursement", last)
PY

check.py prints OK: all invariants hold as its last line. The query prints:

data {'start': '2026-01-01', 'applications_end': '2026-06-30', 'cut_off': '2026-10-28'}
    {'applications': 852, 'loans': 372, 'schedule': 1127, 'repayments': 891} last disbursement 2026-06-28
data1 {'start': '2026-01-01', 'applications_end': '2026-06-30', 'cut_off': '2026-10-28'}
    {'applications': 8386, 'loans': 3645, 'schedule': 10735, 'repayments': 8457} last disbursement 2026-06-28

Applications stop on 30 June and the last loan leaves on 28 June, so any funnel or disbursement row after June is a true zero.

2. Rebuild the position. Save this as state.py. It holds the helpers, the buckets and position(), which rebuilds each loan’s principal outstanding and days past due for any morning from schedule and repayments. The naira() helper turns integer kobo into text; money stays in kobo everywhere else.

"""state.py: shared helpers and the position of every loan on a given morning."""
import datetime as dt
import sqlite3

# Days-past-due buckets. The book writes a loan off at 180 days past due (loans.py).
BUCKETS = [("current", 0, 0), ("1-29", 1, 29), ("30-59", 30, 59), ("60-89", 60, 89), ("90-179", 90, 179)]
WRITE_OFF_DPD = 180


def connect(path):
    return sqlite3.connect(f"file:{path}?mode=ro", uri=True)      # a report only reads


def naira(kobo):
    sign = "-" if kobo < 0 else ""
    kobo = abs(kobo)
    return f"{sign}₦{kobo // 100:,}.{kobo % 100:02d}"


def pct(num, den):
    return f"{num / den:.1%}" if den else "n/a"


def day(text):
    return dt.date.fromisoformat(text[:10])


def windows(pack_date):
    """The pack for a morning reports the day before, the 7 days to it, and the month to it."""
    r = pack_date - dt.timedelta(days=1)
    return [("day", r, r), ("last 7 days", r - dt.timedelta(days=6), r), ("month to date", r.replace(day=1), r)]


def position(db, pack_date):
    """Each loan's position at the start of pack_date, which is the close of the day before.
    A payment counts if it was made before pack_date. An instalment is overdue if it fell due
    before pack_date and the principal and interest paid on it do not cover it."""
    before = pack_date.isoformat()
    paid = {}
    for loan_id, n, p, i in db.execute(
            "SELECT loan_id, instalment, principal_kobo, interest_kobo FROM repayments WHERE paid_at < ?", (before,)):
        paid[(loan_id, n)] = paid.get((loan_id, n), 0) + p + i
    oldest = {}
    for loan_id, n, due, total in db.execute(
            "SELECT loan_id, instalment, due_date, total_kobo FROM schedule WHERE due_date < ? ORDER BY due_date",
            (before,)):
        if paid.get((loan_id, n), 0) < total and loan_id not in oldest:
            oldest[loan_id] = day(due)
    repaid = dict(db.execute("SELECT loan_id, SUM(principal_kobo) FROM repayments WHERE paid_at < ? GROUP BY loan_id",
                             (before,)).fetchall())
    rows = []
    for loan_id, product, principal in db.execute(
            "SELECT id, product, principal_kobo FROM loans WHERE disbursed_at < ?", (before,)):
        rows.append(dict(id=loan_id, product=product, outstanding=principal - repaid.get(loan_id, 0),
                         dpd=(pack_date - oldest[loan_id]).days if loan_id in oldest else 0))
    return rows

Test it. At the cut-off the rebuilt position must equal the loans table. For an earlier date the loans table has nothing to compare with, so the script only counts.

python3 - <<'PY'
import datetime as dt
from state import connect, naira, position

for folder in ("data", "data1"):
    db = connect(f"{folder}/finance.sqlite")
    cut = dt.date.fromisoformat(db.execute("SELECT value FROM loan_book_meta WHERE key = 'cut_off'").fetchone()[0])
    stored = {i: (d, o) for i, d, o in db.execute(
        "SELECT id, days_past_due, outstanding_principal_kobo FROM loans")}
    rows = position(db, cut)
    wrong = [r["id"] for r in rows if (r["dpd"], r["outstanding"]) != stored[r["id"]]]
    print(f"{folder}: {len(rows)} loans rebuilt for {cut}, {len(wrong)} differ from the loans table, "
          f"principal outstanding {naira(sum(r['outstanding'] for r in rows))}")
    early = position(db, dt.date(2026, 7, 1))
    owing = [r for r in early if r["outstanding"]]
    print(f"   for 2026-07-01: {len(owing)} loans still owing, "
          f"{sum(1 for r in owing if r['dpd'] >= 90)} of them at 90 or more days past due")
PY
data: 372 loans rebuilt for 2026-10-28, 0 differ from the loans table, principal outstanding ₦8,502,584.79
   for 2026-07-01: 237 loans still owing, 0 of them at 90 or more days past due
data1: 3645 loans rebuilt for 2026-10-28, 0 differ from the loans table, principal outstanding ₦97,717,218.19
   for 2026-07-01: 2369 loans still owing, 18 of them at 90 or more days past due

The rebuild matches the stored days_past_due and outstanding_principal_kobo on every loan, in both folders. It also answers a question the table cannot: at the start of 1 July, 18 loans in the scale 1 book were already 90 or more days past due.

3. The flows. Save this as flows.py: the funnel, disbursements, collections and cash. Each function prints one section for the day, the last seven days and the month to date.

"""flows.py: what happened in the day, the week and the month: funnel, disbursements, collections, cash."""
import datetime as dt

from state import naira, pct


def funnel(db, wins):
    print("1. FUNNEL (applications, by the day they were made)")
    print(f"   {'':<15}{'applications':>13}{'approved':>10}{'declined':>10}{'withdrawn':>10}{'offer rate':>11}{'take-up':>9}")
    for name, a, b in wins:
        c = dict(db.execute("SELECT decision, COUNT(*) FROM applications "
                            "WHERE substr(applied_at, 1, 10) BETWEEN ? AND ? GROUP BY 1",
                            (a.isoformat(), b.isoformat())).fetchall())
        ap, de, wd = c.get("approved", 0), c.get("declined", 0), c.get("withdrawn", 0)
        print(f"   {name:<15}{ap + de + wd:>13}{ap:>10}{de:>10}{wd:>10}"
              f"{pct(ap + wd, ap + de + wd):>11}{pct(ap, ap + wd):>9}")


def disbursements(db, wins):
    print("\n2. DISBURSEMENTS (by disbursement date)")
    print(f"   {'':<15}{'loans':>6}{'principal':>18}{'fees kept':>14}{'paid out':>18}")
    for name, a, b in wins:
        n, p, f, net = db.execute(
            "SELECT COUNT(*), COALESCE(SUM(principal_kobo), 0), COALESCE(SUM(fee_kobo), 0), "
            "COALESCE(SUM(disbursed_net_kobo), 0) FROM loans WHERE disbursed_at BETWEEN ? AND ?",
            (a.isoformat(), b.isoformat())).fetchone()
        print(f"   {name:<15}{n:>6}{naira(p):>18}{naira(f):>14}{naira(net):>18}")


def collections(db, wins, pack_date):
    print("\n3. COLLECTIONS (instalments that fell due, and the cash that came in)")
    print(f"   {'':<15}{'due':>5}{'value':>16}{'paid on day':>12}{'value':>16}{'by count':>10}{'by value':>10}{'cash in':>16}")
    for name, a, b in wins:
        due_n, due_k = db.execute("SELECT COUNT(*), COALESCE(SUM(total_kobo), 0) FROM schedule "
                                  "WHERE due_date BETWEEN ? AND ?", (a.isoformat(), b.isoformat())).fetchone()
        on_n, on_k = db.execute(
            "SELECT COUNT(*), COALESCE(SUM(s.total_kobo), 0) FROM schedule s JOIN repayments r "
            "ON r.loan_id = s.loan_id AND r.instalment = s.instalment AND r.paid_at <= s.due_date "
            "AND r.principal_kobo + r.interest_kobo >= s.total_kobo WHERE s.due_date BETWEEN ? AND ?",
            (a.isoformat(), b.isoformat())).fetchone()
        cash = db.execute("SELECT COALESCE(SUM(amount_kobo), 0) FROM repayments WHERE paid_at BETWEEN ? AND ?",
                          (a.isoformat(), b.isoformat())).fetchone()[0]
        print(f"   {name:<15}{due_n:>5}{naira(due_k):>16}{on_n:>12}{naira(on_k):>16}"
              f"{pct(on_n, due_n):>10}{pct(on_k, due_k):>10}{naira(cash):>16}")
    n, k = db.execute("SELECT COUNT(*), COALESCE(SUM(total_kobo), 0) FROM schedule WHERE due_date BETWEEN ? AND ?",
                      (pack_date.isoformat(), (pack_date + dt.timedelta(days=6)).isoformat())).fetchone()
    print(f"   due in the next 7 days, from {pack_date}: {n} instalments, {naira(k)} (the contract, not a forecast)")


def cash(db, wins):
    print("\n4. CASH (lending only: what left and what came back)")
    print(f"   {'':<15}{'paid out':>18}{'received':>18}{'net':>18}")
    for name, a, b in wins:
        out = db.execute("SELECT COALESCE(SUM(disbursed_net_kobo), 0) FROM loans WHERE disbursed_at BETWEEN ? AND ?",
                         (a.isoformat(), b.isoformat())).fetchone()[0]
        got = db.execute("SELECT COALESCE(SUM(amount_kobo), 0) FROM repayments WHERE paid_at BETWEEN ? AND ?",
                         (a.isoformat(), b.isoformat())).fetchone()[0]
        print(f"   {name:<15}{naira(out):>18}{naira(got):>18}{naira(got - out):>18}")

Run it for the morning of 16 June on data1/, a busy day, so the figures come from the busy part of the book.

python3 - <<'PY'
import datetime as dt
import flows
from state import connect, windows

db = connect("data1/finance.sqlite")
pack_date = dt.date(2026, 6, 16)
wins = windows(pack_date)
flows.funnel(db, wins)
flows.disbursements(db, wins)
flows.collections(db, wins, pack_date)
flows.cash(db, wins)
PY
1. FUNNEL (applications, by the day they were made)
                   applications  approved  declined withdrawn offer rate  take-up
   day                      158        69        86         3      45.6%    95.8%
   last 7 days              961       366       567        28      41.0%    92.9%
   month to date           1899       769      1079        51      43.2%    93.8%

2. DISBURSEMENTS (by disbursement date)
                   loans         principal     fees kept          paid out
   day                68     ₦9,475,000.00   ₦125,130.00     ₦9,349,870.00
   last 7 days       355    ₦55,313,000.00   ₦735,690.00    ₦54,577,310.00
   month to date     763   ₦119,975,000.00 ₦1,572,390.00   ₦118,402,610.00

3. COLLECTIONS (instalments that fell due, and the cash that came in)
                    due           value paid on day           value  by count  by value         cash in
   day               62   ₦3,380,517.45          52   ₦3,176,205.76     83.9%     94.0%   ₦3,343,403.14
   last 7 days      432  ₦21,462,358.95         353  ₦19,148,980.64     81.7%     89.2%  ₦20,772,189.06
   month to date    840  ₦43,965,444.24         689  ₦39,845,574.11     82.0%     90.6%  ₦42,704,104.64
   due in the next 7 days, from 2026-06-16: 441 instalments, ₦22,798,617.39 (the contract, not a forecast)

4. CASH (lending only: what left and what came back)
                            paid out          received               net
   day                 ₦9,349,870.00     ₦3,343,403.14    -₦6,006,466.86
   last 7 days        ₦54,577,310.00    ₦20,772,189.06   -₦33,805,120.94
   month to date     ₦118,402,610.00    ₦42,704,104.64   -₦75,698,505.36

Check three figures by hand. The offer rate for the day is (69 + 3) ÷ 158 = 45.6%. Fees kept are ₦125,130.00, so ₦9,475,000.00 − ₦125,130.00 = ₦9,349,870.00 was paid out. Collections count 52 of 62 instalments paid on the day (83.9%), and by value ₦3,176,205.76 of ₦3,380,517.45 (94.0%). Count and value differ by ten points because the instalments missed were smaller than average.

4. The book at close. Save this as stock.py: ageing, PAR, the illustrative provision matrix, the month-end trend and the controls. Change PROVISION_BPS later to see what a rate does. The rates are not IFRS 9’s.

"""stock.py: the book at close: aging, portfolio at risk, an illustrative provision, the trend and the controls."""
import datetime as dt

from state import BUCKETS, WRITE_OFF_DPD, naira, pct, position

# ILLUSTRATIVE provision rates, in basis points of principal outstanding, by bucket.
# A provision matrix like this is not IFRS 9 (the provisioning chapter does that) and not the CBN's.
PROVISION_BPS = {"current": 100, "1-29": 300, "30-59": 1000, "60-89": 2500, "90-179": 6000}


def bucket_of(dpd):
    return next(name for name, lo, hi in BUCKETS if lo <= dpd <= hi)


def aging(rows):
    """Count and principal outstanding by bucket. The gross book is what is still owed on loans that
    are not written off; the written-off loans are kept apart, as a memo."""
    book = {name: [0, 0] for name, _, _ in BUCKETS}
    off = [0, 0]
    for r in rows:
        if r["outstanding"] == 0:
            continue
        target = off if r["dpd"] >= WRITE_OFF_DPD else book[bucket_of(r["dpd"])]
        target[0] += 1
        target[1] += r["outstanding"]
    return book, off


def measures(book):
    gross = sum(v[1] for v in book.values())
    par = lambda lo: sum(v[1] for (name, a, _), v in zip(BUCKETS, book.values()) if a >= lo)
    prov = sum(v[1] * PROVISION_BPS[name] // 10_000 for name, v in book.items())
    return gross, par(1), par(30), par(90), prov


def book_at_close(rows):
    book, off = aging(rows)
    gross, par1, par30, par90, prov = measures(book)
    print("\n5. THE BOOK AT CLOSE (principal outstanding, by days past due of the oldest unpaid instalment)")
    print(f"   {'bucket':<11}{'loans':>6}{'outstanding':>20}{'share':>8}{'rate':>6}{'provision':>18}")
    for name, _, _ in BUCKETS:
        cnt, amt = book[name]
        print(f"   {name:<11}{cnt:>6}{naira(amt):>20}{pct(amt, gross):>8}{PROVISION_BPS[name] / 100:>5.0f}%"
              f"{naira(amt * PROVISION_BPS[name] // 10_000):>18}")
    print(f"   {'gross book':<11}{sum(v[0] for v in book.values()):>6}{naira(gross):>20}{'':>14}{naira(prov):>18}")
    print(f"   written off, outside the book: {off[0]} loans, {naira(off[1])} unpaid (memo)")
    print(f"   PAR1 {pct(par1, gross)}   PAR30 {pct(par30, gross)}   PAR90 (the NPL ratio) {pct(par90, gross)}   "
          f"provision cover {pct(prov, gross)}")


def trend(db, pack_date, months=4):
    print("\n6. TREND (the book at each month end, and now)")
    print(f"   {'close of':<12}{'gross book':>20}{'30+ days':>18}{'PAR30':>8}{'PAR90':>8}{'provision':>18}{'written off':>18}")
    starts, d = [], pack_date.replace(day=1)
    for _ in range(months):
        if d < pack_date:
            starts.append(d)
        d = (d - dt.timedelta(days=1)).replace(day=1)
    for start in sorted(starts) + [pack_date]:
        book, off = aging(position(db, start))
        gross, _, par30, par90, prov = measures(book)
        print(f"   {(start - dt.timedelta(days=1)).isoformat():<12}{naira(gross):>20}{naira(par30):>18}"
              f"{pct(par30, gross):>8}{pct(par90, gross):>8}{naira(prov):>18}{naira(off[1]):>18}")


def controls(db, rows, pack_date):
    print("\n7. CONTROLS (a pack that does not tie out is not sent)")
    book, off = aging(rows)
    parts = sum(v[1] for v in book.values()) + off[1]
    total = sum(r["outstanding"] for r in rows)
    print(f"   buckets and written-off add up to the position: {'OK' if parts == total else 'FAIL'}")
    cut = db.execute("SELECT value FROM loan_book_meta WHERE key = 'cut_off'").fetchone()[0]
    if pack_date.isoformat() != cut:
        print(f"   the loans table holds the cut-off position only: run with --date {cut} to tie out")
        return
    stored = db.execute("SELECT SUM(outstanding_principal_kobo) FROM loans").fetchone()[0]
    dpd = dict(db.execute("SELECT id, days_past_due FROM loans"))
    differ = sum(1 for r in rows if r["dpd"] != dpd[r["id"]])
    print(f"   principal outstanding {naira(total)} against the loans table {naira(stored)}: "
          f"{'OK' if total == stored else 'FAIL'}")
    print(f"   days past due differ from the loans table on {differ} of {len(rows)} loans: {'OK' if differ == 0 else 'FAIL'}")

Run it for the cut-off.

python3 - <<'PY'
import datetime as dt
import stock
from state import connect, position

db = connect("data1/finance.sqlite")
pack_date = dt.date(2026, 10, 28)
rows = position(db, pack_date)
stock.book_at_close(rows)
stock.trend(db, pack_date)
stock.controls(db, rows, pack_date)
PY

5. THE BOOK AT CLOSE (principal outstanding, by days past due of the oldest unpaid instalment)
   bucket      loans         outstanding   share  rate         provision
   current       462      ₦75,217,147.92   79.4%    1%       ₦752,171.47
   1-29           23       ₦3,737,824.04    3.9%    3%       ₦112,134.72
   30-59           8       ₦2,718,812.74    2.9%   10%       ₦271,881.27
   60-89          11       ₦2,444,078.78    2.6%   25%       ₦611,019.69
   90-179        310      ₦10,654,315.82   11.2%   60%     ₦6,392,589.49
   gross book    814      ₦94,772,179.30                   ₦8,139,796.64
   written off, outside the book: 58 loans, ₦2,945,038.89 unpaid (memo)
   PAR1 20.6%   PAR30 16.7%   PAR90 (the NPL ratio) 11.2%   provision cover 8.6%

6. TREND (the book at each month end, and now)
   close of              gross book          30+ days   PAR30   PAR90         provision       written off
   2026-06-30       ₦438,468,149.27     ₦5,057,872.58    1.2%    0.2%     ₦5,758,201.66             ₦0.00
   2026-07-31       ₦307,134,617.39     ₦8,446,296.54    2.8%    1.0%     ₦6,005,565.03             ₦0.00
   2026-08-31       ₦207,639,828.76    ₦14,568,459.89    7.0%    2.3%     ₦6,423,802.28       ₦355,005.43
   2026-09-30       ₦135,854,631.49    ₦15,617,670.12   11.5%    5.7%     ₦7,469,966.61       ₦875,383.19
   2026-10-27        ₦94,772,179.30    ₦15,817,207.34   16.7%   11.2%     ₦8,139,796.64     ₦2,945,038.89

7. CONTROLS (a pack that does not tie out is not sent)
   buckets and written-off add up to the position: OK
   principal outstanding ₦97,717,218.19 against the loans table ₦97,717,218.19: OK
   days past due differ from the loans table on 0 of 3645 loans: OK

The rebuilt principal (₦97,717,218.19) is the gross book of ₦94,772,179.30 plus ₦2,945,038.89 of written-off loans. Find the run-off in the trend: PAR30 climbs from 1.2% to 16.7% while the 30+ amount moves from ₦5,057,872.58 to ₦15,817,207.34. The provision of ₦8,139,796.64 is 8.6% of the gross book.

5. Assemble the pack. Save this as pack.py. It reads the two dates and runs every section.

"""pack.py: the morning pack for Owoleaf's lending team.  python3 pack.py --db data/finance.sqlite --date 2026-10-28"""
import argparse
import datetime as dt

import flows
import stock
from state import connect, position, windows

ap = argparse.ArgumentParser()
ap.add_argument("--db", default="data/finance.sqlite")
ap.add_argument("--date", required=True, help="the morning of the pack: it reports the day before")
a = ap.parse_args()
db = connect(a.db)
pack_date = dt.date.fromisoformat(a.date)
wins = windows(pack_date)
print(f"OWOLEAF LENDING: MORNING PACK for {pack_date} (reports {wins[0][1]}; book {a.db})")
flows.funnel(db, wins)
flows.disbursements(db, wins)
flows.collections(db, wins, pack_date)
flows.cash(db, wins)
rows = position(db, pack_date)
stock.book_at_close(rows)
stock.trend(db, pack_date)
stock.controls(db, rows, pack_date)

Run it on the small book at the cut-off. Then run it on data1/ and compare with step 4.

python3 pack.py --db data/finance.sqlite --date 2026-10-28
python3 pack.py --db data1/finance.sqlite --date 2026-10-28 | sed -n '/^7\./,$p'
OWOLEAF LENDING: MORNING PACK for 2026-10-28 (reports 2026-10-27; book data/finance.sqlite)
1. FUNNEL (applications, by the day they were made)
                   applications  approved  declined withdrawn offer rate  take-up
   day                        0         0         0         0        n/a      n/a
   last 7 days                0         0         0         0        n/a      n/a
   month to date              0         0         0         0        n/a      n/a

2. DISBURSEMENTS (by disbursement date)
                   loans         principal     fees kept          paid out
   day                 0             ₦0.00         ₦0.00             ₦0.00
   last 7 days         0             ₦0.00         ₦0.00             ₦0.00
   month to date       0             ₦0.00         ₦0.00             ₦0.00

3. COLLECTIONS (instalments that fell due, and the cash that came in)
                    due           value paid on day           value  by count  by value         cash in
   day                0           ₦0.00           0           ₦0.00       n/a       n/a      ₦74,449.31
   last 7 days       21   ₦1,421,901.40          17   ₦1,314,918.12     81.0%     92.5%   ₦1,389,367.43
   month to date     51   ₦4,480,049.21          42   ₦4,132,321.37     82.4%     92.2%   ₦4,426,930.71
   due in the next 7 days, from 2026-10-28: 8 instalments, ₦419,815.56 (the contract, not a forecast)

4. CASH (lending only: what left and what came back)
                            paid out          received               net
   day                         ₦0.00        ₦74,449.31        ₦74,449.31
   last 7 days                 ₦0.00     ₦1,389,367.43     ₦1,389,367.43
   month to date               ₦0.00     ₦4,426,930.71     ₦4,426,930.71

5. THE BOOK AT CLOSE (principal outstanding, by days past due of the oldest unpaid instalment)
   bucket      loans         outstanding   share  rate         provision
   current        40       ₦5,760,222.04   70.6%    1%        ₦57,602.22
   1-29            3         ₦276,878.20    3.4%    3%         ₦8,306.34
   30-59           2         ₦214,965.02    2.6%   10%        ₦21,496.50
   60-89           3         ₦519,618.58    6.4%   25%       ₦129,904.64
   90-179         34       ₦1,392,895.16   17.1%   60%       ₦835,737.09
   gross book     82       ₦8,164,579.00                   ₦1,053,046.79
   written off, outside the book: 2 loans, ₦338,005.79 unpaid (memo)
   PAR1 29.4%   PAR30 26.1%   PAR90 (the NPL ratio) 17.1%   provision cover 12.9%

6. TREND (the book at each month end, and now)
   close of              gross book          30+ days   PAR30   PAR90         provision       written off
   2026-06-30        ₦42,903,552.50       ₦582,005.79    1.4%    0.0%       ₦564,412.09             ₦0.00
   2026-07-31        ₦30,345,871.24       ₦829,843.79    2.7%    1.1%       ₦629,580.30             ₦0.00
   2026-08-31        ₦19,882,909.58     ₦1,741,900.95    8.8%    2.9%       ₦706,637.67             ₦0.00
   2026-09-30        ₦12,565,026.93     ₦2,256,125.48   18.0%    6.6%       ₦888,067.10             ₦0.00
   2026-10-27         ₦8,164,579.00     ₦2,127,478.76   26.1%   17.1%     ₦1,053,046.79       ₦338,005.79

7. CONTROLS (a pack that does not tie out is not sent)
   buckets and written-off add up to the position: OK
   principal outstanding ₦8,502,584.79 against the loans table ₦8,502,584.79: OK
   days past due differ from the loans table on 0 of 372 loans: OK

All three controls pass on data/. On a book of 82 loans, a loan of average size (₦8,164,579.00 ÷ 82 = ₦99,568.04) is 1.2% of the whole, and the largest is 7.4%, so one loan going late moves a ratio by points. On data1/ the controls pass too:

7. CONTROLS (a pack that does not tie out is not sent)
   buckets and written-off add up to the position: OK
   principal outstanding ₦97,717,218.19 against the loans table ₦97,717,218.19: OK
   days past due differ from the loans table on 0 of 3645 loans: OK

6. Five traps in numbers. Save this as traps.py. It prints the approval rate four ways, the collection rate by the day you look, the NPL ratio with and without the written-off loans, the weight of one loan, and a past date reported from today’s status column.

"""traps.py: five ways a correct-looking number misleads.  python3 traps.py data1/finance.sqlite"""
import datetime as dt
import sys

from state import connect, naira, pct, position
from stock import aging, measures

path = sys.argv[1] if len(sys.argv) > 1 else "data1/finance.sqlite"
db = connect(path)
cut = dt.date.fromisoformat(db.execute("SELECT value FROM loan_book_meta WHERE key = 'cut_off'").fetchone()[0])
print(path)

print("\n1. THE APPROVAL RATE, FOUR WAYS (every application in the book)")
c = dict(db.execute("SELECT decision, COUNT(*) FROM applications GROUP BY 1"))
ap, de, wd = c["approved"], c["declined"], c["withdrawn"]
ask, got = db.execute("SELECT SUM(requested_kobo), SUM(approved_kobo) FROM applications").fetchone()
print(f"   approved / applications           {ap:>5} / {ap + de + wd:<5} = {pct(ap, ap + de + wd)}")
print(f"   approved / decided                {ap:>5} / {ap + de:<5} = {pct(ap, ap + de)}")
print(f"   offered / applications            {ap + wd:>5} / {ap + de + wd:<5} = {pct(ap + wd, ap + de + wd)}   (offered = approved + withdrawn)")
print(f"   naira approved / naira asked      {naira(got)} / {naira(ask)} = {pct(got, ask)}")

print("\n2. THE COLLECTION RATE FOR AUGUST'S INSTALMENTS, BY THE DAY YOU LOOK")
print(f"   {'paid within':<14}{'by count':>10}{'by value':>10}")
for k in (0, 3, 7, 30):
    n, v, tn, tv = db.execute(
        """SELECT SUM(EXISTS (SELECT 1 FROM repayments r WHERE r.loan_id = s.loan_id AND r.instalment = s.instalment
                              AND r.principal_kobo + r.interest_kobo >= s.total_kobo
                              AND r.paid_at <= date(s.due_date, ?))),
                  SUM(s.total_kobo * EXISTS (SELECT 1 FROM repayments r WHERE r.loan_id = s.loan_id AND r.instalment = s.instalment
                              AND r.principal_kobo + r.interest_kobo >= s.total_kobo
                              AND r.paid_at <= date(s.due_date, ?))),
                  COUNT(*), SUM(s.total_kobo)
           FROM schedule s WHERE s.due_date BETWEEN '2026-08-01' AND '2026-08-31'""", (f"+{k} days", f"+{k} days")).fetchone()
    print(f"   {str(k) + ' days':<14}{pct(n, tn):>10}{pct(v, tv):>10}")

print("\n3. THE NPL RATIO WITH AND WITHOUT THE LOANS ALREADY WRITTEN OFF (at the cut-off)")
book, off = aging(position(db, cut))
gross, par1, par30, par90, prov = measures(book)
print(f"   PAR90 on the gross book                    {naira(par90)} / {naira(gross)} = {pct(par90, gross)}")
print(f"   PAR90 if written-off loans stayed in       {naira(par90 + off[1])} / {naira(gross + off[1])} = {pct(par90 + off[1], gross + off[1])}")

print("\n4. HOW BIG IS ONE LOAN?")
rows = position(db, cut)
top = max(r["outstanding"] for r in rows if r["dpd"] < 180)
print(f"   the largest loan in the gross book is {naira(top)}, {pct(top, gross)} of it; "
      f"{len([r for r in rows if r['outstanding'] and r['dpd'] < 180])} loans share the rest")

print("\n5. A PAST DATE, REPORTED FROM TODAY'S STATUS COLUMN")
when = dt.date(2026, 8, 1)
right = aging(position(db, when))[0]
g, _, _, p90, _ = measures(right)
num = den = 0
for status, out in db.execute("SELECT status, outstanding_principal_kobo FROM loans WHERE disbursed_at < ?",
                              (when.isoformat(),)):
    if status in ("closed", "written_off"):
        continue
    den += out
    num += out if status == "default" else 0
print(f"   PAR90 at the close of {when - dt.timedelta(days=1)}, rebuilt from the schedule and the repayments: {pct(p90, g)}")
print(f"   the same date from the loans table's status today: {pct(num, den)}")
python3 traps.py data1/finance.sqlite
python3 traps.py data/finance.sqlite | sed -n '/^4\./,$p'
data1/finance.sqlite

1. THE APPROVAL RATE, FOUR WAYS (every application in the book)
   approved / applications            3645 / 8386  = 43.5%
   approved / decided                 3645 / 8166  = 44.6%
   offered / applications             3865 / 8386  = 46.1%   (offered = approved + withdrawn)
   naira approved / naira asked      ₦611,757,000.00 / ₦1,940,120,000.00 = 31.5%

2. THE COLLECTION RATE FOR AUGUST'S INSTALMENTS, BY THE DAY YOU LOOK
   paid within     by count  by value
   0 days             87.7%     93.5%
   3 days             91.2%     95.5%
   7 days             92.3%     96.1%
   30 days            95.3%     97.6%

3. THE NPL RATIO WITH AND WITHOUT THE LOANS ALREADY WRITTEN OFF (at the cut-off)
   PAR90 on the gross book                    ₦10,654,315.82 / ₦94,772,179.30 = 11.2%
   PAR90 if written-off loans stayed in       ₦13,599,354.71 / ₦97,717,218.19 = 13.9%

4. HOW BIG IS ONE LOAN?
   the largest loan in the gross book is ₦1,234,572.47, 1.3% of it; 814 loans share the rest

5. A PAST DATE, REPORTED FROM TODAY'S STATUS COLUMN
   PAR90 at the close of 2026-07-31, rebuilt from the schedule and the repayments: 1.0%
   the same date from the loans table's status today: 11.2%

On the small book, the last two traps read:

4. HOW BIG IS ONE LOAN?
   the largest loan in the gross book is ₦600,719.56, 7.4% of it; 82 loans share the rest

5. A PAST DATE, REPORTED FROM TODAY'S STATUS COLUMN
   PAR90 at the close of 2026-07-31, rebuilt from the schedule and the repayments: 1.1%
   the same date from the loans table's status today: 17.1%

Each is the same lesson from a different side. The count in front of a ratio and the date behind it decide what it means.

Open state.py and change the rule for when an instalment counts as paid. Replace the line

        if paid.get((loan_id, n), 0) < total and loan_id not in oldest:

with a looser one: an instalment counts as paid if any payment was made on it.

        if (loan_id, n) not in paid and loan_id not in oldest:

Run the pack on data1/ and read the headline figures and the controls:

python3 pack.py --db data1/finance.sqlite --date 2026-10-28 | grep -E "PAR1|add up|against|differ"

The original code prints:

   PAR1 20.6%   PAR30 16.7%   PAR90 (the NPL ratio) 11.2%   provision cover 8.6%
   buckets and written-off add up to the position: OK
   principal outstanding ₦97,717,218.19 against the loans table ₦97,717,218.19: OK
   days past due differ from the loans table on 0 of 3645 loans: OK

The looser rule prints:

   PAR1 19.8%   PAR30 16.0%   PAR90 (the NPL ratio) 10.2%   provision cover 8.1%
   buckets and written-off add up to the position: OK
   principal outstanding ₦97,717,218.19 against the loans table ₦97,717,218.19: OK
   days past due differ from the loans table on 63 of 3645 loans: FAIL

The total still ties, so a control on the total alone would have passed it. The error is in the distribution: a borrower who stops paying makes a partial payment on a later instalment now and then (the lab’s defaulters do), and the looser rule counts that instalment as paid. The oldest unpaid instalment moves later, so DPD falls and 63 loans land in the wrong bucket. The NPL ratio drops from 11.2% to 10.2%, and the book looks better than it is. Put the original line back. The control that compares each loan’s DPD with the loans table caught what the total could not.

ARTEFACT Write the dashboard specification ~45 MIN
YOU PRODUCEA lending dashboard specification (metric definitions, sources, owners, thresholds and actions)

Template

# Dashboard specification: <dashboard name>, version <n>, <date>
Written by <analyst>, <team>. Signed by <head of lending operations>.
Reader and rhythm: <who reads it, daily, weekly or monthly>.
Date convention: <what date the page describes, and when it is produced>.

## 1. Metrics
### <Metric name>
- Definition: <numerator> divided by <denominator>, in words
- Basis: <count or value; write-offs in or out; DPD convention>
- Printed beside it: <the amount, the loan count, the memo>
- Source: <table and columns, rebuilt from events or read from a status column>
- Owner (keeps the definition): <role>
- Acts on it: <role>, by <when>
- Threshold (the lender’s own, not a rule): <value>, then <the action>

## 2. Controls
<What must tie out before the page is sent, and what stops it.>

## 3. Out of scope
<What this dashboard does not show and where to find it.>

## 4. How this could be wrong
<One way, and what would show it.>

## 5. Decision and sign-off
Decision needed: <what, from whom, by when>.
Prepared <name, date>. Approved <name, date>.
WORKED EXAMPLE

Chinasa, the analyst who looks after Owoleaf’s morning pack, writes this specification; Chikodili, who runs lending operations, signs it. It is version 1, for the pack that describes the close of 27 October 2026, from the scale 1 book.

Metric Definition and basis Printed beside it Source Owner / acts on it Threshold (Owoleaf’s own, an assumption)
Collection rate, count Instalments due in the window and paid in full on or before their due date, divided by instalments due 7 of 8 = 87.5% schedule, repayments Chinasa / collections lead, same day Below 85%: call list for yesterday’s misses
Collection rate, value The same instalments in naira ₦742,018.03 of ₦760,661.28 = 97.5% same Chinasa / treasury Not set: read beside the count
PAR30 Principal outstanding on loans 30 or more days past due, divided by the gross book, written-off loans out ₦15,817,207.34 of ₦94,772,179.30 = 16.7% position() replayed to the date Chikodili / the head of lending Above 15%: credit review within the week
PAR90, headline Same, at 90 days ₦10,654,315.82 of ₦94,772,179.30 = 11.2%, memo 13.9% with the 58 written-off loans in same Chikodili / board Report both, every month
Provision cover Matrix provision divided by gross book ₦8,139,796.64 ÷ ₦94,772,179.30 = 8.6% stock.py rates Finance / Chikodili Illustrative matrix, not IFRS 9

Controls. Buckets plus the written-off memo must equal the rebuilt position, and at the cut-off the rebuilt principal and every loan’s days past due must equal the loans table. A failed control stops the pack, as in the lab’s break step, where the total tied and 63 loans sat in the wrong bucket.

Could be wrong. One day of eight instalments moves the count rate 12.5 points, so the 85% trigger could fire on noise. If it fires on a day and the seven-day column stays above 85%, the cause was the small sample.

Decision. Chikodili is asked to approve the five definitions and the 15% review line, which are assumptions, before the pack goes to the board. Vintages and the IFRS 9 provision are out of scope.

Now you

You are the analyst at an unnamed salary-advance lender in Abuja with about 40 staff, and your head of lending signs what you write. The lender started a daily pack last week and wants a dashboard of three metrics: a collection rate, PAR30 and provision cover. Its book looks like the lab’s data/ book: ₦8,164,579.00 across 82 loans, the largest ₦600,719.56, or 7.4% of the book. Run the chapter’s pack on data/ and write the specification for those three metrics. Choose the thresholds yourself and mark them as assumptions. Decide how a ratio on 82 loans is shown, and what a zero on the funnel row must display so nobody mistakes a missing feed for a quiet day. Your head of lending reads it to decide whether the lender’s first board pack can use these three definitions, and which owner is accountable for each.

Self-check

DECIDE

Owoleaf's board asks Chikodili and Chinasa for one 'NPL ratio' in the monthly pack. At the cut-off the scale 1 book gives PAR90 of 11.2% on the gross book (₦10,654,315.82 of ₦94,772,179.30) and 13.9% if the 58 written-off loans, with ₦2,945,038.89 still unpaid, stay in the base. The two numbers differ only in how write-offs are treated. The board will compare the pack's figure from month to month.

READING
  1. DOC
    IFRS 9 Financial Instruments (the standard, as the IFRS Foundation publishes it)

    The text behind the 30-day and 90-day presumptions this chapter quotes. Read the impairment section, and check the paragraph numbers (5.5.11 and B5.5.37 are the ones the search summaries cite) against your copy. Skip the classification and hedge accounting material on a first read.

  2. DOC
    Central Bank of Nigeria: Prudential Guidelines for Deposit Money Banks (final text, 30 June 2010)

    The CBN's own text for when a bank's credit facility counts as non-performing and how such facilities are classified. Read the criteria for non-performing facilities. Check the CBN's site for the August 2019 exposure draft and any later text before you rely on it for a current rule.

  3. DOC
    CGAP: Microfinance Consensus Guidelines, definitions of selected financial terms, ratios and adjustments

    Standard definitions of portfolio at risk and the gross loan portfolio for microfinance lenders; it says it is not a template for reporting. Read the definitions of PAR and of the portfolio. Skip the adjustments for inflation and subsidy until you build financial statements.

  4. PAPER
    CGAP: All Eyes on Asset Quality, Microfinance Global Valuation Survey 2010 CGAP, 2010

    Uses PAR30 across a sample of microfinance investees to show asset quality shifting in 2009, a worked example of a headline ratio read against its context. Skip the valuation results. Read: The sections on asset quality and portfolio at risk.

  5. DOC
    Basel Committee: Principles for effective risk data aggregation and risk reporting

    The 14 principles on how a bank gathers risk data and reports it. Written for large banks, so read it as a checklist of questions for any lender's reporting, in particular the principles on reporting practices. Skip the supervisors' sections.

  6. BOOK
    Information Dashboard Design: Displaying Data for At-a-Glance Monitoring, second edition Stephen Few, 2013

    The publisher's page for a practitioner's book on what makes a one-page display readable in a glance. Read it after the lab, when you decide what goes on the page. Skip the product reviews. Read: The chapters on common dashboard design mistakes.

All companies and people in these examples are fictional. Any resemblance to a real business or person is unintended.

RECALL CARDS Tap to flip. They join your review deck when you mark the lesson complete.
NEXT: Fairness in AI credit: proxies, disparate impact and how to test for them →