← Back
Home › Systems › Finance and trading

robo-advisor

automated portfolio rebalancing

Betterment

SystemTechniques · 10Primitives · 34 robo-advisor Durable workflow executiondistributed · medium: Ordinary code made crash-proof by logging every side-effect result and replaying the code from that log; activities run at least once, workflow logic must be deterministic.›Mean variance optimizationfinance · medium: Markowitz portfolio optimization with constraints and efficient frontierOrder lifecycle state machinefinance · medium: Order states (new, partial fill, cancel/replace, rejected, expired) with strict transitions and idempotent eventsTax lot accountingfinance · medium: Per-lot cost basis (FIFO, specific ID), wash-sale rules and tax-loss harvestingQuadratic programmingoptimization · medium: Convex QP solvers (active-set, interior-point, ADMM) for constrained optimizationDurable job queuedistributed · medium: Persisted tasks that workers lease for a visibility timeout, ack on success and retry with backoff; at-least-once execution that survives worker and queue crashes.›Interior-point method (primal-dual,…optimization · medium: Follows the central path with Newton steps on the perturbed KKT system, one sparse Cholesky per iteration; Mehrotra's predictor-corrector makes it fast.›Covariance shrinkagestatistics · low: Ledoit-Wolf shrinkage for stable covariance matrices from few samplesIdempotency 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.›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.›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.›Largest remainder roundingfinance · low: Splitting an amount into parts that sum exactly (largest remainder / Hamilton) for allocations, splits and prorationsPortfolio performance metricsfinance · low: Time-weighted and money-weighted returns, Sharpe, Sortino, drawdownThreshold rebalancingfinance · low: Drift-band portfolio rebalancing with minimal trades and cash-flow-aware allocationMonte 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 σ.›Record 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 rebuildEvent 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.›Hierarchical timing wheelsystems · low: Timers bucketed by expiry into wheels of slots, coarser wheels for far deadlines: O(1) insert and cancel for millions of timeouts.›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.›Hierarchical state machinesystems · low: Nest states so a substate inherits its parent's reactions and only overrides what differs, with ordered entry and exit actions along the path.›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.›Fifo lot consumptionfinance · low: Consuming quantities from dated lots in FIFO/FEFO order (points expiry, stock rotation)Calendar date arithmeticsystems · low: Civil dates, time zones (tzdb), DST gaps, month-end anchoring and duration math+ 3 more techniques+ 18 more primitives

Similar systems

Share the most building blocks with this one.