← Back
Home › Systems › Finance and trading

retail-brokerage

retail brokerage

Robinhood

SystemTechniques · 17Primitives · 65 retail-brokerage 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.›Primary-backup replicationdistributed · medium: One node orders all writes and ships them to standbys; the acknowledgement rule (none, one, all) sets what a crash loses, and an external arbiter decides who takes over.›Pub/sub fan-outdistributed · medium: Deliver one published message to every subscriber of a topic by sharing one encoded payload and giving each connection a bounded queue with an explicit slow-consumer policy.›Margin liquidationfinance · medium: Mark-to-market margin calls and forced liquidation of under-margined positions, incl. insurance fund and auto-deleveragingOrder lifecycle state machinefinance · medium: Order states (new, partial fill, cancel/replace, rejected, expired) with strict transitions and idempotent eventsPayment 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.›Tax lot accountingfinance · medium: Per-lot cost basis (FIFO, specific ID), wash-sale rules and tax-loss harvestingDouble-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.›Sequenced multicast feednetworking · low: Exchange order-by-order data as fixed binary messages in sequenced UDP multicast packetsFIX 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.›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.›Corporate-action adjustmentfinance · low: Keep raw bars plus a tiny table of cumulative backward factors, built by one reverse scan over events and applied at read time, versioned by as-of date.›Token bucketsystems · low: A bucket of up to b tokens refilled at rate r; requests spend tokens, enforcing an average rate while allowing bursts of b.›Passkeys (WebAuthn)security · low: Phishing-resistant login with a per-site key pair held by the device or password manager; the server stores only a public key.›Hdr histogramdata-structures · low: Log-linear bucketed histograms with bounded relative error for latency percentilesLargest remainder roundingfinance · low: Splitting an amount into parts that sum exactly (largest remainder / Hamilton) for allocations, splits and prorationsPre-trade risk checksfinance · low: Constant-time gate in front of order entry that rejects fat-finger, over-limit and runaway orders using worst-case exposure counted over open orders.›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.›Process supervisionhardware-os · low: A parent process starts services, reaps their exits and restarts them under a delay and burst-limit policy, then stops them with SIGTERM before SIGKILL.›WebSocketsnetworking · low: Full-duplex message framing over one upgraded HTTP connection; the standard way to push real-time data to browsers.›Mutual TLSsecurity · low: TLS where the client also proves a certificate key, so every connection carries a verified, rotatable machine identity.›+ 10 more techniques+ 49 more primitives

Similar systems

Share the most building blocks with this one.