How banks settle with each other: sessions, net positions, prefunding and collateral
The customer is credited in seconds and the banks pay each other later, net. Between the two sits a promise, and a limit on how big that promise may grow. Reach the limit at sixteen minutes past noon and the payments stop
The lab's network settles 17,798 transfers worth ₦343,902,244 in 21 settlement sessions over one week. In each session only the participants that owe more than they are owed need to find money, and the others receive it. Counting every session, about what share of the ₦343,902,244 do the net debtors have to find?
Nigeria’s rails and a history of payments gave you the shape: the beneficiary is credited at once, and the banks settle later, as net positions. This chapter goes inside the word “later” and looks at it from a bank treasury’s desk. Treasury has four questions. How big is what we owe, and to whom? When is it paid? What stops it growing without limit? What happens at the limit? The lab’s data answers the first two exactly and the last two as a model. The real rules are in the notes below, and where no source showed one, the chapter says so.
What a credited transfer leaves unpaid
When a customer sends ₦20,000 to someone at another bank and the receiver’s phone shows the credit, the two banks have not yet moved any money between themselves. The receiving bank has credited its customer on the sending bank’s promise. How money moves called the movement between banks settlement, and settlement and payouts showed Owoleaf’s side of it. This chapter is about the banks’ side.
The CPMI report on fast payments (November 2016), as search results quote its executive summary, defines fast payments by two features, speed and continuous availability, and says they generally add no new categories of risk to retail payments though they may intensify some existing ones. Only the summary was visible to the search; the report’s own treatment of settlement was notas of 2026-11. The credit described next is this chapter’s reasoning from that setting, not a quotation.
A NIBSS support article, as search summaries show it, describes NIP as a deferred net settlement system in which funds are available to the beneficiary in real time, before settlementas of 2026-11. The history chapter lists the session times that article and other sources give, and they disagree: that article, as summarised, gives two cut-overs a day, another NIBSS page refers to 12 settlement sessions, and a 2025 case study describes four a day. This chapter therefore relies on none of them. The lab uses four sessions a day with its own cut-offs, and says so wherever it matters.
Put the two together. Every instant transfer between two banks creates a small debt from the sender’s bank to the receiver’s bank, and the debt lasts until the session settles. Treasury’s job is to know the sum of those debts at every minute of the day and to be sure it can pay.
Sessions, positions and the zero sum
A settlement session is a window in which settled transfers are collected, netted and paid. In the lab there are four a business day, with cut-offs at 04:00, 10:00, 14:00 and 18:00, each settled an hour later. A transfer after the 18:00 cut-off on a Friday, and every weekend transfer, waits for Monday’s first session. These times are the generator’s. They are not NIBSS’s, and the note above shows the sources disagree about the real ones.
A transfer belongs to the session in which it became final, not the one in which it was sent. That matters in two ways. A transfer that timed out and was later confirmed by a status query settles in the later session. And a transfer whose final status is not 00 never settles at all, because no credit stands behind it.
A participant’s position in a session is what it sent, what it received, and the difference:
net = received − sent
A negative net is a net debit: the participant owes the network that amount and must pay it in. A positive net is a net credit: the network owes it that amount. Take three banks and three transfers in one session.
| Transfer | Amount |
|---|---|
| A pays B | ₦5,000,000 |
| B pays C | ₦3,000,000 |
| C pays A | ₦1,000,000 |
| Bank | Sent | Received | Net |
|---|---|---|---|
| A | ₦5,000,000 | ₦1,000,000 | −₦4,000,000 |
| B | ₦3,000,000 | ₦5,000,000 | +₦2,000,000 |
| C | ₦1,000,000 | ₦3,000,000 | +₦2,000,000 |
The gross value is ₦9,000,000. Only A has to find money, ₦4,000,000, which is 44.4% of the gross. The nets add up to −4 + 2 + 2 = 0, and they must in any session: what the debtors pay in is exactly what the creditors receive. The lab’s invariant 22 checks it for all 21 sessions.
Not every participant settles for itself. In the lab the microfinance banks, the mobile money operators and Owoleaf are sponsored: they settle through a sponsor bank, and the settles_via column in settlement_positions names it. Rolling a session’s positions into their sponsors makes fewer, larger positions. The chapter on direct and sponsored access (named here in plain text, as it is written beside this one) covers what a sponsor carries. Whether the real rules require this of a given institution is a matter for the CBN’s current circulars, which this chapter does not summarise.
Gross against net
The saving from netting is the difference between what every payment would need if each were funded on its own and what the net debtors need. The first count is gross, pre-funded: each payment needs its own cash when it is sent. The history chapter showed that a gross system which lets arriving money fund later payments needs much less, so say which gross you mean before you quote a saving. Here “gross” is the pre-funded kind, because that is the figure a bank would have to hold if it could not rely on anything arriving.
Step 3 of the lab prints the week. Three of its rows tell the story. The figures are whole naira, with the kobo dropped.
| Session | Transfers | Gross | Net debtors fund | Net / gross |
|---|---|---|---|---|
| Monday, second | 881 | ₦13,323,537 | ₦2,403,873 | 18.0% |
| Friday, third | 850 | ₦82,707,195 | ₦69,692,241 | 84.3% |
| Monday 22 June, first (Friday evening and the weekend) | 3,466 | ₦55,591,855 | ₦6,540,205 | 11.8% |
| The week | 17,798 | ₦343,902,244 | ₦118,003,802 | 34.3% |
A normal session needs about a fifth of its gross value. Friday evening’s and the weekend’s 3,466 transfers settle together in Monday’s first session, and with so many payments among the same banks the net is 11.8% of the gross. Friday’s third session is the exception. It carries more gross value than the weekend’s session, yet the debtors have to find 84.3% of it, because one bank, B13, sent ₦69,833,501 and received ₦261,096. There was almost nothing coming the other way to offset it. Without that session the week’s saving is 81.5%, and in that session alone it is 15.7%.
These figures count each participant on its own. Rolled into the banks that settle for them, the need is ₦114,803,928, or 33.4% of the gross, which is the figure the chapter on clearing and settlement at the switch uses. Both are right: they answer different questions, one per participant and one per settlement bank.
Netting saves liquidity when flows meet. It saves almost nothing when one participant is paying out and nobody is paying it back. A treasury that plans from the average saving will be wrong on exactly the day that matters.
Limits, prefunding and collateral
If a participant could build a net debit of any size, the network would be lending it that money for the length of the session, and the banks that were credited would carry the risk that it cannot pay. Three controls answer that, and real systems mix them.
- Prefunding. The participant puts money in before it sends, and cannot send more than it holds. Nothing is owed afterwards, at the cost of tying up liquidity.
- A limit with collateral. The participant may build a net debit up to a cap, and pledges collateral that covers a failure to pay. This is the arrangement the lab models: the cap is the participant’s
collateral_kobo, plus any top-up it has already made: its net debit in the open session, with a new payment added, may not pass it. - Loss sharing. If a participant fails, the others cover the loss by an agreed rule.
At the limit, a system can refuse the payment, queue it until position improves, or let it through and rely on cover. The lab refuses, with its own response code 51, which in the lab means “participant limit”. The lab’s codes are illustrative, so do not read the number as anything a real switch returns.
What do the real rules say? This build found public documents, all seen as search summaries, and one gap.
The CBN’s Large Value Payments page, as search results summarise it, says that NIBSS passes each bank’s net settlement position from clearing into the CBN’s real-time gross settlement system (RTGS) for settlement at a designated time; that the CBN would provide a collateralised intraday credit facility when a participant cannot fund its net position (the search showed that sentence cut off, so the terms are not confirmed); that where an account lacks funds the CBN does not settle the instruction but queues it, first in, first out; and that other transactions banks initiate do not settle until net settlement has completed. The page is undated, so check it for changesas of 2026-11.
The CBN’s Exposure Draft for Nigerian Clearing System Rules, 2016 (Revised), as search summaries describe it, would require a bank that has used clearing collateral to fund its account to replace it within two business days or be suspended from clearing, and lists failure to keep adequate collateral as a ground for suspension. A draft is not the ruleas of 2026-11. The CBN’s Nigerian Bankers’ Clearing System Rules (Revised), as search results describe them, took effect on 1 September 2018 and carry the same framework forward; one reporting source quotes the two-business-day replacement rule from them. This build did not check that wording against the PDF, so read the current rules, and any later revision, before you rely on any of thisas of 2026-11. A regulatory-alert mirror of CBN circular BPS/DIR/CIR/GEN/02/039 (10 November 2017) is summarised as extending the settlement-bank arrangement to all clearing sessions from 1 January 2018, and a mirror of the follow-up circular /041 (December 2017) as suspending that extension until further noticeas of 2026-11. So the 2017 circulars show the direction and not a rule in force; the final 2018 rules are the later text.
The CPMI and IOSCO Principles for financial market infrastructures (April 2012), as search summaries give them, include Principle 4 (cover credit exposure to each participant fully, with a high degree of confidence), Principle 5 (accept collateral with low credit, liquidity and market risk), Principle 7 (measure and manage liquidity risk, with stress scenarios that include the default of the participant with the largest obligation), Principle 8 (final settlement at a minimum by the end of the value date) and Principle 9 (settle in central bank money where practical and available). The search showed summaries of the principles’ headlines and not their key considerationsas of 2026-11.
These are international standards for the operators of payment systems, not Nigerian law. This build found nothing that says how or whether the CBN applies them to NIBSS, so the chapter makes no claim about it. The gap is the important one: no search result showed a NIBSS or CBN document that sets a per-participant net debit cap for NIP, or says how collateral relates to it. The lab’s cap is therefore a model of the idea. If you work for a bank or a sponsored institution, ask your settlement bank or NIBSS for the participant rules, and find out three things: how the limit is set, what the network does at the limit, and how fast a top-up counts.
B13’s Friday, minute by minute
The lab gives B13 collateral of ₦40,000,000. That figure is illustrative, and so is the lab’s limit rule, which rails.py states in its own docstring: a direct participant’s net debit in the open settlement session may not pass its collateral, plus any top-up already made, and the check runs when the payment arrives. In other words the switch adds up what B13 has sent and received in the session so far (counting transfers it has answered 00), adds the new payment, and refuses it with 51 if the total would pass the cap. There is no percentage in it: the cap is the collateral. Step 4 rebuilds that net debit from the transfers and tests all forty supplier payments against it. All times below are the transfers’ recorded times.
The forty supplier payments start at 12:02. By 12:08:12 the net debit has passed half the collateral, at ₦20,047,725. At 12:13:53 it passes 80%, at ₦33,259,966, and at 12:14:38 it passes 90%, at ₦37,383,128 (93.5%). At 12:16:16 the net debit is ₦39,293,558 and the next payment is ₦1,574,142. Together they make ₦40,867,700, which is 102.2% of collateral, so it is refused with 51. Three more follow, at 12:17:03, 12:17:54 and 12:18:13: four payments, ₦6,820,004 in all. The highest the net debit reaches before the top-up is ₦39,316,775, or 98.3%. Before the top-up B13 is never above collateral. The switch refuses a payment that would take it there.
At 12:19:00 B13 sends ₦150,000,000 to the central bank, recorded in the rtgs table as settlement_funding. B13 made another, smaller settlement_funding payment at 11:10 (₦24,970,000), which the lab’s rule ignores: only the 12:19 one raises the cap. The next supplier payment, at 12:19:04, goes through, and all sixteen after the top-up settle, ₦30,276,651 in all. Whether cash sent to settle should raise a limit that collateral sets is a design question, and the lab’s answer is a modelling choice. The session closes at 14:00 with B13 a net debtor of ₦69,572,405. That is 173.9% of its collateral and 36.6% of collateral plus the top-up. So the close is not a breach: the cover had grown with the position.
Two details are worth the care of a treasury analyst.
Decided and recorded agree. Every refusal is recorded between 12:16:16 and 12:18:13, before the top-up at 12:19:00, and the step 4 replay, which tests each payment at its recorded time, gets all forty right. That is why a replay of a limit works at all: the check uses one clock. A replay that took its position from a different moment, such as the session’s close, would find B13 far over its cap all afternoon and refuse nearly everything.
What the customer’s side saw. B13’s own log, in bank_log, shows each of the four debits reversed 40 seconds after it was posted. For forty seconds the corporate’s balance was lower by a payment that never reached anyone. The supplier waited for money that did not come. The refusal is cheap for the network and expensive for the customer.
Look at what treasury could have seen. The net debit crossed 80% at 12:13:53, two minutes and 23 seconds before the first refusal, and 90% at 12:14:38, 98 seconds before it. An alert at 80% gives about two minutes. A top-up takes effect, in the lab, at the minute it is recorded, and in a real system it may not, which is why the question of how fast a top-up counts matters.
When the session balances and the banks still disagree
A session that sums to zero tells you the arithmetic is sound. It does not tell you that every credit the banks gave was settled. The lab’s step 2 compares the banks’ own logs with the sessions. There are 17,802 inward credits in bank_log and 17,798 settled transfers. The four odd ones are transfers of ₦6,336 (B01 to B19), ₦18,200 (B01 to B07), ₦1,814 (B03 to B07) and ₦3,024 (B12 to B23), ₦29,374 in all. In each the first answer was a timeout, and the status queries that should have found it never ran, so the switch’s final status stayed 97. The receiving bank credited its customer. The transfer never reached 00, so no session settled it, and the sending bank reversed its own customer. Three banks are out of pocket until someone finds the credits. Debited but not credited is a later chapter’s subject. The point for settlement is that the sum-to-zero proof covers the transfers the switch calls final. Only a comparison against each bank’s own log shows the rest.
Where this goes wrong
- Treating the zero sum as proof. It proves the netting. It does not prove that every credit was settled or that every position is right. Compare the sessions with the banks’ logs.
- Planning from the average saving. The lab’s week saves 65.7%, and Friday’s third session saves 15.7%. Plan for the concentrated day.
- Looking at the position only at the close. B13 ended its session at 173.9% of collateral, yet its refusals came at 98.3% before the top-up, when a payment would have passed 100%. The peak and the speed of climb matter, and so does the cover at that minute.
- Alerting at the limit. An alert at 100% fires after the refusals. Treasury needs an alert while there is still time to act.
- Measuring the limit on the wrong position. The rule tests the net debit in the open session at the minute the payment arrives. The session’s close, the day’s total or an earlier session’s position gives a different answer. Compare like with like.
- Taking the lab for the rules. The net-debit-against-collateral rule, the collateral figure, the cut-offs and
51are illustrative. Whether a real network refuses, queues or lends at the limit is a question for its rules. - Reading the declines as an outage. B13’s four refusals came from its own position. The switch and the receiving banks were up, so a dashboard that counts refusals as network failures blames the wrong party.
What the lab cannot tell you
The week is ₦343,902,244 across 21 sessions. A real network moves vastly more, and its banks’ positions are on a different scale, so no figure here is a benchmark. The collateral figures, the limit rule and the cut-offs are generated. The lab models the idea of a limit backed by collateral, with one participant at it, and no source found for this chapter says how NIP caps participants. One more thing may change under you. Press, not NIBSS: Nairametrics reported in June 2025 that NIBSS unveiled a National Payment Stack, and search summaries of that coverage describe it as meant to succeed NIP with instant settlement. This build did not establish the current status or any retirement dateas of 2026-11. If settlement moves from deferred net to something else, the positions and limits in this chapter change with it. Check NIBSS’s current documents for what applies to your institution.
You work in labs/finance and only read data/rails.sqlite. Every amount is integer kobo, and the scripts turn kobo into naira only to print. The generator’s codes, cut-offs, collateral and limit rule are illustrative, not NIBSS’s or the CBN’s.
1. Generate the payment-network week and check it. It takes about a second.
cd labs/finance
python3 rails.py
python3 check.py --rails-only32 participants, 22,835 accounts, 17,998 transfers, 12,158 name enquiries, 136 status queries
21 settlement sessions, 125 batch files, 193 RTGS payments, 3,412 USSD sessions, 3,453 PSB postings
planted (answers/rails_truth.csv): credited_without_settlement 4, customer_fee_not_charged 6, customer_reversed_twice 3, levy_not_charged 5, mmo_trust_shortfall 1, participant_limit 4, participant_outage 1, psb_cash_out_fee_not_posted 1, psb_cash_out_posted_twice 1, reversed_after_late_success 4, same_number_two_banks 8, switch_incident 1, telco_record_missing 12
rails week: 17,998 transfers, 21 settlement sessions, 22,835 accounts; checks 21-25 run
OK: all invariants holdThe planted line only counts the generator’s deliberate breaks by kind; the key itself, answers/rails_truth.csv, stays closed in this chapter. Seed 42 gives the same numbers every time. Invariants 21 to 25 hold, and 22 is the one this chapter leans on: every settlement session nets to zero.
2. Recompute every session’s positions from the transfers. The script builds each participant’s sent and received per session from transfers and compares the result with settlement_positions. Then it checks the banks’ own logs against the sessions.
python3 - <<'PY'
import sqlite3
db = sqlite3.connect("data/rails.sqlite")
naira = lambda kobo: f"₦{kobo / 100:,.2f}"
# Only transfers whose final status is 00 settle, and each names the session it settles in.
sent, got = {}, {}
for sess, src, dest, amount in db.execute(
"SELECT settlement_session, src, dest, amount_kobo FROM transfers WHERE settlement_session <> ''"):
sent[(sess, src)] = sent.get((sess, src), 0) + amount
got[(sess, dest)] = got.get((sess, dest), 0) + amount
mine = {key: (sent.get(key, 0), got.get(key, 0), got.get(key, 0) - sent.get(key, 0))
for key in set(sent) | set(got)}
theirs = {(s, p): (o, i, n) for s, p, o, i, n in db.execute(
"SELECT session, participant, sent_kobo, received_kobo, net_kobo FROM settlement_positions")}
print("1. positions recomputed from the transfers")
print(f" recomputed {len(mine)}, in settlement_positions {len(theirs)}, "
f"different {sum(1 for k in set(mine) | set(theirs) if mine.get(k) != theirs.get(k))}")
nets = {}
for (sess, _), (_, _, net) in mine.items():
nets.setdefault(sess, []).append(net)
print(f" sessions {len(nets)}, sessions whose nets do not add to zero {sum(1 for v in nets.values() if sum(v))}")
print("2. one session, 20260615-2, largest positions")
ranked = sorted(((n, p) for (s, p), (_, _, n) in mine.items() if s == "20260615-2"))
for n, p in ranked[:2] + ranked[-2:]:
print(f" {p} {'pays in ' if n < 0 else 'receives'} {naira(abs(n)):>12}")
pay = sum(-n for n, _ in ranked if n < 0)
print(f" {sum(1 for n, _ in ranked if n < 0)} participants pay in {naira(pay)}; "
f"{sum(1 for n, _ in ranked if n > 0)} receive {naira(sum(n for n, _ in ranked if n > 0))}")
print("3. credits in the banks' own logs that no session settles")
for sid, src, dest, amount, first, final in db.execute("""
SELECT t.session_id, t.src, t.dest, t.amount_kobo, t.first_response, t.final_status
FROM bank_log b JOIN transfers t ON t.session_id = b.session_id
WHERE b.direction = 'in' AND t.settlement_session = ''"""):
print(f" {sid}: {src} to {dest}, {naira(amount)}, first response {first}, final status {final}")
print(f" inward credits in bank_log {db.execute('SELECT COUNT(*) FROM bank_log WHERE direction = ?', ('in',)).fetchone()[0]:,}; "
f"settled transfers {db.execute('SELECT COUNT(*) FROM transfers WHERE settlement_session <> ?', ('',)).fetchone()[0]:,}")
PY1. positions recomputed from the transfers
recomputed 668, in settlement_positions 668, different 0
sessions 21, sessions whose nets do not add to zero 0
2. one session, 20260615-2, largest positions
B03 pays in ₦453,307.00
B16 pays in ₦450,253.00
B07 receives ₦330,112.00
B20 receives ₦335,786.00
15 participants pay in ₦2,403,873.00; 17 receive ₦2,403,873.00
3. credits in the banks' own logs that no session settles
900824260616074648336718609909: B01 to B19, ₦6,336.00, first response 97, final status 97
900824260618153249853770689905: B01 to B07, ₦18,200.00, first response 97, final status 97
900758260619121540683004570876: B03 to B07, ₦1,814.00, first response 97, final status 97
900806260619190215950367601939: B12 to B23, ₦3,024.00, first response 97, final status 97
inward credits in bank_log 17,802; settled transfers 17,798All 668 positions match, so the table is exactly what the transfers say. Every session nets to zero. In session 20260615-2, 15 participants pay in ₦2,403,873.00 and 17 receive the same amount. The third check is the one that finds something: the banks’ logs hold 17,802 inward credits and the sessions settle 17,798 transfers. The four odd credits are for ₦6,336.00, ₦18,200.00, ₦1,814.00 and ₦3,024.00. In each the first response was a timeout (97) and the status was never resolved, so nothing settles it.
3. Compare gross with net, session by session. The last column rolls each position into the institution that settles for it, using settles_via.
python3 - <<'PY'
import sqlite3
db = sqlite3.connect("data/rails.sqlite")
naira = lambda kobo: f"{kobo // 100:,}" # whole naira for display; the sums stay in kobo
sessions = {}
for s, via, sent, net in db.execute(
"SELECT session, settles_via, sent_kobo, net_kobo FROM settlement_positions ORDER BY session"):
d = sessions.setdefault(s, {"gross": 0, "fund": 0, "via": {}})
d["gross"] += sent # each transfer is sent once: the gross value
d["fund"] += -net if net < 0 else 0 # what the net debtors must find
d["via"][via] = d["via"].get(via, 0) + net # sponsored members roll into their sponsor
count = dict(db.execute(
"SELECT settlement_session, COUNT(*) FROM transfers WHERE settlement_session <> '' GROUP BY 1"))
print(f"{'session':<11} {'transfers':>9} {'gross ₦':>12} {'net ₦':>10} {'net/gross':>9} {'sponsors ₦':>11}")
tg = tn = tv = 0
for s, d in sessions.items():
v = sum(-x for x in d["via"].values() if x < 0)
tg, tn, tv = tg + d["gross"], tn + d["fund"], tv + v
print(f"{s:<11} {count[s]:>9,} {naira(d['gross']):>12} {naira(d['fund']):>10} "
f"{100 * d['fund'] / d['gross']:>8.1f}% {naira(v):>11}")
print(f"{'week':<11} {sum(count.values()):>9,} {naira(tg):>12} {naira(tn):>10} {100 * tn / tg:>8.1f}% {naira(tv):>11}")
f = sessions["20260619-3"]
print(f"\nliquidity saved over the week: {100 * (tg - tn) / tg:.1f}%")
print(f"without session 20260619-3: {100 * (tg - tn - f['gross'] + f['fund']) / (tg - f['gross']):.1f}%")
print(f"session 20260619-3 alone: {100 * (f['gross'] - f['fund']) / f['gross']:.1f}%")
PYsession transfers gross ₦ net ₦ net/gross sponsors ₦
20260615-1 74 1,160,305 576,564 49.7% 498,069
20260615-2 881 13,323,537 2,403,873 18.0% 2,201,782
20260615-3 855 12,293,187 2,070,311 16.8% 2,016,043
20260615-4 681 9,673,797 2,239,879 23.2% 2,145,697
20260616-1 553 8,669,540 2,015,348 23.2% 1,597,837
20260616-2 855 11,810,906 3,063,993 25.9% 2,732,551
20260616-3 867 15,104,512 3,691,174 24.4% 3,629,256
20260616-4 688 10,009,843 1,994,586 19.9% 1,915,866
20260617-1 571 8,597,288 1,508,609 17.5% 1,451,154
20260617-2 861 11,706,500 1,771,242 15.1% 1,709,520
20260617-3 863 13,074,967 2,372,844 18.1% 1,955,033
20260617-4 665 9,741,750 1,893,056 19.4% 1,819,084
20260618-1 542 11,924,809 3,157,842 26.5% 2,946,265
20260618-2 832 12,572,118 2,115,417 16.8% 1,948,521
20260618-3 837 12,808,551 2,569,311 20.1% 2,334,354
20260618-4 711 11,070,367 2,867,240 25.9% 2,714,528
20260619-1 569 8,612,128 1,851,098 21.5% 1,623,445
20260619-2 878 13,195,536 1,917,546 14.5% 1,917,546
20260619-3 850 82,707,195 69,692,241 84.3% 69,595,990
20260619-4 699 10,253,551 1,691,422 16.5% 1,629,488
20260622-1 3,466 55,591,855 6,540,205 11.8% 6,421,898
week 17,798 343,902,244 118,003,802 34.3% 114,803,928
liquidity saved over the week: 65.7%
without session 20260619-3: 81.5%
session 20260619-3 alone: 15.7%The week’s net debtors have to find 34.3% of the gross, so netting saves 65.7%. Most sessions need between 10% and 27%, and the thin first session on Monday, with 74 transfers, needs 49.7%. Session 20260619-3, Friday’s third, needs 84.3%, and without it the week saves 81.5%. The weekend’s Monday session is the best at 11.8%, because 3,466 payments offset each other. The sponsors column is no higher than the net column in any session (equal in one), because a sponsor’s members’ flows offset inside the sponsor.
4. Replay B13’s Friday. The script rebuilds B13’s net debit in session 20260619-3 from the transfers the switch answered 00, at their recorded times, and tests every supplier payment against the lab’s rule: net debit plus the payment may not pass collateral, plus the top-up once it is made.
python3 - <<'PY'
import sqlite3
db = sqlite3.connect("data/rails.sqlite")
SESSION, BANK = "20260619-3", "B13"
OPEN, CLOSE = "2026-06-19T10:00", "2026-06-19T14:00" # the open session's window, from its cut-offs
naira = lambda kobo: f"{kobo / 100:,.2f}"
collateral, = db.execute("SELECT collateral_kobo FROM participants WHERE code = ?", (BANK,)).fetchone()
# B13 has two settlement_funding payments to the central bank that Friday; the afternoon's is the large one.
topup_at, topup = db.execute("""SELECT at, amount_kobo FROM rtgs WHERE sender = ? AND purpose = 'settlement_funding'
ORDER BY amount_kobo DESC LIMIT 1""", (BANK,)).fetchone()
print(f"collateral ₦{naira(collateral)}")
print(f"RTGS settlement funding at {topup_at[11:19]}: ₦{naira(topup)}")
# Net debit in the open session at time t: what B13 sent minus what it received, counting the transfers
# the switch had answered 00 at their recorded time.
events = db.execute("""SELECT session_id, at, CASE WHEN src = ? THEN amount_kobo ELSE -amount_kobo END
FROM transfers WHERE (src = ? OR dest = ?) AND first_response = '00'
AND at >= ? AND at < ? ORDER BY at""", (BANK, BANK, BANK, OPEN, CLOSE)).fetchall()
def net_debit(sid, t):
return sum(d for s, at, d in events if at <= t and s != sid)
payments = db.execute("""SELECT session_id, at, dest, amount_kobo, first_response FROM transfers
WHERE src = ? AND narration = 'SUPPLIER PAYMENT' ORDER BY at""", (BANK,)).fetchall()
wrong = 0
print("\nthe four payments answered 51 (net debit when each arrived, plus the payment, against the cap):")
declined = []
for sid, at, dest, amount, first in payments:
cap = collateral + (topup if at >= topup_at else 0)
over = net_debit(sid, at) + amount > cap
wrong += over != (first == "51")
if first == "51":
declined.append(amount)
pos = net_debit(sid, at)
print(f" {at[11:19]} to {dest}: ₦{naira(pos)} + ₦{naira(amount)} = ₦{naira(pos + amount)} "
f"({100 * (pos + amount) / collateral:.1f}% of collateral)")
print(f"declined in all: ₦{naira(sum(declined))}")
print(f"payments the rule gets wrong: {wrong} of {len(payments)}")
last = max(at for _, at, _, _, first in payments if first == "51")
print(f"last decline recorded {last[11:19]}, the top-up {topup_at[11:19]}")
crossed, running = {}, 0
for sid, at, d in events:
running += d
for pct in (50, 80, 90):
if running >= collateral * pct // 100:
crossed.setdefault(pct, (at[11:19], running))
print("\nthe net debit first reached:")
for pct, (at, pos) in crossed.items():
print(f" {pct}% of collateral at {at} (₦{naira(pos)})")
peak = max(net_debit("", at) for _, at, _ in events if at < topup_at)
print(f"\nhighest net debit before the top-up: ₦{naira(peak)} ({100 * peak / collateral:.1f}% of collateral)")
close = db.execute("SELECT net_kobo FROM settlement_positions WHERE session = ? AND participant = ?", (SESSION, BANK)).fetchone()[0]
print(f"position at the session's close: ₦{naira(-close)}")
print(f" as a share of collateral: {100 * -close / collateral:.1f}%")
print(f" as a share of collateral + top-up: {100 * -close / (collateral + topup):.1f}%")
import datetime as dt
gaps = [(dt.datetime.fromisoformat(r) - dt.datetime.fromisoformat(d)).seconds for d, r in db.execute(
"""SELECT posted_at, reversed_at FROM bank_log WHERE institution = ? AND direction = 'out' AND status = 'reversed'
AND session_id IN (SELECT session_id FROM transfers WHERE first_response = '51')""", (BANK,))]
print(f"\nB13's own log: {len(gaps)} debits reversed, each after {sorted(set(gaps))} seconds")
PYcollateral ₦40,000,000.00
RTGS settlement funding at 12:19:00: ₦150,000,000.00
the four payments answered 51 (net debit when each arrived, plus the payment, against the cap):
12:16:16 to B09: ₦39,293,558.00 + ₦1,574,142.00 = ₦40,867,700.00 (102.2% of collateral)
12:17:03 to B10: ₦39,314,841.00 + ₦2,043,276.00 = ₦41,358,117.00 (103.4% of collateral)
12:17:54 to B06: ₦39,316,775.00 + ₦1,520,725.00 = ₦40,837,500.00 (102.1% of collateral)
12:18:13 to B11: ₦39,316,775.00 + ₦1,681,861.00 = ₦40,998,636.00 (102.5% of collateral)
declined in all: ₦6,820,004.00
payments the rule gets wrong: 0 of 40
last decline recorded 12:18:13, the top-up 12:19:00
the net debit first reached:
50% of collateral at 12:08:12 (₦20,047,725.00)
80% of collateral at 12:13:53 (₦33,259,966.00)
90% of collateral at 12:14:38 (₦37,383,128.00)
highest net debit before the top-up: ₦39,316,775.00 (98.3% of collateral)
position at the session's close: ₦69,572,405.00
as a share of collateral: 173.9%
as a share of collateral + top-up: 36.6%
B13's own log: 4 debits reversed, each after [40] secondsThe four refusals each come when the net debit plus the payment would be 102.1% to 103.4% of collateral, and the net debit before them was 98.3% of collateral at most. The rule, rebuilt from the transfers, gets all 40 payments right: it refuses those four and accepts the other 36. All four are recorded before the 12:19:00 top-up, so nothing needs explaining by the clock. The net debit ends at ₦69,572,405.00. Against collateral alone that is 173.9%, and against collateral plus the top-up, 36.6%. The net debit passed 80% two minutes and 23 seconds before the first refusal.
5. Check the claim about everyone else. This query lists the five highest net debits as a share of collateral, over all sessions.
python3 - <<'PY'
import sqlite3
db = sqlite3.connect("data/rails.sqlite")
rows = db.execute("""SELECT p.session, p.participant, -p.net_kobo, c.collateral_kobo
FROM settlement_positions p JOIN participants c ON c.code = p.participant
WHERE p.net_kobo < 0 AND c.collateral_kobo > 0
ORDER BY 1.0 * -p.net_kobo / c.collateral_kobo DESC""").fetchall()
over = [r for r in rows if r[2] > r[3]]
print(f"net-debit positions held by participants with collateral: {len(rows)}; above their collateral: {len(over)}")
for s, p, debit, col in rows[:5]:
print(f" {s} {p} net debit ₦{debit / 100:>13,.2f} collateral ₦{col / 100:>13,.2f} {100 * debit / col:>6.1f}%")
PYnet-debit positions held by participants with collateral: 259; above their collateral: 1
20260619-3 B13 net debit ₦69,572,405.00 collateral ₦40,000,000.00 173.9%
20260618-1 B14 net debit ₦ 1,481,135.00 collateral ₦ 2,500,000.00 59.2%
20260616-3 B23 net debit ₦ 1,029,769.00 collateral ₦ 2,500,000.00 41.2%
20260622-1 B24 net debit ₦ 876,831.09 collateral ₦ 2,500,000.00 35.1%
20260622-1 B19 net debit ₦ 642,408.57 collateral ₦ 2,500,000.00 25.7%Of the 259 net-debit positions held by participants with collateral, only B13’s Friday is above its collateral. The next highest is B14’s at 59.2%, which is why one participant at its limit is an event and not a pattern. A position above collateral is the lab’s marker, not proof that anything broke: B13’s was covered by the top-up.
Take the top-up away and replay the afternoon with the same rule. Run this from labs/finance:
python3 - <<'PY'
import sqlite3
db = sqlite3.connect("data/rails.sqlite")
BANK = "B13"
collateral, = db.execute("SELECT collateral_kobo FROM participants WHERE code = ?", (BANK,)).fetchone()
topup_at, topup = db.execute("""SELECT at, amount_kobo FROM rtgs WHERE sender = ? AND purpose = 'settlement_funding'
ORDER BY amount_kobo DESC LIMIT 1""", (BANK,)).fetchone()
events = [] # (time, kind, amount): every transfer the switch answered 00, plus the supplier payments, at the recorded time
for at, src, dest, amount, first, narration in db.execute(
"""SELECT at, src, dest, amount_kobo, first_response, narration FROM transfers
WHERE (src = ? OR dest = ?) AND at >= '2026-06-19T10:00' AND at < '2026-06-19T14:00'
AND (first_response = '00' OR narration = 'SUPPLIER PAYMENT')""", (BANK, BANK)):
if dest == BANK:
events.append((at, "in", amount))
elif narration == "SUPPLIER PAYMENT":
events.append((at, "supplier", amount))
else:
events.append((at, "out", amount))
events.sort()
def replay(cap_of):
position, declined = 0, [] # net debit in the open session, kobo
for t, kind, amount in events:
if kind == "in":
position -= amount
elif kind == "out":
position += amount
elif position + amount > cap_of(t):
declined.append((t, amount))
else:
position += amount
return declined, position
runs = (("as recorded, with the top-up", lambda t: collateral + (topup if t >= topup_at else 0)),
("without the top-up", lambda t: collateral))
for label, cap_of in runs:
declined, close = replay(cap_of)
print(f"{label}: {len(declined)} declined, ₦{sum(a for _, a in declined) / 100:,.2f}; "
f"closing net debit ₦{close / 100:,.2f}; first decline {declined[0][0][11:19] if declined else '-'}")
PYas recorded, with the top-up: 4 declined, ₦6,820,004.00; closing net debit ₦69,581,922.00; first decline 12:16:16
without the top-up: 20 declined, ₦37,096,655.00; closing net debit ₦39,305,271.00; first decline 12:16:16As recorded, the replay refuses four payments, ₦6,820,004.00, and reproduces the first refusal at 12:16:16. Without the top-up it refuses 20 payments worth ₦37,096,655.00: the four refusals plus the sixteen supplier payments (₦30,276,651) that the top-up let through. Only the first 20 of the 40 would have been paid, and B13 would have stayed inside its collateral to the end, at a net debit of ₦39,305,271.00. In the lab’s model the top-up is the reason ₦30,276,651 of suppliers were paid that lunchtime. Now add collateral += 500_000_000 on the line after the collateral is read, which is ₦5,000,000 more cover, and run it again: the first refusal moves from 12:16:16 to 12:18:13 and the refusals fall from four to one. A small change in cover moves the first refusal by almost two minutes, because B13’s payments are large against what is left.
Template
# Intraday liquidity and collateral top-up procedure: <bank>
Written by <treasury analyst> · Approved by <head of treasury> · Version <n>, <date> · Next review <date>
Decision needed: <what the approver is asked to agree, by when>
## Purpose and scope
<What this protects. What it does not cover: other sessions, other participants, end-of-day funding.>
## Positions watched, each session
| Position | Source | Checked | Compared with |
|---|---|---|---|
| Net debit in the open session | <table or screen> | <every n minutes> | <collateral plus top-ups> |
## Warning level
Level: <percent> of <cover>. Why this level: <the time the climb takes, from a past session>
Who is told: <name, role, channel>. Who acts: <name>. If they do not answer in <minutes>: <name>
## Top-up
Trigger: <condition>. Amount: <figure and how it was sized>. Sent by: <role> to <account>
Counts from: <when the top-up raises the cover, as confirmed with the settlement bank>
Approval: <who, and what a dealer may do alone>
## Over the limit
What happens to payments: <refused, queued or other, per the rules>
What the customer sees: <screen, message, reversal time>. Who tells the customer: <role>
## Review after each event
Within <n> working days, <owner> records: peak position, time of warning, time of top-up, payments refused (count, value), what the customer saw. Decision: <keep, change level, change amount>
## What this procedure assumes
- <assumption, and who to ask to confirm it>
- <one way it could be wrong, and what would show it> WORKED EXAMPLE
At a real bank a treasury analyst writes this and the head of treasury signs it: here Tosin drafts it for B13 and Foluke approves it. Decision needed: Foluke’s approval of an 80% warning and of a standing Friday top-up, before the next Friday.
Positions watched. The net debit in the open settlement session, rebuilt from the transfers answered 00, checked every minute from 12:00 on Fridays (an assumption) against collateral of ₦40,000,000 plus any top-up already sent.
Warning level. 80% of cover, which is ₦32,000,000. On the lab’s Friday the net debit passed 80% at 12:13:53, at ₦33,259,966, and the first payment was refused at 12:16:16, so the warning gave 2 minutes 23 seconds. Tosin is told by screen alert and by phone; Foluke is told if Tosin has not acknowledged in 60 seconds (an assumption).
Top-up. Trigger: the 80% warning. Amount: ₦150,000,000, the figure sent at 12:19:00 on the lab’s Friday; the close of ₦69,572,405 was then 36.6% of collateral plus top-up, so the cover was not short. Tosin sends it; Foluke approves it in advance for Fridays. In the lab it counts at the minute it is recorded. B13 must confirm with its settlement bank how fast a real top-up counts.
Over the limit. The lab refuses with 51: four payments, ₦6,820,004 in all, and each debit was reversed 40 seconds after posting, so for 40 seconds the corporate’s balance was lower by a payment no supplier received. Customer care tells the corporate to resubmit (an assumption).
Review. Within two working days Tosin records the peak (98.3% on the lab’s Friday), the warning time, the top-up time and the refusals.
Could be wrong. If a real top-up takes longer than two minutes to count, the 80% warning comes too late; the review would show refusals after the top-up was sent.
Now you
A month later the corporate adds a second payment run on the last working day of the month, and assume it looks like the lab’s Friday: about forty payments of about ₦2 million within half an hour. Foluke asks you, as a treasury analyst, for a revised procedure before then. Assume B13’s settlement bank has told you that a top-up counts only about ten minutes after it is sent (this is an assumption, not a lab output). Use the lab’s Friday: when the net debit passed 50%, 80% and 90%, how fast it climbed, and when the first refusal came. Work out what warning level now leaves ten minutes to act, or say that no level the lab printed can and prefunding is the alternative. Name who is told, how much to top up, and what customers see meanwhile. Foluke reads it and approves it, and it supports one decision: whether the desk watches and tops up in the session, or prefunds before the corporate’s runs begin.
Self-check
Foluke and Tosin have the Friday's replay. B13's corporate customer pays about forty suppliers on a Friday lunchtime, and the lab's limit rule refuses any payment that would take its net debit in the open session past its collateral. A top-up takes effect when it is sent, in the lab, but nobody knows how fast it counts in the real network. They must decide how treasury will handle the next Friday.
- DOC Large Value Payments (Inter-Bank Fund Transfer System) (CBN) Central Bank of Nigeria
The regulator's description of RTGS, how NIBSS passes net positions into it and what happens when an account lacks funds (a queue, and a collateralised intraday facility). Treat any session times as a snapshot: the page is undated.
- DOC How does Settlement happen on the service? (NIBSS support article) NIBSS
The scheme operator's own wording on deferred net settlement and funds being available before settlement. Read it with the Predict; check which service the article covers and its cut-over times, which other sources dispute.
- PAPER Principles for financial market infrastructures (CPMI and IOSCO, 2012) CPMI and IOSCO, 2012
The international standard for the systems that clear and settle payments. Read Principle 4 on credit risk, Principle 5 on collateral, Principle 7 on liquidity risk and Principle 9 on money settlements for what an operator should do about the exposure this chapter measures. Skip the securities-specific principles. Read: Principles 4, 5, 7, 8 and 9.
- PAPER Fast payments: enhancing the speed and availability of retail payments (CPMI, 2016) Committee on Payments and Market Infrastructures, BIS, 2016
How CPMI defines fast payments and which risks it says they intensify. Read the executive summary and the sections on risks, and check what it says about settlement; skip the country case tables on a first pass. Read: Executive summary; sections on key characteristics and on risks.
- DOC Exposure Draft for Nigerian Clearing System Rules, 2016 (Revised) (CBN) Central Bank of Nigeria, 2017
A draft, not the rule in force. Read it for how a regulator frames clearing collateral, settlement banks and what happens when collateral is used. Then look for the current rules before you rely on any of it.
- DOC Nigerian Bankers' Clearing System Rules (Revised) (CBN, 2018) Central Bank of Nigeria, 2018
The later, revised rules that follow the 2016 draft: settlement banks, clearing collateral and suspension. This chapter saw them through search summaries only, so check every rule against the text and look for any later revision.
All companies and people in these examples are fictional. Any resemblance to a real business or person is unintended.