mhtirogla
Home
Systems
API
Pricing
About
Log in
← Back
Home
›
Systems
›
Finance and trading
risk-engine
real-time risk and margin engine
clearing house
System
Techniques · 12
Primitives · 34
risk-engine
Partitioned commit log
distributed · medium: A topic split into replicated append-only partitions: key hash keeps per-key order, offsets give position, and a high watermark limits readers to fully replicated records.
›
Windowed stream aggregation
distributed · medium: Group events by event-time window per key, keep one partial aggregate per slice, and emit a window when the watermark passes its end.
›
Margin liquidation
finance · medium: Mark-to-market margin calls and forced liquidation of under-margined positions, incl. insurance fund and auto-deleveraging
Portfolio margining span
finance · medium: Scenario-based portfolio margin (SPAN-style risk arrays, offsets across correlated products)
Value at Risk and Expected Shortfall
finance · medium: A loss threshold exceeded with probability 1−α over h days, plus the mean loss beyond it; three estimators trade speed for realism.
›
Incremental view maintenance
storage · medium: Update materialized views from deltas instead of recomputing
Vectorized execution
storage · medium: Query operators pass batches of about 1-2K values per column instead of single tuples, amortizing interpretation overhead and enabling tight SIMD loops.
›
Money representation
finance · 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 feed
networking · low: Exchange order-by-order data as fixed binary messages in sequenced UDP multicast packets
Black-Scholes-Merton formula
finance · low: Closed-form European option price and Greeks from spot, strike, time, rates and volatility; Newton inversion gives implied volatility. About 30 ns each.
›
Monte Carlo integration
numerics · 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 sourcing
finance · 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.
›
Pre-trade risk checks
finance · 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.
›
SIMD programming
hardware-os · low: Process 4-16 lanes per instruction with AVX2, AVX-512 or NEON via Rust std::arch, with runtime dispatch and a portable fallback.
›
PCA and SVD
machine-learning · low: Find orthogonal directions of maximum variance by an SVD of the centred data; randomized SVD gets the top k components in a few passes.
›
Low discrepancy sequences
numerics · low: Sobol, Halton and blue-noise sequences with scrambling for quasi-Monte Carlo
LU and Cholesky factorization
numerics · low: Factor A = PLU (any square matrix, partial pivoting) or A = LLᵀ (SPD) once in O(n³), then solve each right-hand side in O(n²).
›
Fast hash functions
data-structures · low: Non-cryptographic hashes built from 64×64→128-bit multiplies and xor-shifts; pick by key size, trust level and whether the hash is persisted.
›
Consumer offsets
distributed · 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.
›
Segmented log
distributed · low: Split an append-only log into files named by their first offset, write only the newest, and find any record by binary search plus a sparse index.
›
Zero-copy I/O
networking · low: Move bytes between files, sockets and NICs by passing page references instead of copying through user space: sendfile, splice, MSG_ZEROCOPY, kTLS.
›
Hash aggregation
storage · low: GROUP BY via hash tables with partitioning and spill to disk
Hierarchical timing wheel
systems · low: Timers bucketed by expiry into wheels of slots, coarser wheels for far deadlines: O(1) insert and cancel for millions of timeouts.
›
+ 5 more techniques
+ 18 more primitives
System
Techniques · 12
Primitives · 34
risk-engine
Partitioned commit log
distributed · medium: A topic split into replicated append-only partitions: key hash keeps per-key order, offsets give position, and a high watermark limits readers to fully replicated records.
›
Windowed stream aggregation
distributed · medium: Group events by event-time window per key, keep one partial aggregate per slice, and emit a window when the watermark passes its end.
›
Margin liquidation
finance · medium: Mark-to-market margin calls and forced liquidation of under-margined positions, incl. insurance fund and auto-deleveraging
Portfolio margining span
finance · medium: Scenario-based portfolio margin (SPAN-style risk arrays, offsets across correlated products)
Value at Risk and Expected Shortfall
finance · medium: A loss threshold exceeded with probability 1−α over h days, plus the mean loss beyond it; three estimators trade speed for realism.
›
Incremental view maintenance
storage · medium: Update materialized views from deltas instead of recomputing
Vectorized execution
storage · medium: Query operators pass batches of about 1-2K values per column instead of single tuples, amortizing interpretation overhead and enabling tight SIMD loops.
›
Primary-backup replication
distributed · 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.
›
Watermarks
distributed · medium: Event-time progress markers that bound lateness and trigger window results
Change data capture
storage · medium: Decode the database's own commit log into row-change events in commit order, with a resume position, so any consumer can mirror the data exactly.
›
LSM-tree
storage · medium: Buffer writes in memory, flush them as immutable sorted files and merge in the background; turns random writes into sequential I/O.
›
Incremental sync cursors
distributed · medium: The client keeps one opaque token; each pull returns only the changes after it plus the next token, so sync cost scales with what changed, not with the dataset.
›
Money representation
finance · 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 feed
networking · low: Exchange order-by-order data as fixed binary messages in sequenced UDP multicast packets
Black-Scholes-Merton formula
finance · low: Closed-form European option price and Greeks from spot, strike, time, rates and volatility; Newton inversion gives implied volatility. About 30 ns each.
›
Monte Carlo integration
numerics · 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 sourcing
finance · 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.
›
Pre-trade risk checks
finance · 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.
›
SIMD programming
hardware-os · low: Process 4-16 lanes per instruction with AVX2, AVX-512 or NEON via Rust std::arch, with runtime dispatch and a portable fallback.
›
PCA and SVD
machine-learning · low: Find orthogonal directions of maximum variance by an SVD of the centred data; randomized SVD gets the top k components in a few passes.
›
Low discrepancy sequences
numerics · low: Sobol, Halton and blue-noise sequences with scrambling for quasi-Monte Carlo
LU and Cholesky factorization
numerics · low: Factor A = PLU (any square matrix, partial pivoting) or A = LLᵀ (SPD) once in O(n³), then solve each right-hand side in O(n²).
›
Fast hash functions
data-structures · low: Non-cryptographic hashes built from 64×64→128-bit multiplies and xor-shifts; pick by key size, trust level and whether the hash is persisted.
›
Consumer offsets
distributed · 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.
›
Segmented log
distributed · low: Split an append-only log into files named by their first offset, write only the newest, and find any record by binary search plus a sparse index.
›
Zero-copy I/O
networking · low: Move bytes between files, sockets and NICs by passing page references instead of copying through user space: sendfile, splice, MSG_ZEROCOPY, kTLS.
›
Hash aggregation
storage · low: GROUP BY via hash tables with partitioning and spill to disk
Hierarchical timing wheel
systems · low: Timers bucketed by expiry into wheels of slots, coarser wheels for far deadlines: O(1) insert and cancel for millions of timeouts.
›
d-ary heap
data-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.
›
Double-entry ledger
finance · 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.
›
Covariance shrinkage
statistics · low: Ledoit-Wolf shrinkage for stable covariance matrices from few samples
Relational algebra
storage · low: Relational operators and equivalence rules: selection pushdown, join reordering, projections
Leases
distributed · 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.
›
Write-ahead log
storage · 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.
›
Health checking
systems · low: Decide per backend whether to route to it using probes and real-traffic errors, with consecutive-count hysteresis, capped ejection and a panic fallback.
›
Message sequence numbers
distributed · low: A per-stream counter on every message lets the receiver detect loss, duplicates and reordering, ack cheaply and resume after reconnect with "send from N".
›
Cursor pagination
networking · low: Keyset/opaque-cursor pagination for stable incremental reads from APIs and tables
Fencing tokens
distributed · low: A number that grows with every lock grant and is checked by the protected resource, so a paused ex-holder's late write is rejected.
›
Largest remainder rounding
finance · low: Splitting an amount into parts that sum exactly (largest remainder / Hamilton) for allocations, splits and prorations
CRC32C checksums
hardware-os · low: The Castagnoli CRC-32 with dedicated instructions on x86 (SSE4.2) and ARMv8. It is the standard fast integrity check for storage blocks, logs and network frames.
›
fsync, O_DSYNC and O_DIRECT
hardware-os · low: What fsync, fdatasync, O_DSYNC, O_DIRECT and F_FULLFSYNC really guarantee on Linux and macOS, and the exact call sequences for crash-safe files.
›
Rejection sampling
ml-training · low: Best-of-n and filtered sampling: generate many candidates, keep those passing a verifier or reward threshold
PRNGs (PCG, xoshiro)
numerics · low: Small, fast, statistically strong non-cryptographic generators: PCG32 and xoshiro256**, with seeding, parallel streams and unbiased ranges.
›
Optimistic concurrency control
storage · low: Run transactions without locks, record what they read, and validate at commit that nothing changed; fastest when conflicts are rare.
›
Slab allocator
systems · low: Pre-carve pages into equal-size slots per size class with an in-place free list: O(1) alloc and free, no external fragmentation, cache-warm reuse.
›
Token bucket
systems · low: A bucket of up to b tokens refilled at rate r; requests spend tokens, enforcing an average rate while allowing bursts of b.
›
Copy for AI
Similar systems
Share the most building blocks with this one.
portfolio-management
24 %
energy-trading
23 %
trading-risk-platform
23 %
clearing
22 %
ctrm
19 %