What does Payment Routing, Chargebacks and Cash Reserves conclude, in numbers, about “A Year's Ledger, Stress Tests and a Pre-Registered Experiment”?
Answer: Chapter 8 gives a year's ledger, stress tests and a pre-registered experiment. Marked boxes separate published evidence, runnable Python calculations (16 programs), classical sources and the author's hypotheses.
Scope of the numbers: Chapter 3 writes friendly fraud as a game of deterrence: once the win probability reaches 0.75, false disputes vanish in the illustrative model; in an evidence package the "considered purchase" tick counts least. Marked boxes separate published evidence, runnable Python calculations (16 programs), classical sources and the author's hypotheses.
Data table
The numbers below are printed verbatim by the chapter's Python program and can be reproduced by running it. standard-library Python only
| setup | margin RM | friendly | season | alerts | net RM | ratio | cash RM |
|---|---|---|---|---|---|---|---|
| A | 18,567,559 | 432,000 | 10,298 | 0 | 18,125,260 | 0.94% | 3,115,772 |
| B | 18,468,285 | 16,385 | 0 | 0 | 18,451,900 | 0.86% | 3,175,855 |
| C | 18,468,285 | 16,385 | 0 | 8,331 | 18,443,569 | 0.60% | 1,467,058 |
Show the full program
# Chapter 8. p14: A year's ledger for 144,000 orders (12,000 a month),
# putting the pieces together. Setups:
# A all on cards, evidence prepared by hand (win 0.35, RM 60 a case),
# refunds paid in 7 days, no alert service, one gateway;
# B the 0.90% routing of p01, automatic evidence package (win 0.711,
# RM 15 a case), refunds within 1 day;
# C as B, plus alerts that catch 30% of disputes, and three gateways.
# Margin from p01, friendly fraud from p05, the refund season from p04
# (one peak month a year), alerts from p08, the cash buffer from p12.
import importlib.util
def load(name):
spec = importlib.util.spec_from_file_location(name, name + ".py")
m = importlib.util.module_from_spec(spec)
spec.loader.exec_module(m)
return m
p01, p04 = load("p01_routing"), load("p04_refund_speed")
p05, p12 = load("p05_deterrence"), load("p12_gateways")
YEAR = 144000 / 10000 # units of 10,000 orders
def setup(x, w, prep, days, caught, k, rng):
ratio, paid, m = p01.evaluate(x)
margin = 1e4 * m * YEAR
ff = p05.loss(w, prep)[2] * YEAR
peak = p04.month(days)[2] - p04.month(1)[2]
counted = ratio * (1 - caught)
alert = caught * ratio * 0.9 * 144000 * 25
need = sorted(p12.path(rng, k)[0] for _ in range(300))[296]
return margin, ff, peak, alert, margin - ff - peak - alert, counted, need
if __name__ == "__main__":
import random
rng = random.Random(85)
rows = {"A": ((1.0,) * 5, 0.35, 60.0, 7, 0.0, 1),
"B": (p01.best(0.009), 0.711, 15.0, 1, 0.0, 1),
"C": (p01.best(0.009), 0.711, 15.0, 1, 0.3, 3)}
print(" setup margin RM friendly season alerts net RM"
" ratio cash RM")
for name, args in rows.items():
mg, ff, pk, al, net, r, need = setup(*args, rng)
print(" {:<5} {:10,.0f} {:8,.0f} {:6,.0f} {:6,.0f} {:10,.0f}"
" {:5.2%} {:9,.0f}".format(name, mg, ff, pk, al, net, r,
need))Single source and citation
Fan, Y. (2026). Cross-Border Payment Routing, Chargeback Defense Games and Treasury Ruin Bounds (Version 1.0.0), Chapter 8: A Year's Ledger, Stress Tests and a Pre-Registered Experiment. 5D Library. https://doi.org/10.5281/zenodo.24090225
DOI: 10.5281/zenodo.24090225 · Read the monograph · 5DL-B-085 · v1.0.0 · CC-BY-NC-ND-4.0
BibTeX
@book{fan2026085,
author = {Fan, Yafu},
title = {Cross-Border Payment Routing, Chargeback Defense Games and Treasury Ruin Bounds},
year = {2026},
publisher = {5D Library},
edition = {1.0.0},
doi = {10.5281/zenodo.24090225},
url = {https://doi.org/10.5281/zenodo.24090225}
}Other chapter answers in this book
- Chapter 1 · Multi-Acquirer Routing and the Chargeback Red Line
- Chapter 2 · A Ratio Is a Noisy Count, and Refunds Must Beat Disputes
- Chapter 3 · The Defence Game against Friendly Fraud, and Scoring the Evidence
- Chapter 4 · A Cryptographic Evidence Chain, and "Fight or Pre-Empt"
- Chapter 5 · The Cramér-Lundberg Model and the Rolling Reserve
- Chapter 6 · A Formula for the Minimum Safe Reserve, and Spreading over Gateways
- Chapter 7 · Song Maritime Customs Levies, and the Secret Codes and Transfers of the Shanxi Remittance Banks