← Back
Home › Systems › Finance and trading

hft

high-frequency trading system

market maker

SystemTechniques · 2Primitives · 34 hft Clock synchronizationdistributed · medium: Estimate a clock's offset from four timestamps, filter out queueing noise, and steer the clock smoothly; NTP gets about a millisecond, PTP with hardware timestamps under a microsecond.›Market making inventory modelfinance · medium: Quote skew and spread from inventory risk (Avellaneda-Stoikov style) for continuous two-sided quotingLimit order bookfinance · low: Per-symbol store of resting orders as FIFO queues per price level; array-indexed ticks plus intrusive lists give O(1) add, cancel and best-price lookup.›Pre-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.›Sequenced multicast feednetworking · low: Exchange order-by-order data as fixed binary messages in sequenced UDP multicast packetsFalse sharingconcurrency · low: Independent variables written by different cores on one cache line force the line to bounce between cores; pad or regroup hot data to fix it.›Memory orderingconcurrency · low: What Relaxed, Acquire, Release and SeqCst atomics actually guarantee, what they cost on x86 and ARM, and which one each pattern needs.›Seqlockconcurrency · low: Readers copy shared data optimistically and retry if a sequence counter changed; zero reader writes, so reads scale perfectly with a single fast writer.›SPSC ring bufferdata-structures · low: Bounded wait-free queue for exactly one producer and one consumer thread, built from an array and two indices with acquire/release ordering.›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.›Low-latency hot pathfinance · low: Rules for microsecond trading paths: one pinned busy-polling thread per stage, no allocation, syscalls, locks or page faults after startup, kernel-bypass I/O, and measured tails.›Branch predictionhardware-os · low: How CPUs guess branch outcomes, what a misprediction costs, and when to replace branches with conditional moves, masks or sorted data.›CPU caches and the memory hierarchyhardware-os · low: Sizes, line widths and latencies of L1/L2/L3/DRAM on modern x86 and Apple M-series, and the data-layout rules that follow from them.›Cpu isolation and pinninghardware-os · low: Isolcpus/nohz_full, thread affinity and IRQ steering for jitter-free hot threadsFpga packet processinghardware-os · low: FPGA/SmartNIC pipelines that parse packets and act in hardware for nanosecond tick-to-tradeVirtual memory and the TLBhardware-os · low: How page tables and TLBs translate every address, what TLB reach means, and when 2 MiB or 1 GiB huge pages pay off on Linux.›IP multicastnetworking · low: Send each datagram once to a class D group address; the network copies it to every joined receiver, and sequence numbers let receivers find loss.›Kernel-bypass networkingnetworking · low: User space (DPDK, AF_XDP) or an in-driver eBPF hook (XDP) handles packets straight from NIC rings, skipping sockets, for 10-40 Mpps per core.›+ 18 more primitives

Similar systems

Share the most building blocks with this one.