A history of payments: clearing houses to instant payments
Every payment system answers one question: when does the money move, and who is owed in the meantime? Settle 55,832 NIP transfers both ways and the answer costs 35% of the gross value, or 7% with one counterparty, in exchange for credit risk
Owoleaf's ledger holds 55,832 NIP movements with 24 counterparty banks over 178 days with traffic, worth ₦1,613,621,607.68 counted gross. Suppose every bank's inward and outward transfers are offset once a day and only the difference is paid. About what share of the gross value still has to move?
Modules 1 and 2 taught what settlement is and how Owoleaf’s rails settle (how money moves, settlement and payouts). This chapter steps back from one company to the design question underneath: when should money move? Every system from a cheque clearing room to an instant payment scheme is an answer to it, and each answer shifts a risk to somewhere else.
Three things a payment system must decide
A payment has three parts that can happen at different times. The instruction travels from payer to payee through their banks. The banks clear it: they check it and work out what each owes the other. Then settlement moves real money, in an asset both banks accept, usually a balance at the central bank. The history of payments is the history of moving these three closer together or further apart.
Four design choices follow, and every system below makes all of them.
- When does settlement happen? On each payment, or later, at set times.
- What is settled? The full amount of each payment (gross) or the difference between what each side owes the other (net).
- Who bears the risk in the gap? If the payee is credited before the money arrives, someone has lent to someone.
- What does it need to have in hand? Cash at the moment of payment, or a limit, or collateral.
Payment economics treats the same set as a trade between liquidity and credit risk. A 2009 survey by Kahn and Roberds, “Why pay? An introduction to payments economics”, is a good place to start. Its bibliographic record shows it as a survey in the Journal of Financial Intermediation, volume 18, issue 1, pages 1 to 23. It opens with a simple model of payment functions and their implementations, then covers policy applications, links to monetary theory and the empirical literature. The publisher’s full text was not available to the search, so this chapter takes only that scope from itas of 2026-11.
Gross settlement: pay now, hold the cash
In gross settlement each payment moves its full amount, on its own, when it is made. Pay ₦5,000,000 and ₦5,000,000 moves. Nothing is owed afterwards, so a payer’s failure never leaves the payee out of pocket. That is its strength.
Its cost is liquidity. The payer must have the cash when it pays, not when the day’s payments are added up. Two things go wrong. A bank that runs out of cash cannot pay, and payments queue. And if bank A waits for money from bank B before paying C, while B waits for A, the system locks up until someone injects cash. That is gridlock. Gross systems manage it with queues and rules for the order in which waiting payments release.
A CBN RTGS (real-time gross settlement) page, as a search summary shows it, says the CBN’s RTGS went live in December 2006, that its direct participants were the deposit money banks and discount houses, and that a transfer whose sender lacks funds is queued and settled first in, first outas of 2026-11.
Gross settlement is the usual design for large-value payments, where one failure to pay would be large, and the cost of holding the liquidity is worth it. Smaller payments are commonly left to cheaper methods.
Deferred net settlement: let payments pile up, pay the difference
The older answer is to wait. Banks collect their instructions through a period, then calculate what each owes the others and settle the differences. This is deferred net settlement (DNS). The name has three parts worth separating.
- Deferred: settlement is at set times, not on each payment.
- Net: only the difference is paid. If bank A owes B ₦500,000 and B owes A ₦300,000, A pays B ₦200,000.
- Bilateral or multilateral: netting each pair of banks against each other is bilateral. Netting every bank’s positions against the whole group, so each bank ends with one figure, is multilateral. A central party that sits in the middle is what makes the second possible.
The cheque clearing house is the picture to keep in mind. Bankers carry the cheques drawn on each other to one room, swap them, add up what each owes, and settle only the differences. The gain is that most of the money never has to move. The cost is that for the length of the cycle each bank has honoured cheques, or credited customers, on the strength of promises that are not yet paid.
What the clearing arrangements of a country look like, and how central banks came to settle them, varies a good deal. Bank of England Working Paper No. 412, by Ben Norman, Rachel Shaw and George Speight (June 2011), is shown in search results as an examination of how interbank settlement arrangements and central banking functions evolved, through several historical country case studies, with particular attention to the lender-of-last-resort function and to whether the institutions at the centre of clearing and settlement took on central-bank-like roles. The results did not show its dates or case details, so this chapter gives no dates for the pre-twentieth-century arrangements it covers: read the paper for themas of 2026-11.
The same question in Nigeria, as sources show it
The Nigerian record is easier to place on a timeline than the older one, because the CBN’s own pages carry dates. They are scattered, and no single CBN history of clearing turned up in search. Some dates below rest on a single page.
The CBN’s Retail Payments page, as summarised in search results, says the Nigeria Automated Clearing System (NACS) went live in October 2002 in the Lagos clearing zone and then spread to other locations, with NIBSS tasked with running itas of 2026-11. The CBN’s Payments System Supervision page, as summarised, lists the 2008 deployment of NACS to the Port Harcourt zone, then to Kano, Ibadan and Enugu in 2009as of 2026-11. A CBN document titled “Guidelines for cheque truncation in Nigeria”, dated 14 March 2012 in its title, appeared in search results. Its text was not read, so it supports only that those guidelines exist and when they are dated. Search summaries tie a move from two-day to one-day clearing in Lagos to the same year, and the CBN text for that was not seenas of 2026-11. The Nigerian Bankers’ Clearing System Rules, as search summaries show them, took effect on 1 September 2018 and state that they supersede earlier rules, including the cheque truncation guidelinesas of 2026-11, so the 2012 guidelines are a dated step, not today’s rulebook.
A Wikipedia entry says the CBN launched a Lagos bankers’ clearing house in May 1961, and a 1969 thesis lists a first bankers’ clearing house opened in Lagos in 1961. No CBN page in the results mentions it, so treat the date, and who set it up, as unconfirmed.
Where sources disagree, the chapter says so:
- NIBSS’s start. NIBSS’s own page, as summarised, says it was incorporated in 1993 and began operations in June 1994, while the CBN’s Retail Payments page says it was established in 1993 and a CBN timeline gives 1994, apparently for the start of operationsas of 2026-11. These fit together as an incorporation date and a start of operations, but the CBN pages were seen only as search summaries.
- The year NIP launched. A BusinessDay report and an AfricaNenda profile, as search summaries show them, place the launch of NIBSS Instant Payment (NIP) in 2011, while a World Bank Fast Payments Toolkit case study, seen only as a third-party copy, says 2012as of 2026-11. None is the operator’s own page, and this chapter does not choose between them; a 2011 pilot and a 2012 full rollout would explain both, but no source seen says so.
Two CBN pages describe how the two ends fit together today. The CBN’s Large Value Payments page, as search results summarise it, describes NIBSS as an approved external system that passes banks’ net settlement positions from clearing into the RTGS for settlement at a set time, with sessions listed from 9am (a CSCS securities file), 10am (cheques and electronic transfers), 2pm (returned cheques and electronic transfers) and 3pm (cards and other electronic inter-bank settlement). It also says a participant that cannot cover its net position triggers an intraday loan charged against its clearing collateral. Search results also showed a different CBN page with cut-offs of 9am, 12 noon, 3pm and 6pm, so the CBN sources disagree on the times, and neither page is clearly datedas of 2026-11. NIBSS’s help article says NIP is a deferred net settlement system in which funds are available in the beneficiary’s account in real time, before settlement, and that NIP transactions settle at cut-over times of 2am and 2pm daily. A Verto support page (a vendor) describes four windows with a 2pm cut-off, and another article says settlement is in batches several times a day, so the sources disagree on the timesas of 2026-11. A Business A.M. press report (August 2026) says NIBSS is preparing to retire NIP for a new payment stackas of 2026-11, so the schedule may change; this is press, not a NIBSS statement.
Put those together and the shape is the one this chapter is about. A NIP customer sees an instant payment. The banks behind it settle later, net, and the shortfall is covered by collateral. The customer’s experience moved to real time. The bank-to-bank settlement did not.
Instant payments: the customer moves first
The fast-payment systems of the last two decades keep that split.
CPMI Report No 154, “Fast payments: enhancing the speed and availability of retail payments”, was published by the BIS on 8 November 2016. A search-result summary of it defines fast payments by speed and availability: the payment message is sent, and final funds are made available to the payee, in real or near-real time and as close to 24/7 as possible. The report’s executive summary is quoted as concluding that fast payments generally do not create new categories of risk beyond those in earlier CPMI retail payment reports, though they may intensify some existing ones. Only the front matter and executive summary were visible to the search, so this chapter does not report its detailed findingsas of 2026-11.
The second sentence matters for the rest of the chapter. A system can give the payee the money at once and still settle between banks later. If it does, the payee’s bank has in effect lent to the payer’s bank, or to whoever guarantees it, for the length of the gap. The other design makes the settlement itself instant and puts the liquidity cost back on the banks. A later chapter in this module, instant payment systems compared, sets NIP against UPI, Pix and FedNow on exactly this axis; it is named here in plain text.
Settle Owoleaf’s NIP flows both ways
Words about trade-offs are cheap. The lab settles Owoleaf’s real NIP movements both ways, so you can read the trade-off off the books. Each movement is an entry on settlement_bank, the account at the partner bank. The inward ones are other banks paying Owoleaf, the outward ones are Owoleaf paying them, and each carries the counterparty bank code, B01 to B24 (illustrative codes, not real banks).
Gross is simple: each transfer settles alone. For deferred net, the lab nets per counterparty bank, once a day, at the day’s end. That is a simplification: the NIBSS article above describes two cut-overs a day, not one. It is also bilateral. Owoleaf’s partner bank would see Owoleaf’s positions against each of 24 other banks.
The lab measures four kinds of cash Owoleaf needs:
| Measure | What it assumes |
|---|---|
| Gross, pre-funded | Each outward payment needs its own cash when it is sent, with no use of money that has already arrived |
| Gross, inflows recycled | Money arriving through the day funds later payments. The need is the deepest the running balance falls below the day’s opening |
| Net, bilateral | At the day’s end pay every bank to which Owoleaf has a debit position |
| Net, one position | Net every bank together and pay only if the total is a debit |
What you will see, in the lab’s own output, is worth stating before you run it, because one of the results is not the one a net-settlement enthusiast expects.
The value that moves falls a lot. Over 178 days, 55,832 transfers worth ₦1,613,621,607.68 gross become 4,032 settlements worth ₦563,988,869.70, which is 35.0% of the value, in 7.2% of the number of payments (4,032 divided by 55,832).
The cash to hold falls against a naive gross, but not against a clever one. On the mean day, bilateral net needs ₦1,549,372.94 of debit positions against ₦4,497,779.51 if every outward payment is pre-funded: 34.4%. But gross with arrivals recycled needs only ₦582,125.30 on the mean day, because inflows and outflows are interleaved through the day and mostly cancel in time. Bilateral net cannot use that, because each bank’s position is settled apart from the others. Only netting all banks into one position beats it, at ₦279,120.53 on the mean day.
So the claim that net settlement needs only a fraction of gross liquidity is true of the value moved and of a pre-funded gross system. It is not automatic against a gross system that recycles incoming money. Whether it holds depends on who nets with whom and on how you count the gross side.
The saving depends on density. Within the same data, net settles 78.3% of gross value in January, when Owoleaf made about 37 transfers a day, and 28.5% in June, at about 601. More payments between the same pairs means more offsetting. Fewer counterparties does the same, which the break step shows. This is why netting suits systems with many payments among few participants, and why it saves little for a small company with a long tail of banks.
What the gap costs: credit risk
Deferred net settlement puts a gap between two events. Owoleaf credits a customer’s wallet the moment an inward NIP transfer arrives. The other bank pays at the day’s end. In between, if it is a net debtor to Owoleaf that day, it owes Owoleaf money that Owoleaf has already paid out to its customer.
The CPMI and IOSCO Principles for financial market infrastructures (April 2012, CPMI Paper No 101), as a search summary lists them, make Principle 4 the requirement that a financial market infrastructure effectively measure, monitor and manage its credit exposures to participants and those arising from its payment, clearing and settlement processes. The search did not return the key considerations, so this chapter takes only the principle’s headline and no detail on deferred net settlement from the documentas of 2026-11.
The lab’s exposure measure is simple. For each bank and day, take the running net of inward minus outward through the day. Where it is positive, the bank owes Owoleaf that amount. Under gross settlement the cash arrives with each transfer, so the figure is zero.
The lab prints the result. On the mean day the banks collectively owe Owoleaf ₦1,619,103.85 at the day’s end. On the worst day, 13 June, it is ₦3,902,889.78. The largest single bank is B03 on 24 April, at ₦1,280,424.67. Against Owoleaf’s share capital of ₦50,000,000.00 (illustrative, from the generator), the worst day is 7.8% and the largest bank is 2.6%. At this scale no day threatens it.
Two things in those figures need care before you relax.
The exposure grows with volume and the capital does not. The worst day’s total rises month by month, from ₦1,150,449.50 in January to ₦3,902,889.78 in June, as transfers a day grow from the tens to hundreds. The licences chapter showed that capital is set by licence category and not by volume. A bank that moves from gross to net settlement for a growing customer has swapped a cost that scales with the customer’s volume (liquidity) for a risk that scales with it too (exposure), and the capital behind both does not move.
The figure is the exposure if the other bank fails, not the loss. Collateral, a limit, a guarantee or a recovery can reduce it. That is the point of what the CBN page above describes: an intraday loan against clearing collateral when a bank cannot cover its position. Whether any of that fits a bank’s own counterparties is for its credit-risk function to decide, as Kaltume’s team would.
There is one more effect that this lab does not show, because it nets bilaterally. In a multilateral net, one bank’s failure changes everyone’s position. If the failing bank’s payments are removed and the nets recomputed, every other participant’s figure moves, and some who expected to receive now have to pay. Systems answer this with collateral, loss-sharing rules or committed credit lines. Your lab’s exposure per bank is independent of the others because the netting is pairwise. A multilateral system has a different and harder problem. Recomputing the nets without the failed bank is called an unwind; a system that cannot do it, or whose participants cannot meet the new figures, suffers a settlement failure, and so rules for the order of default, collateral and committed credit lines matter more than the arithmetic.
The trade-offs, side by side
| Gross, real time | Deferred net, bilateral | Deferred net, multilateral | |
|---|---|---|---|
| Value moved | All of it | 35.0% in the lab | 6.9% in the lab |
| Settlements | One per transfer (55,832) | One per bank per day (4,032) | One per day (178) |
| Cash needed | At each payment | Every debit position | One net position |
| Credit exposure to others | None once settled | Net owed by each bank | Net owed by the group |
| Main failure | Gridlock, queues | A bank fails before settlement | A failure changes everyone’s position |
| Needs | Liquidity or credit from the central bank | Limits, collateral | A central party, collateral, loss rules |
No column wins on every row. Choosing between them is choosing which risk the system carries, and who pays for it.
Where this goes wrong
- Counting the gross side the easy way. Pre-funded gross makes net look far cheaper. Say how you counted before you quote a saving.
- Quoting a netting ratio as a constant. The ratio in the lab runs from 78.3% to 28.5% in six months. A figure from one day, one volume or one set of counterparties does not transfer.
- Assuming the customer’s experience is the settlement. A NIP payment is available to the payee at once, and the banks settle later. Treating “the customer has it” as “the banks have settled” is the error module 1 named in a wallet: crediting before the money arrives.
- Reading a date off a secondary source. The year of NIP’s launch is 2011 in press reports and a profile, and 2012 in a World Bank case study. If a date goes in a model or a board paper, find the operator’s own page.
- Forgetting the reversal. Of the 20,897 outward NIP payments in the lab, 98 were returned later (the
payout_reversalrows). Both legs are in the flows, and a deferred net system must carry that return through the netting. The lab’s inward figure includes ₦2,653,250.62 of returns. - Treating a history as a plan. What the clearing arrangements of one country looked like says what problem each solved, not what a bank today should do.
This is a desk lab on the ledger. You work in labs/finance and create five files there: flows.py, settle.py, exposure.py, group.py and timeline.py. Every script opens the database read-only. No sqlite3 program is needed. The mock switch is not used: its /settlement report covers only transfers made through the mock, not the generated ledger. All money is integer kobo; the naira function is for display. The bank codes B01 to B24 and the share capital are generated and illustrative.
1. Load the flows. Save this as flows.py. It reads every NIP movement on the settlement_bank account: a debit is money in, a credit is money out. Fees go to fee_revenue, so they never enter the settlement.
"""Step 1: every NIP movement of money on Owoleaf's settlement account, from the ledger.
Integer kobo throughout. + is money in (the other bank pays Owoleaf), - is money out."""
import sqlite3
from collections import defaultdict
DB = "data/finance.sqlite"
def naira(kobo):
sign = "-" if kobo < 0 else ""
kobo = abs(kobo)
return f"{sign}₦{kobo // 100:,}.{kobo % 100:02d}"
def load_flows(path=DB):
"""[(posted_at, bank, kind, signed_kobo)] in posting order. Fees are Owoleaf's income, not interbank money."""
db = sqlite3.connect(f"file:{path}?mode=ro", uri=True)
return db.execute(
"""SELECT e.posted_at, t.counterparty_bank, t.kind,
CASE e.direction WHEN 'debit' THEN e.amount_kobo ELSE -e.amount_kobo END
FROM entries e JOIN accounts a ON a.id = e.account_id
JOIN transactions t ON t.id = e.transaction_id
WHERE a.code = 'settlement_bank' AND t.rail = 'nip'
ORDER BY e.posted_at, e.id""").fetchall()
def by_day(flows):
days = defaultdict(list)
for ts, bank, kind, x in flows:
days[ts[:10]].append((bank, x))
return dict(sorted(days.items()))
if __name__ == "__main__":
flows = load_flows()
days = by_day(flows)
print(f"flows: {len(flows):,} over {len(days)} days with NIP traffic, {len({f[1] for f in flows})} counterparty banks")
for kind in ("funding_transfer", "payout_nip", "payout_reversal"):
xs = [x for _, _, k, x in flows if k == kind]
print(f" {kind:17} {len(xs):>7,} {naira(sum(xs)):>22}")
print(f"net movement of the period: {naira(sum(x for *_, x in flows))}")
first = next(iter(days))
per_bank = defaultdict(list)
for bank, x in days[first]:
per_bank[bank].append(x)
print(f"\n{first}: {len(days[first])} flows")
for bank, xs in sorted(per_bank.items()):
print(f" {bank} {[naira(x) for x in xs]}")python3 flows.pyflows: 55,832 over 178 days with NIP traffic, 24 counterparty banks
funding_transfer 34,837 ₦810,363,604.00
payout_nip 20,897 -₦800,604,753.06
payout_reversal 98 ₦2,653,250.62
net movement of the period: ₦12,412,101.56
2026-01-03: 3 flows
B04 ['₦9,078.00']
B17 ['₦42,389.00']
B21 ['-₦29,869.11']The data covers 180 days from 1 January, and the first transfers are on 3 January, so 178 days have traffic. The 20,897 payouts are the 20,799 that succeeded and the 98 that succeeded and were later returned, which is why payout_reversal has 98 rows. Counting every succeeded or reversed NIP transfer gives 34,837 + 20,897 + 98 = 55,832 movements. On the first day there are three transfers with three different banks, so nothing can offset.
2. Settle both ways. Save this as settle.py. For each day it computes the gross value, the cash needs under each reading from the table above, and the bilateral net position per bank.
"""Step 2: settle the same flows two ways, one day at a time. Integer kobo throughout.
gross : every transfer settles on its own, in full, the moment it is made.
net : transfers pile up through the day; at the day's end each counterparty bank's inward
and outward are set against each other and one payment settles the difference.
"""
from collections import defaultdict
from flows import load_flows, by_day, naira
def settle_day(day_flows):
"""day_flows: [(bank, signed_kobo)] in time order. Returns the day's measures, all in kobo."""
run = low = 0
out = 0
pos = defaultdict(int) # bank -> net position at the end of the day
for bank, x in day_flows:
run += x
low = min(low, run) # deepest hole the running balance reaches
pos[bank] += x
if x < 0:
out += -x
return {
"n": len(day_flows),
"gross_value": sum(abs(x) for _, x in day_flows), # value settled, gross
"gross_prefunded": out, # liquidity if each payment needs its own cash
"gross_recycled": -low, # liquidity if inflows fund later outflows
"net_value": sum(abs(v) for v in pos.values()), # value settled, bilateral net
"net_debit": sum(-v for v in pos.values() if v < 0), # cash to pay out, bilateral net
"net_multi": max(0, -sum(pos.values())), # cash to pay out, one net position
"settlements": sum(1 for v in pos.values() if v != 0),
}
if __name__ == "__main__":
days = by_day(load_flows())
res = {d: settle_day(f) for d, f in days.items()}
keys = ["n", "gross_value", "gross_prefunded", "gross_recycled", "net_value", "net_debit", "net_multi", "settlements"]
tot = {k: sum(r[k] for r in res.values()) for k in keys}
peak = {k: max(r[k] for r in res.values()) for k in keys}
mean = {k: tot[k] // len(res) for k in keys}
print(f"{len(res)} days, {tot['n']:,} transfers\n")
print("Value that has to move between settlement accounts")
print(f" gross per transfer {naira(tot['gross_value']):>24} {tot['n']:>7,} settlements")
print(f" net, per bank per day {naira(tot['net_value']):>24} {tot['settlements']:>7,} settlements"
f" {tot['net_value'] / tot['gross_value']:.1%} of gross value")
print("\nCash Owoleaf must hold, per day")
print(f" {'':44} {'mean day':>20} {'worst day':>20}")
for label, k in (("gross, each payment pre-funded", "gross_prefunded"),
("gross, inflows fund later outflows", "gross_recycled"),
("net, bilateral: pay every debit position", "net_debit"),
("net, one position across all banks", "net_multi")):
print(f" {label:44} {naira(mean[k]):>20} {naira(peak[k]):>20}")
print(f"\nbilateral debits / pre-funded gross, mean day: {mean['net_debit'] / mean['gross_prefunded']:.1%}")
print("\nBy month: value settled by net as a share of gross value; transfers per day")
month = defaultdict(lambda: [0, 0, 0, 0])
for d, r in res.items():
m = month[d[:7]]
m[0] += r["gross_value"]; m[1] += r["net_value"]; m[2] += r["n"]; m[3] += 1
for m, (g, n, c, nd) in sorted(month.items()):
print(f" {m} {n / g:6.1%} {c / nd:6.1f} transfers a day")python3 settle.py178 days, 55,832 transfers
Value that has to move between settlement accounts
gross per transfer ₦1,613,621,607.68 55,832 settlements
net, per bank per day ₦563,988,869.70 4,032 settlements 35.0% of gross value
Cash Owoleaf must hold, per day
mean day worst day
gross, each payment pre-funded ₦4,497,779.51 ₦12,591,722.87
gross, inflows fund later outflows ₦582,125.30 ₦3,394,076.17
net, bilateral: pay every debit position ₦1,549,372.94 ₦6,057,627.58
net, one position across all banks ₦279,120.53 ₦3,068,407.87
bilateral debits / pre-funded gross, mean day: 34.4%
By month: value settled by net as a share of gross value; transfers per day
2026-01 78.3% 36.6 transfers a day
2026-02 57.0% 121.9 transfers a day
2026-03 44.2% 235.7 transfers a day
2026-04 34.1% 372.5 transfers a day
2026-05 31.4% 498.2 transfers a day
2026-06 28.5% 601.1 transfers a dayCheck one ratio by hand: 563,988,869.70 ÷ 1,613,621,607.68 = 0.3495, and 4,032 ÷ 55,832 = 0.0722. Read the liquidity table twice. Against the pre-funded gross, bilateral net needs 34.4% of the cash. Against gross with inflows recycled it needs more, ₦1,549,372.94 against ₦582,125.30 on the mean day, because it cannot use money arriving from one bank to pay another. Only the single net position beats gross with recycling. The monthly table is the density effect: as transfers a day grow, the net share falls from 78.3% to 28.5%.
3. Price the credit risk. Save this as exposure.py. For each bank and day it tracks the running net position and records where it is positive: the bank owes Owoleaf money that Owoleaf has already credited to wallets.
"""Step 3: the credit risk deferred net settlement takes on. Integer kobo throughout.
Under net settlement Owoleaf credits a wallet for an inward transfer the moment it arrives, but the other
bank pays at the day's end. Until then that bank owes Owoleaf its net position, if it is positive.
Under gross settlement the cash arrives with the transfer, so nothing is owed.
"""
import sqlite3
from collections import defaultdict
from flows import load_flows, by_day, naira
flows = load_flows()
days = by_day(flows)
# intraday: each bank's running position through the day, in posting order
peak_one = (0, None, None) # largest amount one bank ever owed Owoleaf during a day
end_one = (0, None, None) # largest end-of-day net receivable from one bank
owed_by_banks = {} # day -> sum of end-of-day receivables across banks
owes_banks = {} # day -> sum of end-of-day debit positions
for day, fl in days.items():
run = defaultdict(int)
for bank, x in fl:
run[bank] += x
if run[bank] > peak_one[0]:
peak_one = (run[bank], day, bank)
for bank, v in run.items():
if v > end_one[0]:
end_one = (v, day, bank)
owed_by_banks[day] = sum(v for v in run.values() if v > 0)
owes_banks[day] = sum(-v for v in run.values() if v < 0)
worst_day = max(owed_by_banks, key=owed_by_banks.get)
mean_owed = sum(owed_by_banks.values()) // len(owed_by_banks)
db = sqlite3.connect("file:data/finance.sqlite?mode=ro", uri=True)
capital = db.execute(
"""SELECT SUM(CASE direction WHEN 'credit' THEN amount_kobo ELSE -amount_kobo END)
FROM entries e JOIN accounts a ON a.id = e.account_id WHERE a.code = 'share_capital'""").fetchone()[0]
print("Owed to Owoleaf by banks that have not yet settled (net-settlement exposure)")
print(f" gross settlement, any moment {naira(0):>22}")
print(f" net, mean day, all banks at the day's end {naira(mean_owed):>22}")
print(f" net, worst day, all banks at the day's end {naira(owed_by_banks[worst_day]):>22} {worst_day}")
print(f" net, one bank, largest end-of-day figure {naira(end_one[0]):>22} {end_one[2]} on {end_one[1]}")
print(f" net, one bank, largest at any moment {naira(peak_one[0]):>22} {peak_one[2]} on {peak_one[1]}")
print(f"\nOwoleaf's share capital {naira(capital):>22}")
print(f"largest one-bank exposure / share capital {end_one[0] / capital:>21.1%}")
print(f"worst day's total exposure / share capital {owed_by_banks[worst_day] / capital:>21.1%}")
over = [d for d, v in owed_by_banks.items() if v > capital]
print(f"days when the total owed to Owoleaf exceeded its share capital: {len(over)} of {len(days)}")
print("\nA bank fails the day it owes Owoleaf the most: Owoleaf's loss before any recovery")
print(f" {end_one[2]}, {end_one[1]}: {naira(end_one[0])} (gross settlement: {naira(0)})")
print(f"\nThe other direction: what Owoleaf owed banks at day's end, worst day {naira(max(owes_banks.values()))}")
print("\nWorst day's total exposure by month, as volume grows")
for m in sorted({d[:7] for d in days}):
d = max((d for d in days if d.startswith(m)), key=owed_by_banks.get)
print(f" {m} {naira(owed_by_banks[d]):>16} on {d} ({len(days[d])} transfers)")python3 exposure.pyOwed to Owoleaf by banks that have not yet settled (net-settlement exposure)
gross settlement, any moment ₦0.00
net, mean day, all banks at the day's end ₦1,619,103.85
net, worst day, all banks at the day's end ₦3,902,889.78 2026-06-13
net, one bank, largest end-of-day figure ₦1,280,424.67 B03 on 2026-04-24
net, one bank, largest at any moment ₦1,280,424.67 B03 on 2026-04-24
Owoleaf's share capital ₦50,000,000.00
largest one-bank exposure / share capital 2.6%
worst day's total exposure / share capital 7.8%
days when the total owed to Owoleaf exceeded its share capital: 0 of 178
A bank fails the day it owes Owoleaf the most: Owoleaf's loss before any recovery
B03, 2026-04-24: ₦1,280,424.67 (gross settlement: ₦0.00)
The other direction: what Owoleaf owed banks at day's end, worst day ₦6,057,627.58
Worst day's total exposure by month, as volume grows
2026-01 ₦1,150,449.50 on 2026-01-24 (68 transfers)
2026-02 ₦2,011,874.62 on 2026-02-12 (125 transfers)
2026-03 ₦2,749,397.15 on 2026-03-30 (312 transfers)
2026-04 ₦3,031,611.40 on 2026-04-24 (398 transfers)
2026-05 ₦3,213,711.13 on 2026-05-03 (453 transfers)
2026-06 ₦3,902,889.78 on 2026-06-13 (656 transfers)This is the exposure if banks fail, not the loss: collateral and limits would reduce it. The figure at the end of the day equals the figure at any moment for B03 on 24 April because that bank’s position only grew that day. The other direction matters too. On the worst day Owoleaf itself owed other banks ₦6,057,627.58, so they carried a credit exposure to Owoleaf, and the partner bank’s credit-risk team has to think about both. Zero days exceeded share capital at this scale. The monthly table shows the exposure growing with the volume.
4. Place the methods on a timeline. Save this as timeline.py. The five rows are the dates this chapter can source. Add at least three of your own from the Bank of England paper and the other reading, each with its source, and uncomment the template line to follow its format.
"""Step 4: a timeline of settlement methods. Each row: when, what, how it settles, where you read it.
The rows below come from search results that quote CBN pages and the CPMI. Add at least three of your own
from the Bank of England paper and the other reading, with a page number, and run it again."""
ROWS = [
("2002-10", "NACS, the automated clearing system for cheques, live in the Lagos zone", "cheques and other instruments cleared in batches; net positions passed to RTGS", "CBN, Retail Payments page"),
("2006-12", "CBN real-time gross settlement system (RTGS) live", "each large payment settled on its own, in central bank money", "CBN, RTGS page (as summarised)"),
("2008", "NACS extended to the Port Harcourt zone (2009: Kano, Ibadan, Enugu)", "the same clearing, in more places", "CBN, Payments System Supervision page"),
("2012-03", "CBN guidelines for cheque truncation (dated 14 March 2012)", "the image replaces the paper in the clearing", "CBN, guidelines document"),
("2016-11", "CPMI report on fast payments", "payee funds available in real or near-real time, as close to 24/7 as possible", "CPMI, d154"),
# ("YYYY-MM", "your row from the reading", "how it settled", "paper, page"),
]
for when, what, how, src in sorted(ROWS):
print(f"{when} {what}\n settles: {how}\n source: {src}")python3 timeline.py2002-10 NACS, the automated clearing system for cheques, live in the Lagos zone
settles: cheques and other instruments cleared in batches; net positions passed to RTGS
source: CBN, Retail Payments page
2006-12 CBN real-time gross settlement system (RTGS) live
settles: each large payment settled on its own, in central bank money
source: CBN, RTGS page (as summarised)
2008 NACS extended to the Port Harcourt zone (2009: Kano, Ibadan, Enugu)
settles: the same clearing, in more places
source: CBN, Payments System Supervision page
2012-03 CBN guidelines for cheque truncation (dated 14 March 2012)
settles: the image replaces the paper in the clearing
source: CBN, guidelines document
2016-11 CPMI report on fast payments
settles: payee funds available in real or near-real time, as close to 24/7 as possible
source: CPMI, d154NIP is not in the list because the sources for its launch year disagree and neither is the operator’s. Add it yourself with the year you can defend, and say where it comes from. The Retail Payments row says “net positions passed to RTGS” from the Large Value Payments page: check that against the page.
Fewer counterparties, more offsetting. Save this as group.py, which folds the 24 banks into groups and settles again.
"""Break: fewer, bigger counterparties. Fold the 24 banks into 6 groups and settle again."""
from flows import load_flows, by_day, naira
from settle import settle_day
flows = load_flows()
for groups in (24, 12, 6, 3, 1):
fold = lambda bank: int(bank[1:]) % groups # B01..B24 -> groups of equal size
days = by_day([(ts, fold(b), k, x) for ts, b, k, x in flows])
res = [settle_day(f) for f in days.values()]
g = sum(r["gross_value"] for r in res); n = sum(r["net_value"] for r in res)
s = sum(r["settlements"] for r in res)
print(f"{groups:>2} counterparties: net settles {n / g:6.1%} of gross value in {s:>6,} settlements")python3 group.pyWhat to look for: with 24 counterparties net settles 35.0% of the value in 4,032 settlements, as in step 2. At 12 it is 25.9% in 2,069, at 6 it is 18.4% in 1,054, at 3 it is 13.2% in 533, and with one group (every bank netted together) it is 6.9% in 178, one settlement a day. The same transfers settle for less value as the counterparties get fewer. Now say what you gave up: each step down makes one counterparty hold more of the netted exposure. Add the exposure calculation from step 3 to this script and print the largest end-of-day exposure at each grouping, then decide where the trade-off is worth it.
Template
# Board briefing: how we settle <flows>
Written by <head of treasury or payments> · Risk figures checked by <credit risk> · Signed and presented by <CFO> · <date>
For: <noting | decision on X by date>
Scope: <whose flows, which period, whose books the figures come from>
## In one paragraph
<What we do today, what it costs, what risk we carry, the one question. No jargon.>
## Two terms
- Gross: <one plain sentence>
- Net: <one plain sentence>
## What each method costs
| | Gross | Net |
|---|---|---|
| Value that moves | <₦> | <₦, % of gross> |
| Cash we must hold, mean day / worst day | <₦ / ₦> | <₦ / ₦> |
| Owed before it is paid, and by whom | <₦0.00> | <₦ mean / worst day> |
How the gross side was counted: <pre-funded or inflows recycled>
## The risk, against capital
<Largest single counterparty, worst day, and how they are growing. As a share of <whose capital>. Exposure, not loss: <what reduces it>.>
## What history shows
<Dated facts only, each with its source, and where sources disagree.>
## How this briefing could be wrong
<One way, and what would show it.>
## The question for each year
<One question, the number that answers it, who answers it.> WORKED EXAMPLE
Onome, who runs treasury operations at Northmere Bank, writes this; Kaltume in credit risk checks the exposure figures; the CFO signs and presents it, and the board notes it.
Board briefing: how we settle a payments customer’s NIP transfers. For noting. Scope: the figures come from the lab run on Owoleaf’s own ledger, 178 days with traffic. They are Owoleaf’s books, not Northmere’s. Today we pay each transfer on its own (gross). The alternative is net: let a day’s transfers offset and pay only the differences. On that data, 55,832 transfers worth ₦1,613,621,607.68 gross become 4,032 payments worth ₦563,988,869.70, which is 35.0% of the value.
Cost. For the customer’s flows, counted as each payment needing its own cash, gross needs ₦4,497,779.51 on the mean day and bilateral net needs ₦1,549,372.94. With arriving money funding later payments, gross needs only ₦582,125.30, so net is not cheaper in cash on that count.
Risk. Net means credit is given before the other bank pays. In Owoleaf’s ledger, banks owed Owoleaf ₦3,902,889.78 at the day’s end on the worst day, 13 June: 7.8% of Owoleaf’s ₦50,000,000.00 share capital (illustrative). Gross carries ₦0.00. That is Owoleaf’s exposure to other banks, not ours. Ours runs the other way: Owoleaf owed banks ₦6,057,627.58 on its worst day, spread over all 24, and we have not measured our share. This is exposure, not loss; collateral or a limit would reduce it. It grew from ₦1,150,449.50 in January while the capital stayed fixed.
History. Nigeria’s RTGS, which pays each large payment on its own, went live in December 2006. NIBSS describes NIP as net settlement in which the beneficiary has the funds before settlementas of 2026-11, and sources disagree on NIP’s launch year and settlement times.
Could be wrong. These are one customer’s six months in its books, and they do not show our own share. Running the same steps on our ledger for this customer would show it.
Each year, ask: what was the largest amount this customer owed us at any day’s end, as a share of its capital, and has it grown? Credit risk answers it.
Now you
You are head of payments at Owoleaf, now with 200 people. At a real company you write this page, credit risk checks the exposure figures and the CFO signs and presents it. Your settlement partner bank has proposed moving your NIP flows from one transfer at a time to daily bilateral netting, and the CFO will take your page to Owoleaf’s board next month. The board has no payments specialists. Use the lab’s figures from your own run: the mean-day and worst-day cash under each method (step 2), the exposure and its growth by month (step 3), and the share capital of ₦50,000,000.00 (illustrative). Remember that on the worst day Owoleaf itself owed other banks ₦6,057,627.58. Say how you counted the gross side, and what you would want to see if volumes keep growing. Your reader is the board, who must decide whether to ask the partner bank for netting or to keep the current method.
Self-check
Onome's treasury at Northmere Bank settles a payments-company customer's NIP flows, which are growing every month, one transfer at a time against the customer's settlement account, and holds liquidity to match. Kaltume's credit-risk team has run the lab's numbers on the customer's own data. Daily netting would cut the value moved to about a third and the cash held to a fraction of the pre-funded figure, but the bank would be owed money it has already paid out for the length of the cycle. Which design do they take to the risk committee first?
- PAPER The history of interbank settlement arrangements: exploring central banks' role in the payment system (Bank of England Working Paper 412) Ben Norman, Rachel Shaw and George Speight, 2011
The historical case studies this chapter leaves out, with the dates it does not state. Read it for how clearing houses became central-bank settlement and where the lender of last resort fits; skim the country detail you do not need. It supplies the earlier rows for step 4 of the lab. Read: Introduction and the case studies; check page numbers in the PDF.
- PAPER Why pay? An introduction to payments economics Charles M. Kahn and William Roberds, 2009
A survey of the economics of payments: why liquidity and credit risk trade against each other in settlement. Read the opening model for the vocabulary this chapter uses. The record on this page is bibliographic, so find the full text through the journal. Read: Journal of Financial Intermediation 18(1), pages 1 to 23.
- DOC Fast payments: enhancing the speed and availability of retail payments (CPMI Report No 154) Committee on Payments and Market Infrastructures (BIS), 2016
The central banks' definition of a fast payment and their survey of how systems differ. Read the executive summary for the risk conclusion quoted here and the chapter on features for the design choices; the next chapter in this module compares systems on them.
- DOC Principles for financial market infrastructures CPMI and IOSCO, 2012
The international standard for the systems that clear and settle payments. This chapter took only the headline of Principle 4. Read Principle 4 on credit risk and the principles on settlement finality and money settlements for what an operator must do about the exposure the lab measures.
- DOC Retail Payments (CBN) Central Bank of Nigeria
The CBN's own page on the automated clearing system and other retail payments. Read it for the dates and roles behind the timeline in step 4; it is a web page, so note when you read it, as it may change.
- DOC Large Value Payments (Inter-Bank Fund Transfer System) (CBN) Central Bank of Nigeria
How the CBN describes RTGS and how NIBSS passes net positions into it, including the settlement sessions and what happens when a participant cannot cover its position. Read the session times as a snapshot: search results flagged them as possibly out of date.
- DOC How does settlement happen on the service? (NIBSS support article) NIBSS
NIBSS's own description of NIP as deferred net settlement, with funds available to the beneficiary before settlement, and its cut-over times. Read it with the other sources in this chapter, which disagree on the times.
- BOOK Electronic Value Exchange: Origins of the VISA Electronic Payment System David L. Stearns, 2011
A history of how a card scheme built its authorisation and settlement system, from the mid-1960s to the early 1980s. Read it for how a network settles among members that must trust each other; skip the corporate detail. Read: Springer, History of Computing series; read the chapters on the authorisation and settlement systems.
All companies and people in these examples are fictional. Any resemblance to a real business or person is unintended.