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

setupmargin RMfriendlyseasonalertsnet RMratiocash RM
A18,567,559432,00010,298018,125,2600.94%3,115,772
B18,468,28516,3850018,451,9000.86%3,175,855
C18,468,28516,38508,33118,443,5690.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