WORKINGCHAPTER 16

Agent banking and POS: terminals, agents, cash in and cash out

A shop becomes a bank branch with two tills: a drawer of cash and a wallet of e-value. They run out in opposite directions, and one timed-out cash-out can leave them disagreeing

55 MINPAYMENTSUPDATED 2026-11-14
PREDICT

An agent opens with ₦100,000 in the drawer and ₦150,000 of e-float. All morning she takes cash from customers and credits their wallets: ₦90,000 in total, ignoring commission. What does she have at midday?

An agent is a person or a small business that a licensed institution has appointed to deliver some of its services in a shop. As a rule the institution holds the licence for those services and answers for the agent. That one fact shapes everything else: the agent needs cash, and the institution needs the customer’s money to be the customer’s money, to the kobo, at every step.

Who is in the chain

Four words come up, and they are easy to mix up.

Role What it is In the Kano company’s story
Principal A licensed financial institution that appoints agents and is responsible for them: a bank, a mobile money operator or a payment service bank (see Nigeria’s rails) The institution whose wallets and accounts the customers hold
Super-agent A company that recruits, trains, funds and watches many agents for one or more principals The Kano company
Agent The shop or trader that serves the customer face to face One of the 3,000
Aggregator or float runner An informal or contracted helper who brings cash or e-float to agents A rider who tops up stalls in the market

The CBN issued Guidelines for the Operations of Agent Banking in Nigeria by a circular dated 6 October 2025. Search excerpts say they apply to the financial institutions the CBN licenses to use agents, recognise principals, super-agents, agents and Payment Terminal Service Aggregators (PTSAs), and supersede the CBN’s other agent banking guidelines, including the 2013 ones. A super-agent may contract with more than one principalas of 2026-11.. The CBN’s site could not be read in this build, so those lines rest on search excerpts and summaries. Read the Guidelines’ definitions before you use the words in a contract. The fourth row of the table, the float runner, is an operating habit that published studies of agent networks in other countries describe, not a role the excerpts show the CBN defining.

What an agent does

The services are few and they are all about cash.

  • Cash-in (deposit): the customer hands over notes and the agent credits the customer’s wallet or account.
  • Cash-out (withdrawal): the customer asks for notes, the institution debits the wallet or account, and the agent hands the notes over.
  • Transfers and bill payments: the agent takes cash and sends it to another account, or pays a bill with it. The customer may have no account at all.
  • Account opening and card services, for institutions that allow it. These are about identity checks, which the Compliance course covers.

Cash-in and cash-out are the two that matter for this chapter, because they move cash and e-float in opposite directions for the same amount. A transfer or bill payment paid for in cash behaves like a cash-in whose wallet belongs to someone else, and the lab leaves it out.

Two floats, running out in opposite directions

The agent keeps two stocks of value, and they are not interchangeable.

Cash float is the notes in the drawer. Customers can only be paid out of it. E-float is the agent’s own wallet of electronic value with the institution, which the agent pre-funds. A cash-in pays the customer’s wallet out of the e-float. A cash-out pays the customer’s cash out of the drawer and credits the same amount back to the e-float. Look at the two stocks together.

Operation Drawer cash E-float Cash plus e-float
Cash-in of ₦X up by X down by X unchanged (plus commission)
Cash-out of ₦X down by X up by X unchanged (plus commission)
Agent deposits cash for e-float down up unchanged
Agent sells e-float for cash up down unchanged

The last column is the key. Cash plus e-float is the agent’s whole working position, and ordinary trade changes it only by the commission the agent earns. Moving between the stocks is rebalancing. It changes the mix and not the total. An agent in a market where people come to collect their salaries and remittances does cash-outs all day: the drawer empties, the e-float swells, and the agent turns away customers while holding a wallet full of money. An agent beside a bus park takes cash from traders who want to send it home: the e-float empties while the drawer fills. The two shortages come from the same activity, opposite in sign, and neither is the agent’s mistake.

Both shortages cost real sales. A customer turned away today may go elsewhere tomorrow. Rebalancing has a price too: a trip to a branch, a deposit that clears the next working day, or a fee to a float runner. MicroSave, drawing on its Helix Institute agent surveys, describes liquidity management as a main challenge for agent networks, and points to centralised monitoring and to super-agents or master agents that rebalance e-float and cashas of 2026-11. That comes from a search summary of MicroSave’s 2017 post, so read the post for its markets. For a super-agent such as the Kano company the consequence is operational: the company watches each agent’s two stocks, warns before one runs out and arranges rebalancing. To watch them it needs a ledger that records both.

Cash-out by card, and cash-out by transfer

A customer who wants cash from an agent can pay for it in three ways. The shape of each decides what the agent can lose.

Way What moves How fast the agent is paid What can go wrong for the agent
From the institution’s own wallet (the lab’s model) The customer’s wallet is debited, the agent’s e-float credited At once, inside the institution’s books A timeout: debited, cash not handed over, or the reverse
Card at the agent’s POS terminal The issuer approves, the terminal prints a slip, the agent hands over cash At settlement, a later day: the card chapter’s four stages apply Cash has left the drawer today and the money arrives later; an approval later reversed or disputed after the cash is out
Transfer to the agent’s own account A bank transfer from the customer to the agent, then the agent hands over cash At once if the transfer is final A fake credit alert: the agent hands over cash for a transfer that never arrived or that later reverses

A POS (point of sale) terminal is the card machine. In a shop it takes the shop’s sales. In agent banking it takes a card, asks the issuer for approval of an amount and, on approval, the agent pays that amount in cash. The terminal does not talk to the issuer directly. Its traffic passes through a Payment Terminal Service Aggregator (PTSA), a middle party that holds the terminals’ connections and routes them to switches and processors. Search excerpts of the 2025 Guidelines recognise PTSAs as a stakeholder and give them a part in geo-fencing agents’ terminalsas of 2026-11. A later pay4 chapter on routing and the licences takes that up. For this chapter you need one consequence: the agent’s POS money passes through other parties and arrives after settlement, so the drawer pays out before the agent is paid. The agent funds that gap from the drawer.

The transfer route needs a warning because it is the one where the loss is the agent’s alone. An alert on a phone is a message, not a credit. The only proof of money is the credit on the account statement or the bank’s own confirmation. Rails can also reverse a transfer after it looked final (see Nigeria’s rails and the later chapter on payment states). A rule of thumb for any agent: hand over cash only against a credit you have checked in the source of truth, never against the screenshot a customer holds up.

What the agent earns, and what the customer pays

Agents earn commission, and the customer may pay a fee. The two are separate numbers, and mixing them is the commonest error in an agent ledger. A fee is what the customer pays. A commission is what the institution pays the agent, usually a share of the fee for a cash-out, and a small fixed or percentage sum for a cash-in that costs the customer nothing.

The lab uses invented figures so you can follow the arithmetic: a cash-out of ₦30,000 costs the customer a ₦200 fee, and the agent’s commission is 60% of it, ₦120. A cash-in of ₦50,000 pays the agent 0.2%, ₦100. These are illustrative and are not the CBN’s or any institution’s tariff.

Book the fee and the commission as two lines. The fee is revenue of the network, and the commission is its expense. Netting them hides the margin, and it hides the case where a commission rule costs more than the fee it came from. Here are the entries in kobo for that cash-out, with the lab’s account names:

Account Direction Kobo Why
wallet:a debit 3,020,000 The customer pays the ₦30,000 and the ₦200 fee
agent_float credit 3,000,000 The agent receives e-value for the cash handed out
fee_revenue credit 20,000 The ₦200 fee
commission_expense debit 12,000 The ₦120 commission
agent_float credit 12,000 The commission is paid into the agent’s e-float
cash_control debit 3,000,000 The mirror of the drawer, below
agent_cash credit 3,000,000 The notes leave the drawer

Debits are 3,020,000 + 12,000 + 3,000,000 = 6,032,000. Credits are 3,000,000 + 20,000 + 12,000 + 3,000,000 = 6,032,000. The posting balances. The agent’s net change is cash down 3,000,000 and e-float up 3,012,000: plus 12,000, the commission, and nothing else.

Debited but not dispensed

Name the failure first. A cash-out has two halves that cannot happen in one atomic step: the institution debits the wallet, and a person hands over notes. A timeout between them leaves one half done and the other unknown. There are four states of the world, and only two of them are normal.

Wallet debited? Cash handed over? What it is
Yes Yes A normal cash-out
No No A failed cash-out, nothing to fix
Yes No Debited but not dispensed: the customer is out of pocket and has nothing
No Yes Dispensed but not debited: the agent is out of pocket and the customer has both

The third is the one the customer sees and phones about. The fourth is the one the agent bears, and it happens when the debit later fails or is reversed after the notes went. Neither can be fixed by editing a balance, because you do not yet know which world you are in. The fix is to record the half you know and park the money in suspense until you learn the other half.

A suspense account holds money that has left one place and has not arrived at another. When the cash-out times out, you debit the customer’s wallet, credit suspense, and leave the agent’s two stocks alone. Then somebody finds out what happened, using the terminal log, the institution’s record and the agent’s own account of what they did, and the posting that follows depends on the answer. If no cash left the drawer, release suspense back to the customer. If cash did leave, settle suspense as a normal cash-out: the agent is paid e-float for the notes. Suspense must be zero when the day closes, or the day is not closed.

The CBN has timelines for failed card transactions. The CBN’s June 2020 press release on payment channels, as a search summary shows it, says resolution of disputed or failed POS and web transactions must be concluded within 72 hours, down from five days, with effect from 8 June 2020. Secondary summaries of the revised Guidelines give 48 hours for refunds on failed POS and web transactions; the 48 and 72 hours may be a refund deadline and a resolution deadline, but that was not confirmed from the text. Later changes were not checkedas of 2026-11. Use neither number for a wallet cash-out, which is the institution’s own business and not a POS transaction. For a card cash-out, read the current text of both documents.

What the rules say about limits, exclusivity and location

The rules on agent limits have been restated more than once recently. Read the primary text before you build on any of this.

The CBN’s Circular on Cash-out limits for Agent Banking Transactions, dated 17 December 2024, tells issuers to set a cash-out limit per customer, regardless of channel, of ₦500,000 a week, as a search result quotes it. Search summaries also attribute ₦100,000 a day per customer and ₦1.2 million a day per agent to it, but the weekly figure is the only one quoted from its textas of 2026-11. The October 2025 Guidelines restated limits. Secondary summaries of the 2025 Guidelines, from a law firm and the press, report ₦100,000 a day and ₦500,000 a week per customer through agents (some say for cash-in as well as cash-out) and a daily cumulative cap of ₦1.2 million per agent. None of these was checked against the Guidelines’ text, and the summaries differ on whether cash-ins are limitedas of 2026-11.

Three other rules shape what you build, and they come from the same Guidelines. Search excerpts and summaries say that an agent must be exclusive to one principal and to one super-agent network, and cannot be appointed by another principal until any existing agent banking agreement ends; that devices used for agent banking, POS terminals among them, must be geo-fenced or tagged to the agent’s registered premises or approved location; and that agents must keep a dedicated account or wallet for agent banking transactions only. The CBN’s reforms page, as a search result shows it, says the circular took effect on release except agent location and exclusivity, which start on 1 April 2026, a date that has passed; some outlets give 1 April 2026 for the terminal geo-fencing too. None of the results shows whether the rules were enforced on that dateas of 2026-11.

What each means for a ledger is concrete. A limit is a policy check that sits in front of the ledger, as in the project chapter: the ledger would post a ₦120,000 cash-out correctly, and a rule decides whether the attempt is allowed. A dedicated account is the reason this chapter’s ledger keeps agent postings apart from any other business the shop does. Exclusivity means one agent code belongs to one network, so your agent table needs the network and the agreement dates. Geo-fencing or tagging means a terminal’s location is data you hold and compare: a transaction from a terminal far from its registered shop is a signal worth a check. The lab applies limits as CUSTOMER_DAILY_CASH_OUT and AGENT_DAILY_CASH_OUT. The values are set equal to the reported figures above for realism, but they are the lab’s own constants, not a statement of the rule.

Fraud and liquidity risk, in outline

Agents are the weak point of a network because they are many, small and far from supervision. Four patterns recur, and the ledger can help with each one.

  • Float theft and skimming. An agent takes e-float from customers’ transfers and cash-outs and does not hand over the cash, or charges an extra fee. Customers report it, and the ledger shows the pattern as many suspense postings for one agent.
  • Splitting. Several smaller cash-outs for one customer to stay under a limit. A per-customer daily total finds it.
  • Fake credit alerts, above, where the agent is the victim.
  • Liquidity fraud. An agent asks the network for emergency float it does not need, or sells float outside the network. The two stocks, watched through the day, show it as a position that moves without commission.

The Compliance course covers fraud systems and the checks on who an agent is. Here the point is narrow: the check that cash plus e-float changes only by commission is a fraud check too. Any day where the position moves by more than commission, with no top-up or withdrawal of the agent’s own money, has a cause someone must find.

Modelling the day as a double-entry ledger

An agent’s books straddle two organisations: the notes in the drawer belong to the agent, and the wallets belong to the institution. In this ledger “the network” means the party that holds the wallets and pays the agent, whether the principal or a super-agent acting for it; the lab does not split the two. To count both in one ledger the lab uses a mirror account. agent_cash is an asset that records the drawer. cash_control is an equity account that mirrors it, standing for cash that lives outside the network’s books: it has the opposite balance, so the network’s own accounts never mistake the agent’s notes for its money. Every movement of notes posts a pair: a debit to agent_cash and a credit to cash_control for a cash-in, the reverse for a cash-out. The trial balance still holds, because each pair balances on its own.

The accounts and their types:

Account Type Meaning
settlement_bank asset The network’s bank account
agent_cash asset Notes in the drawer
cash_control equity The mirror of the drawer
agent_float liability E-value the network owes the agent
suspense liability Customer money taken and not yet settled
wallet:<name> liability One for each customer
commission_expense expense Commission paid to the agent
fee_revenue income Fees paid by customers

Two rules in the posting function matter more than the rest. First, neither the drawer nor the e-float may go negative: a cash-out the drawer cannot cover is refused whole, and the customer’s wallet is not debited. Second, the mirror pairs are built by the operations (cash_in, cash_out, cash_to_float) and not by the caller, so nobody can post half a movement by hand. The balance sheet equation checks that debits equal credits, and the position check proves something the equation cannot: that the two stocks together moved only by commission. The break at the end of the lab shows the difference.

LAB Model one agent's day as a ledger, replay a cash-out that times out, and prove the position ~60 MIN
YOU NEEDPython 3.9 or later (standard library only)labs/finance with the data generated (python3 generate.py), for the optional step 5 onlyNo Docker, no packages, no mock services

You work in labs/finance and create six small files there: agent_ledger.py, try_agent_door.py, agent_day.py, agent_break.py, agent_sizes.py and break_cash_leg.py. The ledger is in memory, so nothing is written to your data. Every amount is integer kobo. The fees, commissions and limits are the lab’s illustrative values.

1. Write the ledger. Save this as agent_ledger.py. Read the account list at the top first, then post: it is the only door.

"""One agent's day as a double-entry ledger. Money is integer kobo everywhere.

Accounts (a is an asset, l a liability, e equity, i income, x expense):
  settlement_bank   a  the network company's bank account
  agent_cash        a  cash in the agent's drawer (the agent's own money, counted here)
  cash_control      e  the mirror of agent_cash: cash that lives outside the network's books
  agent_float       l  the e-float wallet: e-value the network owes the agent
  suspense          l  customer money taken and not yet settled either way
  commission_expense x commission the network pays the agent
  fee_revenue       i  the fee the customer pays on a cash-out
  wallet:<name>     l  one per customer
"""
import sqlite3

SCHEMA = """
CREATE TABLE accounts (id INTEGER PRIMARY KEY, code TEXT UNIQUE NOT NULL,
  type TEXT NOT NULL CHECK (type IN ('asset','liability','equity','income','expense')),
  can_go_negative INTEGER NOT NULL);
CREATE TABLE postings (id INTEGER PRIMARY KEY, label TEXT NOT NULL UNIQUE);
CREATE TABLE entries (id INTEGER PRIMARY KEY, posting_id INTEGER NOT NULL REFERENCES postings(id),
  account_id INTEGER NOT NULL REFERENCES accounts(id),
  direction TEXT NOT NULL CHECK (direction IN ('debit','credit')),
  amount_kobo INTEGER NOT NULL CHECK (amount_kobo > 0));
"""
FIXED = [("settlement_bank", "asset", 1), ("agent_cash", "asset", 0), ("cash_control", "equity", 1),
         ("agent_float", "liability", 0), ("suspense", "liability", 0),
         ("commission_expense", "expense", 1), ("fee_revenue", "income", 1)]


class Refused(Exception):
    pass


def new_ledger(wallets):
    db = sqlite3.connect(":memory:")
    db.executescript(SCHEMA)
    for code, typ, neg in FIXED:
        db.execute("INSERT INTO accounts (code, type, can_go_negative) VALUES (?, ?, ?)", (code, typ, neg))
    for w in wallets:
        db.execute("INSERT INTO accounts (code, type, can_go_negative) VALUES (?, 'liability', 0)", (f"wallet:{w}",))
    return db


def balance(db, code):
    """Credit-positive: credits minus debits. An asset's natural balance is the negative of this."""
    return db.execute("""SELECT COALESCE(SUM(CASE e.direction WHEN 'credit' 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]


def held(db, code):
    """The balance the way its owner reads it: assets and expenses as debits minus credits, the rest as credits minus debits."""
    typ = db.execute("SELECT type FROM accounts WHERE code = ?", (code,)).fetchone()[0]
    b = balance(db, code)
    return -b if typ in ("asset", "expense") else b


def post(db, label, legs):
    """Post legs [(account code, 'debit'|'credit', kobo)] as one posting, or raise Refused. Writes nothing on refusal."""
    for _, d, k in legs:
        if d not in ("debit", "credit") or type(k) is not int or k <= 0:
            raise Refused(f"bad_leg: {d} {k!r}")
    dr = sum(k for _, d, k in legs if d == "debit")
    cr = sum(k for _, d, k in legs if d == "credit")
    if dr != cr:
        raise Refused(f"unbalanced: debits {dr} != credits {cr}")
    if db.execute("SELECT 1 FROM postings WHERE label = ?", (label,)).fetchone():
        raise Refused(f"duplicate: {label} is already posted")
    change = {}
    for code, d, k in legs:
        change[code] = change.get(code, 0) + (k if d == "credit" else -k)
    for code, delta in change.items():
        row = db.execute("SELECT type, can_go_negative FROM accounts WHERE code = ?", (code,)).fetchone()
        if row is None:
            raise Refused(f"unknown_account: {code}")
        typ, negative_ok = row
        natural = held(db, code) + (-delta if typ in ("asset", "expense") else delta)
        if not negative_ok and natural < 0:
            raise Refused(f"insufficient_funds: {code} holds {held(db, code)} kobo and would end at {natural}")
    with db:
        pid = db.execute("INSERT INTO postings (label) VALUES (?)", (label,)).lastrowid
        for code, d, k in legs:
            db.execute("INSERT INTO entries (posting_id, account_id, direction, amount_kobo) "
                       "VALUES (?, (SELECT id FROM accounts WHERE code = ?), ?, ?)", (pid, code, d, k))


def trial_balance(db):
    """(assets + expenses, liabilities + equity + income) in kobo, plus total debits and credits."""
    t = dict(db.execute("""SELECT a.type, 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 GROUP BY a.type"""))
    left = t.get("asset", 0) + t.get("expense", 0)
    right = -(t.get("liability", 0) + t.get("equity", 0) + t.get("income", 0))
    return left, right


# --- the agent's operations, as legs -----------------------------------------------------
def cash_in(w, x, commission):
    """Customer hands the agent x in cash. Agent's float funds the customer's wallet."""
    return [("agent_float", "debit", x), (f"wallet:{w}", "credit", x),
            ("agent_cash", "debit", x), ("cash_control", "credit", x),
            ("commission_expense", "debit", commission), ("agent_float", "credit", commission)]


def cash_out(w, x, fee, commission):
    """Customer's wallet pays x plus a fee; the agent hands over x in cash and earns the commission in float."""
    return [(f"wallet:{w}", "debit", x + fee), ("agent_float", "credit", x),
            ("fee_revenue", "credit", fee),
            ("commission_expense", "debit", commission), ("agent_float", "credit", commission),
            ("cash_control", "debit", x), ("agent_cash", "credit", x)]


def hold(w, x, fee):
    """The customer was debited and the answer never came back: the money waits in suspense."""
    return [(f"wallet:{w}", "debit", x + fee), ("suspense", "credit", x + fee)]


def release_to_customer(w, x, fee):
    return [("suspense", "debit", x + fee), (f"wallet:{w}", "credit", x + fee)]


def release_to_agent(x, fee, commission):
    """The agent did pay the cash: settle the hold as a normal cash-out."""
    return [("suspense", "debit", x + fee), ("agent_float", "credit", x),
            ("fee_revenue", "credit", fee),
            ("commission_expense", "debit", commission), ("agent_float", "credit", commission),
            ("cash_control", "debit", x), ("agent_cash", "credit", x)]


def cash_to_float(x):
    """The agent deposits cash with the network and receives the same amount of e-float."""
    return [("agent_cash", "credit", x), ("cash_control", "debit", x),
            ("settlement_bank", "debit", x), ("agent_float", "credit", x)]


def float_to_cash(x):
    return [("agent_float", "debit", x), ("settlement_bank", "credit", x),
            ("agent_cash", "debit", x), ("cash_control", "credit", x)]

2. Try the door by hand. Save this as try_agent_door.py. It opens one agent and tries six postings, four of them wrong.

from agent_ledger import Refused, held, new_ledger, post, trial_balance
import agent_ledger as L

db = new_ledger(["a", "b"])
post(db, "open-cash", [("agent_cash", "debit", 10_000_000), ("cash_control", "credit", 10_000_000)])   # ₦100,000 in the drawer
post(db, "open-float", [("settlement_bank", "debit", 15_000_000), ("agent_float", "credit", 15_000_000)])  # ₦150,000 of e-float
post(db, "fund-a", [("settlement_bank", "debit", 5_000_000), ("wallet:a", "credit", 5_000_000)])           # customer a holds ₦50,000
post(db, "fund-b", [("settlement_bank", "debit", 30_000_000), ("wallet:b", "credit", 30_000_000)])           # customer b holds ₦300,000

tries = [
    ("cash-in 1", L.cash_in("a", 4_000_000, 8_000)),                      # ₦40,000 in, ₦80 commission
    ("cash-out 1", L.cash_out("a", 2_000_000, 10_000, 6_000)),            # ₦20,000 out, ₦100 fee, ₦60 commission
    ("short", [("agent_cash", "debit", 100), ("cash_control", "credit", 90)]),
    ("too much cash", L.cash_out("b", 15_000_000, 10_000, 6_000)),        # ₦150,000: more than the drawer holds
    ("float", [("agent_float", "debit", 15.5), ("wallet:a", "credit", 15.5)]),
    ("cash-in 1", L.cash_in("a", 4_000_000, 8_000)),                      # the same label again
]
for label, legs in tries:
    try:
        post(db, label, legs)
        print(f"{label}: posted")
    except Refused as r:
        print(f"{label}: refused, {r}")
for code in ("agent_cash", "agent_float", "wallet:a", "commission_expense", "fee_revenue"):
    print(f"{code:20} {held(db, code):>12}")
left, right = trial_balance(db)
print("assets + expenses", left, "| liabilities + equity + income", right)
python3 try_agent_door.py
cash-in 1: posted
cash-out 1: posted
short: refused, unbalanced: debits 100 != credits 90
too much cash: refused, insufficient_funds: agent_cash holds 12000000 kobo and would end at -3000000
float: refused, bad_leg: debit 15.5
cash-in 1: refused, duplicate: cash-in 1 is already posted
agent_cash               12000000
agent_float              13014000
wallet:a                  6990000
commission_expense          14000
fee_revenue                 10000
assets + expenses 62014000 | liabilities + equity + income 62014000

Check it by hand. The drawer started at ₦100,000, took ₦40,000 and paid out ₦20,000: ₦120,000 (12,000,000 kobo). The e-float started at ₦150,000, paid ₦40,000, received ₦80 of commission, paid back ₦20,000 and ₦60 of commission: 15,000,000 − 4,000,000 + 8,000 + 2,000,000 + 6,000 = 13,014,000. The cash-out for customer b was refused because the drawer would end at −3,000,000, and customer b was not debited. Both sides of the trial balance are 62,014,000.

3. Replay the day. Save this as agent_day.py. It opens an agent with ₦100,000 in the drawer and ₦150,000 of e-float, funds four customer wallets, and runs thirteen operations. Operation 7 is the cash-out whose terminal times out after the debit; operation 8 settles it.

"""Replay one agent's scripted day into the ledger and prove it."""
import sys
import agent_ledger as L
from agent_ledger import Refused, held, new_ledger, post, trial_balance

N = 100                                    # kobo per naira
CUSTOMER_DAILY_CASH_OUT = 100_000 * N      # the lab's policy limits, set equal to the figures
AGENT_DAILY_CASH_OUT = 1_200_000 * N       # in the chapter's AsOf box: check the current text


def fee_for(x):                            # ILLUSTRATIVE customer fee on a cash-out
    return 100 * N if x <= 20_000 * N else 200 * N if x <= 50_000 * N else 300 * N


def commission_out(fee):                   # ILLUSTRATIVE: the agent gets 60% of the fee
    return fee * 60 // 100


def commission_in(x):                      # ILLUSTRATIVE: 0.2% of a cash-in, rounded down
    return x // 500


def naira(kobo):
    return f"{kobo // N:,}"


def open_day(wallet_funds):
    db = new_ledger(list(wallet_funds))
    post(db, "open-cash", [("agent_cash", "debit", 100_000 * N), ("cash_control", "credit", 100_000 * N)])
    post(db, "open-float", [("settlement_bank", "debit", 150_000 * N), ("agent_float", "credit", 150_000 * N)])
    for w, naira_amount in wallet_funds.items():
        post(db, f"fund-{w}", [("settlement_bank", "debit", naira_amount * N), (f"wallet:{w}", "credit", naira_amount * N)])
    return db


# kind, customer, amount in naira, note
DAY = [
    ("cash_in", "a", 50_000, ""),
    ("cash_in", "b", 40_000, ""),
    ("cash_in", "c", 80_000, "the float is nearly gone"),
    ("cash_to_float", "-", 100_000, "the agent deposits cash for float"),
    ("cash_in", "c", 80_000, "the same customer, again"),
    ("cash_out", "a", 30_000, ""),
    ("cash_out_timeout", "d", 20_000, "the terminal times out after debiting"),
    ("resolve_reverse", "d", 20_000, "the agent counts no cash given: reverse"),
    ("cash_out", "c", 90_000, ""),
    ("cash_out", "b", 60_000, "the drawer is nearly empty"),
    ("cash_out", "b", 120_000, "over the customer's daily limit"),
    ("float_to_cash", "-", 60_000, "the agent sells float for cash"),
    ("cash_out", "b", 60_000, ""),
]


def run_day(db, day=DAY, verbose=True, resolve="reverse"):
    cust_out, agent_out = {}, 0
    if verbose:
        print(f"{'#':>2} {'operation':<17} {'who':<3} {'naira':>8}  {'result':<46} {'cash':>8} {'float':>8} {'suspense':>8}")
    for n, (kind, w, amount, note) in enumerate(day, 1):
        x = amount * N
        fee = fee_for(x)
        result = "posted"
        try:
            if kind == "cash_in":
                post(db, f"op{n}", L.cash_in(w, x, commission_in(x)))
            elif kind in ("cash_out", "cash_out_timeout"):
                if cust_out.get(w, 0) + x > CUSTOMER_DAILY_CASH_OUT:
                    raise Refused("policy: customer daily cash-out limit")
                if agent_out + x > AGENT_DAILY_CASH_OUT:
                    raise Refused("policy: agent daily cash-out limit")
                legs = L.cash_out(w, x, fee, commission_out(fee)) if kind == "cash_out" else L.hold(w, x, fee)
                post(db, f"op{n}", legs)
                cust_out[w] = cust_out.get(w, 0) + x
                agent_out += x
                if kind == "cash_out_timeout":
                    result = "posted to suspense"
            elif kind == "resolve_reverse":
                legs = (L.release_to_customer(w, x, fee) if resolve == "reverse"
                        else L.release_to_agent(x, fee, commission_out(fee)))
                post(db, f"op{n}", legs)
                result = "released to customer" if resolve == "reverse" else "released to agent"
            elif kind == "cash_to_float":
                post(db, f"op{n}", L.cash_to_float(x))
            elif kind == "float_to_cash":
                post(db, f"op{n}", L.float_to_cash(x))
        except Refused as r:
            result = "REFUSED " + str(r).split(":")[0] + (": " + str(r).split(": ", 1)[1].split(" kobo")[0].split(" holds")[0] if str(r).startswith("insufficient") else "")
            if str(r).startswith("policy"):
                result = "REFUSED " + str(r)
        if verbose:
            print(f"{n:>2} {kind:<17} {w:<3} {amount:>8,}  {result:<46} {naira(held(db, 'agent_cash')):>8} "
                  f"{naira(held(db, 'agent_float')):>8} {naira(held(db, 'suspense')):>8}")
    return cust_out, agent_out


if __name__ == "__main__":
    funds = {"a": 80_000, "b": 60_000, "c": 100_000, "d": 30_000}
    db = open_day(funds)
    start = held(db, "agent_cash") + held(db, "agent_float")
    print(f"start of day: cash {naira(held(db, 'agent_cash'))}, float {naira(held(db, 'agent_float'))}, position {naira(start)} naira")
    run_day(db)
    end = held(db, "agent_cash") + held(db, "agent_float")
    commission = held(db, "commission_expense")
    left, right = trial_balance(db)
    print()
    print(f"trial balance: assets + expenses {left:,} kobo, liabilities + equity + income {right:,} kobo, equal: {left == right}")
    print(f"position: start {start:,} + commission {commission:,} = {start + commission:,}; end {end:,}; equal: {end == start + commission}")
    print(f"suspense at close: {held(db, 'suspense'):,} kobo")
    print(f"customer d holds {held(db, 'wallet:d'):,} kobo (funded with {funds['d'] * N:,})")
    print(f"postings {db.execute('SELECT COUNT(*) FROM postings').fetchone()[0]}, entries {db.execute('SELECT COUNT(*) FROM entries').fetchone()[0]}")
python3 agent_day.py
start of day: cash 100,000, float 150,000, position 250,000 naira
 # operation         who    naira  result                                             cash    float suspense
 1 cash_in           a     50,000  posted                                          150,000  100,100        0
 2 cash_in           b     40,000  posted                                          190,000   60,180        0
 3 cash_in           c     80,000  REFUSED insufficient_funds: agent_float         190,000   60,180        0
 4 cash_to_float     -    100,000  posted                                           90,000  160,180        0
 5 cash_in           c     80,000  posted                                          170,000   80,340        0
 6 cash_out          a     30,000  posted                                          140,000  110,460        0
 7 cash_out_timeout  d     20,000  posted to suspense                              140,000  110,460   20,100
 8 resolve_reverse   d     20,000  released to customer                            140,000  110,460        0
 9 cash_out          c     90,000  posted                                           50,000  200,640        0
10 cash_out          b     60,000  REFUSED insufficient_funds: agent_cash           50,000  200,640        0
11 cash_out          b    120,000  REFUSED policy: customer daily cash-out limit    50,000  200,640        0
12 float_to_cash     -     60,000  posted                                          110,000  140,640        0
13 cash_out          b     60,000  posted                                           50,000  200,820        0

trial balance: assets + expenses 51,082,000 kobo, liabilities + equity + income 51,082,000 kobo, equal: True
position: start 25,000,000 + commission 82,000 = 25,082,000; end 25,082,000; equal: True
suspense at close: 0 kobo
customer d holds 3,000,000 kobo (funded with 3,000,000)
postings 16, entries 63

Read the table down the cash and float columns. Operations 1 and 2 raise the drawer and lower the e-float. Operation 3 is refused: an ₦80,000 cash-in needs more e-float than the ₦60,180 left, and nothing is posted. Operation 4 turns ₦100,000 of cash into e-float. Operation 7 debits customer d ₦20,100 (the ₦20,000 and a ₦100 fee) into suspense and leaves the drawer and e-float alone; operation 8 releases it and suspense is back to zero. By operation 9 the drawer is down to ₦50,000 while the e-float has grown to ₦200,640, so operation 10, a ₦60,000 cash-out, is refused for want of notes. Operation 11 never reaches the ledger: customer b asks for ₦120,000, over the lab’s ₦100,000 daily limit for one customer, and the policy check says no first. Operation 12 sells e-float for cash and operation 13 serves customer b. The closing lines are the proofs. Both sides of the trial balance are 51,082,000 kobo. The position starts at 25,000,000 kobo (₦250,000) and the day’s commission is 82,000 kobo (₦820), so it must end at 25,082,000, and it does.

4. Break the resolution. Save this as agent_break.py. It runs the day twice. In both runs the agent did hand customer d the ₦20,000, so the drawer really holds what the “confirm” run says. One run settles operation 8 as a reversal, the other as a confirmed cash-out.

"""The timed-out cash-out, settled two ways. In fact the agent did hand d the cash."""
from agent_day import N, naira, open_day, run_day
from agent_ledger import held, trial_balance

FUNDS = {"a": 80_000, "b": 60_000, "c": 100_000, "d": 30_000}


def close(resolve):
    db = open_day(FUNDS)
    run_day(db, verbose=False, resolve=resolve)
    return db


truth = held(close("confirm"), "agent_cash")          # what the drawer really holds: the cash did leave it
for resolve in ("reverse", "confirm"):
    db = close(resolve)
    left, right = trial_balance(db)
    variance = truth - held(db, "agent_cash")
    print(f"resolved as {resolve:7}: trial balance equal {left == right}; suspense {held(db, 'suspense')}; "
          f"ledger cash {naira(held(db, 'agent_cash'))}, drawer {naira(truth)}, "
          f"drawer minus ledger {variance // N:,} naira; customer d holds {naira(held(db, 'wallet:d'))}")
python3 agent_break.py
resolved as reverse: trial balance equal True; suspense 0; ledger cash 50,000, drawer 30,000, drawer minus ledger -20,000 naira; customer d holds 30,000
resolved as confirm: trial balance equal True; suspense 0; ledger cash 30,000, drawer 30,000, drawer minus ledger 0 naira; customer d holds 9,900

Both ledgers balance and both close with suspense at zero. The reversal run is wrong all the same: customer d has the ₦30,000 back and the ₦20,000 in hand, the drawer is ₦20,000 short of the ledger, and the agent’s e-float was never credited for the notes. The confirm run leaves the drawer and the ledger in agreement, and customer d holds ₦9,900: ₦30,000 less the ₦20,000 and the ₦100 fee. A balanced trial balance does not say the evidence was read correctly.

5. Optional: cash-outs the size of the lab’s payouts. Save this as agent_sizes.py. It takes the first 25 succeeded payout_nip rows between ₦1,000 and ₦100,000, rounds each down to a whole ₦100, and runs them as cash-outs, one customer each, against a fresh agent.

"""Optional: cash-outs the size of the lab's payouts. Needs data/finance.sqlite."""
import sqlite3
from agent_day import N, fee_for, naira
import agent_day
from agent_ledger import held, new_ledger, post, trial_balance

db0 = sqlite3.connect("file:data/finance.sqlite?mode=ro", uri=True)
sizes = [k // 10_000 * 100 for (k,) in db0.execute(      # kobo -> whole naira, rounded down to a multiple of ₦100
    """SELECT amount_kobo FROM transactions WHERE kind = 'payout_nip' AND status = 'succeeded'
       AND amount_kobo BETWEEN 100000 AND 10000000 ORDER BY id LIMIT 25""")]
print("first sizes (naira):", sizes[:8], "... total", f"{sum(sizes):,}", "for", len(sizes))

wallets = {f"w{i}": 100_000 for i in range(len(sizes))}
db = new_ledger(list(wallets))
post(db, "open-cash", [("agent_cash", "debit", 100_000 * N), ("cash_control", "credit", 100_000 * N)])
post(db, "open-float", [("settlement_bank", "debit", 150_000 * N), ("agent_float", "credit", 150_000 * N)])
for w in wallets:
    post(db, f"fund-{w}", [("settlement_bank", "debit", 100_000 * N), (f"wallet:{w}", "credit", 100_000 * N)])
day = [("cash_out", f"w{i}", s, "") for i, s in enumerate(sizes)]
agent_day.run_day(db, day=day, verbose=False)
served = db.execute("SELECT COUNT(*) FROM postings WHERE label LIKE 'op%'").fetchone()[0]
print(f"served {served} of {len(day)} cash-outs; drawer {naira(held(db, 'agent_cash'))}, float {naira(held(db, 'agent_float'))}")
left, right = trial_balance(db)
print("trial balance equal:", left == right)
python3 agent_sizes.py
first sizes (naira): [29800, 9800, 2400, 19500, 19300, 5600, 1100, 94500] ... total 419,000 for 25
served 13 of 25 cash-outs; drawer 2,200, float 248,520
trial balance equal: True

The 25 sizes total ₦419,000, far more than the ₦100,000 drawer, so the ledger refuses each cash-out the drawer cannot cover when it arrives. It serves 13 of 25. The e-float is 248,520 naira: 150,000 plus the 97,800 handed out, plus 720 of commission.

Save break_cash_leg.py and run it. It takes the operation that pays a customer, cash_out, and removes the two legs that touch the drawer (cash_control and agent_cash). The posting still balances.

"""Break it: a cash-out that forgets the drawer. The trial balance cannot see it."""
import agent_day as D
import agent_ledger as L
from agent_ledger import held, trial_balance

original = L.cash_out
L.cash_out = lambda w, x, fee, c: [leg for leg in original(w, x, fee, c) if leg[0] not in ("cash_control", "agent_cash")]

db = D.open_day({"a": 80_000, "b": 60_000, "c": 100_000, "d": 30_000})
start = held(db, "agent_cash") + held(db, "agent_float")
D.run_day(db, verbose=False)
end = held(db, "agent_cash") + held(db, "agent_float")
commission = held(db, "commission_expense")
left, right = trial_balance(db)
print("trial balance equal:", left == right)
print(f"position: {start:,} + commission {commission:,} = {start + commission:,}; end {end:,}; equal: {end == start + commission}")
print(f"excess: {end - start - commission:,} kobo")
python3 break_cash_leg.py
trial balance equal: True
position: 25,000,000 + commission 82,000 = 25,082,000; end 43,082,000; equal: False
excess: 18,000,000 kobo

The trial balance is still equal, and it always will be, because each posting still balances. The position check fails by ₦180,000, the three cash-outs of ₦30,000, ₦90,000 and ₦60,000 in the day: the e-float rose each time and the drawer did not fall. Add a check to agent_day.py that stops the run when the position moves by more than the commission, and decide where in a real system it would run: after each posting, at close, or both.

ARTEFACT Write the agent float and monitoring procedure ~45 MIN
YOU PRODUCEAgent float and monitoring procedure

Template

# Agent float and monitoring procedure: <network or market>
Owner: <agent network manager> · Approved by: <head of operations> · Version <n> · Review by <date>
Decision needed: <what the approver is asked to sign off or fund>

## Purpose and scope
<Which agents, which two stocks, which products. What this procedure does not cover.>

## How float is funded and topped up
- Opening: cash <₦>, e-float <₦>, position <₦> (cash plus e-float)
- Cash to e-float: <who deposits, where, cut-off time, when it shows>
- E-float to cash: <who may ask, who releases, how it is recorded>
- Thresholds (our own choice, not a rule): warn below <₦> in either stock

## Daily checks, per agent
| Check | Source | When | Pass looks like |
|---|---|---|---|
| Cash and e-float against thresholds | <ledger> | <time> | |
| Position moved by commission only | <ledger> | <close> | |
| Cash-out pattern: size, count, repeats | <report> | <time> | |
| Failed terminal transactions and suspense | <log> | <time> | zero at close |

## Red flags and what each triggers
| Flag | Action | Who | Within |
|---|---|---|---|

## Escalation path
1. <Role>: <step>, within <time>
2. <Role>: <step>, within <time>

## Suspension and reinstatement
<Who may suspend, on what evidence, who approves reinstatement.>

## Where this could be wrong
<One way, and the figure or report that would show it.>
WORKED EXAMPLE

Nanre writes this for her Kano company’s market agents, and her company’s head of operations approves it. It uses the lab’s day for one agent. The agent opens with ₦100,000 in the drawer and ₦150,000 of e-float, a position of ₦250,000. The warning threshold, ₦70,000 in either stock, and the times and names below are the company’s own assumptions, not rules. Decision needed: sign the procedure and fund a float runner for the market.

Top-up. After operation 2 the e-float is ₦60,180, under the threshold, and at operation 3 the ₦80,000 cash-in is refused. The procedure says the agent calls the desk at the warning, and a supervisor approves a deposit that same morning. At operation 4 the agent deposits ₦100,000 of cash and the e-float becomes ₦160,180. At operation 9 the drawer is down to ₦50,000 and e-float is ₦200,640, so the cash side warns, and operation 12 sells ₦60,000 of e-float for cash.

Daily checks. Position at close must equal ₦250,000 plus the day’s commission of ₦820: ₦250,820, which the lab prints as 25,082,000 kobo. Suspense must be zero: operation 7 put ₦20,100 there, and operation 8 released it after the agent counted no cash given.

Red flags. A position that moves by more than commission: the lab’s broken run was ₦180,000 high, so any gap above ₦0 is a call the same day. Two refusals for lack of notes or float in one day, as at operations 3 and 10. Suspense open at close.

Escalation. Supervisor calls within one hour; the network manager reviews the same day; suspension needs the manager, and reinstatement needs the head of operations.

Where this could be wrong. The ₦70,000 threshold may fire too late for an agent whose cash-outs are large. Operations refused before the call would show it.

Now you

You are the network manager at a 20-person company in Aba with about 400 agents, most of them in a shoe market where customers cash out all day. The head of operations has asked for one float and monitoring procedure for those agents before the December rush, and will sign it. You have agent_sizes.py from step 5 (if you skipped it, these figures are enough): against an agent opening with ₦100,000 in the drawer and ₦150,000 of e-float, 25 cash-outs totalling ₦419,000 arrive, 13 are served, and the day ends with ₦2,200 in the drawer and ₦248,520 of e-float. Write the procedure. Choose your own thresholds and top-up times and say they are assumptions. Use break_cash_leg.py, whose position ended ₦180,000 too high, for your position check. Say who tops up, who calls, who suspends and who reinstates. The head of operations will read it to decide whether to fund a runner for the shoe market.

Self-check

DECIDE

Nanre's company manages about 3,000 agents. In one Kano market, 40 agents report that they run out of cash by noon on market days, while their e-float keeps growing. Customers are turned away at the stalls. Osaretin's ledgers show the pattern is steady: cash-outs outnumber cash-ins every market day. Nanre can change policy, tools or fees this month. What does she do first?

READING
  1. DOC
    Guidelines for the Operations of Agent Banking in Nigeria (CBN circular, 6 October 2025) Central Bank of Nigeria, 2025

    The CBN's current text, which this chapter knows only through search summaries. Read the definitions, the sections on exclusivity, location and dedicated accounts, and the limits. Note which provisions have their own start dates, because sources disagree on them.

  2. DOC
    Circular on Cash-out limits for Agent Banking Transactions (CBN, 17 December 2024) Central Bank of Nigeria, 2024

    The earlier circular that set a weekly cash-out cap per customer. Read it next to the 2025 Guidelines to see which limit replaced which; the short text is quicker than any summary.

  3. DOC
    Guidelines for the Regulation of Agent Banking and Agent Banking Relationships in Nigeria (CBN, 2013) Central Bank of Nigeria, 2013

    The original rules, which the CBN's 2025 circular says it supersedes. Read it for how the principal and agent relationship was first defined, and as a comparison with what changed. Do not use it for current limits.

  4. DOC
    Guidelines on Operations of Electronic Payment Channels in Nigeria (CBN, 2020) Central Bank of Nigeria, 2020

    The text for POS terminals and the handling of failed POS transactions. Read the POS and dispute sections to settle the 48-hour and 72-hour question that the sources disagree on.

  5. DOC
    Agent Management Toolkit: Building a Viable Network of Branchless Banking Agents (CGAP) CGAP

    CGAP's technical guide, based on interviews with agents and network managers in Brazil, India and Kenya. Read it for how networks recruit, fund and monitor agents, and how they manage liquidity. Skip the financial model unless you build a business case.

  6. DOC
    Liquidity: solving agents' perennial problem (MicroSave, 2017) Nancy Kiarie and Graham Wright, MicroSave, 2017

    A short consultancy post on why agents run out of cash or e-float and how monitoring and super-agent rebalancing help. It is a practitioner view, not a rule, so treat its claims as one network operator's experience.

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: Direct debit and mandates →