PRINCIPALCHAPTER 42

What not to build

A product can bring most of the fees and carry all of the risk. Price each one after its risk and its licence, put three questions to anything you might start, and write the memo so that every figure traces to code

80 MINPAYMENTSUPDATED 2026-11-14
PREDICT

In Owoleaf's books, card top-ups bring 74.5% of fee revenue, and the rest comes from NIP payouts. Every one of the 109 chargebacks is on a card top-up. Charge the card product the processor's fees and its chargebacks. How much of its own fee revenue is left?

Every earlier module taught you to build something. This chapter asks when not to. It uses what the course gave you: the ledger (double entry), the three-way match (reconciliation), the cost of a dispute (disputes and chargebacks), the price of a card (interchange and pricing) and the licence floor (licences in Nigeria). It adds three public failures and a method for the memo.

Revenue is not what a product is worth

A product’s revenue is what customers pay for it. Its contribution is what is left after the costs that belong to it. Those are the direct cost (what a provider charges you for it), the risk cost (what goes wrong on it and who pays: chargebacks, fraud, returned payments) and the cost of the permission it needs (the licence, and the capital under it). Overheads such as salaries sit outside contribution. They decide whether the contributions add up to enough.

Three mistakes make a bad product look good or a good one look bad.

  • Reading revenue as profit. The product with the largest fee line can have the smallest margin.
  • Reading silence as zero. A cost that is not in your data is not a cost of nothing. It is a cost you have not found.
  • Reading a product’s own line as its whole effect. A product that loses money may bring the customers who pay for another. A product that earns may be one that no customer would miss.

The method is the same each time. List every product. Give each a line for revenue, direct cost, risk and permission. Mark every cost as booked, assumed or missing. Only then argue.

Revenue and cost by product

Owoleaf sells four things, and the ledger already knows which: every transaction has a kind. Nigeria’s rails and wallets and stored value named them. A top-up by bank transfer, a top-up by card, a transfer between wallets and a payout to another bank. Two more kinds are plumbing: the processor’s settlement, which pays Owoleaf and takes its fee, and a returned payout, which gives a fee back.

The fee postings carry the transaction they came from. One join, entries to transactions to accounts, gives revenue and cost by product. Step 1 runs it, then checks that the slices add back to the fee_revenue and processing_expense accounts in the trial balance. A join that quietly drops a row gives a plausible table that is wrong.

The processor’s fee is attached to the card top-up. The settlement transaction has no customer, but the fee is a charge on card money and nothing else causes it. That is a judgement about attribution: giving a shared cost to the product that causes it. Write every such judgement down. In the lab it is one line in a map.

Product Posted Fee revenue Share of fees Cost in the ledger
Card top-up 10,280 ₦1,652,473.21 74.5% ₦1,105,902.67
Bank-transfer funding 34,837 ₦0.00 0.0% ₦0.00
Wallet to wallet 13,540 ₦0.00 0.0% ₦0.00
NIP payout 20,897 ₦565,350.00 25.5% ₦0.00

(Posted counts transactions that succeeded or were later reversed. Payout revenue is net of the fees given back with returned payouts.)

Two products earn and two do not. Bank-transfer funding is the biggest by value, ₦810,363,604.00, and brings no fee in the lab’s price list. Card top-ups bring three quarters of the fees and carry the only cost in the ledger, so their margin on this table is ₦546,570.54: the customer pays 1.5%, capped, and the processor takes 1%. The prices are the generator’s. What carries over to a real company is the method, not the shares.

Risk arrives late and sits elsewhere

The lab’s ledger does not post chargebacks. They live in the disputes table that cards.py adds, with a reason, an amount, a ₦1,000 fee (the generator’s) and an outcome. Disputes and chargebacks shows how to post them. For a product decision you need only what they cost, and that takes three assumptions, each stated. The fee is paid win or lose. Owoleaf bears the amount when it loses or accepts a dispute, because the customer’s wallet was already credited. A won dispute costs its fee and nothing more. Interchange and pricing made the same assumptions and reached ₦17,070.71. Step 2 reaches it again by another road, which is a check.

One more cost is not yet booked. Card money captured on the last day is still in card_clearing, and the processor will take its fee when it settles. A cost that is incurred and not yet booked is the commonest error in a product table. Here the ledger is ₦16,540.83 short. The lab computes it from card_clearing and then asks the processor, whose settlement report is a record Owoleaf does not write.

Card top-up Amount
Fee revenue ₦1,652,473.21
Processing fee booked −₦1,105,902.67
Processing fee not yet booked −₦16,540.83
Chargeback fees, 109 disputes −₦109,000.00
Disputes lost or accepted, 48 −₦403,959.00
Net after risk ₦17,070.71

The working: 1,652,473.21 − 1,105,902.67 = 546,570.54; less 16,540.83 is 530,029.71; less 109,000.00 is 421,029.71; less 403,959.00 is 17,070.71. The product that brings 74.5% of the fees keeps 1.0% of its own revenue, and it holds every chargeback in the data. No other product in this lab can have one. That is the sentence a board remembers.

Now slice the same product by the customer’s KYC tier (the generator’s illustrative tiers).

Tier Card top-ups Fees Processing Disputes Dispute cost Net
1 5,849 ₦433,439.05 ₦288,959.60 76 ₦223,098.00 −₦78,618.55
2 3,496 ₦807,378.31 ₦546,807.64 26 ₦176,753.00 ₦83,817.67
3 935 ₦411,655.85 ₦286,676.26 7 ₦113,108.00 ₦11,871.59

Tier 1 has 56.9% of the card top-ups (5,849 of 10,280) and 69.7% of the disputes (76 of 109), and it loses ₦78,618.55. Tiers 2 and 3 earn ₦95,689.26 between them, and the three add to ₦17,070.71. A stolen-card ring works through new tier 1 wallets in April in this data, as the disputes chapter showed, and one month of fraud is not the character of a tier. Seven disputes decide tier 3. A table this small can reverse. But it shows the choice a board really has: not “keep or stop the card” but “keep it, stop it, or restrict it to the customers it earns on”. Nneoma’s version of this table is the one that changes Ferrowave’s conversation.

Silence is not zero

The NIP payout books ₦565,350.00 and no cost. That looks like the best product in the table, and the ledger cannot support it. The generator does not post what a partner bank charges for the NIP connection, so the line is empty because the data is silent. Build or partner priced that connection per payout, and Ferrowave’s partner banks charge per payout too. For Ferrowave’s core product the missing line is the main line.

The lab does not invent a cost. It asks the reverse question: at what cost per payout does this product stop earning? The answer is the average fee. Owoleaf sent 20,897 payouts and kept ₦565,350.00 after returns. In kobo, 56,535,000 divided by 20,897 is 2,705, rounded down: ₦27.05. Any charge above that turns the product negative, and the average hides a spread, because the generator’s fees are ₦10, ₦25 and ₦50 by amount band (illustrative). A payout at the ₦10 band loses money at a ₦15 cost. The break step sets an assumed cost and shows the table flip.

A real company asks its finance team and reads its contract. Take no figure from this chapter. A missing cost is the most important line in the table, and the memo says so.

The licence is a cost with no line in the ledger

Licences in Nigeria mapped Owoleaf’s activities. Holding wallets, bank-transfer funding, wallet-to-wallet transfers and payouts point to the mobile money operator licence. On that chapter’s reading, card top-ups taken through a provider need no licence of their own. As search results quote the CBN’s consolidated 2021 requirements, and law-firm summaries agree, a mobile money operator needs ₦2,000,000,000 of shareholders’ funds unimpaired by losses. The summaries also describe a refundable ₦2,000,000,000 escrow deposit at the CBN, which this chapter does not model. The search snippet of the CBN document itself showed only the eligibility text, so check every figure in the PDFas of 2026-11. A law-firm summary (Mondaq, commentary and not the rule) lists a non-refundable application fee of ₦100,000 and a licensing fee of ₦1,000,000, payable before the final licence is issued. Step 3 uses the ₦1,000,000 licensing fee onlyas of 2026-11..

Owoleaf’s shareholders’ funds are ₦51,111,920.54, so it is ₦1,948,888,079.46 short, as that chapter found. The floor is not a fee. It is capital that shareholders must hold in the business, and someone expects a return on it. The lab assumes no rate. It asks the reverse: what do the products earn on the floor? It scales the 180 days to a year by 365 over 180, so ₦582,420.71 becomes ₦1,181,019.77. Against the floor that is 0.0591%. The wallet products alone earn ₦565,350.00 in 180 days, which scales to 0.0573%.

Read those figures carefully. They are contribution before salaries, rent and everything else, so the real return is lower. They are at scale 0.1, with 2,000 customers, and the floor does not shrink with the customer count. A licence is a fixed cost, and volume pays for fixed costs. The figures do not say that wallets never pay. They say that this book does not carry this floor, and the memo should state the volume at which it would. Which product carries the licence also matters. The card top-up needs none of its own, so stopping it would not lower the floor. Only stopping the wallet would, and the wallet is the business.

A product is more than its own line

A product that loses money may be the reason customers stay. A product that earns may be one nobody would miss. The ledger can bound this, and cannot settle it.

Step 2 counts how many customers used card top-ups and what the payout fees they pay come to. Of Owoleaf’s 1,557 card users, 59 never funded by bank transfer. Card users pay ₦356,420.00 of the ₦565,350.00 payout fees, which is 63.0%. The 59 with no other route pay ₦1,150.00, or 0.2%. Neither number is the effect of stopping. The first counts people who used a product at least once, and heavy users use everything. The second counts only those with no other route and ignores that they could be given one. The books record who used a product, not who would leave without it.

The honest test is an experiment: switch the product off for a small random group of new customers and compare. Until someone runs it, the memo says which of the two numbers it uses and why. That is also why “restrict” is a real option: limiting the card to tiers 2 and 3 can be reversed, and it tests the dependence.

Three failures, read for what they teach

Three public failures each fail a different question. They are cases, not verdicts. Every figure below comes from the source named, or from search summaries and press where it says so.

Wirecard: can anyone you do not control confirm it? Wirecard’s own release of 28 April 2020, as search summaries describe it, said KPMG had delivered its report on the special investigation, that incriminating evidence for the public allegations of balance sheet forgery had not been identified, and that the documents were sufficient to prove third-party acquiring revenues for 2016 to 2018. Search summaries of the KPMG report itself, dated 27 April 2020 and hosted on wirecard.com (its full text was not read here), say that KPMG was unable to fully comprehend Wirecard’s gross accounting of third-party acquiring revenue, and that it could not independently confirm the existence of about €1 billion of cash said to sit in trustee accounts. The company’s release and the report stress different findingsas of 2026-11. Press reports (Reuters-based coverage carried by outlets such as FinTech Futures) say that on 18 June 2020 Wirecard said its auditors could not confirm €1.9 billion said to be held in trustee accounts, that it later said the money probably did not exist, and that it applied for insolvency proceedings in Munich on 25 June 2020. Reports differ on which banks held the money, so this chapter takes only the amount and the datesas of 2026-11. For a product table the lesson is about evidence. Revenue that a few partners report, and cash that a trustee is said to hold, are claims until a party you can check confirms them. In the lab, card_clearing is that kind of number. The ₦1,654,083.00 in it is Owoleaf’s claim on the processor, and step 2 confirms it from the processor’s own settlement report.

Synapse: do you owe what the banks hold? The CFPB’s complaint against Synapse Financial Technologies, as search summaries of it describe it, says that as early as September 2023 Synapse’s records did not match the records kept by its partner banks. It says the banks determined that the funds they held for consumers were between $60 million and $90 million less than Synapse’s records reflected, and that consumers had no access to funds for weeks or months while the banks reconciled. The CFPB filed on 21 August 2025 in Synapse’s bankruptcy case together with a proposed stipulated final judgment with a $1 civil money penalty; the search results did not show whether the court entered it. The complaint’s own text was not read hereas of 2026-11. Press reports (PYMNTS and others), not the chapter 11 trustee’s filings, put the shortfall at about $85 million in the trustee’s first report in June 2024 and at $65 million to $96 million in a later report; one October 2024 report quotes the upper bound as $95 million. The figure moved between reports, and it was an estimateas of 2026-11. Two records of the same money, kept by two parties and not compared every day, can drift for months. Reconciliation is the control, and payments incidents says what to do when it fails: treat a difference as an incident.

Libra: can you get the permission at the size you need? A Congressional Research Service Insight of 21 October 2019 (a copy is hosted by the Federation of American Scientists) says Facebook announced in June 2019 that it and 28 other members had formed the Libra Association to launch a cryptocurrency called Libra, and notes that some original partners later withdrew. Press reports later call the project Diemas of 2026-11. CPMI Papers No 187, ‘Investigating the impact of global stablecoins’, was published on 18 October 2019 from the G7 working group on stablecoins chaired by the CPMI’s chair. Search summaries say it sets out recommendations for private developers and public authorities, and that no global stablecoin project should begin operation until the legal, regulatory and oversight challenges and risks are adequately addressed. The exact wording was not confirmed against the BIS PDFas of 2026-11. That report is the authorities’ view and did not stop the project by itself. Press reports (Banking Dive and others) say the Diem Association announced on 31 January 2022 that it was selling its assets to Silvergate and winding down, with its chief executive saying that the project had had positive feedback on its design but that federal regulators had made clear it could not proceed. Some commentators doubt that framing. The reports differ on the deal’s value, which this chapter does not useas of 2026-11. The problem Libra named, slow and costly cross-border payments, did not go away. CPMI’s July 2020 report to the G20 (paper 193) sets out 19 building blocks in five focus areas, four of which seek to improve the existing payments ecosystem and one of which is more exploratory, covering new payment infrastructures and arrangements, as search summaries of the BIS page describe itas of 2026-11. Cross-border payments and stablecoins for cross-border payments covered the problem and the answers. The lesson here is only that a product can need an approval that is not yours to give.

Each case becomes a question you can put to any product, and to Owoleaf’s own books.

Question Asked by In Owoleaf’s lab
Proof. Is any revenue or cash confirmed only by a party you cannot check? Wirecard card_clearing, ₦1,654,083.00, a claim on the processor, confirmed by its settlement report
Reconcile. Do you owe what the banks hold, by their records, today? Synapse The statement shows ₦171,927,413.24 against ₦122,438,628.35 owed, 140.4%; ledger and statement differ by ₦30,947.35, which check.py explains
Permission. Does the product need an approval you cannot get at the size it needs? Libra The wallet needs a floor Owoleaf is ₦1,948,888,079.46 short of

What never to start

A never is not a ban. It is a product you do not start until you can answer the three questions with records, not with intentions. Four kinds of product fail them most often. None of them names a company.

  1. Holding customer money you cannot reconcile to a bank every day. It fails the reconcile question. The records of two parties drift, and the customers find out first.
  2. Lending from a wallet balance. A pay-later feature on a wallet licence fails the permission question. A legal-research platform’s summary (commentary) of the CBN’s Framework and Guidelines for Mobile Money Services, released on 9 July 2021, and press reports say the framework’s list of non-permissible activities bars a mobile money operator from granting loans, advances or guarantees, directly or indirectly. Sources differ on the section numbering, and the framework’s own text was not read hereas of 2026-11. Lending has rules and a book of its own: the Lending course starts from them.
  3. A balance in a token you issue. It fails permission, as Libra did, and proof, because the reserve behind it is a claim someone has to confirm.
  4. Revenue booked from a partner you cannot audit. It fails proof. If most of a line comes from a few partners, ask what you could check without them.

Add one test to all four: could you explain the product’s money to an examiner using only records you did not write? If the answer needs a counterparty’s goodwill, the product is not finished.

Where this analysis goes wrong

  • Silence read as zero. The NIP line above. Mark every cost as booked, assumed or missing.
  • Booked read as incurred. The ₦16,540.83 not yet booked is small here. A week of unsettled captures at a month end is not.
  • An observation window. The disputes are seen to 28 October 2026. None is open, but fraud chargebacks arrive late (a median of 44 days after the sale in the disputes chapter), so a table cut earlier is kinder to the card than this one.
  • Small counts. Seven tier-3 disputes. Say how many rows stand behind each figure.
  • Prices that are not real. The fees, the 1% and the ₦1,000 are the generator’s. A finding that the card margin is thin is about this price list, not about Nigerian cards.
  • A memo that cannot be checked. Step 5 makes every figure trace to an output.

What the course was for

Every question in this chapter was taught earlier. Every claim about money needs a record that someone else can check, and a product is ready when you can produce it.

The question Where the course taught it
Is every amount an integer, and does every entry balance? Money in software, double entry for engineers, the wallet ledger project
Does a retry pay once? Idempotency
Do the ledger, the provider and the bank agree? Reconciliation, the reconciliation engine project
What does a card earn, and what does a dispute cost? Interchange and pricing, disputes and chargebacks
Which licence does the activity need? Licences in Nigeria
Do you build it or partner? Where does a payment go? Build or partner, routing across providers
Who set the limits when software pays? Agentic payments

The other module 5 chapters give the frame around it: a history of payments, instant payment systems compared, CBDCs and what the eNaira showed, ledger design research and who is liable when an AI moves money. The Lending course takes the next product, credit, with the same ledger under it.

What not to build is the product you cannot price after its risk, cannot prove from records you did not write, or cannot get permission for at the size it needs. The rest is arithmetic you can run, and a memo whose every figure you can trace.

LAB Price Owoleaf's products after risk and licence, then write the memo ~75 MIN
YOU NEEDPython 3.9 or later (standard library only)labs/finance with the data generated (python3 generate.py, then python3 cards.py; scale 0.1, seed 42)curl, and one terminal for the mock provider in step 2No Docker, no packages, no model, no paid account

You work in labs/finance and create a memo/ folder there. Every script opens data/finance.sqlite read-only, uses only the standard library and keeps money in integer kobo. No sqlite3 program is needed: the queries run through Python’s sqlite3 module. Every command below was run, and the outputs are what they printed. The fees, the 1% processing charge, the ₦1,000 dispute fee, the KYC tiers and the bank codes in the data are invented by the generator. The licence floor and fee in licence.py are the figures this chapter quotes from search results about CBN documents: check them against the CBN’s PDF and change them if the text differs. The memo is yours, so nothing here writes it.

1. Read the books by product. books.py opens the database read-only and holds the map from a transaction kind to a product, which is where your attribution judgements live. products.py runs the join. Generate the data first if data/ does not hold the card tables.

cd labs/finance
python3 generate.py && python3 cards.py     # skip if data/ already has both
python3 check.py
mkdir -p memo/out

check.py proves the books are sound before you analyse them. The lab’s own tables print before it. If you also ran loans.py, there is one more line, about the loan book.

card book: 10,680 card attempts, 109 disputes for 91,728,900 kobo; checks 12-15 run
accounts by type (debit-positive kobo): {'asset': 17355054889, 'equity': -5000000000, 'expense': 110590267, 'income': -221782321, 'liability': -12243862835}
settlement_bank in ledger 17,189,646,589 kobo; on the statement 17,192,741,324 kobo
OK: all invariants hold
cat > memo/books.py <<'EOF'
"""Shared by the memo lab: read-only access to Owoleaf's books, kobo shown as naira, and the
map from a transaction kind to the product a customer would call it."""
import sqlite3

def books(path="data/finance.sqlite"):
    return sqlite3.connect(f"file:{path}?mode=ro", uri=True)      # read-only: the memo lab never writes

def naira(kobo):
    sign = "-" if kobo < 0 else ""
    kobo = abs(kobo)
    return f"{sign}₦{kobo // 100:,}.{kobo % 100:02d}"            # display only; every sum stays in integer kobo

# The kinds a customer starts. The other kinds are plumbing: card_settlement is the processor paying
# Owoleaf and taking its fee, payout_reversal is a bank returning a payout, capital_injection is the owners.
PRODUCT = {
    "funding_card":     "card top-up",
    "card_settlement":  "card top-up",           # the processor's fee is a cost of the card product
    "funding_transfer": "bank-transfer funding",
    "p2p_transfer":     "wallet to wallet",
    "payout_nip":       "NIP payout",
    "payout_reversal":  "NIP payout",            # a returned payout gives its fee back
}
CUSTOMER_KINDS = ("funding_card", "funding_transfer", "p2p_transfer", "payout_nip")
EOF
cat > memo/products.py <<'EOF'
"""Step 1: revenue and cost by product, from the entries joined to the transaction kinds.
Run from labs/finance:  python3 memo/products.py"""
from books import books, naira, PRODUCT, CUSTOMER_KINDS

# The ledger books no cost for the NIP connection (the partner bank's charge per transfer is not in the
# generated data). Leave this at 0 to see the books as they are. Any other value is YOUR assumption, in
# kobo per payout sent, and it flows into every later step.
NIP_COST_KOBO = 0

SQL = """
SELECT t.kind, a.code,
       SUM(CASE e.direction WHEN 'credit' THEN e.amount_kobo ELSE -e.amount_kobo END)
FROM entries e
JOIN transactions t ON t.id = e.transaction_id
JOIN accounts a     ON a.id = e.account_id
WHERE a.code IN ('fee_revenue', 'processing_expense')
GROUP BY t.kind, a.code
"""

def by_product(db):
    """product -> revenue, cost (positive: booked plus any you assume), posted attempts and value, in kobo."""
    out = {p: {"revenue": 0, "cost": 0, "assumed": 0, "posted": 0, "value": 0} for p in dict.fromkeys(PRODUCT.values())}
    for kind, account, signed in db.execute(SQL):
        if account == "fee_revenue":
            out[PRODUCT[kind]]["revenue"] += signed        # income: a credit balance is positive
        else:
            out[PRODUCT[kind]]["cost"] -= signed           # expense: debits come back negative, so flip
    marks = ",".join("?" * len(CUSTOMER_KINDS))
    for kind, n, value in db.execute(
            f"""SELECT kind, COUNT(*), SUM(amount_kobo) FROM transactions
                WHERE status IN ('succeeded', 'reversed') AND kind IN ({marks}) GROUP BY kind""", CUSTOMER_KINDS):
        out[PRODUCT[kind]]["posted"] += n
        out[PRODUCT[kind]]["value"] += value
    out["NIP payout"]["assumed"] = NIP_COST_KOBO * out["NIP payout"]["posted"]
    out["NIP payout"]["cost"] += out["NIP payout"]["assumed"]
    return out

if __name__ == "__main__":
    db = books()
    table = by_product(db)
    revenue = sum(p["revenue"] for p in table.values())
    print(f"{'product':22} {'posted':>7} {'value':>20} {'revenue':>15} {'cost':>15} {'margin':>15} {'of fees':>8}")
    for name, p in table.items():
        print(f"{name:22} {p['posted']:>7,} {naira(p['value']):>20} {naira(p['revenue']):>15} "
              f"{naira(p['cost']):>15} {naira(p['revenue'] - p['cost']):>15} {p['revenue'] / revenue:>8.1%}")
    cost = sum(p["cost"] for p in table.values())
    print(f"{'all products':22} {'':>7} {'':>20} {naira(revenue):>15} {naira(cost):>15} {naira(revenue - cost):>15}")
    # The slices must add up to the two accounts in the trial balance, or the join lost something.
    booked = cost - sum(p["assumed"] for p in table.values())           # an assumed cost is not in the ledger
    for code, total, sign in (("fee_revenue", revenue, -1), ("processing_expense", booked, 1)):
        ledger = sign * db.execute(
            """SELECT SUM(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 WHERE a.code = ?""", (code,)).fetchone()[0]
        print(f"ties to {code}: {naira(ledger)}  {'OK' if ledger == total else 'MISMATCH'}")
EOF
python3 memo/products.py | tee memo/out/1-products.txt

The table has one row per product. Card top-ups bring 74.5% of the fees and carry the only cost in the ledger. Bank-transfer funding and wallet-to-wallet bring nothing in the lab’s price list. The last two lines prove the slices add back to the ledger’s two accounts.

product                 posted                value         revenue            cost          margin  of fees
card top-up             10,280      ₦112,244,350.00   ₦1,652,473.21   ₦1,105,902.67     ₦546,570.54    74.5%
bank-transfer funding   34,837      ₦810,363,604.00           ₦0.00           ₦0.00           ₦0.00     0.0%
wallet to wallet        13,540       ₦84,359,324.96           ₦0.00           ₦0.00           ₦0.00     0.0%
NIP payout              20,897      ₦800,604,753.06     ₦565,350.00           ₦0.00     ₦565,350.00    25.5%
all products                                          ₦2,217,823.21   ₦1,105,902.67   ₦1,111,920.54
ties to fee_revenue: ₦2,217,823.21  OK
ties to processing_expense: ₦1,105,902.67  OK

2. Put the risk in. risk.py reads the disputes table. It prints the card top-up from fee to net, the same product by KYC tier, the NIP payout’s break-even cost, and who would notice if the card stopped. Then you ask the processor for the fee the ledger has not booked.

cat > memo/risk.py <<'EOF'
"""Step 2: put the risk in. Chargebacks come from the disputes table (cards.py), not from the ledger,
which does not post them. Run from labs/finance:  python3 memo/risk.py"""
from books import books, naira
from products import by_product

PROCESSOR_FEE_PERCENT = 1      # the generator's PROCESSOR_FEE_RATE (1%); the curl in step 2 asks the processor for it

def unbooked_fee(db):
    """The processor's fee on card money captured but not yet settled. It is still in card_clearing,
    so the ledger has not booked the fee that will be taken from it."""
    clearing = db.execute(
        """SELECT SUM(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 WHERE a.code = 'card_clearing'""").fetchone()[0]
    return clearing * PROCESSOR_FEE_PERCENT // 100

def disputes(db, tier=None):
    """Count, fees, and the amount of disputes the merchant lost or accepted (it bears those)."""
    return db.execute(
        """SELECT COUNT(*), COALESCE(SUM(d.fee_kobo), 0),
                  COALESCE(SUM(CASE WHEN d.status IN ('lost', 'accepted') THEN d.amount_kobo END), 0),
                  SUM(d.status IN ('lost', 'accepted')), SUM(d.status = 'open')
           FROM disputes d
           JOIN transactions t ON t.id = d.transaction_id
           JOIN customers c    ON c.id = t.customer_id
           WHERE t.kind = 'funding_card' AND (? IS NULL OR c.kyc_tier = ?)""", (tier, tier)).fetchone()

def card_net(db):
    card = by_product(db)["card top-up"]
    n, fees, lost, n_lost, n_open = disputes(db)
    return card["revenue"] - card["cost"] - unbooked_fee(db) - fees - lost

if __name__ == "__main__":
    db = books()
    table = by_product(db)
    card, nip = table["card top-up"], table["NIP payout"]
    n, fees, lost, n_lost, n_open = disputes(db)
    gross_unsettled = unbooked_fee(db)
    net = card["revenue"] - card["cost"] - gross_unsettled - fees - lost
    print("1. The card top-up, from fee to net")
    for label, kobo in (("fee revenue", card["revenue"]), ("processing fee booked", -card["cost"]),
                        ("processing fee not yet booked", -gross_unsettled),
                        (f"chargeback fees ({n} disputes)", -fees),
                        (f"disputes lost or accepted ({n_lost})", -lost), ("net after risk", net)):
        print(f"   {label:34} {naira(kobo):>16}")
    print(f"   disputes still open at the cut-off: {n_open}")
    print(f"   net as a share of the fee revenue: {net / card['revenue']:.1%}")

    print("\n2. The same product by KYC tier of the customer")
    print(f"   {'tier':4} {'fundings':>8} {'revenue':>14} {'processing':>14} {'disputes':>9} {'dispute cost':>14} {'net':>14}")
    total = 0
    for tier in (1, 2, 3):
        count, revenue, gross = db.execute(
            """SELECT COUNT(*), SUM(t.fee_kobo), SUM(t.amount_kobo) FROM transactions t
               JOIN customers c ON c.id = t.customer_id
               WHERE t.kind = 'funding_card' AND t.status = 'succeeded' AND c.kyc_tier = ?""", (tier,)).fetchone()
        d, d_fees, d_lost, _, _ = disputes(db, tier)
        processing = gross * PROCESSOR_FEE_PERCENT // 100      # the fee incurred, booked or not
        tier_net = revenue - processing - d_fees - d_lost
        total += tier_net
        print(f"   {tier:<4} {count:>8,} {naira(revenue):>14} {naira(processing):>14} {d:>9} {naira(d_fees + d_lost):>14} {naira(tier_net):>14}")
    print(f"   {'all':4} {'':>8} {'':>14} {'':>14} {'':>9} {'':>14} {naira(total):>14}   (step 1 total: {naira(net)})")

    print("\n3. The NIP payout: the ledger holds a fee and no cost")
    sent = nip["posted"]
    print(f"   fee revenue, net of returned payouts {naira(nip['revenue']):>16}  over {sent:,} payouts sent")
    print(f"   cost assumed                         {naira(nip['cost']):>16}  (NIP_COST_KOBO in products.py; the ledger books none)")
    print(f"   net                                  {naira(nip['revenue'] - nip['cost']):>16}")
    print(f"   break-even cost per payout           {naira(nip['revenue'] // sent):>16}")

    print("\n4. Who would notice if the card top-up stopped")
    users, only, fees, fees_users, fees_only = db.execute(
        """WITH card_users AS (SELECT DISTINCT customer_id FROM transactions WHERE kind = 'funding_card' AND status = 'succeeded'),
                bank_users AS (SELECT DISTINCT customer_id FROM transactions WHERE kind = 'funding_transfer' AND status = 'succeeded')
           SELECT (SELECT COUNT(*) FROM card_users),
                  (SELECT COUNT(*) FROM card_users WHERE customer_id NOT IN (SELECT customer_id FROM bank_users)),
                  SUM(fee_kobo),
                  SUM(CASE WHEN customer_id IN (SELECT customer_id FROM card_users) THEN fee_kobo END),
                  SUM(CASE WHEN customer_id IN (SELECT customer_id FROM card_users)
                            AND customer_id NOT IN (SELECT customer_id FROM bank_users) THEN fee_kobo END)
           FROM transactions WHERE kind = 'payout_nip' AND status = 'succeeded'""").fetchone()
    print(f"   customers who topped up by card: {users:,}; of them, never funded by bank transfer: {only:,}")
    print(f"   {'payout fees kept, all customers':48} {naira(fees):>16}")
    print(f"   {'... from customers who ever topped up by card':48} {naira(fees_users):>16}  {fees_users / fees:.1%}")
    print(f"   {'... from those who never funded by transfer':48} {naira(fees_only):>16}  {fees_only / fees:.1%}")
EOF
python3 memo/risk.py | tee memo/out/2-risk.txt

The card top-up nets ₦17,070.71, which is 1.0% of its fee revenue, and it matches the interchange chapter’s figure. Tier 1 loses ₦78,618.55 while tiers 2 and 3 earn. The NIP payout breaks even at ₦27.05 a payout, and the ledger holds no cost to compare with it. The 63.0% in section 4 is the share of payout fees paid by anyone who ever topped up by card; the 0.2% is those who had no bank funding at all.

1. The card top-up, from fee to net
   fee revenue                           ₦1,652,473.21
   processing fee booked                -₦1,105,902.67
   processing fee not yet booked           -₦16,540.83
   chargeback fees (109 disputes)         -₦109,000.00
   disputes lost or accepted (48)         -₦403,959.00
   net after risk                           ₦17,070.71
   disputes still open at the cut-off: 0
   net as a share of the fee revenue: 1.0%

2. The same product by KYC tier of the customer
   tier fundings        revenue     processing  disputes   dispute cost            net
   1       5,849    ₦433,439.05    ₦288,959.60        76    ₦223,098.00    -₦78,618.55
   2       3,496    ₦807,378.31    ₦546,807.64        26    ₦176,753.00     ₦83,817.67
   3         935    ₦411,655.85    ₦286,676.26         7    ₦113,108.00     ₦11,871.59
   all                                                                      ₦17,070.71   (step 1 total: ₦17,070.71)

3. The NIP payout: the ledger holds a fee and no cost
   fee revenue, net of returned payouts      ₦565,350.00  over 20,897 payouts sent
   cost assumed                                    ₦0.00  (NIP_COST_KOBO in products.py; the ledger books none)
   net                                       ₦565,350.00
   break-even cost per payout                     ₦27.05

4. Who would notice if the card top-up stopped
   customers who topped up by card: 1,557; of them, never funded by bank transfer: 59
   payout fees kept, all customers                       ₦565,350.00
   ... from customers who ever topped up by card         ₦356,420.00  63.0%
   ... from those who never funded by transfer             ₦1,150.00  0.2%

In a second terminal, start the mock provider and leave it running. In the first, ask for the settlement of 30 June, which pays out the money captured on 29 June, the last day of the data.

python3 mock_provider.py --quiet
curl -s 'localhost:8101/settlements?date=2026-06-30' -H 'Authorization: Bearer sk_test_owoleaf_mock' | python3 -c "import json,sys; d=json.load(sys.stdin); print({k: d[k] for k in ('captured_on','gross_kobo','fee_kobo','net_kobo')})"

The provider prints one line when it starts. The processor’s own report puts the unsettled batch at 165,408,300 kobo and its fee at 1,654,083 kobo: ₦16,540.83, the same as the number risk.py took from card_clearing. A figure the ledger computed, confirmed by a record Owoleaf did not write.

mock_provider on http://127.0.0.1:8101  secret sk_test_owoleaf_mock  webhooks -> (none)
{'captured_on': '2026-06-29', 'gross_kobo': 165408300, 'fee_kobo': 1654083, 'net_kobo': 163754217}

3. Price the licence. licence.py reads the share capital and the profit kept, adds the floor and fee from the licences chapter, and divides the products’ contribution by the floor.

cat > memo/licence.py <<'EOF'
"""Step 3: the licence as a cost. The floor and the fee are the figures the licences-in-nigeria chapter
quotes from search results about CBN documents; check them against the CBN's PDF before you rely on them.
Run from labs/finance:  python3 memo/licence.py"""
from books import books, naira
from products import by_product
from risk import card_net

NAIRA = 100
MMO_FLOOR = 2_000_000_000 * NAIRA     # shareholders' funds, unimpaired by losses, for a mobile money operator
LICENCE_FEE = 1_000_000 * NAIRA       # one-off licensing fee, as a law-firm summary reports it
DAYS_OBSERVED, DAYS_A_YEAR = 180, 365
UNDER_MMO = {"bank-transfer funding", "wallet to wallet", "NIP payout"}   # the licences chapter's reading of the books

def balance(db, code, side):
    """Net balance of one account, positive on its normal side (side=+1 debit, -1 credit)."""
    return side * db.execute(
        """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 a.code = ?""", (code,)).fetchone()[0]

if __name__ == "__main__":
    db = books()
    funds = balance(db, "share_capital", -1) + balance(db, "fee_revenue", -1) - balance(db, "processing_expense", +1)
    table = by_product(db)
    wallet = sum(p["revenue"] - p["cost"] for name, p in table.items() if name in UNDER_MMO)
    card = card_net(db)
    print("1. What the licence asks")
    print(f"   shareholders' funds today           {naira(funds):>20}")
    print(f"   mobile money operator floor         {naira(MMO_FLOOR):>20}")
    print(f"   shortfall                           {naira(MMO_FLOOR - funds):>20}")
    print(f"   one-off licensing fee               {naira(LICENCE_FEE):>20}")

    print("\n2. Which products sit under it")
    for product in table:
        print(f"   {product:24} {'mobile money operator' if product in UNDER_MMO else 'none of its own'}")

    print("\n3. What the products earn against the floor")
    for label, kobo in (("all products, after risk", card + wallet), ("wallet products only", wallet)):
        year = kobo * DAYS_A_YEAR // DAYS_OBSERVED
        print(f"   {label:36} {naira(kobo):>16} in {DAYS_OBSERVED} days, {naira(year):>16} a year = {year / MMO_FLOOR:.4%} of the floor")
EOF
python3 memo/licence.py | tee memo/out/3-licence.txt

Shareholders’ funds are ₦51,111,920.54, the same as in the licences chapter, so the shortfall matches. The products, after risk, earn ₦582,420.71 in 180 days: ₦17,070.71 from the card and ₦565,350.00 from the wallet. Check the annual figure by hand: 582,420.71 × 365 ÷ 180 = 1,181,019.77, and that over ₦2,000,000,000 is 0.0591%.

1. What the licence asks
   shareholders' funds today                 ₦51,111,920.54
   mobile money operator floor            ₦2,000,000,000.00
   shortfall                              ₦1,948,888,079.46
   one-off licensing fee                      ₦1,000,000.00

2. Which products sit under it
   card top-up              none of its own
   bank-transfer funding    mobile money operator
   wallet to wallet         mobile money operator
   NIP payout               mobile money operator

3. What the products earn against the floor
   all products, after risk                  ₦582,420.71 in 180 days,    ₦1,181,019.77 a year = 0.0591% of the floor
   wallet products only                      ₦565,350.00 in 180 days,    ₦1,146,404.16 a year = 0.0573% of the floor

4. Ask whether the bank would agree. proof.py compares what customers are owed with the bank’s own statement, and separates cash from a claim on the processor.

cat > memo/proof.py <<'EOF'
"""Step 4: are the people Owoleaf owes covered by money a third party confirms?
The bank's statement is the bank's record, not Owoleaf's. Run from labs/finance:  python3 memo/proof.py"""
from books import books, naira
from licence import balance

db = books()
owed = -db.execute(
    """SELECT SUM(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 WHERE a.code LIKE 'wallet:%'""").fetchone()[0]
ledger_cash = balance(db, "settlement_bank", +1)
claim = balance(db, "card_clearing", +1)
bank_cash = db.execute("SELECT balance_kobo FROM bank_statement ORDER BY line DESC LIMIT 1").fetchone()[0]

print(f"{'owed to customers (wallets)':46} {naira(owed):>18}")
print(f"{'cash at the bank, on the bank statement':46} {naira(bank_cash):>18}   {bank_cash / owed:.1%} of what is owed")
print(f"{'cash at the bank, in the ledger':46} {naira(ledger_cash):>18}")
print(f"{'statement minus ledger':46} {naira(bank_cash - ledger_cash):>18}")
print(f"{'owed by the processor (card_clearing)':46} {naira(claim):>18}   a claim, not cash")
print(f"{'cash above what customers are owed':46} {naira(bank_cash - owed):>18}")
print(f"{'ledger assets the statement shows as cash':46} {bank_cash / (ledger_cash + claim):>18.1%}")
EOF
python3 memo/proof.py | tee memo/out/4-proof.txt

The bank’s statement covers 140.4% of what customers are owed, and ₦49,488,784.89 of it is a cushion above that. The statement and the ledger differ by ₦30,947.35, which is what check.py explained in step 1: it printed OK because the planted breaks account for exactly that difference. The ₦1,654,083.00 from the processor is a claim, not cash, and the last line, 99.1%, is the share of the ledger’s assets that the statement shows as cash.

owed to customers (wallets)                       ₦122,438,628.35
cash at the bank, on the bank statement           ₦171,927,413.24   140.4% of what is owed
cash at the bank, in the ledger                   ₦171,896,465.89
statement minus ledger                                 ₦30,947.35
owed by the processor (card_clearing)               ₦1,654,083.00   a claim, not cash
cash above what customers are owed                 ₦49,488,784.89
ledger assets the statement shows as cash                   99.1%

5. Write the memo, then check its evidence. Save the template and the checker. The template has five sections and a TODO in each. The checker does not grade your opinions. It fails if a TODO is left, a section is missing, the memo is over 450 words (about a page), or any naira figure or percentage in it is not in an output you saved in memo/out/.

cat > memo/memo.md <<'EOF'
# Memo to the board: what Owoleaf should stop offering, and what it should never start

From: TODO
Date: TODO

## Stop or restrict
TODO: one product or one segment. The figure that says so, from a step you ran, and what it would cost if you are wrong.

## Keep
TODO: what earns its place after risk and licence, with its figure.

## Never start
TODO: two products. For each, the question from the three failures that it fails.

## What the books cannot show
TODO: at least two costs or effects that are not in the data, and how you would find out.

## What would change my mind
TODO: the one number you would measure next, and the result that would reverse your advice.
EOF
cat > memo/memo_check.py <<'EOF'
"""Step 5: check the memo's evidence, not its opinions. Every naira figure and percentage in memo/memo.md
must appear in an output you saved in memo/out/. Run from labs/finance:  python3 memo/memo_check.py"""
import pathlib, re

MEMO = pathlib.Path("memo/memo.md").read_text()
OUT = "\n".join(p.read_text() for p in sorted(pathlib.Path("memo/out").glob("*.txt")))
SECTIONS = ["## Stop or restrict", "## Keep", "## Never start", "## What the books cannot show", "## What would change my mind"]
FIGURE = re.compile(r"₦\d{1,3}(?:,\d{3})*(?:\.\d+)?|\d+(?:\.\d+)?%")      # ₦17,070.71 and 74.5%, nothing else
MAX_WORDS = 450                                                           # about one page

problems = []
todo = len(re.findall(r"\bTODO\b", MEMO))
if todo:
    problems.append(f"{todo} TODO left in the memo")
for heading in SECTIONS:
    if heading not in MEMO:
        problems.append(f"missing section: {heading}")
words = len(MEMO.split())
if words > MAX_WORDS:
    problems.append(f"{words} words: one page is {MAX_WORDS}")
found = set(FIGURE.findall(OUT))
cited = FIGURE.findall(MEMO)
for figure in dict.fromkeys(cited):
    if figure not in found:
        problems.append(f"not in any output you saved: {figure}")

for p in problems:
    print("FAIL", p)
print(f"{len(cited)} figures cited, {sum(1 for f in cited if f in found)} found in memo/out; {words} words")
raise SystemExit(1 if problems else 0)
EOF
python3 memo/memo_check.py

The starter fails on its seven TODOs and cites no figures yet.

FAIL 7 TODO left in the memo
0 figures cited, 0 found in memo/out; 127 words

Now write the memo. Answer what Owoleaf should stop offering and what it should never start, in the five sections. Use the three questions from the chapter for the never-start list, say which numbers you used and which costs are missing, and name the one number that would change your mind. Run the checker again until it prints no FAIL line. When a figure is not in an output, either add the line that produces it to a step and save the output, or take it out.

A memo whose figures all trace ends with a count and no FAIL line, for example 10 figures cited, 10 found in memo/out; 172 words; yours will differ. Change one digit of a figure and run it again. In a test memo, ₦565,350.00 became ₦565,530.00:

FAIL not in any output you saved: ₦565,530.00
10 figures cited, 9 found in memo/out; 172 words

The NIP payout’s cost is silent, so test it. In memo/products.py change NIP_COST_KOBO = 0 to NIP_COST_KOBO = 2_800, an invented ₦28 a payout that is a little above the break-even, and for no other reason. It is not what any bank charges. Run steps 1, 2 and 3 again.

product                 posted                value         revenue            cost          margin  of fees
card top-up             10,280      ₦112,244,350.00   ₦1,652,473.21   ₦1,105,902.67     ₦546,570.54    74.5%
bank-transfer funding   34,837      ₦810,363,604.00           ₦0.00           ₦0.00           ₦0.00     0.0%
wallet to wallet        13,540       ₦84,359,324.96           ₦0.00           ₦0.00           ₦0.00     0.0%
NIP payout              20,897      ₦800,604,753.06     ₦565,350.00     ₦585,116.00     -₦19,766.00    25.5%
all products                                          ₦2,217,823.21   ₦1,691,018.67     ₦526,804.54
ties to fee_revenue: ₦2,217,823.21  OK
ties to processing_expense: ₦1,105,902.67  OK

Section 3 of python3 memo/risk.py:

3. The NIP payout: the ledger holds a fee and no cost
   fee revenue, net of returned payouts      ₦565,350.00  over 20,897 payouts sent
   cost assumed                              ₦585,116.00  (NIP_COST_KOBO in products.py; the ledger books none)
   net                                       -₦19,766.00
   break-even cost per payout                     ₦27.05

Section 3 of python3 memo/licence.py:

3. What the products earn against the floor
   all products, after risk                   -₦2,695.29 in 180 days,       -₦5,465.45 a year = -0.0003% of the floor
   wallet products only                      -₦19,766.00 in 180 days,      -₦40,081.06 a year = -0.0020% of the floor

What to look for: the NIP payout’s cost becomes ₦585,116.00 (2,800 kobo × 20,897 payouts) and its margin −₦19,766.00. The whole book, after risk, falls to −₦2,695.29: 17,070.71 − 19,766.00. The tie-out still prints OK, because it compares only the booked cost. The product your first reading called the best now loses money, and the memo you wrote in step 5 could say the wrong thing. Set the line back to 0 and run steps 1 to 4 again so that memo/out holds the books as they are. Then decide what cost you would ask finance for, and write it in the section on what the books cannot show.

ARTEFACT Write the product retirement plan ~50 MIN
YOU PRODUCEProduct retirement plan

Template

# Retirement plan: <product>
Owner: <product owner> · Signers: <finance>, <compliance>, <CEO> · Date written: <date>
Decision needed: <what each signer is asked to approve>, by <date>

## Why we are stopping
<One paragraph and the memo it follows. The figure that says so, and what it would cost if wrong.>

## Who is affected
| Group | Customers | Balances | What they lose | What we offer |
|---|---|---|---|---|
Source of each figure: <lab output or query>

## Notice and timing
| Date | Step | Owner |
|---|---|---|
Notice length and why: <rule or assumption>

## Open items, refunds and disputes
- In flight at the last day: <what settles, what is refunded, by whom>
- Disputes after the last day: <window, desk, reserve and how it is sized>

## Ledger accounts closed
| Account | Balance today | Closing entry | Proof it is zero |
|---|---|---|---|
Accounts that stay open, and why: <list>

## Partner contracts ended
| Partner | Contract | Notice term (from the contract) | End date |
|---|---|---|---|

## Done means
<The date, and the three or four checks that must all be true on it.>

## Risks, and out of scope
- <how this plan could be wrong> — <what would show it>
- Out of scope: <what this plan does not touch>
WORKED EXAMPLE

Who writes and signs. At a real company the product owner writes this plan, and the heads of finance and compliance and the CEO sign it. This one stops Owoleaf’s card top-up, on the lab’s books at 29 June 2026.

Why. After processing and chargebacks the card keeps ₦17,070.71 of ₦1,652,473.21 in fees, 1.0% (step 2). If wrong, Owoleaf loses that net and the 59 customers with no other way in. Card users pay 63.0% of payout fees, a ceiling and not the effect of stopping.

Who is affected. 1,557 customers topped up by card and hold ₦89,926,890.52 in wallets, which stay open; only the way in closes. 59 never funded by bank transfer and hold ₦1,893,751.43, so they get bank-transfer details first. Both come from query 1.

Timing. Notice goes out Monday 4 January 2027. The last top-up is Wednesday 3 February 2027, 30 days on (Owoleaf’s choice, not a rule), and the processor settles it on 4 February.

Disputes. Assumption: the tail after the last day looks like the lab’s. Query 2: the slowest dispute opened about 75 days after its sale, so the window is 90 days, to Tuesday 4 May 2027. Query 3: 33 disputes opened after the lab’s last top-up day, costing ₦190,994.00 (fees ₦33,000.00, ₦157,994.00 lost or accepted). That is the reserve, and late refunds come from it. The slowest took about 65 days to close, so the desk and reserve stay until Thursday 8 July 2027.

Ledger. card_clearing held ₦1,654,083.00 on 29 June, one day’s captures. Proof of zero: a balance query returning 0 after the 4 February settlement. fee_revenue and processing_expense stay open: payouts post there. Disputes are not a ledger account: the proof is no open rows in disputes on 8 July.

Contract. The processor agreement must run past 8 July; its notice term is read from the contract.

Done on 8 July 2027. Wrong if a dispute opens after 4 May or the tail is heavier than the lab’s.

Queries 1 to 3, run read-only on data/finance.sqlite in any SQLite client; money is in kobo.

-- 1. Card customers: how many, their wallet balances, and those who never funded by bank transfer
WITH card AS (SELECT DISTINCT customer_id FROM transactions WHERE kind = 'funding_card' AND status = 'succeeded'),
     bank AS (SELECT DISTINCT customer_id FROM transactions WHERE kind = 'funding_transfer' AND status = 'succeeded'),
     bal  AS (SELECT a.customer_id, SUM(CASE e.direction WHEN 'credit' THEN e.amount_kobo ELSE -e.amount_kobo END) AS kobo
              FROM entries e JOIN accounts a ON a.id = e.account_id WHERE a.code LIKE 'wallet:%' GROUP BY a.customer_id)
SELECT COUNT(*) AS card_customers, SUM(kobo) AS balances_kobo,
       SUM(bal.customer_id NOT IN (SELECT customer_id FROM bank)) AS no_transfer_customers,
       SUM(CASE WHEN bal.customer_id NOT IN (SELECT customer_id FROM bank) THEN kobo END) AS no_transfer_kobo
FROM bal JOIN customers c ON c.id = bal.customer_id
WHERE bal.customer_id IN (SELECT customer_id FROM card);   -- for one tier, add: AND c.kyc_tier = 1

-- 2. Slowest dispute: days from sale to opening, and from opening to closing
SELECT MAX(julianday(d.opened_at) - julianday(t.created_at)) AS sale_to_open,
       MAX(julianday(d.closed_at) - julianday(d.opened_at)) AS open_to_close
FROM disputes d JOIN transactions t ON t.id = d.transaction_id;

-- 3. Disputes opened after the last top-up day (29 June 2026) and what they cost
SELECT COUNT(*) AS disputes, SUM(d.fee_kobo) AS fees_kobo,
       SUM(CASE WHEN d.status IN ('lost', 'accepted') THEN d.amount_kobo ELSE 0 END) AS lost_kobo
FROM disputes d JOIN transactions t ON t.id = d.transaction_id JOIN customers c ON c.id = t.customer_id
WHERE d.opened_at >= '2026-06-30';                     -- for one tier, add: AND c.kyc_tier = 1

Now you

It is a month after the board meeting. Owoleaf’s board chose the middle option: keep the card top-up for KYC tiers 2 and 3 and switch it off for tier 1, and it wants tier 1 off by 31 March 2027. You are the product owner and you write the plan. Step 2, section 2 gives you the tier 1 line: 5,849 card top-ups, ₦433,439.05 of fees, ₦288,959.60 of processing, 76 disputes costing ₦223,098.00, and a net of −₦78,618.55, against ₦95,689.26 earned by tiers 2 and 3 together. Run the example’s queries 1 and 3 for tier 1 to get the customers, their balances, those with no bank-transfer route and the dispute tail. Then decide what retired means when the processor contract and the product stay for other tiers: which ledger accounts stay open, how you prove that no tier 1 card top-up posts after the date, how the reserve is sized, and whether a customer who moves up a tier gets the card back. The head of finance, the compliance lead and the CEO read it, and it supports their decision on the date tier 1 is switched off.

Self-check

DECIDE

Ferrowave's board has asked Nneoma and Ifeyinwa which product to stop. Nneoma builds her table the way the lab builds Owoleaf's. It shows one add-on that brings most of the new fee revenue, nearly all of the chargebacks and, after both, almost nothing. The chargebacks come mostly from new customers on the smallest limits. The partner banks' charge per payout is not yet in the table for the core payout product. The figures are illustrative and none of this is advice. What do they cost out first?

READING
  1. DOC
    Report concerning the independent special investigation, Wirecard AG, Munich (KPMG) KPMG, 2020

    The auditor's own findings on third-party acquiring revenue and on trustee accounts, as hosted on wirecard.com. Read the summary of findings and skip the process chapters, and compare it with the company's release of 28 April 2020.

  2. DOC
    Synapse Financial Technologies, Inc. (CFPB enforcement action) Consumer Financial Protection Bureau, 2025

    The regulator's own account of records that did not match the partner banks' records, and of the harm to customers. Read the complaint's facts section; the figures in this chapter come from summaries of it.

  3. POST
    Synapse Bankruptcy Trustee Finds $85 Million 'Shortfall' Amid Tangled Web of Accounts PYMNTS, 2024

    A press account of the trustee's first report, so a secondary source. Read it for how a shortfall estimate moved, then look for the trustee's filings on the court docket before you quote a number.

  4. PAPER
    Investigating the impact of global stablecoins (CPMI Papers No 187) G7 Working Group on Stablecoins, CPMI, 2019

    The G7 working group's view of the risks a global stablecoin raises, written after Libra was announced. Read the executive summary and the recommendations, and compare the wording of the conditions with this chapter's summary. Read: the executive summary and the recommendations.

  5. PAPER
    Enhancing cross-border payments: building blocks of a global roadmap (CPMI Papers No 193) CPMI, 2020

    What the authorities proposed for the problem Libra named: faster, cheaper, more transparent payments on existing arrangements. Read the executive summary and the list of building blocks. Read: the executive summary and the building blocks.

  6. DOC
    Approved New Licence Categorization Requirements, Consolidated 2021 Central Bank of Nigeria, 2021

    The capital floors and fees behind step 3, in the CBN's own document. Read the mobile money operator section and compare each figure with licence.py.

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: Account numbers and identifiers: NUBAN, bank codes, BVN, NIN and phone numbers →