← Back
Home › Systems › Finance and trading

clearing

central counterparty clearing

LCH, OCC

SystemTechniques · 7Primitives · 34 clearing Raftdistributed · medium: Leader-based consensus on a replicated log; one leader per term, majority commit; the default for a strongly consistent replicated state machine.›Margin liquidationfinance · medium: Mark-to-market margin calls and forced liquidation of under-margined positions, incl. insurance fund and auto-deleveragingMultilateral nettingfinance · medium: Netting obligations across many parties into one net position per participant per currencyPortfolio margining spanfinance · medium: Scenario-based portfolio margin (SPAN-style risk arrays, offsets across correlated products)Value at Risk and Expected Shortfallfinance · medium: A loss threshold exceeded with probability 1−α over h days, plus the mean loss beyond it; three estimators trade speed for realism.›Tamper-evident audit logsecurity · medium: An append-only log whose Merkle root, signed per batch, lets anyone verify an entry is present and history was never rewritten, with log-size proofs.›State-machine snapshotsdistributed · medium: Periodically save the state a log has produced at index i so the log prefix can be deleted; recovery and catch-up become load snapshot plus replay suffix.›Write-ahead logstorage · low: Append each change to a checksummed sequential log and fsync it before touching data pages; the basis of crash durability in nearly every database.›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.›Money 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.›Monte Carlo integrationnumerics · low: Estimate an expectation by averaging random samples; error falls as σ/√N in any dimension, and variance reduction (antithetic, control variates, importance sampling) shrinks σ.›Event sourcingfinance · low: Persist state changes as an append-only stream of immutable events per entity; current state is a fold over them, guarded by expected-version appends.›FIX protocol (session layer)finance · low: Tag=value order-entry protocol over TCP with per-direction sequence numbers, heartbeats and resend so sessions survive disconnects without losing or duplicating orders.›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.›Iso 20022 messagesfinance · low: ISO 20022 XML payment and securities messages (pacs, pain, camt, sese): structure and validationReconciliationfinance · 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.›Business day calendarssystems · low: Holiday calendars, business-day adjustment rules (following, modified following) and settlement cyclesLeasesdistributed · low: A lock that expires on its own: bounded-time ownership that survives crashes and partitions, given bounded clock drift and fencing tokens on writes.›Exponential backoff with jittersystems · low: Retry after delays that grow geometrically and are randomized, so failed clients spread out instead of hammering a recovering service in synchronized waves.›d-ary heapdata-structures · low: Array heap with d children per node (d = 4 typical): half the binary heap's depth, siblings in one cache line, faster priority queues.›Sequenced multicast feednetworking · low: Exchange order-by-order data as fixed binary messages in sequenced UDP multicast packetsHash aggregationstorage · low: GROUP BY via hash tables with partitioning and spill to diskBlack-Scholes-Merton formulafinance · low: Closed-form European option price and Greeks from spot, strike, time, rates and volatility; Newton inversion gives implied volatility. About 30 ns each.›+ 18 more primitives

Similar systems

Share the most building blocks with this one.