Everything so far has happened inside your ledger, where a mistake is a reversing entry. This chapter is about the edge where the ledger touches banks. Money moves on rails with their own clocks, calendars and ideas of finality. It sits in accounts your ledger does not control, and once it has left, getting it back depends on someone else being willing. The engineering problem is not sending money. It is keeping a promise in your ledger consistent with a bank that runs on different time, while pay-ins can still be reversed and payouts cannot.
Engineers usually compare rails on speed and cost. The comparison that matters more is finality: how long after “settled” someone else can still take the money back, and by what process. Every rail has two clocks. The settlement clock says when funds become usable. The reversal clock says when they stop being at risk. On card acquiring, funds reach the merchant in a day or three, but chargebacks can arrive for months. On ACH debits, most returns come within two banking days, but a consumer can claim an unauthorised debit for 60 calendar days. SEPA Direct Debit gives the payer eight weeks to get a refund with no questions asked, and thirteen months if the debit was unauthorised. Wires on RTGS systems and instant rails such as RTP, FedNow, SCT Inst and Faster Payments are the opposite: final within seconds of settlement, with no right of reversal, only a request.
Windows are scheme defaults and simplified; your acquirer or bank agreement can shorten or extend them. The design consequence is the pairing: pay-ins arrive on reversible rails, payouts leave on final ones. The gap between the two reversal horizons is where platforms lose money.
Line the two sides of a marketplace or payments platform up against this table and the structural risk is obvious. Money comes in on reversible rails (cards, debits) and goes out on near-final ones (ACH credit, SEPA credit, instant). Every payout made before the pay-in’s reversal clock expires is credit extended to the recipient, whether or not anyone called it that. That is not a reason to hold funds for 120 days, which no seller would accept. It is a reason to model unsettled, settled but reversible and final as separate balance states in the ledger, so the payout policy is an explicit decision over those states rather than a side effect of what the “available” column happens to contain.
It is worth putting a number on that credit, because it is usually larger than anyone has budgeted. Take illustrative figures: $5M a day of card volume, paid out on settlement, and a 0.3% eventual dispute rate whose arrivals spread over roughly 120 days. At steady state the platform has about 5M × 0.003 × 120 ≈ $1.8M of disputes still to arrive against money it has already paid out. None of that is a loss while sellers keep selling, because the chargeback is netted against their next payout. It becomes a loss when a seller’s future sales stop covering their dispute tail: a merchant that churns, gets banned, or was a bust-out fraud from the start. So the quantity to monitor per seller is not the dispute rate. It is expected dispute tail ÷ expected net sales over the same window. Above 1 the seller is already a credit exposure, whatever their balance says. That ratio is what drives reserves (5.4), and it moves fastest exactly when sales drop, which is also when the seller asks for faster payouts.
The second difference is how failure gets back to you. Instant rails answer synchronously: accepted or rejected, in the same call. Batch rails answer in a later file. An ACH credit to a closed account is accepted by your bank, sent to the Fed, marked paid in your system — and returns as an R02 entry in a file two banking days later. Your state machine must allow a payout to go from paid back to returned, with money coming back into the FBO account and a balance to re-credit. Systems designed around card or instant rails often forbid that transition, and then handle ACH returns as manual adjustments, which is how the sub-ledger starts to drift.
Architect's note · instant rails move the risk, they do not remove it
Batch rails run on banking days in the bank’s time zone, with cutoffs set by the bank, not the scheme. FedACH’s same-day submission deadlines (10:30, 14:45 and 16:45 ET) are the Fed’s; your originating bank’s cutoffs sit earlier, sometimes by an hour or more, and differ by channel — API, host-to-host SFTP, the web portal. The practical result is a step function. A payout requested ten minutes after the last cutoff on Friday reaches the recipient on Monday, roughly two and a half to three calendar days later, and on Tuesday if Monday is a bank holiday.
Ten minutes past a cutoff costs roughly 2.5 to 3 calendar days on every batch rail, and a Monday holiday adds a fourth. Same-day ACH buys nothing here: the Monday next-day settlement and the Monday same-day settlement land within hours of each other.
The calendar is data, and it changes. Holidays differ per rail and per country (TARGET holidays for euro settlement, Federal Reserve holidays for FedACH and Fedwire, local bank holidays for domestic schemes), and new ones appear with little notice. Juneteenth became a US federal holiday on 17 June 2021, the day before it was first observed. The Federal Reserve Banks stayed open that year and began observing it in 2022, so for one year “federal holiday” and “Fed holiday” were different answers, and any system that derived banking days from a public-holiday library got that week wrong in one direction or the other. A calendar compiled into code or copied into a cron schedule will eventually be wrong. Keep it as a versioned table per rail, sourced from the scheme or bank, with a test that fails when the table has no entries for next year. Every date calculation — expected settlement, return deadlines, SLA to the seller — goes through one function that takes the rail as an argument.
Three second-order effects are worth designing for. First, batch concentration: payouts scheduled daily at 09:00 in your system will, on Monday, carry Saturday’s and Sunday’s obligations too, so the Monday file is two to three times a weekday file, and so are the balance checks, the fraud review queue and the bank’s per-file limits. Second, cutoff races: if file generation starts at 15:55 against a 16:00 cutoff and the upload takes six minutes on a bad day, the file is processed the next banking day, and every expected-arrival date you showed a seller is wrong. Put a safety margin in the scheduler and treat “submitted after cutoff” as an event that updates promised dates, not as a success. Third, time zones: a payout requested at 23:30 in Sydney is the previous business day in New York. Store the requested instant in UTC, and compute the rail’s business date explicitly — never with the server’s local date.
Pitfall · the promised date is a contract
A For Benefit Of account is one pooled, custodial account at a partner bank; the per-customer split exists only in your sub-ledger. That turns the ledger from an internal accounting tool into the legal record of ownership, and it turns reconciliation between the ledger and the FBO statement from good practice into what keeps you solvent.
partner bank
FBO account · “Platform Inc FBO its customers”
one balance, one statement (camt.053 / BAI2)
customer money — not platform property
operating account
platform money: fees, payroll, pre-funding source
fee sweep: FBO → operating, on schedule, one journal per sweep. Never the reverse without a pre-funding entry.
your ledger · the only record of ownership
pay-ins in transit
credited to sellers, not yet landed at bank
payouts in flight
debited from sellers, not yet debited by bank
fees earned, unswept
platform revenue still sitting in FBO
bank FBO balance = Σ positive customer balances + unswept fees − pay-ins in transit + payouts in flight − negatives not yet funded by the platform + Σ open breaks
Every term except the last has an owner and an age. The last term is the one that ended Synapse: when it is large and old, nobody can prove which customer the missing money belonged to.
The collapse of Synapse Financial Technologies in 2024 is the case study. Synapse was middleware between fintech apps and partner banks, holding end-user funds in pooled FBO accounts across several banks and keeping the per-user records itself. When it went into bankruptcy, the banks’ balances and Synapse’s records could not be reconciled, and the shortfall between what users were owed and what the banks held was reported in the tens of millions of dollars. Users’ deposits were frozen for months. Nobody had to steal anything for this to happen: breaks that are never closed, money moved between pools without matching ledger entries, and ownership records split across organisations are enough. The invariant in the diagram is what would have caught it, if it had been computed daily, per bank, with every timing item aged and owned.
Four design rules follow. Never mix funds: platform revenue can accumulate in the FBO account as unswept fees, but it must be a named liability-side line and swept to the operating account on a schedule, with one journal per sweep. Platform money going the other way — covering a negative seller balance or pre-funding payouts — must be an explicit, recorded platform contribution, never a silent transfer. Negative balances are platform money: when a chargeback lands after a payout and a seller goes to −1,120, the pooled account is now short by exactly that amount against every other customer’s claims. The platform has to fund it from operating money on the day it happens, not when collections succeed. One pool per bank per currency, reconciled separately; netting across banks hides a shortfall in one behind a surplus in another. And keep the ownership record where the bank can see it: pass-through deposit insurance depends on records that identify the beneficial owners, and after Synapse the FDIC proposed (in 2024) a recordkeeping rule for custodial accounts aimed at exactly that per-beneficiary record. A daily sub-ledger file sent to the partner bank is cheap insurance.
The invariant is only useful if its timing items cannot absorb a real shortfall, and that needs a hard rule rather than judgement. Each timing item belongs to a rail, and each rail has a maximum settlement lag from 5.1 and 5.2. A timing item older than its rail’s maximum lag, measured in that rail’s banking days, is not timing. It is reclassified automatically as a break, gets an owner, and starts counting towards the break-age alert. Without that rule, “in transit” becomes the account where unexplained differences go to wait, and the total grows slowly enough that nobody’s daily view shows a step. The size of the timing items is also a check on its own: in steady state it should track payout and pay-in volume times lag. If volume is flat and the total keeps rising, something is being parked there.
The daily change in the pink line is within the weekday-to-weekend swing of the expected line, so no single day looks wrong; after a month, a third of the “timing” balance is a leak. The age-out rule keeps in transit within about one lag-window of the leak rate and moves the rest to a queue with owners, where its age is what triggers the page.
The rule has a cost that teams underestimate: in the first week it runs, it turns months of silently parked differences into a queue of breaks with no obvious owner, and the first instinct is to widen the lag to make the queue go away. Resist that. Set each rail’s age-out at its scheme maximum plus one banking day, not at an observed p99, because an observed p99 on a leaking account already includes the leak. Where a bank’s own processing is slower than the scheme, record that as a per-bank override with an expiry date and a named approver, so every widening is visible in review.
Architect's note · the ledger is custody
Payout speed is a product decision that finance pays for. If pay-ins settle T+2 banking days and payouts go out faster, the gap is funded from the platform’s own balance — its pre-funding requirement. The rough formula is daily payout volume × (settlement lag − payout lag), but the formula is where the mistake starts, because it uses averages. Card spending happens seven days a week; settlement happens five. Run the calendar and the requirement has a weekly shape that peaks between Sunday and Tuesday, when Friday’s, Saturday’s and Sunday’s pay-ins are all paid out and none has settled.
Size the credit line for the peak, not the mean: instant payouts double the requirement between Friday and Tuesday, and a Monday holiday pushes it to five days of GMV ($25M here). Chargebacks and refunds against already-paid sellers stack on top.
In the illustrative case — $5M a day of card volume, settling T+2 banking days — instant payouts need $10M of pre-funding on a weekday and $20M from Sunday to Tuesday. A Monday bank holiday makes it $25M. Next-banking-day payouts look cheap on average, but put a spike on Tuesday when Saturday, Sunday and Monday are paid together. Paying out on settlement needs no pre-funding and gives sellers the slowest experience. The credit line or cash buffer has to be sized for the holiday-weekend peak plus the refund and chargeback tail, and it has to sit in the right account, at the right bank, before the payout file goes out — a treasury transfer that misses its own wire cutoff is a payout run that fails on the balance check.
2 days
weekday pre-fund, instant
4 days
Sun–Tue peak, instant
5 days
with a Monday holiday
~120 days
card reversal tail
Float also runs the other way. When payouts lag settlement, the platform holds customer money that earns interest. When rates were near zero this did not matter; at a few percent it is real revenue, and it creates an incentive to make payouts slower that product and finance should discuss openly rather than discover. The honest framing is that instant payouts sell the float back to the seller — which is why they are usually priced as a percentage of the amount rather than a flat fee. Check that the price covers the cost of carrying the peak, not the average.
The risk side of treasury is reserves. For a seller whose refunds and chargebacks can exceed future sales — a travel merchant selling months ahead, a subscription business about to churn — the platform holds back a share of each payout or delays release by a number of days. In the ledger, a reserve is an account, not a flag: money moves from available to reserved with a release date on the entry, and a scheduled job moves it back. When reserves are implemented as a “hold amount” field on the seller record, they fall outside the invariant, and reconciliation cannot explain them.
The usual reserve designs are a rolling reserve (a percentage of each payout, released a fixed number of days later), a fixed reserve (a floor the balance may not go below), and a payout delay (hold everything N days). Most discussion is about the percentage. The failure is usually in the release rule. A rolling reserve released by calendar assumes the seller keeps trading, so that new holdback replaces what is released. That holds for the sellers who never needed a reserve, and breaks for the one who did: the bust-out seller whose volume and dispute rate jump together, and who then disappears.
Same seller, same 10% holdback, same $170k peak reserve. The only difference is what triggers release. A calendar release hands back the bust-out weeks’ holdback from week 13 onwards, just as their disputes peak; the reserve crosses zero at week 18 and the platform absorbs $142k. Tie release to the remaining expected tail and the same reserve ends $28k positive.
The worked model above uses a 10% holdback with 90-day release. It is a typical-looking policy and it loses $142k on one seller, because it pays the bust-out weeks’ holdback back to the fraudster from week 13, exactly when their disputes are peaking. Two changes fix it without raising the percentage. First, release against the remaining expected tail, not the calendar: releasable = reserve − (expected disputes still to arrive × a safety factor), recomputed daily from the seller’s own dispute curve. Second, freeze releases on a volume collapse, for example when trailing-7-day sales fall below a third of the trailing-30-day average (an illustrative threshold to calibrate on your own churn data), and hold until the tail has run off. The same variable drives both rules: the exposure ratio from 5.1. Reserve changes also need their own audit trail, because a seller will dispute them, and “the model changed” is not an answer a regulator or a court will accept without the inputs recorded on the reserve entry.
A multi-currency balance is a set of accounts, one per currency, with no total. The moment a product shows a customer “total balance in USD”, someone has chosen a rate, a timestamp and a direction, and that number is a display value, not a ledger fact. Chapter 01, Modelling Money Correctly, covered rates as timestamped data with provenance. The treasury question here is what happens after the conversion is booked.
one balanced entry per currency
Each currency balances on its own. The rate lives on the entry as data (ch. 01), never as a mixed-currency posting. The FX position accounts now hold +10,000 USD and −9,150 EUR: the platform is long USD.
covered at quote time
covered 4h later, market −1%
never covered (netted)
The 50 EUR spread is revenue only if the position is closed while it is still 50 EUR. A 1% move over the cover delay is bigger than a 0.5% spread.
Book a conversion as two entries, each balanced in its own currency, through FX position accounts. After the customer converts USD to EUR, the platform holds more USD and owes more EUR than before: it has an open position. The spread in the customer rate is revenue only if the position is covered while the market is still near the quote. In the illustrative example, a 0.5% spread is lost entirely if the cover trade happens four hours later after a 1% move — a normal intraday range for many emerging-market currencies, and during events for major ones too. So the design question is not the spread; it is the cover policy. Cover each conversion as it happens (simple, expensive in small tickets), net over a window and cover the residual above a threshold (cheaper, with market risk for the window), or cover on a schedule against a forecast. Whatever the choice, the size of the open position per currency should be a live metric with a limit, and conversions above a size should be refused or re-quoted when the position is at its limit.
The netting window can be sized from first principles. Over a window of t hours, a currency pair with annualised volatility σ moves with a standard deviation of about σ × √(t / hours in a trading year). Illustratively, for a pair at 10% annualised volatility and a four-hour window, that is roughly 10% × √(4 / 6,240) ≈ 0.25%. A two-standard-deviation move, 0.5%, then consumes the whole of a 0.5% spread about one window in forty. That is the budget you are running. The same formula shows why a single cover policy across corridors is wrong: a pair at 30% volatility needs a window about nine times shorter for the same risk, and tighter netting windows mean smaller, more expensive cover trades. Set the window per corridor from volatility and ticket size, and shorten it automatically when realised volatility jumps, which is also when customers convert most.
The second FX problem is where the currency physically is. Paying out EUR to a German bank account requires EUR in an account that can reach SEPA. If the conversion is covered with a liquidity provider, the EUR arrives on the FX trade’s settlement date — typically T+2 for spot — while the seller may have been promised EUR today. The gap is covered by pre-funding the destination account, which is the float problem from 5.4 again, once per currency corridor. Settlement itself carries the oldest risk in the business: you deliver USD and have not yet received EUR. The 1974 failure of Bankhaus Herstatt, closed after receiving the Deutsche Mark legs of its trades but before paying the dollar legs, is why interbank FX now largely settles payment-versus-payment through CLS. Your liquidity provider trades usually do not, so the counterparty limit on each provider is a real risk control, not a formality.
Pitfall · revaluation noise in the ledger
A duplicated charge can be refunded. A duplicated payout on a final rail is a request to a stranger to send money back. That asymmetry decides the architecture. The payout pipeline is the one place in the stack where you should accept lower availability for correctness: a payout that waits a day for an ambiguous status to resolve is a support ticket; a payout sent twice is a loss and possibly a fraud case.
The state machine carries four rules. Reserve before send: the first transition debits the seller’s available balance into a payouts-pending account in the same transaction that creates the payout. Two concurrent payout requests cannot both see the same balance, because the reservation is a conditional write against the ledger, not a read followed by a send. Mint the identity at reserve: the payment reference — ISO 20022 EndToEndId, the SWIFT gpi UETR, or the bank API’s idempotency key where one exists — is generated once and stored before any network call. Every resend of this payout, by any worker, carries the same reference. Unknown is a state, not an error: a timeout, connection reset or 5xx after the request left your process moves the payout to unknown. From there it can only move through a status inquiry, a status report (pain.002), a statement line, or a human. Automatic resend from unknown is forbidden. Money moves in the ledger when the bank moves it: the cash posting happens when the debit appears on the bank feed, not when the API returns 200.
The hard part of unknown is getting out of it. The only safe way from unknown to a failed state is positive evidence of non-execution: a rejection status (pain.002 with RJCT, or the API’s own terminal failure), or a bank confirmation that no instruction with that reference exists, once the rail’s execution window has closed. Absence of a debit on today’s statement is not evidence; intraday feeds are partial, and a file acknowledged late may still be processed on the next banking day. That makes the resolution time a property of the channel you picked. An API with a status endpoint keyed on your reference resolves most unknowns in minutes. A file channel with no per-item status can leave a payout unknown until the next end-of-day statement, or longer, if the bank needs a ticket to confirm non-receipt. When you compare banks, ask how you query an instruction by your own reference, and how fast the answer is authoritative. That matters more to payout correctness than the price per item, and it rarely appears on the RFP.
The first four rows are one bug in four disguises: identity created at send time. Everything after row 4 is damage control, and on final rails damage control is a phone call.
The anatomy above is the common case, and it is useful to see why the usual idempotency tools do not catch it. The job framework’s retry is idempotent by its own definition — it retries the job — but the job builds a new request each time. The bank’s duplicate detection, where it exists, keys on the fields it was given, and a new reference and timestamp make it a new payment. File-based channels are worse. NACHA files carry a File ID Modifier to tell apart several files created on the same day, and duplicate-file checks commonly key on header fields like it. An operator who regenerates a rejected batch and bumps the modifier to get it accepted has just defeated the check — and if the first file was not actually rejected, but only slow to acknowledge, every payout in it is sent twice. The rule for files is the same as for APIs: a file is an immutable artifact built from reserved instructions, stored with its hash, and resent byte for byte. Never rebuilt.
Two further controls earn their keep. A per-beneficiary velocity limit — no more than N payouts, or X total, to one bank account in a window — breaks the cascade even when identity handling has a bug, and it also catches the account-takeover pattern where the bank details change and the balance leaves within minutes. And intraday recon of the bank’s debit feed against payouts-pending turns a double payout discovered at T+1 into one discovered within the hour, while the second instruction may still be recallable. The general treatment of unknown outcomes across a provider boundary is in chapter 03, Payment Flows & Unknown Outcomes; the idempotency-key mechanics are in the API & Integration Design track. What is specific to payouts is that the cost of getting it wrong is not symmetric, so the defaults should not be either.
Architect's note · recovery is not a control
Design review · questions to ask of any payout pipeline
Every payout platform ends up with a rail abstraction: one internal instruction model, and adapters per bank and rail. It is the right shape, and it leaks in the places that matter. What should be common is the instruction and its ledger lifecycle — amount, currency, beneficiary, reference, reservation, promised date, state. What must stay per rail is finality, the return taxonomy and the calendar. An abstraction that maps every bank response into success or failure throws away exactly the information needed to decide what to do next.
The dangerous default is a generic “failed → retry” branch. Retrying a closed-account return nightly costs nothing in the ledger but counts against your return rate. A replacement payout created after the seller updates their bank details, while the original is still waiting for its return, pays the seller twice once that return re-credits the balance.
Returns are the part most systems get wrong, because they arrive after the payout has been marked paid and are treated as exceptions. They are routine: at scale, a steady fraction of ACH credits comes back for closed or invalid accounts, and the handling must be automated by class. Account-level returns (closed, invalid, frozen) re-credit the seller, disable the bank account, and require new details before the next payout. Retrying them is not only pointless: returns are a metric your bank watches. On the debit side NACHA sets explicit originator return-rate thresholds — 0.5% unauthorised, 3% administrative (R02, R03, R04), 15% overall — and crossing one triggers review by your originating bank. Credit returns carry no scheme threshold, but the bank that sponsors your programme monitors them anyway, and its tolerance is the real constraint on your payout operation. A retry loop against stale bank details is the fastest way to look careless to it. Verify accounts before the first payout (prenote, micro-deposits or an account-verification service), and treat the return rate as an SLO with an alert well below the threshold. Notifications of change are not failures at all — the payment succeeded, but the bank is telling you to correct the account details, and NACHA rules expect the correction to be applied within six banking days or before the next entry, whichever is later. On the pay-in side, insufficient-funds returns on debits may be re-presented at most twice under NACHA rules, while unauthorised returns may not be re-presented without new authorisation and belong to the dispute workflow in chapter 06.
The race in the matrix caption is worth spelling out, because it looks like a feature working. A payout goes to an account that was closed last month. The seller notices the delay and updates their bank details. A “retry failed payouts” job sees the payout in submitted — the return has not arrived yet — and a support agent helpfully creates a new payout to the new account. Two days later the R02 comes in, the original payout is marked returned, and the balance is re-credited, so a third payout goes out on the next run. Whether this pays once or twice depends on whether the replacement was modelled as the same obligation re-routed (one reservation, a new attempt that supersedes the first) or as a new payout with its own reservation. Model attempts under an obligation: one reserved amount, many attempts, at most one attempt not in a terminal failed state at a time.
Routing is a decision over the rail matrix. For each payout, the inputs are amount, urgency promised to the recipient, the rails the beneficiary’s bank supports, cost, and how much the platform is exposed if the pay-in behind it reverses. Low-value, non-urgent payouts belong on the cheapest batch rail. Urgent ones go instant where the receiving bank participates — RTP and FedNow reach is still uneven across US banks, so participation lookup is a live dependency with its own cache and staleness. Large amounts to new beneficiaries are where a slower, cancellable path is worth its delay. Keep routing a pure function with a logged decision, so that finance can answer “why did this go by wire” months later, and so a change of bank pricing is a config change, not a deploy.
In two of the six rows the deciding input is risk state, not rail price or speed. A router that only knows cost and urgency cannot express those decisions, so they end up as special cases in the payout job, where finance cannot see them and nobody tests them.
Two failure modes of routers are worth designing against. The first is fallback that changes the promise. An instant payout that fails because the receiving bank has dropped off the network, and silently falls back to next-day ACH, has broken the contract the seller paid for. Fallback must re-quote the arrival date, refund any speed fee, and emit the event that updates the dashboard, all in the same transaction as the reroute. The second is correlated rerouting. When one bank channel degrades, a router that fails over per payout moves the whole Monday batch to the second bank in minutes. That bank’s FBO pool was sized for its normal share, so the balance check fails and the outage has now spread to both channels. Failover must be capacity-aware: it knows the free balance in each pool, moves only what that balance covers, and queues the rest against the original channel with an honest date.
Finally, treat the partner bank as a dependency with an SLO. Banks have outages, missed file acknowledgements, delayed statements and, occasionally, regulatory orders that restrict new programmes. A single sponsor bank is a single point of failure for every payout you make; a second bank means two FBO pools, two reconciliations and routing logic that knows which pool funds which payout. It is expensive, and for a platform whose sellers depend on payout day it is usually worth it. Whatever you run, the internal invariant does not change: for each pool, the bank balance equals the sum of the ledger’s claims on it, plus explained timing items with owners and ages.
Where next