SME lending products: invoice finance, supply-chain finance and revenue-based financing
A term loan promises fixed payments out of whatever the business earns. The other SME products tie repayment to something else: a buyer's payment, an anchor's credit, a slice of sales. Each moves risk, and each hides its cost in a different place
A merchant takes a revenue-based financing advance of ₦407,000. It repays 8% of every day's wallet inflow until ₦488,400 (1.20 times the advance) has been paid. At the merchant's recent sales, that takes about 89 days. Sales then fall by half and stay there. What happens?
Module 1 taught you the four consumer and small-business products of Owoleaf’s book, and loan products showed how each is repaid. Credit analysis read a merchant’s cash flow to size an instalment. This chapter widens the menu. A business that needs working capital can be offered five different promises, and each one answers differently the question every lender must answer first: who repays, and from what?
The lab runs on Owoleaf’s merchants and their wallet inflows. Tallowmere and Crustwell are the examples in the prose. The invoice figures and the distributor figures are illustrative, labelled so in the code or the text, and no product here is an offer or a recommendation.
Who repays, and from what
A term loan is repaid by the borrower out of the business’s general cash flow, on fixed dates. You met it as the lab’s SME product: 3.5% a month on the reducing balance, a 1.5% fee taken at disbursement, equal instalments. The promise is fixed. The cash is not.
The other products change the source of repayment.
| Product | Repaid by | From what | Who carries a bad month | Where the cost hides |
|---|---|---|---|---|
| SME term loan | The business | General cash flow, on fixed dates | The business | In the fee and the rate: an APR from interest, APR, fees and amortisation shows it |
| Invoice finance or factoring | The business’s customer (the buyer) | Payment of one invoice | Shared: the supplier under recourse, the lender if non-recourse | In the discount fee, which runs for as long as the buyer is slow |
| Supply-chain finance (reverse factoring) | The anchor buyer | Its approved payables, on their due dates | The anchor’s credit | In the discount, which looks small because the anchor’s credit is strong |
| Merchant cash advance (MCA) | The merchant, by a share of sales | Card or wallet takings, daily | The lender: payments fall with sales | In the factor rate, which has no time in it |
| Revenue-based financing (RBF) | The merchant, by a share of revenue | Revenue, until a cap is reached | The lender | In the cap multiple, for the same reason |
Two things are worth seeing before the detail. First, only the term loan puts the whole risk of a weak month on the borrower. That is why it needs the credit analysis of the previous chapter. Second, every other product replaces a promise to pay with an arrangement that makes payment more likely or more flexible: money from a named buyer, a stronger name, or a slice of sales taken before the merchant sees them. Each arrangement works only while its mechanism holds, and the failure of the mechanism is the credit risk.
Invoice finance and factoring
A supplier sells on credit. It raises an invoice, ships the goods and waits for the buyer to pay, perhaps for 60 days. In that wait it has paid its staff and suppliers and has no cash. Invoice finance gives the supplier most of the invoice’s value now, against the buyer’s later payment.
Two forms are common, and the names are used loosely, so check which is meant:
- Invoice discounting. The supplier keeps collecting from its buyer, and the buyer may not know. The lender advances against the invoice and the supplier repays when the buyer pays.
- Factoring. The lender, called the factor, takes over collection. The buyer is told (this is called notification) and pays the factor directly. Some factors also take over the sales ledger and the risk of non-payment.
The mechanics are the same in both. Take Tallowmere’s invoice of ₦6,000,000 to a clinic group. The lender pays an advance of 80%, which is ₦4,800,000. It charges a discount fee on the money advanced for as long as it is outstanding: here 2.5% for each 30 days, accrued daily. When the buyer pays, the lender takes back the advance and the fee and releases the balance, the rebate, to the supplier.
Where the advance rate comes from
The lender does not advance 100%, because the buyer will not always pay the face value. The gap is dilution: the share of an invoice that never turns into cash because of credit notes (a supplier’s written reduction of an invoice), returns, discounts or disputes. The advance rate has to leave room for the worst dilution and for the fees that will accrue, or the lender is advancing against cash that will not arrive.
The lab uses eight invoices from Tallowmere’s history with the clinic group (illustrative). Their face value adds to ₦42,500,000 and credit notes to ₦1,143,000: overall dilution is 1,143,000 ÷ 42,500,000 = 2.69%. The worst single invoice, ₦4,800,000 of face value, lost ₦480,000, which is 10%, and it was also the slowest, paid on day 90. A lender that sizes on the average (2.69%) leaves no room for a month like that. A prudent ceiling works from the worst case: 100% less 10% worst dilution less a fee reserve of 7.5% for a 90-day invoice (2.5% × 3) is 82.5%, so an advance rate of 80% is below the ceiling. The reserve applies the fee rate to the whole face value, which is a little more than the fee on the advance alone, so the ceiling is deliberately cautious. The reasoning is the lender’s, and so is the arithmetic you can redo.
What the fee does when the buyer is slow
A fee that accrues daily is a price on time. For a 60-day payment on ₦4,800,000 at 2.5% per 30 days, the fee is 4,800,000 × 2.5% × 2 = ₦240,000, and the rebate is 6,000,000 − 4,800,000 − 240,000 = ₦960,000. If the buyer pays on day 90, the fee is ₦360,000 and the rebate ₦840,000; on day 120, ₦480,000 and ₦720,000. The supplier’s cost of finance rises with the buyer’s slowness, which the supplier does not control. That is an ordinary feature of the product, and a supplier who budgets on the 60-day figure has made the same error as Azuka’s customer.
Recourse, and what happens when the buyer does not pay
With recourse, the supplier must repay the advance and fees if the buyer does not pay. The lender’s risk is then mostly the supplier’s, and the buyer’s credit matters less. With non-recourse the lender bears the buyer’s non-payment, usually only where the buyer is approved in advance and only for credit reasons, not for disputes. The lender then needs a credit view of the buyer, a limit per buyer and a price that carries the loss. If the clinic group never pays and fees run 120 days, ₦5,280,000 is owed: ₦4,800,000 advance and ₦480,000 fees. Under recourse that is Tallowmere’s debt. Under non-recourse it is the lender’s loss.
How it goes wrong
Four failures recur, and each is a gap between the invoice on paper and the cash in fact.
- Dilution above the allowance. A credit note or a dispute cuts the invoice below the advance plus fees. The supplier owes the difference, and a small supplier may not have it.
- A false or duplicated invoice. The same invoice financed with two lenders, or an invoice for goods never delivered. Verify with the buyer, and look in the registers described below. The lending fraud chapter in this module treats these cases in depth.
- Concentration. One buyer is most of the book. If that buyer is slow, every invoice is slow together.
- Diverted payment. The buyer pays the supplier’s other account, and the supplier spends it. A lender that does not control the collection account has only a promise.
Supply-chain finance: the anchor’s credit
Supply-chain finance (SCF) means a set of techniques that use the strength of a large buyer to finance its suppliers or its distributors. The buyer is the anchor.
The best-known form is reverse factoring. The anchor approves its suppliers’ invoices for payment on a due date. A lender then offers each supplier early payment, at a discount priced on the anchor’s credit and not the supplier’s. Take an unnamed packaging supplier to Crustwell, with an approved invoice of ₦10,000,000 due on day 90. If the lender pays on day 10 at 1.5% for each 30 days on the face value (illustrative), the discount is 10,000,000 × 1.5% × 80 ÷ 30 = ₦400,000, and the supplier receives ₦9,600,000. Crustwell pays the lender ₦10,000,000 on day 90. The supplier pays for liquidity at a rate set by the anchor’s credit: usually cheaper than the supplier could borrow on its own credit, which is the point of the technique, and the lender’s risk is Crustwell’s risk.
The second form runs the other way, and Crustwell’s own distributors use it. Crustwell’s distributors prepay before the warehouse releases stock, each through its own virtual account (a bank account number issued to one payer, see transfers and virtual accounts). A lender can fund that prepayment: the money goes straight from the lender to the distributor’s virtual account and so to Crustwell, and the distributor repays the lender from what it sells. This is distributor finance. It has a useful property: the loan’s proceeds cannot be diverted, because they never reach the distributor’s own account. It has a failure mode that the arithmetic exposes.
Bolade’s facility is ₦20,000,000 for 30 days (illustrative). His stock sells evenly over 21 days, and his retail customers pay 14 days after they buy. Cash from the first sale arrives on day 14, from the last on day 35. By day 30 he has collected the sales made up to day 16: 16 ÷ 21 of the stock, which is 20,000,000 × 16 ÷ 21 = ₦15,238,095 at cost, ignoring his margin, which would narrow the gap only a little. He is ₦4,761,905 short when the facility falls due. He can repay only by drawing a new facility to cover the old one. A lender that sees a 30-day facility repaid on time every month may be looking at a loan that is renewed, not repaid, and has never seen the stock sell. The tenor of the facility has to be longer than the time the whole stock takes to turn back into cash: the days from paying for stock to collecting for the last of it (the cash conversion cycle, the subject of reading SME statements). Here that is 21 + 14 = 35 days against a 30-day tenor.
Crustwell can help in ways a lender cannot do alone: it holds the orders data, sees what each distributor takes and when, and can agree to buy back unsold stock. That makes it an anchor, and also a concentration: the lender is exposed to Crustwell’s behaviour as well as to each distributor’s. One more risk is built in. A manufacturer that pushes stock onto distributors to hit a target is stuffing the channel, and a facility that funds the stuffing is financing stock that will not sell.
Merchant cash advance and revenue-based financing
A merchant cash advance (MCA) pays a merchant a lump sum in exchange for a fixed amount of its future sales, taken as a holdback: a percentage of each day’s takings, held back at source. Revenue-based financing (RBF) is the same idea under another name, usually for businesses with recurring revenue: a share of revenue until a cap, a fixed multiple of the advance, has been repaid. The two names overlap, and a contract’s terms matter more than its title. Both differ from a loan in three ways:
- There is no instalment and no due date.
- The price is a multiple. A factor rate of 1.20 means the merchant repays ₦1.20 for each ₦1 advanced.
- The payback time depends on the merchant’s sales.
An Owoleaf-style wallet makes the holdback easy to operate, because the lender can split each inflow as it arrives. The lab’s offer, all illustrative: an advance of 20% of the merchant’s recent 30-day inflow, a cap of 1.20 times the advance, a holdback of 8% of each day’s inflow. The quoted payback is cap ÷ (holdback × daily inflow). With the advance set at 20% of a month’s inflow, that is 1.20 × 0.20 ÷ 0.08 × 30 = 90 days for every merchant, whatever its size. In the lab the advance is rounded down to the nearest ₦1,000 and sized from 28 days of history, so the quoted figure comes out a day or so under 90 (89 for the merchant followed below). That figure is a forecast, and the replay in the lab tests it against what the merchants’ wallets actually did.
The cost is in the speed
The cap fixes the cost in naira: ₦81,400 on ₦407,000 for the merchant in the middle of the lab’s repayment times (its advance is above the cohort’s median of ₦176,000), at any speed. The annual rate depends on how fast the money comes back. The merchant pays from day one, so the balance falls every day, and the average money outstanding is a fraction of the advance. Repaid over 86 days, that merchant’s effective annual rate is 421%. Paid as one lump on day 86 the same ₦488,400 would be 117% a year. The difference is the repayment starting on day one. A factor of 1.20 sounds like 20%; it is not 20% a year. Compare these products on the cost in naira and the effective annual rate, and expect the annual rate to be high when the money comes back fast. If the merchant’s sales double, the cost in naira stays the same and the annual rate rises again.
Who carries a weak month
The same fixed instalment that makes a term loan a fixed promise makes it fragile. For that same merchant, the third 30-day window’s inflow is ₦1,706,915 against ₦2,318,039 in the second. At an assumed margin of 10% (illustrative, the convention of the credit analysis chapter), a term loan’s instalment of ₦145,272.21 gives a debt service coverage ratio (cash available divided by the instalment) of 1.17 in the weak window and 1.60 in the strong one. The RBF’s holdback is 8% of inflow in every window, so its coverage against the same margin is 10 ÷ 8 = 1.25 in every full window. The weak month costs the merchant less cash, and the cost moves to the lender, who waits longer.
On the whole cohort, that matters: 61 of 169 merchants would have had a window where 10% of inflow was below the term loan’s instalment. The RBF never asks a merchant to pay more than 8% of what it took in.
Monitoring without a due date
A term loan has days past due. An RBF has none: a merchant whose sales stop pays nothing, and owes nothing late. The lender’s alarm is the pace: cumulative repayment against the quoted schedule. In the lab, 10 of 169 merchants had repaid less than half the quoted pace by day 60. The reading is a prompt to look: sales may have fallen, the merchant may have moved sales to another account to avoid the holdback, or the season may have turned. That last risk, diversion, is the product’s weak point. The holdback bites only on the inflows the lender can see. A lender that offers RBF must watch the share of the merchant’s trade that still passes through the wallet.
Holdback against margin is the other trap. A holdback of 8% of revenue costs a merchant that earns a 10% margin most of its profit for the period. The advance has to earn its own return, in stock sold or a machine paid for, for the merchant to be better off.
Choosing a structure is an analysis, not a menu
Start from the need and the evidence, in this order:
- What is the cash gap, and when does it close? A gap that closes when a named buyer pays is an invoice-finance gap. A gap that closes when stock sells is a stock-cycle gap, and the tenor must be longer than the cycle. A gap with no event that closes it is a funding need for a term loan or equity.
- Who actually pays, and can the lender see them? An approved anchor, a verified buyer, a wallet the lender controls: each is a source of repayment that exists apart from the borrower’s promise.
- Is the cash flow volatile? The more volatile the sales, the more a fixed instalment hurts, and the more a flexible product moves the cost to the lender. The lender then needs a price and a monitoring system that carry it.
- What can go wrong with the mechanism? Dilution, diversion, stuffing, concentration. A product is only as strong as the mechanism that sends the money.
None of these steps says which product to buy. They tell you what each structure would have to be true to work.
What the rules say, and what this build could not confirm
The rules for lenders that buy receivables are not settled in the sources this build found, and those sources are secondary. Search summaries of the Central Bank of Nigeria’s Revised Guidelines for Finance Companies (2014) say they list debt factoring, meaning buying a client’s receivables at a discount and collecting them, among the permitted activities of a finance company licensed by the CBN, which may not take depositsas of 2026-11. A law-firm commentary from 2022 says Nigeria then had no single legal and regulatory framework for debt factoring and that a factoring bill was before the legislatureas of 2026-11. This build did not read the Guidelines in full and could not confirm whether the bill has since become law, or whether a licence is required for every kind of receivables purchase, so check the CBN’s own site before you rely on any of this.
On registering a claim against receivables, search results say the Secured Transactions in Movable Assets Act 2017 covers accounts receivable among movable assets, that a security interest is perfected by filing a financing statement with the National Collateral Registry, and that the registry sits at the CBNas of 2026-11. Those points rest on search summaries and law-firm notes, not on a reading of the Act’s sections or the registry’s procedure and fees. The Act’s gazetted text is in the reading list. The registry gets a fuller treatment in secured lending and collateral, the chapter before this one in the module, which also reports law-firm commentary on how registration at the registry sits alongside registration at the Corporate Affairs Commission. A lender should also ask a lawyer whether a company charge must be registered separately at the Corporate Affairs Commission. This chapter does not state that rule.
The common vocabulary is better settled. The International Chamber of Commerce (ICC), with industry bodies, published standard definitions for supply-chain finance techniques in 2016; search summaries say they sort techniques into receivables purchase, loan or advance-based, and enabling framework, with payables finance, the buyer-led technique this chapter calls reverse factoring, under receivables purchaseas of 2026-11. The terms you meet in a term sheet may still be used loosely, so read what the contract does.
Two questions are left for module 4 and are not answered here: what licence a wallet company needs to advance money against future sales or to buy invoices, and whether an MCA or RBF is a loan in law. A product’s name in a contract does not settle either. Earlier chapters used the FCCPC’s digital lending regulations; whether they reach a company’s invoice or a merchant’s advance is not settled here.
When it goes wrong
- Pricing on the quoted timing. The 60-day invoice that pays on day 90, the 89-day RBF that takes 180, the 30-day facility on a 35-day cycle. Price and monitor the slow case.
- Reading a factor rate as a rate. Compare on naira cost and effective annual rate.
- Counting the same invoice, or the same sale, twice. Two lenders on one receivable; one wallet’s inflows promised to two RBF lenders.
- No control of the cash. An invoice financed without control of the collection account; a holdback on a wallet the merchant can leave.
- No alarm. A product with no due date and no pace report is a loan nobody is watching.
You work in labs/finance against data1/finance.sqlite (scale 1, seed 42): 1,520 merchants and their wallet inflows. The wallet data covers 180 days from 1 January 2026, so the last day with any inflow is 29 June, and that sets the design. You act as a lender who offers every merchant an RBF on 1 March 2026 and then replays what the merchants’ wallets did from then to 30 June, 122 days (the last has no data). Every term is illustrative.
1. Build the scale-1 book if you have not, check it, and save the helper module. Money stays in integer kobo until naira() prints it. Floats appear only in rates.
cd labs/finance
ls data1/finance.sqlite 2>/dev/null || (python3 generate.py --scale 1 --out data1 && python3 loans.py --out data1 \
&& python3 cards.py --out data1 && python3 collect.py --out data1 && python3 book3.py --out data1)
python3 check.py --db data1/finance.sqlite | tail -1
cat > smeprod.py <<'PY'
"""Helpers for the SME lending products lab. Standard library only. Money is integer kobo.
Every term below is ILLUSTRATIVE: not any lender's, and not a rule."""
import sqlite3
from datetime import date, timedelta
DB = "data1/finance.sqlite"
OFFER_DATE = date(2026, 3, 1) # the day the offer is made
LAST_DAY = date(2026, 6, 30) # the replay ends here (the wallet's last day with data is 29 June)
HISTORY_DAYS = 28 # wallet history the offer is sized on
ADVANCE_BPS = 2000 # advance = 20% of the trailing monthly inflow
CAP_BPS = 12000 # the merchant repays 1.20 x the advance, no more
HOLDBACK_BPS = 800 # 8% of every day's inflow goes to the lender
MARGIN_BPS = 1000 # assumed 10% margin, as in credit analysis (illustrative)
def naira(kobo):
sign = "-" if kobo < 0 else ""
kobo = abs(kobo)
return f"{sign}₦{kobo // 100:,}.{kobo % 100:02d}"
def connect():
db = sqlite3.connect(DB)
db.row_factory = sqlite3.Row
return db
def inflows_by_day(db, customer_id):
"""Succeeded bank-transfer and card fundings per day, the whole wallet history."""
out = {}
for day, kobo in db.execute("""
SELECT substr(created_at, 1, 10), SUM(amount_kobo) FROM transactions
WHERE customer_id = ? AND status = 'succeeded'
AND kind IN ('funding_transfer', 'funding_card') GROUP BY 1""", (customer_id,)):
out[date.fromisoformat(day)] = kobo
return out
def offer(inflow):
"""Size the offer from the 28 days before OFFER_DATE. Returns (monthly, advance, cap)."""
trailing = sum(inflow.get(OFFER_DATE - timedelta(days=i), 0) for i in range(1, HISTORY_DAYS + 1))
monthly = trailing * 30 // HISTORY_DAYS
advance = monthly * ADVANCE_BPS // 10000 // 100000 * 100000 # down to the nearest ₦1,000
return monthly, advance, advance * CAP_BPS // 10000
def cohort(db):
"""Merchants with the full 28 days of history before OFFER_DATE and an advance of at least ₦50,000."""
out = []
for r in db.execute("""SELECT id, ref FROM customers WHERE kind = 'merchant'
AND substr(signup_at, 1, 10) <= ? ORDER BY id""",
((OFFER_DATE - timedelta(days=HISTORY_DAYS)).isoformat(),)):
inflow = inflows_by_day(db, r["id"])
monthly, advance, cap = offer(inflow)
if advance >= 5_000_000:
out.append(dict(id=r["id"], ref=r["ref"], inflow=inflow, monthly=monthly, advance=advance, cap=cap))
return out
def rbf_replay(inflow, cap, holdback_bps=HOLDBACK_BPS, scale_bps=10000):
"""Each day from OFFER_DATE, the lender keeps holdback_bps of that day's inflow until `cap` is
repaid. scale_bps rescales the inflows (5000 = sales halve). Returns daily rows
(day number from 1, inflow, payment, total paid) and the day the cap was reached, or None."""
paid, rows, done = 0, [], None
for i in range((LAST_DAY - OFFER_DATE).days + 1):
day = OFFER_DATE + timedelta(days=i)
got = inflow.get(day, 0) * scale_bps // 10000
pay = min(got * holdback_bps // 10000, cap - paid)
paid += pay
rows.append((i + 1, got, pay, paid))
if paid >= cap:
done = i + 1
break
return rows, done
def annual_rate(flows):
"""Effective annual rate from (day, kobo) flows (negative = money out), by bisection on the
daily rate, then compounded over 365 days. Floats here are a rate, never money."""
lo, hi = 0.0, 1.0
for _ in range(200):
mid = (lo + hi) / 2
if sum(k / (1 + mid) ** t for t, k in flows) > 0:
lo = mid
else:
hi = mid
return (1 + mid) ** 365 - 1
def rbf_flows(advance, rows):
return [(0, -advance)] + [(d, p) for d, _, p, _ in rows if p]
def term_loan(principal, rate_bps=350, fee_bps=150, n=3, period=30):
"""The lab's SME term loan: fee taken at disbursement, equal instalments on a reducing
balance, as loans.py does. Returns (net paid out, instalment, [(day, instalment)])."""
fee = round(principal * fee_bps / 10000)
r = rate_bps / 10000
inst = round(principal * r / (1 - (1 + r) ** -n))
return principal - fee, inst, [(period * k, inst) for k in range(1, n + 1)]
def window_inflows(inflow, windows=3, length=30):
"""Inflow in each 30-day window after OFFER_DATE."""
return [sum(inflow.get(OFFER_DATE + timedelta(days=w * length + i), 0) for i in range(length))
for w in range(windows)]
def with_replays(cohort_rows):
"""Add the RBF replay to every merchant: `rows` (daily) and `done` (the day the cap was reached)."""
for m in cohort_rows:
m["rows"], m["done"] = rbf_replay(m["inflow"], m["cap"])
return cohort_rows
def median_merchant(cohort_rows):
"""The merchant in the middle of those that repaid in full, ordered by days to repay."""
repaid = sorted((m["done"], m["id"]) for m in cohort_rows if m["done"])
pick = repaid[len(repaid) // 2][1]
return next(m for m in cohort_rows if m["id"] == pick)
PYOK: all invariants holdIf the first line is slow, it is building the book. If check.py fails, rebuild data1 with the README’s commands.
2. Find the cohort. Keep merchants with the full 28 days of history before the offer and an advance of at least ₦50,000. Four weeks is thin: credit analysis asked for three windows. The wallet data is only 180 days long, so a longer history would leave too little to replay. Treat the result as a test of what a short history can forecast.
python3 - <<'PY'
import statistics
from smeprod import *
db = connect()
c = with_replays(cohort(db))
adv = sorted(m["advance"] for m in c)
print(f"{len(c)} merchants have at least {HISTORY_DAYS} days of wallet history before {OFFER_DATE} and an advance of at least ₦50,000")
print("advance: lowest", naira(adv[0]), "| median", naira(statistics.median(adv)), "| highest", naira(adv[-1]))
m = median_merchant(c)
print("the merchant in the middle of the repayment times:", m["ref"], f"(repaid in {m['done']} days)")
PY169 merchants have at least 28 days of wallet history before 2026-03-01 and an advance of at least ₦50,000
advance: lowest ₦50,000.00 | median ₦176,000.00 | highest ₦2,627,000.00
the merchant in the middle of the repayment times: C0013641 (repaid in 86 days)The advances are small, because each is 20% of a month’s inflow. The merchant in the middle of the repayment times, whose advance is above the median, is the one you follow.
3. Build the RBF schedule for that merchant. The quoted payback comes from the offer terms alone. The replay then takes 8% of each day’s actual inflow until the cap is reached.
python3 - <<'PY'
from smeprod import *
db = connect()
c = with_replays(cohort(db))
m = median_merchant(c)
print(f"merchant {m['ref']}: 30-day inflow before the offer {naira(m['monthly'])}")
print(f"advance {naira(m['advance'])}, cap {naira(m['cap'])} (cost {naira(m['cap'] - m['advance'])}), holdback {HOLDBACK_BPS / 100:.0f}% of daily inflow")
quoted = m["cap"] * 30 * 10000 // (HOLDBACK_BPS * m["monthly"])
print(f"quoted payback: {m['cap']} kobo / (0.08 x {m['monthly'] // 30} kobo a day) = {quoted} days")
print("week inflow held back paid so far still owed")
rows = m["rows"]
for w in range(0, len(rows), 7):
chunk = rows[w:w + 7]
if (w // 7) % 2 == 0 or chunk[-1][3] >= m["cap"]:
print(f"{w // 7 + 1:>4} {naira(sum(r[1] for r in chunk)):>16} {naira(sum(r[2] for r in chunk)):>14} {naira(chunk[-1][3]):>14} {naira(m['cap'] - chunk[-1][3]):>14}")
print("cap reached on day", m["done"], "of the replay; rows kept:", len(rows))
print("effective annual rate on the advance: %.0f%%" % (100 * annual_rate(rbf_flows(m["advance"], rows))))
lump = (m["cap"] / m["advance"]) ** (365 / m["done"]) - 1
print("for comparison, the whole cap paid in one lump on day %d would be %.0f%% a year" % (m["done"], 100 * lump))
PYmerchant C0013641: 30-day inflow before the offer ₦2,037,211.07
advance ₦407,000.00, cap ₦488,400.00 (cost ₦81,400.00), holdback 8% of daily inflow
quoted payback: 48840000 kobo / (0.08 x 6790703 kobo a day) = 89 days
week inflow held back paid so far still owed
1 ₦499,385.00 ₦39,950.80 ₦39,950.80 ₦448,449.20
3 ₦530,788.00 ₦42,463.04 ₦117,154.32 ₦371,245.68
5 ₦391,329.00 ₦31,306.32 ₦202,258.96 ₦286,141.04
7 ₦667,364.00 ₦53,389.12 ₦305,529.36 ₦182,870.64
9 ₦719,959.00 ₦57,596.72 ₦392,321.60 ₦96,078.40
11 ₦580,291.00 ₦46,423.28 ₦451,972.80 ₦36,427.20
13 ₦262,019.00 ₦15,273.92 ₦488,400.00 ₦0.00
cap reached on day 86 of the replay; rows kept: 86
effective annual rate on the advance: 421%
for comparison, the whole cap paid in one lump on day 86 would be 117% a yearThe quoted payback is 89 days (cap ÷ the daily holdback at the recent rate, rounded down), and the replay took 86. The cost is ₦81,400 whatever the speed: 488,400 − 407,000. The weeks shown are the odd-numbered ones and the last. The annual rate is 421% because money comes back from day one. The lump-sum figure, 1.2^(365 ÷ 86) − 1 = 117%, is what the same cost would be if nothing came back until day 86.
4. Compare with an SME term loan on the same advance. The term loan uses the lab’s SME terms: 3.5% a month on the reducing balance, 1.5% fee taken at disbursement, three 30-day instalments. The coverage columns divide 10% of each 30-day window’s inflow (an assumed margin) by what the merchant pays in that window.
python3 - <<'PY'
from smeprod import *
db = connect()
c = with_replays(cohort(db))
m = median_merchant(c)
net, inst, plan = term_loan(m["advance"])
fee = m["advance"] - net
print(f"term loan on the same {naira(m['advance'])}: fee {naira(fee)}, paid out {naira(net)}, 3 instalments of {naira(inst)}")
total = inst * 3
print(f"total repaid {naira(total)}; cost {naira(total - net)} against the RBF's {naira(m['cap'] - m['advance'])}")
print("effective annual rate: term loan %.0f%%, RBF %.0f%%" % (
100 * annual_rate([(0, -net)] + plan), 100 * annual_rate(rbf_flows(m["advance"], m["rows"]))))
print()
print("window inflow 10% margin term instalment DSCR RBF paid DSCR")
paid_by_window = [sum(r[2] for r in m["rows"][w * 30:(w + 1) * 30]) for w in range(3)]
for w, inflow in enumerate(window_inflows(m["inflow"])):
cash = inflow * MARGIN_BPS // 10000
print(f"{w + 1:>6} {naira(inflow):>14} {naira(cash):>13} {naira(inst):>15} {cash / inst:>4.2f} {naira(paid_by_window[w]):>13} {cash / paid_by_window[w]:>4.2f}")
print()
rows, done = rbf_replay(m["inflow"], m["cap"], scale_bps=5000)
print("sales halve: the term loan's instalment is unchanged;", f"the RBF's {naira(m['cap'])} is repaid on day {done}" if done else "the RBF is not repaid by 30 June")
print("RBF paid by 30 June, sales halved:", naira(rows[-1][3]), "of", naira(m["cap"]))
PYterm loan on the same ₦407,000.00: fee ₦6,105.00, paid out ₦400,895.00, 3 instalments of ₦145,272.21
total repaid ₦435,816.63; cost ₦34,921.63 against the RBF's ₦81,400.00
effective annual rate: term loan 67%, RBF 421%
window inflow 10% margin term instalment DSCR RBF paid DSCR
1 ₦2,245,260.00 ₦224,526.00 ₦145,272.21 1.55 ₦179,620.80 1.25
2 ₦2,318,039.00 ₦231,803.90 ₦145,272.21 1.60 ₦185,443.12 1.25
3 ₦1,706,915.00 ₦170,691.50 ₦145,272.21 1.17 ₦123,336.08 1.38
sales halve: the term loan's instalment is unchanged; the RBF is not repaid by 30 June
RBF paid by 30 June, sales halved: ₦320,140.96 of ₦488,400.00Check by hand: the fee is 407,000 × 1.5% = ₦6,105; the instalment is 407,000 × 0.035 ÷ (1 − 1.035⁻³) = ₦145,272.21. The term loan costs less in naira here (₦34,921.63 against ₦81,400.00) because the lab’s RBF terms (cap 1.20) are an assumption, not a market price. The term loan’s coverage falls to 1.17 in the weak window; the RBF’s holds at 1.25 whenever it is collecting. When sales halve, the term instalment is unchanged, and the RBF is still owed ₦168,259.04 on 30 June (488,400.00 − 320,140.96).
5. Run the whole cohort. How wrong is a four-week forecast, who has fallen behind, and how many merchants would have found the term loan’s instalment too heavy in some window?
python3 - <<'PY'
import statistics
from smeprod import *
db = connect()
c = cohort(db)
n = len(c)
days, owed, cap_all, weak, behind, rates = [], 0, 0, 0, 0, []
for m in with_replays(c):
rows, done = m["rows"], m["done"]
cap_all += m["cap"]
if done:
days.append(done)
rates.append(annual_rate(rbf_flows(m["advance"], rows)))
else:
owed += m["cap"] - rows[-1][3]
# pace: at day 60 the quoted schedule has repaid 60/90 of the cap
paid60 = rows[59][3] if len(rows) >= 60 else m["cap"]
if paid60 * 90 * 2 < m["cap"] * 60:
behind += 1
_, inst, _ = term_loan(m["advance"])
if any(w_in * MARGIN_BPS // 10000 < inst for w_in in window_inflows(m["inflow"])):
weak += 1
q = statistics.quantiles(days, n=4)
print(f"{n} merchants offered an RBF on {OFFER_DATE}; replay to {LAST_DAY} ({(LAST_DAY - OFFER_DATE).days + 1} days)")
print(f"repaid in full: {len(days)}; not repaid by {LAST_DAY}: {n - len(days)} (owing {naira(owed)} of {naira(cap_all)} of caps)")
print(f"days to repay (quoted: about 90): fastest {min(days)}, quartiles {q[0]:.0f} / {q[1]:.0f} / {q[2]:.0f}, slowest {max(days)}")
rq = statistics.quantiles(rates, n=4)
print("effective annual rate of the RBFs repaid: lowest %.0f%%, median %.0f%%, highest %.0f%%" % (100 * min(rates), 100 * rq[1], 100 * max(rates)))
print(f"at day 60, less than half the quoted pace repaid: {behind} merchants")
print(f"term loan on the same advance: DSCR below 1.00 in at least one of three windows for {weak} merchants (10% margin assumed)")
PY169 merchants offered an RBF on 2026-03-01; replay to 2026-06-30 (122 days)
repaid in full: 135; not repaid by 2026-06-30: 34 (owing ₦1,310,241.68 of ₦64,318,800.00 of caps)
days to repay (quoted: about 90): fastest 28, quartiles 73 / 86 / 97, slowest 121
effective annual rate of the RBFs repaid: lowest 190%, median 381%, highest 99378%
at day 60, less than half the quoted pace repaid: 10 merchants
term loan on the same advance: DSCR below 1.00 in at least one of three windows for 61 merchants (10% margin assumed)The quoted 90 days is the middle of the distribution (median 86) but the spread is wide: from 28 to 121 days, so the lender’s return, and the merchant’s annual rate, vary by orders of magnitude (190% to 99,378%) on identical terms. Thirty-four merchants had not repaid by 30 June, owing ₦1,310,241.68 in all. The generator does not tie wallet inflows to loan defaults, so this replay shows how the holdback behaves with ordinary sales noise. It does not show a collapse in sales or a diversion of sales away from the wallet.
6. Price an invoice advance. Eight of Tallowmere’s invoices to the clinic group (illustrative) give the dilution and the advance-rate ceiling; then one ₦6,000,000 invoice is settled five ways.
python3 - <<'PY'
from smeprod import naira, annual_rate
# ILLUSTRATIVE history of Tallowmere's invoices to one clinic group on 60-day terms:
# (face, credit notes issued against it, days from invoice to payment), all in kobo.
HISTORY = [(420_000_000, 0, 58), (600_000_000, 30_000_000, 63), (350_000_000, 0, 61),
(510_000_000, 25_500_000, 72), (720_000_000, 0, 55), (480_000_000, 48_000_000, 90),
(630_000_000, 0, 66), (540_000_000, 10_800_000, 60)]
FEE_BPS_30D = 250 # 2.5% of the amount advanced for each 30 days it is outstanding
face = sum(h[0] for h in HISTORY)
credit = sum(h[1] for h in HISTORY)
worst_bps = max(h[1] * 10000 // h[0] for h in HISTORY)
slowest = max(h[2] for h in HISTORY)
print(f"{len(HISTORY)} invoices, face {naira(face)}, credit notes {naira(credit)}: dilution {round(credit * 10000 / face) / 100:.2f}% overall, {worst_bps / 100:.2f}% on the worst invoice")
print(f"days to pay: average {sum(h[2] for h in HISTORY) / len(HISTORY):.1f}, slowest {slowest}")
reserve_bps = FEE_BPS_30D * 3 # fees for a 90-day invoice, as a share of face (a simple ceiling)
ceiling = 10000 - worst_bps - reserve_bps
print(f"advance rate ceiling: 100% - {worst_bps / 100:.0f}% worst dilution - {reserve_bps / 100:.1f}% fee reserve = {ceiling / 100:.1f}%; the lender offers 80%")
print()
def settle(face_k, advance_bps, days, credit_note=0):
advance = face_k * advance_bps // 10000
fee = advance * FEE_BPS_30D * days // (30 * 10000)
collected = face_k - credit_note
rebate = collected - advance - fee
rate = annual_rate([(0, -advance), (days, advance + fee)])
return advance, fee, rebate, rate
INVOICE = 600_000_000
print(f"invoice {naira(INVOICE)}, advance 80%")
print("paid on day credit note advance fee rebate to Tallowmere annual rate")
for days, cn in [(60, 0), (90, 0), (120, 0), (60, 45_000_000), (60, 150_000_000)]:
adv, fee, rebate, rate = settle(INVOICE, 8000, days, cn)
note = " (Tallowmere owes the shortfall)" if rebate < 0 else ""
print(f"{days:>11} {naira(cn):>12} {naira(adv):>14} {naira(fee):>13} {naira(rebate):>20} {rate * 100:>7.0f}%{note}")
adv = INVOICE * 8000 // 10000
fee120 = adv * FEE_BPS_30D * 120 // (30 * 10000)
print()
print(f"buyer never pays, fees run 120 days: {naira(adv + fee120)} is owed.")
print(" recourse: Tallowmere owes it back. Non-recourse: the lender bears it (the price must carry that).")
PY8 invoices, face ₦42,500,000.00, credit notes ₦1,143,000.00: dilution 2.69% overall, 10.00% on the worst invoice
days to pay: average 65.6, slowest 90
advance rate ceiling: 100% - 10% worst dilution - 7.5% fee reserve = 82.5%; the lender offers 80%
invoice ₦6,000,000.00, advance 80%
paid on day credit note advance fee rebate to Tallowmere annual rate
60 ₦0.00 ₦4,800,000.00 ₦240,000.00 ₦960,000.00 35%
90 ₦0.00 ₦4,800,000.00 ₦360,000.00 ₦840,000.00 34%
120 ₦0.00 ₦4,800,000.00 ₦480,000.00 ₦720,000.00 34%
60 ₦450,000.00 ₦4,800,000.00 ₦240,000.00 ₦510,000.00 35%
60 ₦1,500,000.00 ₦4,800,000.00 ₦240,000.00 -₦540,000.00 35% (Tallowmere owes the shortfall)
buyer never pays, fees run 120 days: ₦5,280,000.00 is owed.
recourse: Tallowmere owes it back. Non-recourse: the lender bears it (the price must carry that).The fee is a price on time: ₦240,000 at 60 days, ₦480,000 at 120. The annual rate stays near 34% to 35%, because the fee is linear in days. The cost is in the naira and in the supplier’s budget. In the last row the credit note of ₦1,500,000 exceeds the ₦960,000 of rebate that remained after the fee, so Tallowmere owes ₦540,000. In the second-last row the rebate is ₦510,000 (6,000,000 − 450,000 − 4,800,000 − 240,000).
Change the replay. Let this merchant’s sales fall by 40% from the first day and read the new payback and annual rate.
python3 - <<'PY'
from smeprod import *
db = connect()
m = median_merchant(with_replays(cohort(db)))
rows, done = rbf_replay(m["inflow"], m["cap"], scale_bps=6000)
print("sales down 40%:", f"repaid on day {done}" if done else f"not repaid by 30 June, paid {naira(rows[-1][3])} of {naira(m['cap'])}")
if done:
print("effective annual rate: %.0f%%" % (100 * annual_rate(rbf_flows(m["advance"], rows))))
PYsales down 40%: not repaid by 30 June, paid ₦384,168.75 of ₦488,400.00Then set HOLDBACK_BPS = 1500 in smeprod.py and rerun step 5. With 15%, the median repayment falls from 86 to 50 days, the median annual rate rises from 381% to 1,423% and only 3 merchants are still owing on 30 June (the pace test in the script still assumes 90 days). Falling sales do the opposite, as the first run shows. The question to answer: what would you put in a monitoring report so that a lender sees a weak merchant before the pace has fallen by half, given that there is no days past due?
Template
# Term sheet: invoice finance for <supplier>, <date>
Prepared by <analyst>, SME credit. Approved by <head of credit>.
## 1. The facility
- Supplier: <name>. Buyer: <name>. Invoice: <number>, <face value in ₦>, payment terms <days>.
- Recourse or non-recourse: <which>, and what that means in naira if the buyer never pays.
## 2. Eligibility
<What the supplier and the buyer must show before the first advance: history, invoices on file, anything missing.>
## 3. Advance rate
- Advance: <rate>% = ₦<amount>.
- Ceiling: 100% - <worst dilution>% - <fee reserve>% = <ceiling>%. Source: <invoice history>.
## 4. Pricing
- Fee: <rate>% of the advance for each 30 days, accrued daily.
- Cost and rebate at day <60>, <90>, <120>: ₦<fee> and ₦<rebate>. The cost if a credit note lands: <figure>.
## 5. Verification and collection
<Who confirms the invoice and delivery with the buyer, the registers checked, where the buyer pays, who sees it first.>
## 6. Risks and controls
| Risk | How it would show | Control |
## 7. How this could be wrong
<one way, and what would show it>
## 8. Decision and sign-off
Decision needed: <what, from whom, by when>. Out of scope: <what this term sheet does not cover>.
Prepared <name, date>. Approved <name, date>. WORKED EXAMPLE
An analyst at an SME lender in Ibadan, Azuka, writes this for each facility; the head of credit signs it. This one is for Tallowmere’s ₦6,000,000 invoice to a clinic group on 60-day terms, from the lab’s step 6 figures (illustrative).
Facility. Recourse. If the clinic group never pays and fees run 120 days, ₦5,280,000 is owed, and it is Tallowmere’s debt.
Eligibility. Eight invoices to the clinic group are on file, with credit notes of ₦1,143,000 on face value of ₦42,500,000. Missing: the clinic group’s own confirmation of this invoice.
Advance. 80%, ₦4,800,000. Ceiling: 100% − 10% worst dilution − 7.5% fee reserve (three 30-day fees, for a 90-day invoice) = 82.5%.
Pricing. 2.5% of the advance for each 30 days. Fee ₦240,000 at day 60, ₦360,000 at 90, ₦480,000 at 120; rebate ₦960,000, ₦840,000, ₦720,000. With a ₦450,000 credit note at day 60 the rebate is ₦510,000.
Verification. Azuka confirms the invoice and delivery with the clinic group before paying out; the clinic group pays into an account the lender controls.
Risks and controls. A false invoice: confirm it with the clinic group and search the registers. Diverted payment: the lender controls the collection account. Concentration: a limit on the clinic group’s financed debt. Dilution: recourse, so credit notes fall on Tallowmere.
Could be wrong. Eight invoices are a small history, and the worst one, ₦4,800,000 of face value, lost ₦480,000. A ninth with 15% dilution would break the ceiling.
Decision. The head of credit is asked to approve an 80% advance of ₦4,800,000 once the clinic group confirms the invoice. Other buyers are out of scope.
Now you
A month later, Tallowmere raises a second invoice of ₦3,000,000 on the same clinic group, also on 60-day terms, while the first, ₦6,000,000, is still unpaid and financed. You are the analyst at the lender, and your head of credit signs what you write. Edit step 6 so INVOICE is 300_000_000 and read how the fee and rebate move at 60, 90 and 120 days, and what is owed if the buyer never pays. Reuse the eight-invoice history for the ceiling, and say whether the first invoice, financed and unpaid, changes your view of the clinic group as a source of repayment. Assume the lender will not have ₦9,000,000 of one buyer’s debt financed at once unless the head of credit agrees. Your head of credit reads the term sheet to decide whether to fund the second invoice, at what rate, and on what conditions.
Self-check
Azuka is asked to fund Tallowmere's ₦6,000,000 invoice to the clinic group. The clinic group's history in the file: 60-day terms, but one invoice paid on day 90 with a 10% credit note, and an average of about 66 days. Tallowmere also has steady card takings in its own wallet. Azuka can offer recourse invoice finance at 80%, non-recourse at 90%, an RBF against the wallet, or a term loan.
- DOC Standard Definitions for Techniques of Supply Chain Finance (ICC) International Chamber of Commerce and partner bodies, 2016
The industry's shared vocabulary for receivables discounting, factoring, forfaiting and payables finance. Read the definitions of the techniques named in this chapter so a term sheet's words map to a mechanism. Skip the sections on trade-finance products this chapter does not use.
- DOC EBA Market Guide on Supply Chain Finance, version 2.0 Euro Banking Association, 2014
A bank-association guide to how supply-chain finance programmes are structured and described. Read it for the roles of anchor, supplier and financier. It is a market guide, not a rule, and it is European: use it for structure, not for Nigerian law.
- DOC UNIDROIT Convention on International Factoring (Ottawa, 1988) UNIDROIT, 1988
The treaty text on what a factoring contract is and how a receivable is assigned. Read it for the legal shape of the product. Search results give 1 May 1995 as its entry into force and one third-party database lists Nigeria as ratifying in 1994, but this build did not see UNIDROIT's own status list, so check it. Read: The definition of a factoring contract and the provisions on assignment of receivables.
- DOC Explanatory note on the UNIDROIT Convention on International Factoring UNIDROIT
A plainer account of the convention than the treaty text. Read it first, then the convention.
- DOC Revised Guidelines for Finance Companies in Nigeria (CBN, 2014) Central Bank of Nigeria, 2014
The CBN's own text on what a licensed finance company may do, including debt factoring. Read the list of permitted activities and the conditions on them, then check whether later CBN circulars changed them.
- DOC Secured Transactions in Movable Assets Act 2017 (Nigeria Government Gazette Supplement, 31 May 2017) Federal Republic of Nigeria (copy on the Africa Gazettes archive), 2017
The Act's gazetted text, the primary source for how a security interest in receivables is created and registered. Read the parts on security interests and on the registry to check what this chapter states from summaries. Confirm it is the current text.
- DOC National Collateral Registry (CBN) Central Bank of Nigeria
The CBN's page for the registry. Read it for how a lender registers an interest and searches before it lends, which is the defence against the same receivable financed twice. Check the page's current content, as this build could not read it.
- POST Debt factoring in Nigeria: structuring, legal and regulatory framework and key considerations (Mondaq) Law-firm commentary on Mondaq
A lawyer's account of the licensing and structuring points for factoring in Nigeria. It is commentary, not the rule: read it for the questions to ask a lawyer, then check each point against the CBN's own texts.
All companies and people in these examples are fictional. Any resemblance to a real business or person is unintended.