The Trading Machine, One Slide At A Time


What actually happens between “buy” and “bought”?

If you have just joined a quant trading firm, your first month is a wall of acronyms: OMS, RMS, EMS, SOR, FIX, ITCH, colo, drop copy, refdata, TCA… and every meeting quietly assumes somebody already gave you the map. Nobody did. So here it is, as a deck.

How to use it: each slide builds itself, step by step, as it scrolls into view.

  • Click a slide (or use the ‹ › buttons) to step through at your own pace; ↻ replays, ⛶ presents it fullscreen.
  • The colours mean the same thing everywhere: blue is market data, orange is orders, red is risk, green is post-trade, violet is oversight.

Nothing here is specific to any one firm; it’s the textbook shape of electronic trading, the kind of thing you could reconstruct from exchange manuals and regulator rulebooks. Brief notes under each slide, an appendix for the parts the textbook skips, and a jargon glossary at the end. That’s it. The slides are the post.

The Agenda

The Trading Machine: an onboarding deckTitle slide showing a firm and an exchange connected by an orders arrow and a market data arrow, plus a colour legend for the five planes used across the deck.AN ONBOARDING DECKThe Trading MachineEvery box you will hear in your first month on a trading floor, and how they connect.Your firmstrategies · riskExchangematching engineordersmarket datamarket dataordersriskpost-tradeoversightcolour = plane · the same coding on every slidegeneric industry knowledge · nothing here is specific to any one firm

The Whole Machine On One Slide

Map of a trading firm and an exchangeA firm with research, strategies, OMS, risk gate, gateway and feed handlers connects to an exchange with gateway, matching engine and market data publisher; a post-trade strip runs from clearing house to settlement to back office, with a compliance banner underneath.01 / 14The whole machine on one slideTwo planes moving in opposite directions, one gate, one ledger, and everyone being watched.YOUR FIRMEXCHANGEStrategiesdecide what to tradeconsume data · emit ordersMatching engineprice-time priority · auctionsMarket data publisherA/B multicast fan-outFeed handlers · booksdecode · arbitrate · rebuildmarket data · multicastResearch · alphasOMS · the ledgerRisk gatepre-tradechecksGatewayvenueadaptersExchange gatewaysessions · throttlesorders · FIX / nativeacks · fillsfillsClearing house (CCP)novation · netting · marginSettlement · custodyT+1 · assets vs cashYour back officereconciliation · books · NAVCompliance and regulators see everythingdrop copy of every order · synced clocks · full audit trail · surveillance · reportingEvery slide after this one zooms into a box on this slide.

Two planes moving in opposite directions, and everything else is bookkeeping around them:

  • Market data flows out of the exchange (blue); orders flow into it (orange).
  • The risk gate has veto power on the way in; the OMS remembers everything that happened.
  • Orientation the slide can’t say out loud: a quant fund is the buy side, brokers and banks are the sell side, exchanges are venues.

Every slide after this zooms into one box.

Front, Middle, Back

Front, middle and back officeThree panels listing what front office, middle office and back office each do, with their mandates.02 / 14Front, middle, backThe oldest split in the industry. It is about mandate, not floor plan.FRONT OFFICEmandate: make the moneyportfolio managers · quantstraders · execution deskstrading-systems engineersresearch platform · data eng(sell side: sales desks)MIDDLE OFFICEmandate: keep it measuredrisk management · limitsP&L · product controltrade support · bookingtreasury · margin · collateralcompliance (its own pillar)BACK OFFICEmandate: make it realsettlements · the T+1 machineryreconciliation vs brokerscorporate actions processingbooks · records · NAVclient · fund reportingThe borders blur in practice. In a quant fund, engineers sit in all three,and the org chart is really a data flow.Front runs fast. Middle keeps score. Back makes it true.

Mandates, not floor plans:

  • Front makes the money. Middle keeps the score honest. Back makes it real.
  • The borders blur in practice; in a quant fund, engineers sit in all three.
  • The slow halves kill firms faster than slow strategies do… breaks and unexplained P&L end careers quietly.

Life Of An Order

Life of an order in ten stepsTen numbered boxes from alpha firing through risk checks, routing, acknowledgement, fill, position update, drop copy, clearing and settlement.03 / 14Life of an orderTen steps from a signal to settled cash. Two very different clocks.Alpha firessignal: price lookscheap vs fair value1Strategy decidesinstrument · sidesize · price2Risk gatelimits · collars ·throttles all pass3Routed · sentvenue picked, orderencoded on the wire4Exchange acksorder now restingin the book5Fill!matched at the topof the queue61 → 6: the fast loop · tick-to-trade in microsecondsPosition updatesOMS ledger moves ·PnL marks tick7Drop copy fans outrisk · compliancesee it independently8ClearedCCP nets it andmargins it9Settled T+1securities moveagainst cash107 → 10: the truth loop · milliseconds, then hours, then next dayThe fast loop trades. The truth loop makes it official.

Ten steps, two clocks:

  • Steps 1 to 6 are the fast loop: tick-to-trade, in microseconds.
  • Steps 7 to 10 are the truth loop: milliseconds, then hours, then next day.
  • A trade is not done when you get the fill. It’s done when it settles and reconciles, and the gap between those two “done”s employs half the industry.

The Market Data Plane

Market data planeMatching engine feeds a market data publisher which sends redundant A and B multicast feeds to a feed handler, then order books, then an internal bus fanning out to strategies, risk and capture.04 / 14The market data planeExchange publishes once over multicast. Everything downstream is your problem.Matching engineMD publisherone stream, everyoneFeed handlerarbitrate A vs B · fill gapsdecode → normalized ticksfeed A · UDP multicastfeed B · same packetsOrder booksL1 · L2 · L3your local truthinternal distribution · shared-memory rings · internal multicastStrategiestrade on itRisk · monitoringwatch itCapture · researchreplay it latergaps? sequencenumbers betray them;recover via snapshot /retransmission channelYou never see “the” book. You rebuild your own copy, packet by packet.

The exchange publishes each packet once over UDP multicast; everyone in the datacenter hears it at the same nominal moment. From there, it’s your problem:

  • Two identical feeds (A and B) cover packet loss; sequence numbers expose gaps.
  • You rebuild the order book yourself, packet by packet. There is no “the” book, only your copy.
  • US wrinkle: a consolidated tape (the SIP) computes the official NBBO under Reg NMS,1 and fast firms take the direct feeds and beat it.
  • When arrival times quietly stop being equal, regulators get involved… India has an entire saga about it.

The Order Book

A limit order bookA price ladder with five ask levels above a highlighted spread row and five bid levels below, annotated with L1, L2 and an L3 queue inset showing price-time priority.05 / 14The order bookThe central data structure of the whole industry: resting limit orders, sorted by price.100.052100100.04900100.031650100.02700100.01400asks · sellers100.0055099.99120099.9880099.97240099.961100bids · buyersspread = 1 tick (0.01) · mid = 100.005best askbest bidL1 · top of bookbest bid & ask onlyL2 · depthsize per price levelL3 · queueat 100.00:220160youprice-time priority:queue = the gametick = smallest price step (0.01 here) · lot = smallest size step · imbalance = bid size vs ask sizeL1 is the price. L2 is the depth. L3 is your place in line.

The one data structure to internalize this year:

  • Prices move on a grid (the tick), sizes come in lots, and at every price there is a queue.
  • L1 is the best bid and ask, L2 is depth per level, L3 is every order in line.
  • Under price-time priority, your queue position is your economics; for market makers, the queue is the game.

The Order Plane: OMS, EMS, SOR

Order management and execution flowIntent flows to OMS, then EMS execution algos, then a pre-trade risk gate, then a smart order router fanning out through native and FIX adapters to exchanges, dark pools and brokers, with drop copy to surveillance.06 / 14The order planeFrom “I want 50k” to venue-native bytes, with a risk gate in the middle of the road.IntentPM / strategy:“buy 50k ACME today”OMSparent order · positionslimits · the ledgerEMS · exec algosslice parent intochild ordersPre-trade riskevery child order,microsecond budgetchildrenSmart order routerpick venue by price,fees, queue, speedNative adapterExchange ANative adapterExchange BFIX adapterBroker DMA · algosExchange AExchange BDark pool / brokerDrop copyrisk · surveillanceHFT reality: the strategytalks to the gatewaydirectly. The OMS becomesthe ledger, not the hot path.acks and fills stream back over the same sessions; the OMS keeps the running truth of what you own.OMS remembers. EMS decides how. Adapters speak each venue’s language.

From “I want 50k” to venue-native bytes:

  • OMS is the system of record, EMS slices parent orders into child orders, the SOR picks venues, adapters speak each venue’s dialect.
  • In HFT these blur into one custom stack and the strategy talks to the gateway directly.
  • Drop copy gives risk and compliance their own independent feed of everything you do.

One Order’s State Machine

Order state machineStates from Sent to Live to Partially filled to Filled, with Rejected and Canceled branches, modify and more-fills loops, and a note that every transition is an execution report.07 / 14One order’s state machineOne order with real numbers: buy 500, limit 100.25. The exchange’s word is the only truth.SentPendingNew · on the wirebuy 500 @ 100.25Liveacked (New) · resting0 done · 500 openackPartially filledfill for 200 arrives:200 done · 300 openFilledfinal fill lands:500 / 500 donefill 200final +150cancel / replace (modify price or size)more fills: +150 → 350 / 500Rejectednever accepted:0 / 500 tradedvalidation failsCanceledkills only the open 150;the 350 done stays yourscancel request · halt · disconnectevery arrow arrives as anexecution report (FIX 35=8)carrying cumQty (done) andleavesQty (still open).done + open = 500, always.parse them or fly blind.You are what got acked and filled, not what you sent.

Follow the numbers: buy 500, ack, a fill for 200, another for 150, the final 150.

  • Every arrow is an execution report (FIX 35=8) carrying cumQty (done) and leavesQty (still open).
  • done + open must equal 500 at every step… the first invariant you’ll ever assert.
  • The subtle corner: cancels (yours, or the exchange’s on a halt or disconnect) kill only the open quantity. The 350 already done stays yours.
  • This is the happy path. The full state machine, in-flight windows and all, gets its own appendix slide.

How Machines Talk To Markets

FIX versus native binary protocolsLeft panel shows a FIX new order message with tag callouts and session-layer notes; right panel shows a fixed-offset binary message layout with examples like ITCH, OUCH, MDP3 and EOBI.08 / 14How machines talk to marketsTwo dialects for the same conversation.FIX · the lingua franca8=FIX.4.4 35=D 49=FUND 56=BRKR 11=ORD-4255=ACME 54=1 38=500 40=2 44=100.2559=3 60=20260721-13:30:05.123 10=08735=D new order · 54=1 buy · 38=500 qty40=2 limit · 44=100.25 price · 59=3 IOCsession layer: seq numbers · heartbeats · resendtext tags: flexible, verbose, slower to parselives on: broker links · drop copy · allocationsone standard, everywhere on the street since the 90sNative binary · the fast lanelentypetokensideqty u32symbol c8price i64fixed offsets · every byte where the spec says it isbranchless, allocation-free decodenanoseconds to parse, not microsecondsper venue, not portable · you write one adapter eachITCHNasdaq market data · order-by-order (L3)OUCHNasdaq order entryMDP3 · iLink 3CME data · orders (SBE encoded)EOBI · ETIEurex data · ordersmarket data side and order side are separate protocolsboth sides say the same things: new / modify / cancel in, execution reports outFIX is how the street talks. Native is how you race.

Two dialects for one conversation:

  • FIX is the street’s shared text language, alive since the 90s:2 flexible, verbose, everywhere reach matters.
  • Native binary protocols (ITCH, OUCH,3 MDP3, EOBI) are each venue’s fast lane: fixed byte offsets, decoded like casting a struct pointer.
  • The difference compounds: nanoseconds instead of microseconds, a few million times a day.

The Risk Machine

Risk management layersThree panels for pre-trade inline checks, at-trade controls like kill switches and cancel-on-disconnect, and post-trade monitoring, with notes on SEC 15c3-5 and MiFID II RTS 6.09 / 14The risk machine (RMS)Three lanes on one timeline: before, during, after. The first one runs in the hot path.BEFORE · pre-tradeinline, on every single orderprice collars · fat-finger bandsmax order size · max notionalposition · exposure limitsself-trade preventionrestricted · halted symbolsthrottles · duplicate checksDURING · at-tradealways on, while orders liveopen-order · cancel trackingcancel-on-disconnectkill switch: strategy, session,desk, or the whole firmexchange-side limits tooAFTER · post-trademinutes to dailylive positions · PnL marksmargin · buying powerstress tests · limit reviewsreports to desk heads · CROthe pre-trade lane runs inside the hot path, so its latency budget is nanoseconds to microsecondsUS: SEC rule 15c3-5 · pre-trade checks are the lawfor anyone with market accessEU: MiFID II RTS 6 · kill functionality and annualself-assessment for algo firmsThe kill switch is the feature you build praying it never fires.

Three jobs wearing one name:

  • Pre-trade: inline checks on every single order, inside the hot path’s latency budget.
  • At-trade: kill switch, cancel-on-disconnect, open-order tracking while orders live.
  • Post-trade: positions, margin, stress.

None of it is optional politeness: SEC rule 15c3-5 makes pre-trade controls law in the US,4 MiFID II RTS 6 mandates kill functionality in the EU.5 Ask an old-timer about Knight Capital.6

Compliance And The Regulators

Compliance, surveillance and regulatorsThree panels covering manipulation patterns surveillance hunts, the audit-trail plumbing that proves behaviour, and the regulators watching in each region.10 / 14Compliance and the regulatorsThe violet plane. It does not make money. It keeps the licence to make money.WHAT SURVEILLANCE HUNTSspoofing · layering (fake depth)wash trades (self-matching)marking the closemomentum ignitioninsider dealingbest-execution failuresPLUMBING THAT PROVES ITevery order event, archivedclocks synced to UTC (HFT:within 100 µs, MiFID II)drop copy: independent feedreporting: CAT (US) · MiFIR (EU)comms surveillance: chats, callsWHO IS WATCHINGUS: SEC · FINRA · CFTCUK: FCA · EU: ESMA + nationalIN: SEBI · SG: MAS · HK: SFCthe exchanges themselvesyour own compliance desk,who see it firstnone of this is optional, and almost all of it is engineering: pipelines, clocks, storage, replayIf it is not timestamped and replayable, it did not happen.

The violet plane keeps the licence to make money, and it’s mostly engineering:

  • Every order event archived; drop copies feeding surveillance independently of you.
  • Clocks within 100 µs of UTC for HFT under MiFID II.7
  • Every US order event reported to the Consolidated Audit Trail.8

I’ve made the wider argument before: a fair market is one the regulator can replay. Inside a firm, the same bar applies to you.

Reference Data

Securities master and reference dataA central securities master connected to identifiers, contract specs, calendars, corporate actions, fees and universe data, with a strip of classic refdata failure modes.11 / 14Reference dataThe unglamorous slide. Also the one that ruins the most weekends.Securities masterone golden recordper instrumentIdentifiersticker · ISIN · CUSIP · SEDOLRIC · FIGI · exchange symbolContract specstick size · lot size · multiplierexpiry · currency · segmentCalendarssessions · holidays · half-daysauction times per venueCorporate actionssplits · dividends · renameshistory must be adjustedFees · costsmaker-taker · exchange feesborrow cost · stamp dutyUniverseindex membershipborrowable · locate listswrong tick size → rejects all day · missed split → phantom overnight PnLstale calendar → quoting into an auction you did not know aboutRefdata bugs do not crash. They trade the wrong thing, quietly.

One golden record per instrument: identifiers, tick sizes, calendars, corporate actions, fees.

  • Refdata bugs are special because nothing crashes; the system runs fine and is simply wrong.
  • Wrong tick size rejects all day; a missed split invents overnight PnL; a stale calendar quotes into an auction you didn’t know existed.
  • Needless to say: when a number looks insane, check refdata before you check your math.

Alphas, Strategies, Execution

Alpha research and executionA pipeline from data through research, alpha, portfolio, execution and TCA with a feedback loop; a horizon spectrum from microseconds to weeks; and panels for strategy families and execution algos.12 / 14Alphas, strategies, executionResearch finds edges. Strategies express them. Execution pays the toll to get in.Dataticks · books · altResearchfeatures · backtestsAlphaE[return] · horizonPortfoliotargets · limitsExecutionchild ordersTCAcost vs benchmarkthe loop that keeps you honestalpha horizon (how long until the signal pays off) decides the tech you need:µs – msmarket making · latency arbseconds – minutesmicrostructure signalsintraday – daysstat arb · mean reversionweeks +fundamental quantshorter horizon → more infrastructure. longer horizon → more model.STRATEGY FAMILIES · the whatmarket making: quote both sides, earn thespread, dodge adverse selectionarbitrage: cross-venue · ETF vs basket · basisdirectional: momentum · mean reversionEXECUTION ALGOS · the howVWAP / TWAP: follow a volume or time schedulePOV: stay near x% of printed volumeIS / arrival price: urgency vs market impacticeberg · dark: show little, hide the sizeAlpha picks the destination. Execution decides what the trip costs.

An alpha is a prediction with a horizon, and the horizon decides the technology:

  • Microsecond signals need the next slide; multi-week signals need better models.
  • Execution is its own discipline: VWAP, POV, arrival price… getting size done without moving the market against yourself.
  • TCA measures what it actually cost, and the loop from TCA back to research is what keeps you honest.

Alpha picks the destination; execution pays the toll.

The Speed Layer

The HFT speed layerA colo rack stack from matching engine through a layer-1 switch into FPGA and kernel-bypass software paths, next to a log-scale latency ladder from a 5 nanosecond switch hop to a 150 millisecond human blink.13 / 14The speed layer (HFT)Where the market data and order planes get compressed until physics shows up.INSIDE THE EXCHANGE COLOExchange matching engineL1 switch fan-out · ~5 nsFPGA pathdecode · risk · fireall in silicon~100s of nsSoftware pathkernel-bypass NICpinned C++ · busy-poll1 – 10 µstick in → decision → order out, at the bottom of the rackPTP · GPS clockshw timestampscapture allTHE LATENCY LADDER(log scale: every step right is 10×)L1 switch hop~5 nsFPGA tick-to-trade~0.1 – 1 µstuned software tick-to-trade1 – 10 µskernel TCP round trip (why bypass exists)tens of µsbetween NJ equity datacenters~100s of µsChicago ↔ NJ: microwave ~4 ms · fiber ~6.5 msone waya human blink~150 ms1 ns1 µs1 ms1 sBelow a microsecond, the network diagram is part of the strategy.

My corner of the world.

  • Inside the colo: layer-1 switches, kernel bypass, pinned busy-polling C++ with the NUMA topology minded, and FPGAs when software is still too slow.
  • Between cities, physics takes over: microwave cuts Chicago to New Jersey from ~6.5 ms to ~4 ms one-way, near the ~3.9 ms light limit.9
  • Treat every number as an order of magnitude; the ratios are the point. A blink is 150 ms.

The machines are not playing our sport.

Post-Trade: Where It Becomes Real

Clearing and settlement chainA chain from trade to CCP clearing with novation and margin, to settlement at T+1, to custody, plus prime broker and back-office reconciliation boxes.14 / 14Post-trade: clearing and settlementThe emerald plane. Slow, boring, and the only part that legally matters.The tradeyou ↔ someone,matched in µsCCP · clearingnovation: CCP takes bothsides · netting · marginSettlementdelivery vs payment ·US equities T+1Custodycustodian holds assets ·your records must matchinitial margin: posted up frontvariation margin: settled as prices movePrime broker (for funds)financing · stock borrow for shortsone face to many venues · custodyYour back office, every dayreconcile: our books vs broker vs custodiancorporate actions · NAV · books and recordswhen your number and their number disagree, that is a “break”, and someone’s evening is goneThe fill is instant. Ownership takes a day. Truth takes a reconciliation.

The emerald plane, where the trade becomes legally true:

  • The CCP steps in via novation (buyer to every seller, seller to every buyer) and demands margin.
  • Settlement moves securities against cash: T+1 in US equities since May 2024,10 T+2 in much of the world.
  • Every day, your back office reconciles your books against the broker’s and the custodian’s. A mismatch is a “break”, and someone’s evening is gone.

The fill is instant. Ownership takes a day. Truth takes a reconciliation.

You Already Know This Machine

If you came into this from a CS degree, wondering how much of it is genuinely new: less than you’d fear. Strip the vocabulary off and half the deck is systems you have already built in college, just with a P&L attached.

Computer science to trading floor mappingNine rows pairing familiar CS concepts with their trading-floor names: sorted maps to order books, pub/sub to market data, state machines to order lifecycles, event sourcing to the OMS, tee to drop copy, config to refdata, event loops to matching engines.A2 / A5You already know this machineThe systems you built in college, wearing finance names.a sorted map of FIFO queuesthe order book · slide 5pub/sub over UDP multicastthe market data plane · slide 4a state machine with an invariantthe order lifecycle · slide 7a session protocol: heartbeats, replaya FIX sessionfixed-offset structs, zero-copy readsnative protocols: ITCH, OUCHan event-sourced ledgerthe OMStee on a streamdrop copyconfig managementrefdata · slide 11a single-threaded event loopthe matching engineNew vocabulary. Old computer science.

Row by row, with the details:

You know it asThe floor calls it
a sorted map of FIFO queuesthe order book (slide 5): price levels are the keys, time priority is the queue
pub/sub over UDP multicastthe market data plane (slide 4): the exchange publishes once, everyone subscribes
building reliability on an unreliable transportA/B feed arbitration: sequence numbers, gap detection, retransmission requests
a state machine with an invariantthe order lifecycle (slide 7): done + open = sent, at every step
a session protocol with heartbeats and replayFIX: sequence numbers, resend requests, heartbeats… TCP’s ideas at message level
casting a pointer onto a fixed-offset structnative binary decoding (slide 8): ITCH and friends are specs for exactly this
an event-sourced ledgerthe OMS: current state is a fold over every execution report ever received
tee on a streamdrop copy: the same order flow, duplicated to an independent consumer
config managementrefdata (slide 11): wrong config never crashes, it just misbehaves expensively
a single-threaded event loopthe matching engine: strictly sequential per instrument, determinism is the product

The computer science is the familiar part. What’s actually new is the domain: why the queue position pays, why the invariant is money, why the config file can lose a fortune quietly. That’s the part worth your first year.

The Vocabulary

The slides carried most of it. Here’s the rest of the week-one jargon, in five tables and no ceremony.

The things you trade

The deck talks about orders all day and never says what’s being bought. If markets are new to you, this is the missing slide zero.

The instruments: equity, index, future, optionFour cards: equity and index as cash instruments, future and option as derivative contracts whose value derives from an underlying, plus a panel defining long, short, margin, leverage and hedge.A1 / A5What you're actually tradingEverything on the floor is one of these four, or a basket of them.CASH · OWNERSHIPEquitya share of a companycash segment · you own itIndexa basket: Nifty 50, S&P 500tracked, not traded directlyDERIVATIVES · PROMISESFutureprice locked today, settled at expirymargin up front · inherently leveragedOptionthe right, not the obligationcall = right to buy · put = right to sellstrike · expiry · premium up frontvalue derives from the underlyingTHE WORDS THAT COME WITH THEMlong profits when it rises; short profits when it falls (shorting equities needs a borrow first)margin: collateral the clearing house demands · leverage: notional bigger than your cashhedge: a position whose only job is to cancel a risk you didn't wantCash is ownership. A derivative is a promise with an expiry date.
TermMeaning
equitya share of a company; what the cash segment trades
indexa basket standing in for a market (Nifty 50, S&P 500); traded via futures, options and ETFs
derivativea contract whose value derives from something else: a stock, an index, a rate
futurelock a price today, settle later; margin posted up front makes it inherently leveraged
optionthe right (not the obligation) to buy (call) or sell (put) at a strike price by an expiry; you pay a premium for it
expirythe day a derivative stops existing; derivative desks live by this calendar
long / shortpositioned to profit if it rises / falls; shorting equity means borrowing shares first
margincollateral the clearing house demands so your promises are believable
hedgea position whose only job is to cancel a risk you didn’t want

Orders you can send

TermMeaning
market ordertrade now at whatever the book offers; you pay the spread
limit ordertrade at my price or better; may rest in the book
IOC / FOKimmediate-or-cancel (partial fill ok) / fill-or-kill (all or nothing); never rests
day / GTChow long an unfilled order lives: today, or until cancelled
post-onlyrest in the book or be rejected; never take liquidity
icebergdisplay a small slice, hide the full size
pegprice tracks a reference (mid, best bid) automatically
stopdormant until a trigger price trades, then goes live

Market structure

TermMeaning
maker / takerresting order that gets hit = maker (often earns a rebate); aggressor = taker (pays the fee)
auctionbatch match at the open and close; the close is the day’s biggest liquidity event
halt / LULDtrading pauses; limit-up-limit-down bands stop runaway prices in US equities
dark poolvenue with no displayed book; typically matches at the midpoint, hides intent
DMA / sponsored accesstrading venues directly through a broker’s membership and infrastructure
NBBOthe official US national best bid and offer, consolidated across venues
basis / rollfutures price minus spot; migrating positions to the next contract before expiry

Risk and PnL

TermMeaning
notionalsize times price: what the position is “worth” on paper
gross / net exposuresum of absolute position values / the same sum with signs
mark-to-marketvaluing positions at current prices; splits PnL into realized and unrealized
drawdownpeak-to-trough loss; the number risk managers actually fear
Sharpereturn per unit of volatility; the quant scoreboard
ADVaverage daily volume; your size as a fraction of ADV predicts your impact
slippagewhat you actually paid versus the price when you decided
adverse selectionyour resting orders fill exactly when the price is about to move against you
locate / borrowto sell short you must first find shares to borrow

Latency

TermMeaning
tick-to-trademarket data in to order out; the headline latency number
wire-to-wiremeasured on the wire by hardware taps, not by your own code’s opinion
p50 / p99median versus tail latency; in HFT the tail is the story
jittervariance of latency; determinism often beats raw speed
colo / cross-connectyour servers in the exchange’s datacenter, cabled to its network

If Your Desk Is In India

The deck is deliberately generic, and its legal examples lean US and EU because that’s where the textbook was written. But there’s a decent chance you’re reading this from Mumbai… and India’s copy of the machine has real personality. Some of it, to be honest, is ahead of the textbook.

The Indian market wrinkleNSE and BSE with no consolidated tape, a SEBI panel with algo approval and pre-trade checks, guardrails with circuit breakers and no dark pools, and a strip noting T+1 since January 2023 and the closing auction arriving August 2026.A3 / A5The Indian editionSame boxes, different laws, occasionally ahead of the West.NSE#1 derivatives venue on Earthby contracts traded, since 2019BSEAsia's oldest exchangeno consolidated tape · no NBBOyou take each venue's own feedSEBI · THE REFEREEevery algo needs exchange approvalexchange pre-trade checks, in front of yoursretail algo orders carry IDs (2025)THE GUARDRAILSindex circuit breakers: 10 / 15 / 20%single stocks: price bands, not haltsno dark pools · size via block windowsAHEAD OF THE TEXTBOOKT+1 settlement: every stock since Jan 2023 · the US caught up in May 2024the close: VWAP of the last 30 minutes · a real closing auction only lands Aug 2026Same machine, Mumbai tuning. Ask an old-timer about the colo saga.

The fine print, with sources:

The deck saysYour Indian desk says
venues, plural, plus a consolidated tapeNSE and BSE, no consolidated tape, no NBBO: you take each venue’s own feed. And by contracts traded, NSE has been the world’s largest derivatives exchange five years running, and counting.11
pre-trade risk checks are the lawsame instinct, different shape: every algo needs exchange approval, and the exchange runs its own price and quantity checks in front of yours.12 Since 2025, retail algo orders carry exchange-assigned IDs too.13
LULD bandsindex circuit breakers at 10 / 15 / 20% halt the entire market; individual stocks get price bands instead of halts.14
T+1 in US equities since May 2024since January 2023 here. India finished its phased move to T+1 before the US began.15
the close is an auctionnot yet! India’s close has been the VWAP of the last 30 minutes; a real closing auction only arrives in August 2026, for stocks with derivatives.16
dark poolsnone. Off-book size goes through the exchanges’ block-deal windows: on-exchange, size-gated, disclosed.17
colo and cross-connectsNSE colo, with a history worth knowing before someone tells you the folklore version: the unfair millisecond.
fees are refdatavery much so: STT, stamp duty and exchange charges ride on every trade, and the tax line is part of the strategy math, not a rounding error.

Add the rhythm: the market runs 9:15 to 15:30 IST with a pre-open auction, and derivative expiry days set the pulse of the week.

One more India-specific thing: NISM. SEBI’s certification institute runs a series of exams, and depending on your seat, compliance may sign you up for one in month one (Series VIII if you touch derivatives,18 Series VII if you sit near ops and settlement19). Don’t groan. The workbooks are free PDFs, and they’re quietly the official India edition of slides 3, 9 and 14.

The Architecture Everyone Reinvents

One more diagram, because you will meet this pattern in month one and nobody will name it for you. Exchanges run it. Fast firms run it. The build ladder below ends at it.

The sequencer architectureGateways, feed handlers and timers feed a single sequencer that stamps a global order onto an append-only stream; strategy, risk, OMS and capture consume the same stream and derive identical state, with a dashed replay loop for recovery.A4 / A5The sequencerThe architecture behind exchanges and fast firms alike.Gatewaysorders inFeed handlersticks inTimers · admineverything elseSequencerone process owns timestamps the global sequencethe stream · an append-only log#1#2#3#4#5#6Strategy · matchingRiskOMS · ledgerCapture · replaysame events · same order · identical state, everywherecrash? replay the log from #1 · determinism is the fault toleranceOne process owns time. Everyone else just agrees.
  • One process (the sequencer) stamps a global order onto every event: orders, ticks, timers, everything. That stamp is the consensus; there’s no distributed agreement protocol in the hot path.
  • Every consumer (strategy, risk, OMS, capture) reads the same stream and derives identical state. Disagreement between systems becomes structurally impossible, which is half of what slide 14 spends its life reconciling elsewhere.
  • Recovery is replay: crash, rejoin, re-read the log from event #1, arrive at the same state. Determinism is the fault tolerance.
  • It’s also the debugger. Any production moment can be reproduced tick by tick, which is worth more than any log line you will ever print.

The LMAX architecture is this pattern built around ring buffers; Jane Street’s exchange talk is this pattern grown into a venue. Once you see it, you can’t unsee it.

The Order FSM, Properly

Slide 7 showed one order’s happy path with real numbers. The full machine has more corners, and you should be able to draw all of them: every state, every event that moves it, and the two windows where you’ve asked for something and the exchange hasn’t answered yet.

The order state machine, formallyA state diagram: PendingNew to Live to Partially filled to Filled via acks and fills, Rejected on validation failure, PendingCancel and PendingReplace as dashed in-flight states, Canceled killing only open quantity, plus a panel of corner cases about late fills, duplicate reports and torn reads.A5 / A5The order FSM, properlyEvery state, every event that moves it, and the two windows where you are waiting on the exchange.PendingNewon the wireLiveacked · restingPartially filledsome done, some openFilledackfillfinal fillor filled in one printRejectedrejectPendingCancelcancel in flightCanceledopen qty onlycancel sentcancel ackhalt · disconnect · day endfills can still land in here!PendingReplacemodify in flightreplace sentreplace ack · new price = back of the queuedashed = you asked, the exchange hasn't answered · double border = terminalTHE CORNERS THAT PAGE YOUa fill arrives for an order you think is Canceled: the exchange wins, you were wrongduplicate or out-of-order reports: dedupe by execID, trust the sequence, resync when confusedstate, cumQty and leavesQty must change together: a torn read breaks done + open = sentYour enum is a cache of the exchange's truth. Cache invalidation is famous for a reason.

Then make it an exercise, because it is one:

  • Enumerate the events, not the states: ack, reject, fill, cancel ack, replace ack, unsolicited cancel, expiry. States are just what’s left behind after events, and the exchange’s execution reports are the only input that moves anything.
  • The in-flight windows (PendingCancel, PendingReplace) are where the bugs live. Fills can and do land inside them: your cancel isn’t a cancel until the exchange says so, and the fill that raced it is still yours.
  • Now represent it in code, and feel the floor drop. One atomic enum? Fine, until cumQty and leavesQty need to move together with the state… a torn read between them breaks the invariant. So: pack state and both quantities into one 64-bit word and swap it atomically? Single-writer with a seqlock for readers? A version counter the hot path validates before acting? Each of these is a real production design, and choosing between them is the exercise.
  • Decide what happens on an illegal transition: a fill for an order you believe is Canceled, a duplicate execution report, a report for an order you’ve never heard of. The boring, correct answer: the exchange wins, log loudly, resync from a snapshot. Your enum is a cache of their truth.

Draw the diagram from memory before you write the enum. If your drawing has an arrow you can’t explain, so will your code.

Where To Start

  1. Learn the map (slide 1) until you can redraw it from memory. Whiteboard it. Seriously.
  2. Then the order book and the order state machine (slides 5 and 7); they sit underneath every conversation you’ll have for years. When slide 7 starts feeling trivial, the full FSM is the deep end.
  3. Go deep on whichever plane your team owns. Let the rest stay a map until it becomes relevant. It will.
  4. Interrogate your own firm; the deck is generic, your paycheck isn’t. Five questions for week one: which venues and segments do we trade? Which plane does my team own? What’s our tick-to-trade budget (microseconds and milliseconds are different careers)? Where does the truth live when two systems disagree? And what was our worst day, and what changed after it? Every firm has a Knight story. Learn yours early.
  5. The book everyone recommends is Larry Harris, Trading and Exchanges. To be honest, I haven’t read it myself yet… so take that as the street’s recommendation, not mine.
  6. The internet’s good corners, all free: Zerodha Varsity for India-flavoured basics (their futures and options modules are the gentlest on-ramp I know), Databento’s microstructure guide for the market data plane in real packet-level detail, Jane Street’s How to Build an Exchange talk for the matching engine from the inside, and Mechanical Markets when you’re ready to hear how HFT argues with itself.
  7. If your team is the speed layer: Martin Thompson’s Mechanical Sympathy blog (the name is the philosophy: Jackie Stewart’s point that you drive better when you understand the car), then the LMAX Disruptor and Martin Fowler’s write-up of the architecture around it: a single-threaded business core fed by lock-free ring buffers, doing millions of orders a second… in 2011.
  8. And build toys! Nothing teaches this stack faster than implementing it badly once. The ladder: an order book with sorted price levels and FIFO queues (slide 5); a matching engine on top with price-time priority and partial fills; an OMS that consumes your own fills and asserts done + open = sent at every event (slide 7); and finally the whole thing rewired as the sequencer, one process stamping a total order on every event while everyone else replays the same stream into identical state.

Maybe I’m biased toward the fast half of this picture; it’s where I’ve spent my career. But speed only wins trades. Truth keeps firms alive… and in six months you’ll be the one presenting this deck to the next fresher. Hopefully with better slides than mine!

References

Footnotes

  1. SEC Regulation NMS adopting release, 2005

  2. FIX Trading Community, the standards body behind the FIX protocol

  3. Nasdaq data product and protocol specifications (ITCH, OUCH)

  4. SEC rule 15c3-5 adopting release: risk management controls for brokers with market access, 2010

  5. Commission Delegated Regulation (EU) 2017/589 (MiFID II RTS 6), organisational requirements for algorithmic trading firms

  6. SEC administrative order against Knight Capital under rule 15c3-5, 2013

  7. Commission Delegated Regulation (EU) 2017/574 (MiFID II RTS 25), clock synchronisation

  8. The Consolidated Audit Trail (CAT NMS plan)

  9. Laughlin, Aguirre and Grundfest, “Information Transmission between Financial Markets in Chicago and New York”, 2013

  10. SEC press release: settlement cycle shortened to T+1, compliance date May 28, 2024

  11. NSE press release: world’s largest derivatives exchange by contracts traded per FIA, fifth consecutive year, January 2024

  12. SEBI circular CIR/MRD/DP/09/2012: broad guidelines on algorithmic trading

  13. SEBI circular: safer participation of retail investors in algorithmic trading, February 2025

  14. NSE: index-based market-wide circuit breakers

  15. SEBI circular SEBI/HO/MRD2/DCAP/P/CIR/2021/628: introduction of T+1 rolling settlement, September 2021; the exchanges’ phased rollout covered every listed stock by January 27, 2023

  16. SEBI circular: introduction of the Closing Auction Session in the equity cash segment, January 2026, live August 3, 2026

  17. SEBI circular: review of the block deal framework, October 2025

  18. NISM Series VIII, equity derivatives: the mandated certification for approved users and sales personnel on the equity derivatives segment

  19. NISM Series VII, securities operations and risk management: the mandated benchmark for associated persons in broking operations and risk; the workbook is a free PDF