← Back
Home › Systems › Finance and trading

rtgs

central-bank real-time gross settlement for high-value payments: settlement accounts, liquidity-saving queues with gridlock resolution, intraday credit against collateral, ISO 20022 high-value messages, DvP/PvP links to CSDs and CLS, business-day cycle and contingency

Fedwire Funds, TARGET2/T2, CHAPS/RT2, BOJ-NET

SystemTechniques · 17Primitives · 48 rtgs Deterministic simulation testingdistributed · medium: Run the whole system in one thread under a seeded scheduler with simulated network, disk and clock, so every failure replays from its seed.›Exactly once processingdistributed · medium: Idempotent producers plus transactional offset+output commits for effectively-once resultsRaftdistributed · medium: Leader-based consensus on a replicated log; one leader per term, majority commit; the default for a strongly consistent replicated state machine.›Payment queue gridlock resolutioneconomics · medium: Queue of unsettled payments with offsetting search and multilateral cycle finding to release gridlockDelivery versus paymentfinance · medium: Atomic exchange of securities and cash so neither leg settles without the otherMultilateral nettingfinance · medium: Netting obligations across many parties into one net position per participant per currencyPayment state machinefinance · medium: Persisted state machine for a payment lifecycle (authorize, capture, void, refund) that treats timeouts as unknown, retries with the same key and applies webhooks idempotently.›Idempotency keysfinance · low: Client-chosen unique key per logical operation, stored with a request fingerprint and the final response, so retries replay the first result instead of acting twice.›Double-entry ledgerfinance · low: Append-only journal of transactions whose postings sum to zero per currency; balances are derived, so money can only move, never appear or vanish.›Iso 20022 messagesfinance · low: ISO 20022 XML payment and securities messages (pacs, pain, camt, sese): structure and validationDual control approvalsecurity · low: Four-eyes / maker-checker approval with quorum policies for sensitive operationsCollateral haircut valuationeconomics · low: Value pledged collateral with haircuts and eligibility rules to set credit limitsMoney representationfinance · low: Store money as integer minor units with an explicit currency exponent, compute in wider integers, and round once with a named rounding mode.›Reconciliationfinance · low: Match internal ledger records against bank and processor statements by reference, then amount and date window; every unmatched or mismatched item becomes an exception.›Mutual TLSsecurity · low: TLS where the client also proves a certificate key, so every connection carries a verified, rotatable machine identity.›X509 certificatessecurity · low: Certificate chains, path validation, SANs, revocation and short-lived issuanceBusiness day calendarssystems · low: Holiday calendars, business-day adjustment rules (following, modified following) and settlement cyclesCalendar date arithmeticsystems · low: Civil dates, time zones (tzdb), DST gaps, month-end anchoring and duration mathCooperative schedulingconcurrency · low: Green threads/coroutines yielding at await points on a user-space schedulerRecord replaydistributed · low: Record every nondeterministic input (time, randomness, I/O, model and tool outputs, per-tick player input) and re-execute deterministically for debugging, replays and state rebuildPRNGs (PCG, xoshiro)numerics · low: Small, fast, statistically strong non-cryptographic generators: PCG32 and xoshiro256**, with seeding, parallel streams and unbiased ranges.›Consumer offsetsdistributed · low: Each consumer group stores one integer per partition, the next position to read, so a restarted consumer resumes where it left off with at-least-once delivery.›Event deduplication windowdistributed · low: Keep the ids of recently accepted events for a time window and drop repeats; memory stays bounded by rotating time buckets instead of per-entry timers.›+ 10 more techniques+ 32 more primitives

Similar systems

Share the most building blocks with this one.