What does Cross-Border Settlement Friction and Conversion Batches conclude, in numbers, about “A Network of Currency Channels: Minimum-Loss Flows and the Shadow Price of Money”?

Answer: Chapter 3 draws a group's currency accounts and licensed channels as a network and finds by minimum-cost flow a route losing 25.69 basis points against 28.15 for direct return, with account shadow prices and bargaining targets for channels.

Scope of the numbers: All fees, rates, volatilities, amounts and group structures are illustrative; all calculations are generated by the book's programs; the book is not individual legal, tax or financial advice. Marked boxes separate published evidence, runnable Python calculations (19 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 onlyprinted values that match the answer: 25.69, 28.15

minimum-loss plan (kUSD-equivalent per month)
US.USD> HK.USDwire6 bp100
US.USD> CN.USDwire10 bp300
DE.EUR> HK.EURwire5 bp250
HK.EUR> HK.USDFX EUR>USD12 bp250
HK.USD> CN.USDwire4 bp150
HK.USD> HK.CNHFX USD>CNH9 bp150
HK.CNH> CN.CNYRMB cross-border6 bp150
CN.USD> CN.CNYFX tier 110 bp300
CN.USD> CN.CNYFX tier 220 bp150
optimal loss 1670.0 USD = 25.69 bp of 650 kUSD
direct-to-home loss 1830.0 USD = 28.15 bp
saving 160.0 USD a month, 0.087 of the direct loss
Show the full program
# Chapter 3. p31: minimum-loss routing over a multi-currency channel net.
# A group owes its home entity (CN, needs CNY) for goods under real
# intra-group sales contracts; the US and DE entities hold the receipts.
# Nodes are (entity, currency) accounts; arcs are licensed channels:
# same-currency transfers and same-entity conversions. Every arc costs
# whole basis points of the amount and some have monthly capacities.
# Amounts are kUSD-equivalent at mid rates; 1 bp on 1 kUSD = 0.1 USD.
# Successive shortest paths with Dijkstra on reduced costs (heapq),
# integer arithmetic throughout. All fees are illustrative only.
import heapq

NODES = ["US.USD", "DE.EUR", "HK.USD", "HK.EUR", "HK.CNH",
         "CN.USD", "CN.EUR", "CN.CNY"]
BIG = 10 ** 6
ARCS = [  # from, to, capacity kUSD, bp, channel
    ("US.USD", "HK.USD", BIG, 6, "wire"),
    ("US.USD", "CN.USD", BIG, 10, "wire"),
    ("US.USD", "CN.CNY", 200, 35, "PSP collect+FX"),
    ("DE.EUR", "HK.EUR", BIG, 5, "wire"),
    ("DE.EUR", "CN.EUR", BIG, 12, "wire"),
    ("HK.EUR", "HK.USD", BIG, 12, "FX EUR>USD"),
    ("HK.USD", "CN.USD", BIG, 4, "wire"),
    ("HK.USD", "HK.CNH", 150, 9, "FX USD>CNH"),
    ("HK.CNH", "CN.CNY", BIG, 6, "RMB cross-border"),
    ("CN.USD", "CN.CNY", 300, 10, "FX tier 1"),
    ("CN.USD", "CN.CNY", BIG, 20, "FX tier 2"),
    ("CN.EUR", "CN.CNY", BIG, 30, "FX EUR>CNY")]
SUPPLY = {"US.USD": 400, "DE.EUR": 250, "HK.USD": -50, "CN.CNY": -600}


def min_cost_flow(nodes, arcs, supply):
    idx = {v: k for k, v in enumerate(nodes)}
    n = len(nodes) + 2
    src, snk = n - 2, n - 1
    g = [[] for _ in range(n)]

    def add(u, v, cap, cost):
        g[u].append([v, cap, cost, len(g[v])])
        g[v].append([u, 0, -cost, len(g[u]) - 1])
        return (u, len(g[u]) - 1)

    handles = [add(idx[a], idx[b], c, w) for a, b, c, w, _ in arcs]
    need = 0
    for v, s in supply.items():
        if s > 0:
            add(src, idx[v], s, 0)
            need += s  # step
        elif s < 0:
            add(idx[v], snk, -s, 0)
    pot = [0] * n
    cost = flow = 0
    while flow < need:
        dist = [None] * n
        prev = [None] * n
        dist[src] = 0
        heap = [(0, src)]
        while heap:
            d, u = heapq.heappop(heap)
            if d != dist[u]:
                continue
            for k, (v, cap, w, _) in enumerate(g[u]):
                nd = d + w + pot[u] - pot[v]
                if cap > 0 and (dist[v] is None or nd < dist[v]):
                    dist[v] = nd
                    prev[v] = (u, k)
                    heapq.heappush(heap, (nd, v))
        if dist[snk] is None:
            raise ValueError("infeasible")
        for v in range(n):
            if dist[v] is not None:
                pot[v] += dist[v]  # step
        push, v = need - flow, snk
        while v != src:
            u, k = prev[v]
            push = min(push, g[u][k][1])
            v = u
        v = snk
        while v != src:
            u, k = prev[v]
            g[u][k][1] -= push  # step
            g[v][g[u][k][3]][1] += push  # step
            cost += push * g[u][k][2]  # step
            v = u
        flow += push  # step
    used = [arcs[j][2] - g[u][k][1] for j, (u, k) in enumerate(handles)]
    return cost, used, g, handles


if __name__ == "__main__":
    cost, used, _, _ = min_cost_flow(NODES, ARCS, SUPPLY)
    print("minimum-loss plan (kUSD-equivalent per month)")
    for (a, b, cap, bp, ch), f in zip(ARCS, used):
        if f:
            print("  %-7s > %-7s %-17s %3d bp %5d" % (a, b, ch, bp, f))
    naive = [("US.USD", "CN.USD", 10, 350), ("CN.USD", "CN.CNY", 10, 300),
             ("CN.USD", "CN.CNY", 20, 50), ("DE.EUR", "CN.EUR", 12, 250),
             ("CN.EUR", "CN.CNY", 30, 250), ("US.USD", "HK.USD", 6, 50)]
    naive_cost = 0
    for a, b, bp, f in naive:
        naive_cost += bp * f  # step
    vol = 650
    print("optimal loss %.1f USD = %.2f bp of %d kUSD"
          % (cost / 10.0, cost / vol, vol))
    print("direct-to-home loss %.1f USD = %.2f bp"
          % (naive_cost / 10.0, naive_cost / vol))
    print("saving %.1f USD a month, %.3f of the direct loss"
          % ((naive_cost - cost) / 10.0, 1 - cost / naive_cost))

Single source and citation

Fan, Y. (2026). Cross-Border Settlement Frictions and Compliant Treasury Scheduling: Minimum-Loss Network Flows over Multi-Currency Channel Fees and Conversion Slippage (Version 1.0.0), Chapter 3: A Network of Currency Channels: Minimum-Loss Flows and the Shadow Price of Money. 5D Library. DOI pending

DOI pending · monograph page goes live after publication · 5DL-B-280 · v1.0.0 · CC-BY-NC-ND-4.0

BibTeX
@book{fan2026280,
  author    = {Fan, Yafu},
  title     = {Cross-Border Settlement Frictions and Compliant Treasury Scheduling: Minimum-Loss Network Flows over Multi-Currency Channel Fees and Conversion Slippage},
  year      = {2026},
  publisher = {5D Library},
  edition   = {1.0.0},
  note      = {DOI pending}
}

Other chapter answers in this book