WORKINGCHAPTER 12

Settlement and payouts: timing, float, settlement accounts

A payout spends cash now against money that arrives later. Date every balance, measure the gap, and fund it with your own money

55 MINPAYMENTSUPDATED 2026-11-14
PREDICT

Owoleaf's lab processor pays card money every calendar day, and the most it ever owed Owoleaf, immediately before the 10:00 settlement, was ₦2,007,780.00. Suppose it paid only on business days (Monday to Friday), the day after capture or the next business day. What would the largest amount owed be?

You met settlement in two earlier places. In the card payment chapter the processor paid one batch the morning after capture. In the settlement float lesson a holiday opened a hole in the cash. This chapter goes one level down: what “settled” means, which dates a bank puts on a line, how big the float is in a real set of books and what it depends on, how many accounts the money should sit in, and how a payout job should decide what it may send.

What settlement is

Three words are used loosely, and the gap between them is the float. Clearing is the exchange of the details of payments so each side knows what it owes. Settlement is the movement of money that discharges those obligations. Finality is the point after which a settled payment cannot be taken back by the system. A payment can be cleared and not settled (the card batch sent on Monday, paid on Tuesday), and it can be settled but not final (a transfer that is returned later by the beneficiary bank).

Two principles for the infrastructures that do this work name the questions you should ask about your own settlement. The Principles for financial market infrastructures (CPMI and IOSCO, 2012), as quoted in search results, say in Principle 8 that a system should provide clear and certain final settlement, at a minimum by the end of the value date and, where necessary or preferable, intraday or in real time. Principle 9 says a system should conduct its money settlements in central bank money where practical and available, and, where it does not, should minimise and strictly control the credit and liquidity risk arising from the use of commercial bank moneyas of 2026-11. These rules bind the infrastructures, not Owoleaf or Ojaline. They still give you two practical questions. When is it final: a card batch that can still be charged back, or a NIP credit that can still be returned, is not. And in whose money is it settled: the cash in your settlement account is a claim on a commercial bank, so it is only as good as that bank, and the bank’s figure is the only one that says what you can spend.

How Owoleaf’s two rails settle

The lab has two flows into and out of the settlement account, and they settle differently.

Cards settle in a batch. The lab’s processor pays the day’s captures at 10:00 the next day, minus a fee of 1% of the batch, in one line on the statement narrated CARD SETTLEMENT. Until then the money sits in the ledger account card_clearing, a receivable: Owoleaf’s claim on the processor, with no bank account behind it. The lab pays on every calendar day, which a real processor may not do. One payment platform’s documentation (a vendor claim, as a search summary shows it) says payouts scheduled on weekends or holidays arrive on the next business dayas of 2026-11. For Nigerian card acquiring, the card payment chapter records what search summaries of the CBN’s 2020 electronic payment channel guidelines say about T+1 settlement reports, and why it states no payout deadline. Read the contract, not the lab, for your processor’s calendar.

NIP transfers settle in two layers. For the customer and for Owoleaf, a transfer is immediate: the payout debits the settlement account when it is sent, and an inward credit lands when it arrives. The lab’s statement shows both at once, as NIP OUTWARD and NIP INWARD lines. Between the banks, settlement is later. NIBSS describes NIP as a deferred net settlement system in which funds are available in the beneficiary’s account in real time before settlement, with a cut-over time of 2am and 2pm daily: transactions from 2pm the previous day to 1:59am settle at 2am, and those from 2am to 1:59pm settle at 2pmas of 2026-11. The CBN’s Large Value Payments page, as search results summarise it, says NIBSS sends each bank’s net settlement position from clearing into the CBN’s RTGS (real-time gross settlement) system for settlement at a designated timeas of 2026-11. A CBN RTGS page, as search results summarise it, says an instruction from a participant whose account lacks funds is queued and settled first in, first outas of 2026-11. Both pages are descriptions of the system as published and the times may have changed, so check them before you rely on a time. A newer view of the same market is also worth reading: a 2021 CPMI report, as search results summarise it, says retail fast payment systems are spreading quickly, that keeping them available overnight and at weekends is hard, and that they may change RTGS access criteria and operating hoursas of 2026-11. Deferred net settlement is a design choice, not a law of nature.

What does this mean for a company like Owoleaf or Ojaline? The netting between banks is mostly invisible to you. What you feel on the NIP side is the status of each payout: a transfer that is pending, and a transfer that is returned days later. Your float on NIP is not the interbank settlement time. It is the unknown outcome of the payouts in flight.

Three dates on one statement line

Open the lab’s bank_statement and you find three dates that people merge.

Date Meaning Where in the lab
Booking When the bank recorded the line booked_at
Value The day the bank counts the line towards its balance value_date
Availability When you can actually spend it Not in the lab: the bank’s own figure, which may also reflect holds

In the lab, a line booked at 23:00 or later takes the next day’s value date. That rule is invented here: a real bank sets its own cut-off, and its own treatment of weekends. The point is what it does to a balance. Step 3 finds 3,114 lines of 56,008 booked at 23:00 or later (1,941 inward credits and 1,173 outward payouts), and every one has a value date a day after its booking date. They are the only lines in the statement whose two dates differ, and none of them is a break: reconciliation must expect them, and the reconciliation chapter in this module matches by reference so that it does.

They do change the day-end balance, in both directions, and this is the trap for a payout job. Compare a day’s closing balance counted by booking date with the same day counted by value date. On 23 May 2026 the value-dated balance was ₦946,742.56 too high: more payouts than credits were booked after 23:00, so the money had left the account while the value-dated balance still counted it. On 29 March it was ₦943,152.35 too low, because more credits than payouts came in late. A job that reads a value-dated balance at 23:30 can therefore overspend or underspend, depending on the night. Of the 180 days, 170 differ. This is the statement-side version of the Monday morning in the Why.

Name the balances you hold, because “the balance” is four different numbers:

Balance What it counts Spend against it?
Dashboard (all-in) Cash plus money still owed by the processor No: part of it is a promise
Booked Every line the bank has recorded, whatever its value date Only if you know the bank lets you
Value-dated Lines counted from their value date No: it lags or leads the cash by the late lines
Available What the bank will let you move now Yes: this is the one

Float: how big, and who pays for it

Float is the money you have been promised and do not hold. In the lab it is the balance of card_clearing, and step 1 draws it. Immediately before each 10:00 settlement it holds the day before’s captures plus the morning’s. The mean over the period is ₦781,886.36, and the peak is ₦2,007,780.00 at 09:59 on Thursday 28 May. At the end of the data, the day’s captures are still there, as the card payment chapter found.

Under the lab’s processor the float holds about one day of captures plus the morning’s. Step 2 changes one rule: captures settle on the next business day. Friday’s, Saturday’s and Sunday’s captures then all settle on Monday at 10:00. The largest amount owed rises from ₦2,007,780.00 to ₦4,345,480.00, on Monday 1 June. The float is the receivable, and the receivable grows by a day of captures for every day settlement does not run.

That growth is cash you do not have, and you can size it. For a non-settling weekend, the cash you would have received and now do not is the net of Friday’s and Saturday’s settlements (the lab pays Friday’s captures on Saturday and Saturday’s on Sunday, less 1%). Over 25 weekends, the largest was ₦2,806,562.88, from the weekend of 12 June. A prefund for that weekend has to be at least that, plus a buffer for a bigger week, plus the same again for each extra non-settling day. The prefund is a transfer of Owoleaf’s own money into the settlement account before the gap opens.

Whose money fills the gap? Step 1 closes with the answer, using the identity the double-entry chapter gave you: assets equal liabilities plus equity plus income less expenses. At 09:59 on 28 May:

  • cash in the settlement account ₦136,245,140.12, plus ₦2,007,780.00 owed by the processor, is ₦138,252,920.12 of assets;
  • wallets ₦87,526,652.42 plus capital ₦50,000,000.00 plus fees earned less fees paid ₦726,267.70 is ₦138,252,920.12.

The two sides are equal. Subtract the wallets from the cash and ₦48,718,487.70 is Owoleaf’s own money sitting in the account, which is the capital and fees, less the receivable. Take the capital away and the cash would trail the wallets by ₦1,281,512.30, which is the ₦2,007,780.00 owed less the ₦726,267.70 of net fees. The float was 2.29% of wallet balances. Capital covers it in the lab. A company without capital in that account is paying part of the float with customers’ money, and a later chapter in this module, on wallets and stored value, covers what the rules say about that.

Settlement accounts: one account, several jobs

Owoleaf has one bank account, settlement_bank, and one receivable, card_clearing. Neither is the customer’s money: the wallets are a liability, and the account is where the cash that backs them sits. A larger company chooses how many accounts to put the flows through. These are the usual jobs, and a company can combine or separate them.

Job What it holds What goes wrong when it is mixed
Collection Money coming in: card settlements, inward transfers Payouts leave from the same pot, so a late settlement blocks them
Payout Cash for outgoing transfers, topped up from collection Without a cap on top-ups, one bug drains everything
Reserve A holdback for refunds and chargebacks If it is mixed with payout cash, a dispute spends the payout cash
Own funds Capital, fees earned If it is mixed with customer money, the prefund and the fees cannot be told apart

Separate accounts add transfers between your own accounts, and each is a settlement event to book and reconcile. The benefit is that each balance means one thing. A payout account’s balance is the cash a payout run may spend, and nothing else. Ojaline might keep collection and payout apart for exactly that reason, and a smaller firm might not. This is a design trade-off. It is not a recommendation of a bank or a structure.

Payouts: spend what is there

A payout job answers four questions in order. What is due (the sellers’ wallet balances, or those that asked)? What cash is available, read from the bank, not the dashboard? Who gets paid when cash is short? What happens to a payout whose outcome is unknown?

The third question needs a policy before the night it matters. The simplest is to pay in request order while the cash lasts, hold the rest for the next run, and tell the sellers held. Step 5 runs it on the Why’s numbers:

def release(requests, available_kobo):
    paid, held = [], []
    for seller, amount in requests:
        if amount <= available_kobo:
            available_kobo -= amount
            paid.append((seller, amount))
        else:
            held.append((seller, amount))
    return paid, held, available_kobo

Run against the dashboard’s ₦48,200,000, it releases all six requests, ₦44,000,000, and the account is ₦2,100,000 short. Against the available ₦41,900,000 it pays five sellers ₦40,800,000 and holds one. A different policy, such as stopping at the first request that does not fit, is also defensible, because it protects order while skipping lets small payouts past a large one. What is not defensible is not having chosen.

The fourth question is the one the NIP rail forces. Step 4 makes ten payouts with the switch, one forced to pending and one forced to be returned, and two inward credits. The switch’s GET /settlement reports outward, returned, inward and pending amounts and a net: inward plus returned minus outward. Read it at once and the pending ₦20,000 is in pending_kobo and in no other total. Read it 32 seconds later and it has moved into outward, and the returned ₦22,500 has appeared. The net moved from -₦55,500 to -₦53,000. A net position that includes pending money as sent can be wrong in one direction, and one that ignores it can be wrong in the other, so the report keeps it apart. Your job does the same: a pending payout reserves its cash, is not counted as paid, and is requeried.

A returned payout is cash coming back, later and unannounced. The lab’s statement has 98 NIP RETURN lines, each a credit for an amount that had earlier left the account. The wallet is credited again with the amount and the fee, as the payment states and refunds chapter in this module covers, and the seller’s balance is the thing that is due again at the next run. Two rules follow. A payout that has not been final for the time the rail takes to return it is not a fact yet. And a return must not create a second payout by accident: a retry needs the same payment reference, so the switch can answer that it is a duplicate. The idempotency chapter in this module is the full treatment.

Where it goes wrong

Name the failures first, because each of them looks like normal operation until the day it does not.

Paying from the dashboard balance. It counts the receivable and the cash as one. Against it, the Why’s run released ₦44,000,000 from a bank balance of ₦41,900,000.

Reading a value-dated balance at night. The late lines are in or out depending on the day. On 23 May the figure was ₦946,742.56 too high.

Forgetting that weekends and holidays are not settlement days. The lab’s processor settles every day, so the lab hides the problem. The peak doubles when it does not, and one extra holiday takes it from ₦4,345,480.00 to ₦5,297,741.00 (the lab’s break).

Treating pending as failed, or as paid. Both lose money. A pending payout retried as new is a double payout, and one written off may land.

Counting the processor’s fee in the wrong place. The settlement is net: the card chapter’s 16 March batch of ₦433,202.00 paid ₦428,869.98. A forecast of cash that uses the gross figure is ₦4,332.02 too high for that day.

Assuming a return will not happen. 98 payouts came back in the lab’s history. A forecast that has none is an optimistic forecast.

Funding the float with customers’ money. If no capital stands behind the receivable, the cash is below the wallets, as step 1 shows with the capital taken out.

LAB Measure the float, date the statement, read the switch's net position and gate a payout run ~45 MIN
YOU NEEDPython 3.9 or later (standard library only)labs/finance with the data generated (python3 generate.py, seed 42, scale 0.1)Two terminals for step 4No Docker, no packages

You work in labs/finance. Every step is Python run from that folder against data/finance.sqlite, so no sqlite3 program is needed. Step 4 also runs the mock switch. The numbers below are for seed 42 at scale 0.1. A plot here is a text chart printed by the script.

1. Plot the card_clearing balance, and see who funds it. The script reads every card_clearing entry, notes the balance immediately before each 10:00 settlement, charts a fortnight, and then splits the assets at the peak moment.

cd labs/finance
python3 generate.py          # skip if data/finance.sqlite exists
python3 - <<'PY'
import sqlite3

db = sqlite3.connect("data/finance.sqlite")

def naira(kobo):
    return f"₦{kobo // 100:,}.{kobo % 100:02d}"

clr, = db.execute("SELECT id FROM accounts WHERE code = 'card_clearing'").fetchone()
bal = 0
before_settlement, close = {}, {}
for ts, direction, kobo in db.execute(
        "SELECT posted_at, direction, amount_kobo FROM entries WHERE account_id = ? ORDER BY posted_at, id", (clr,)):
    day = ts[:10]
    if direction == "credit":              # the 10:00 settlement: note the balance immediately before it
        before_settlement[day] = bal
    bal += kobo if direction == "debit" else -kobo
    close[day] = bal

peak_day = max(before_settlement, key=before_settlement.get)
print(f"{len(close)} days with card activity; peak immediately before settlement: {naira(before_settlement[peak_day])} on {peak_day}")
print(f"mean closing balance {naira(sum(close.values()) // len(close))}; "
      f"mean balance immediately before settlement {naira(sum(before_settlement.values()) // len(before_settlement))}")

print("\nbalance immediately before the 10:00 settlement, 2026-05-18 to 2026-05-31 (one # = ₦50,000)")
for day in sorted(before_settlement):
    if "2026-05-18" <= day <= "2026-05-31":
        v = before_settlement[day]
        print(f"{day} {naira(v):>14} {'#' * (v // 5_000_000)}")

print("\nwho funds the float, at the peak moment")

AT = "2026-05-28T09:59:12+01:00"        # the peak moment from step 1
def debit_balance(where):
    return db.execute(f"""SELECT COALESCE(SUM(CASE e.direction WHEN 'debit' THEN e.amount_kobo ELSE -e.amount_kobo END), 0)
        FROM entries e JOIN accounts a ON a.id = e.account_id WHERE e.posted_at <= ? AND {where}""", (AT,)).fetchone()[0]

cash = debit_balance("a.code = 'settlement_bank'")
owed = debit_balance("a.code = 'card_clearing'")
wallets = -debit_balance("a.code LIKE 'wallet:%'")
capital = -debit_balance("a.code = 'share_capital'")
net_fees = -debit_balance("a.code IN ('fee_revenue', 'processing_expense')")

print(f"at {AT}")
print(f"  cash in the settlement account   {cash:>14,}  {naira(cash)}")
print(f"  owed by the processor            {owed:>14,}  {naira(owed)}")
print(f"  owed to customers (wallets)      {wallets:>14,}  {naira(wallets)}")
print(f"  Owoleaf's capital                {capital:>14,}  {naira(capital)}")
print(f"  fees earned less fees paid       {net_fees:>14,}  {naira(net_fees)}")
print(f"  cash + owed = wallets + capital + net fees: {cash + owed == wallets + capital + net_fees}")
own_in_cash = cash - wallets
print(f"  cash minus wallets (Owoleaf's own money in the account) {own_in_cash:,} = capital + net fees - owed: "
      f"{own_in_cash == capital + net_fees - owed}")
print(f"  the float is {owed / wallets:.2%} of wallet balances")

shortfall = wallets - (cash - capital)
print(f"  without the capital, cash would trail the wallets by {shortfall:,} kobo = {naira(shortfall)}; "
      f"that is owed - net fees: {shortfall == owed - net_fees}")
PY
177 days with card activity; peak immediately before settlement: ₦2,007,780.00 on 2026-05-28
mean closing balance ₦634,148.87; mean balance immediately before settlement ₦781,886.36

balance immediately before the 10:00 settlement, 2026-05-18 to 2026-05-31 (one # = ₦50,000)
2026-05-18  ₦1,403,468.00 ############################
2026-05-19    ₦863,156.00 #################
2026-05-20  ₦1,031,126.00 ####################
2026-05-21  ₦1,066,798.00 #####################
2026-05-22  ₦1,276,897.00 #########################
2026-05-23  ₦1,404,918.00 ############################
2026-05-24  ₦1,287,637.00 #########################
2026-05-25  ₦1,541,493.00 ##############################
2026-05-26  ₦1,384,393.00 ###########################
2026-05-27  ₦1,375,649.00 ###########################
2026-05-28  ₦2,007,780.00 ########################################
2026-05-29  ₦1,214,384.00 ########################
2026-05-30  ₦1,389,838.00 ###########################
2026-05-31  ₦1,537,178.00 ##############################

who funds the float, at the peak moment
at 2026-05-28T09:59:12+01:00
  cash in the settlement account   13,624,514,012  ₦136,245,140.12
  owed by the processor               200,778,000  ₦2,007,780.00
  owed to customers (wallets)       8,752,665,242  ₦87,526,652.42
  Owoleaf's capital                 5,000,000,000  ₦50,000,000.00
  fees earned less fees paid           72,626,770  ₦726,267.70
  cash + owed = wallets + capital + net fees: True
  cash minus wallets (Owoleaf's own money in the account) 4,871,848,770 = capital + net fees - owed: True
  the float is 2.29% of wallet balances
  without the capital, cash would trail the wallets by 128,151,230 kobo = ₦1,281,512.30; that is owed - net fees: True

The chart shows a receivable that never reaches zero by 09:59: each morning it holds the previous day’s captures plus the morning’s. The peak is Thursday 28 May. The identity holds to the kobo, and without the ₦50,000,000 of capital the cash would trail the wallets by ₦1,281,512.30.

2. Move settlement to business days. The script replays the same captures under two rules and sizes the weekend gap. The set HOLIDAYS is empty for now.

python3 - <<'PY'
import datetime as dt
import sqlite3

db = sqlite3.connect("data/finance.sqlite")
FEE_RATE_PER_MILLE = 10          # the lab's processor fee: 1%, as 10 per 1,000
HOLIDAYS = set()                 # ISO dates on which the processor does not settle

def naira(kobo):
    return f"₦{kobo // 100:,}.{kobo % 100:02d}"

clr, = db.execute("SELECT id FROM accounts WHERE code = 'card_clearing'").fetchone()
captures = db.execute("SELECT posted_at, amount_kobo FROM entries WHERE account_id = ? AND direction = 'debit' "
                      "ORDER BY posted_at", (clr,)).fetchall()
by_day = {}
for ts, kobo in captures:
    by_day[ts[:10]] = by_day.get(ts[:10], 0) + kobo

def next_business_day(day):
    d = day + dt.timedelta(days=1)
    while d.weekday() >= 5 or d.isoformat() in HOLIDAYS:    # 5 = Saturday, 6 = Sunday
        d += dt.timedelta(days=1)
    return d

def peak_before_settlement(settle_day_of):
    """Largest balance owed by the processor, over every capture and every 10:00 settlement."""
    events = [(ts, 1, kobo) for ts, kobo in captures]
    for day, gross in by_day.items():
        s = settle_day_of(dt.date.fromisoformat(day))
        if s.isoformat() < "2026-06-30":                       # the data stops on 29 June
            events.append((s.isoformat() + "T10:00:00+01:00", 0, -gross))
    bal = peak = 0
    peak_at = None
    for ts, _, kobo in sorted(events):
        bal += kobo
        if bal > peak:
            peak, peak_at = bal, ts
    return peak, peak_at

daily = lambda d: d + dt.timedelta(days=1)
for name, rule in (("every calendar day (the lab's processor)", daily), ("business days only", next_business_day)):
    peak, at = peak_before_settlement(rule)
    weekday = dt.date.fromisoformat(at[:10]).strftime("%A")
    print(f"{name}: peak owed {naira(peak)} at {at[:16]} ({weekday})")

print("\nCash that is not there on Monday morning if settlement skips the weekend")
gaps = []
for day, friday in sorted(by_day.items()):
    d = dt.date.fromisoformat(day)
    if d.weekday() == 4:                                       # a Friday
        saturday = by_day.get((d + dt.timedelta(days=1)).isoformat(), 0)
        # The lab pays Friday's captures on Saturday and Saturday's on Sunday, net of 1%.
        net = sum(g - g * FEE_RATE_PER_MILLE // 1000 for g in (friday, saturday))
        gaps.append((net, day))
gaps.sort(reverse=True)
print(f"{len(gaps)} weekends; the three largest, as the net of Friday's and Saturday's captures:")
for net, day in gaps[:3]:
    print(f"  weekend of {day}: {net} kobo = {naira(net)}")
PY
every calendar day (the lab's processor): peak owed ₦2,007,780.00 at 2026-05-28T09:59 (Thursday)
business days only: peak owed ₦4,345,480.00 at 2026-06-01T09:20 (Monday)

Cash that is not there on Monday morning if settlement skips the weekend
25 weekends; the three largest, as the net of Friday's and Saturday's captures:
  weekend of 2026-06-12: 280656288 kobo = ₦2,806,562.88
  weekend of 2026-06-19: 270774405 kobo = ₦2,707,744.05
  weekend of 2026-05-29: 252795213 kobo = ₦2,527,952.13

Skipping the weekend more than doubles the largest amount owed, from ₦2,007,780.00 to ₦4,345,480.00, and it lands on a Monday morning. The weekend gaps are the net of two settlements that would have paid on Saturday and Sunday. The largest is ₦2,806,562.88: the least a prefund for that weekend could be.

3. Date the statement. The script lists the lines booked at 23:00 or later, and compares each day’s closing balance by booking date with the same day by value date.

python3 - <<'PY'
import collections
import sqlite3

db = sqlite3.connect("data/finance.sqlite")

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

lines = db.execute("SELECT line, value_date, booked_at, direction, amount_kobo, narration FROM bank_statement ORDER BY line").fetchall()
late = [l for l in lines if int(l[2][11:13]) >= 23]
different = [l for l in lines if l[1] != l[2][:10]]
print(f"{len(lines)} statement lines; {len(late)} booked at 23:00 or later; {len(different)} with a value date other than the booking date")
print("late lines are the same lines as the different ones:", {l[0] for l in late} == {l[0] for l in different})
kinds = collections.Counter(l[5].rsplit(" C0", 1)[0] for l in late)
print("by narration:", dict(kinds))
overall = collections.Counter(l[5].rsplit(" C0", 1)[0] for l in lines)
print("all lines by narration:", dict(overall))
print("\nthe first three:")
for l in late[:3]:
    print(f"  line {l[0]}: booked {l[2][:16]}, value date {l[1]}, {l[3]} {l[4]}, {l[5]}")

# Closing balance of each day two ways: by booking date and by value date.
signed = lambda l: l[4] if l[3] == "CR" else -l[4]
by_booked, by_value = collections.defaultdict(int), collections.defaultdict(int)
for l in lines:
    by_booked[l[2][:10]] += signed(l)
    by_value[l[1]] += signed(l)
days = sorted(set(by_booked) | set(by_value))
run_b = run_v = 0
gap = {}
for d in days:
    run_b += by_booked.get(d, 0)
    run_v += by_value.get(d, 0)
    gap[d] = run_b - run_v          # money already moved on the booking day, not yet counted on that value date
worst = sorted(gap.items(), key=lambda x: -abs(x[1]))[:3]
print("\nclosing balance by booking date minus closing balance by value date, largest three days:")
for d, g in worst:
    print(f"  {d}: {g} kobo = {naira(g)}")
print(f"days where the two closing balances differ: {sum(1 for g in gap.values() if g)} of {len(gap)}")
PY
56008 statement lines; 3114 booked at 23:00 or later; 3114 with a value date other than the booking date
late lines are the same lines as the different ones: True
by narration: {'NIP INWARD': 1941, 'NIP OUTWARD': 1173}
all lines by narration: {'CAPITAL INJECTION': 1, 'NIP INWARD': 34837, 'NIP OUTWARD': 20896, 'CARD SETTLEMENT': 174, 'NIP RETURN': 98, 'NIP INWARD UNKNOWN': 2}

the first three:
  line 11: booked 2026-01-04T23:13, value date 2026-01-05, CR 1610100, NIP INWARD C0001798
  line 17: booked 2026-01-05T23:24, value date 2026-01-06, CR 1560000, NIP INWARD C0000164
  line 27: booked 2026-01-06T23:54, value date 2026-01-07, CR 38091900, NIP INWARD C0000599

closing balance by booking date minus closing balance by value date, largest three days:
  2026-05-23: -94674256 kobo = -₦946,742.56
  2026-03-29: 94315235 kobo = ₦943,152.35
  2026-05-28: -80838882 kobo = -₦808,388.82
days where the two closing balances differ: 170 of 180

The 3,114 late lines are exactly the lines whose value date differs from the booking date. A positive difference means more credits than payouts came in late, so the value-dated balance understates the cash. A negative one means the opposite: on 23 May the value-dated balance overstated it by ₦946,742.56. The statement’s 98 NIP RETURN lines are the returned payouts.

4. Read the switch’s net position. In one terminal start the mock switch, with fresh state. In the other, run the script: ten payouts (the eighth forced pending, the ninth forced to be returned), two inward credits and two reads of GET /settlement.

python3 mock_switch.py --fresh
python3 - <<'PY'
import json
import time
import urllib.error
import urllib.request

BASE = "http://127.0.0.1:8102"
HEAD = {"Authorization": "Bearer sw_test_owoleaf_mock", "Content-Type": "application/json"}

def call(method, path, body=None, force=None):
    headers = dict(HEAD, **({"X-Mock-Force": force} if force else {}))
    data = json.dumps(body).encode() if body is not None else None
    req = urllib.request.Request(BASE + path, data=data, headers=headers, method=method)
    try:
        with urllib.request.urlopen(req) as r:
            return json.load(r)
    except urllib.error.HTTPError as e:
        return json.load(e)

def position(label):
    s = call("GET", "/settlement")
    print(f"{label}: outward {s['outward_kobo']}, returned {s['returned_kobo']}, inward {s['inward_kobo']}, "
          f"pending {s['pending_kobo']}, net {s['net_kobo']}")
    return s

# Ten payouts of ₦2,500, ₦5,000 ... ₦25,000 to one pseudo bank. Number 8 will stay pending, number 9 will be returned.
sent = 0
forces = {8: "pending", 9: "reverse"}
for i in range(1, 11):
    amount = 250_000 * i
    ne = call("POST", "/name-enquiry", {"bank_code": "B03", "account_number": "3012345671"})
    r = call("POST", "/transfers", {"payment_reference": f"SETTLE-LAB-{i:02d}", "name_enquiry_ref": ne["name_enquiry_ref"],
                                    "sender_account": "9000000042", "amount_kobo": amount, "narration": f"seller payout {i}"},
             force=forces.get(i))
    sent += amount
    print(f"payout {i:>2}: {amount:>9} kobo -> response {r['response_code']}, status {r['status']}")
print("sent in total:", sent, "kobo")

# Two credits from other banks.
for amount in (5_000_000, 1_200_000):
    r = call("POST", "/admin/inward", {"account_number": "9000000042", "amount_kobo": amount, "sender_bank": "B11"})
    print(f"inward {amount}: response {r['response_code']}")

first = position("now         ")
time.sleep(32)                          # pending_seconds is 10 and reverse_seconds is 30
last = position("32 s later  ")
print("net = inward + returned - outward:", last["net_kobo"] == last["inward_kobo"] + last["returned_kobo"] - last["outward_kobo"])
by_status = {}
for t in call("GET", "/transfers")["transfers"]:
    by_status[t["status"]] = by_status.get(t["status"], 0) + 1
print("transfer report by status:", by_status)
PY
payout  1:    250000 kobo -> response 00, status successful
payout  2:    500000 kobo -> response 00, status successful
payout  3:    750000 kobo -> response 00, status successful
payout  4:   1000000 kobo -> response 00, status successful
payout  5:   1250000 kobo -> response 00, status successful
payout  6:   1500000 kobo -> response 00, status successful
payout  7:   1750000 kobo -> response 00, status successful
payout  8:   2000000 kobo -> response 09, status pending
payout  9:   2250000 kobo -> response 00, status successful
payout 10:   2500000 kobo -> response 00, status successful
sent in total: 13750000 kobo
inward 5000000: response 00
inward 1200000: response 00
now         : outward 11750000, returned 0, inward 6200000, pending 2000000, net -5550000
32 s later  : outward 13750000, returned 2250000, inward 6200000, pending 0, net -5300000
net = inward + returned - outward: True
transfer report by status: {'successful': 11, 'reversed': 1}

Payout 8 is 09, in progress: its ₦20,000 appears only in pending_kobo. After 32 seconds it has resolved to successful and joined the outward total, and payout 9 has flipped to reversed, so ₦22,500 shows as returned. The net moved from -5,550,000 to -5,300,000 kobo, which is inward 6,200,000 plus returned 2,250,000 minus outward 13,750,000. The report counts a returned payout in outward and again in returned. If you run the script a second time without --fresh, every payout answers 26, a duplicate.

5. Gate a payout run. This is the function from the chapter, run against the Why’s numbers: a dashboard of ₦48,200,000, ₦4,300,000 in transit and ₦2,000,000 booked after the cut-off.

python3 - <<'PY'
def naira(kobo):
    return f"₦{kobo // 100:,}"

def release(requests, available_kobo):
    """Pay in request order while the cash lasts; hold what does not fit for the next run."""
    paid, held = [], []
    for seller, amount in requests:
        if amount <= available_kobo:
            available_kobo -= amount
            paid.append((seller, amount))
        else:
            held.append((seller, amount))
    return paid, held, available_kobo

requests = [("seller A", 1_200_000_000), ("seller B", 950_000_000), ("seller C", 800_000_000),
            ("seller D", 650_000_000), ("seller E", 480_000_000), ("seller F", 320_000_000)]
ledger = 4_820_000_000                      # the dashboard: ₦48,200,000
in_transit = 430_000_000                    # ₦4,300,000 captured, not yet paid by the processor
late_value_dated = 200_000_000              # ₦2,000,000 booked after the bank's cut-off, value date tomorrow
available = ledger - in_transit - late_value_dated

for label, cash in (("against the ledger balance", ledger), ("against available cash", available)):
    paid, held, left = release(requests, cash)
    total = sum(a for _, a in paid)
    print(f"{label} ({naira(cash)}): paid {naira(total)} to {len(paid)} sellers, held {len(held)}, cash left {naira(left)}")
print("requested", naira(sum(a for _, a in requests)), "- available", naira(available),
      "= short by", naira(sum(a for _, a in requests) - available))
PY
against the ledger balance (₦48,200,000): paid ₦44,000,000 to 6 sellers, held 0, cash left ₦4,200,000
against available cash (₦41,900,000): paid ₦40,800,000 to 5 sellers, held 1, cash left ₦1,100,000
requested ₦44,000,000 - available ₦41,900,000 = short by ₦2,100,000

Against the dashboard the run pays all six sellers and the account is ₦2,100,000 short. Against the available balance it pays five and holds the sixth for the next run.

Add an invented public holiday on a Friday. In step 2, change HOLIDAYS = set() to HOLIDAYS = {"2026-05-29"} and run it again. The second line becomes business days only: peak owed ₦5,297,741.00 at 2026-06-01T09:20 (Monday): one more non-settling day, and Monday’s payment carries four days of captures. The prefund you sized from ordinary weekends is now too small. A calendar of non-settling days belongs in the payout job’s configuration, not in a person’s head. Then change step 5’s late_value_dated to 0: the job reports ₦3,100,000 of cash left instead of ₦1,100,000, ₦2,000,000 more than the bank counts, so a further request of ₦2,500,000 would be released and fail at the bank.

ARTEFACT Write the payout schedule and float note ~45 MIN
YOU PRODUCEPayout schedule and float note

Template

# Payout schedule and float note: <company>, <period>
Author · <treasury lead> · Date · Signed by <CFO or founder> · Review date <date>

## Decision needed
<Approve a prefund of ₦<amount> before <dates>, funded from <account>.>

## When people are paid
| Who | Paid | Out of which balance | Days with no payout |
|---|---|---|---|

## When we are settled
| Source | Settles | Days it does not | Calendar of holidays kept in |
|---|---|---|---|

## The float on the worst day
Worst day in the data: <date>, <amount owed by the processor> (<lab line>)
Gap to prefund: <amount> for <stretch of days>, plus <amount> for each extra day

## If settlement is late
<What the payout job reads, who is told, which payouts are held, who releases the run.>

## Buffer and who funds it
Buffer: <percent or amount>, because <reason> (an assumption, not a measurement)
Funded from <own money, not customers' wallets>; repaid when <event>.

## How this could be wrong
<One way, and the number or event that would show it.>

## Not covered
<Returns, refunds, fees, other rails.>
WORKED EXAMPLE

Remilekun, Ojaline’s treasury lead, writes this note for the CFO to sign. Ojaline’s seller wallets are paid out by NIP every night, Saturday and Sunday included, from the bank’s available balance. The processor pays card money on business days only, so Monday 10:00 carries Friday, Saturday and Sunday.

On the lab’s history the largest amount the processor owed was ₦4,345,480.00, immediately before the Monday 1 June settlement, against ₦2,007,780.00 under daily settlement. The cash that does not arrive over a weekend is the net of two settlements, and the largest of 25 weekends was ₦2,806,562.88, the weekend of 12 June. Remilekun reran step 2 with a Friday holiday on 29 May, as the break does: the peak rises to ₦5,297,741.00, because Monday’s payment now carries four days of captures.

Step 2 does not print the cash gap for that longer stretch, so she assumes the extra day is half the largest weekend, ₦1,403,281.44. Her buffer is 20%, also an assumption, a margin above the worst of 25 weekends. She asks for ₦3,367,875.46 before an ordinary weekend (₦2,806,562.88 plus 20%) and ₦5,051,813.18 before a Friday holiday (₦4,209,844.32 plus 20%), moved from Ojaline’s own funds to the payout account on Thursday. It is Ojaline’s money, repaid when Monday’s settlement lands, and sellers’ wallets never fund it.

If Monday’s settlement is late, Yusuf’s job still reads only the available balance, holds what does not fit, and tells treasury, and Remilekun releases a held run by name.

The note could be wrong if a holiday day carries more card volume than the lab’s history, and a single day above the assumed ₦1,403,281.44 would show it. It is reviewed on the first business day after the holiday. Returns are out of scope.

Now you

You are treasury at Owoleaf, the wallet company, with the lab’s statement and ledger as its history. Owoleaf pays customers’ NIP cash-outs the moment they are requested, every day. Its card processor now pays on business days only. Suppose Monday 15 June is an invented public holiday, so there is no settlement from Friday to Monday.

Run step 2 with HOLIDAYS = {"2026-06-15"} for the peak owed. Its weekend table does not change, so size the extra day as an assumption and say how you chose it. Use step 1’s split of cash, wallets and capital to say who funds the gap, and choose a buffer with a reason. At a real company the treasury lead or finance manager writes this note and the CFO signs it; here the founder signs. It supports one decision: how much of Owoleaf’s own money to move into the settlement account before that stretch, and when.

Self-check

DECIDE

Ojaline's processor pays card money on business days only. Sellers expect a payout every night, including Saturday and Sunday, from the seller wallet. Remilekun finds that the largest weekend gap in the last six months was ₦2.8m, and Yusuf's job currently releases against the dashboard balance. A public holiday is two weeks away. What does she do first?

READING
  1. DOC
    Principles for financial market infrastructures (CPMI and IOSCO, 2012) CPMI and IOSCO, 2012

    The international standard for the systems that settle payments. Read Principle 8 on settlement finality and Principle 9 on money settlements to see the two questions: when is it final, and in whose money. It governs infrastructures, not wallet companies, and the full report is long; skip the principles on governance and default. Read: Principles 8 and 9.

  2. DOC
    Developments in retail fast payments and implications for RTGS systems CPMI, 2021

    A CPMI survey of retail fast payment systems and what they mean for central banks' gross settlement systems. Read it for the policy view of instant payments and RTGS. It is about systems and central banks, not merchants, and this chapter has not checked what it says about Nigeria.

  3. DOC
    How does settlement happen on the service? (NIBSS support article) NIBSS

    NIBSS's own plain description of NIP as deferred net settlement, with its cut-over times. Read it for the difference between funds being available to the beneficiary and the banks being settled. It is a support page, short and undated, so check whether the times have changed.

  4. DOC
    Large Value Payments (Inter-Bank Fund Transfer System) Central Bank of Nigeria

    The CBN's description of its RTGS and of how NIBSS sends net positions into it. Read it to see where net settlement happens. The page describes the system as set up and can be out of date; this chapter's reading of it rests on search summaries.

  5. BOOK
    Payments Systems in the U.S.: A Guide for the Payments Professional Benson, Loftesness and Jones, 2017

    A guide to how US payment systems work across initiation, funding and settlement. Read it for the vocabulary of settlement. The examples are American, so use it for structure and not for Nigerian rules. The link is the publisher's product page, and this chapter has not checked its contents. Read: Chapters on settlement.

  6. DOC
    Payouts (Stripe documentation, a vendor's description) Stripe

    One platform's account of payout schedules, business days and delays, as a worked example of the design choices in this chapter. It is a vendor's product documentation, so treat it as a claim about that product. Read the schedule and timing sections, and skip the setup steps.

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: Wallets and stored value: design and regulation →