Basic Prerequisites: Probability & Measure Theory and Calculus & Optimization. (these are the folder-level prerequisites for pages 02–06; page 01 states its own, smaller, entry requirements)


1. Intuition & Practical Objective

Before any algorithm can trade, it has to answer two questions that have nothing to do with forecasting: what instructions can I send to a market, and where do those instructions actually go? This folder is the entry point of Pillar 2. It maps the trading landscape - the order types an engine may submit, the venues (exchanges, dark pools, OTC) that accept them, the auction and continuous mechanisms that match them, and the fee and regulatory structure that surrounds them - and it is the shared vocabulary every later folder in this pillar assumes.

It is a hub. It gives you (a) the fast order-type lookup table below (job #1), (b) the core microstructure quantities (spread, micro-price, effective spread, adverse-selection measures) in one place, and (c) routes to six sub-pages that climb from zero-knowledge intuition to the HFT strategy taxonomy.

The one-sentence essence. “A market is a mechanism, not a place: you submit a typed instruction - market, limit, stop, IOC/FOK, hidden, pegged - into a matching engine (or dark pool, or dealer quote) that fills it under explicit price-time (or pro-rata) priority, and every fee, rebate, and regulation is a constraint on how that instruction is routed and priced.”

Scope note (avoid duplication). This folder is the order-and-venue view - what you can send, and where. The deep limit-order-book mechanics (L2/L3 book reconstruction, matching-engine internals, queue dynamics) live in Pillar 6, Limit Order Book Mechanics; the fill-probability perspective lives in Queue Position & Fill Probability. This folder cross-links them rather than repeating them.


2. Mathematical Ground Truth & Derivations

Quick-Reference Lookup (job #1) - the order-type menu.

Order typeInstructionAdds / takes liquidityFill ruleTypical usePrimary risk
Marketexecute now, any pricetakessweeps book, walks the levelsimmediate exit; urgencyslippage vs quoted price
Limitexecute at price or betteradds (if passive)rests until crossedpatient entry/exit; earn spreadnon-execution / adverse selection
Stop / stop-limittrigger when crosses stop , then market/limitbecomes taker at triggerlatent until triggerprotective stop, momentum entrygaps & trigger cascades
IOCfill what you can now, cancel resttakespartial ok, no restaggressive stat-arb snipingpartial fill leaves residual
FOKfill entire size now or canceltakesall-or-nothingarbitrage legs, block sweepsrejection rate
AONall-or-nothing, may resteitherno partial fillslarge blockslonger queue wait
Hiddenlimit, invisible in bookaddsfills, but usually loses priority to visiblesize concealmentworse queue position, detection
Iceberg / reserveshow tip , keep hiddenaddstip fills, then reload at back of queuelarge passive sizereload forfeits FIFO
Peggedprice tracks mid/best bid/best ask ± offsetadds or takesre-priced as reference movesrelative-value quotesadverse selection on stale peg
Post-onlyonly adds; cancel if it would crossaddsreject on crossrebate capture, no takemissed fills
Midpoint peg / darktrade at the NBBO midpointadds (no display)matches inside spreadminimize footprintlow hit-rate, adverse selection
Discretionaryvisible price, hidden willingness behind itaddsleaks into price improvementcompetitive quotinginformation leakage

Notation. best ask/bid; mid ; spread ; sizes ; direction for buy/sell; transaction price ; efficient (latent) price ; half-spread components.

Core microstructure quantities (cross-checked against Hasbrouck, Foucault).

  • Quoted spread / relative spread (Foucault eq 2.1):
  • Micro-price (size-weighted midpoint): - leans toward the thin side, a short-horizon tick predictor.
  • Effective half-spread (Foucault eq 2.3): - the realized cost of immediacy versus the contemporaneous mid.
  • Realized half-spread (Foucault eq 2.5): - the liquidity supplier’s profit after the market has moved (the mirror image of adverse selection).
  • Roll model (Hasbrouck Ch 3):
  • Kyle price impact (Hasbrouck Ch 7): , with market depth .
  • Glosten–Milgrom adverse-selection spread (Hasbrouck Ch 5), symmetric prior: - the spread is the information cost of facing an informed share .

Fee identity (maker-taker). For a trade of shares, the all-in cash cost is

with at a traditional venue and the signs flipped at an inverted venue.


3. Computational Implementation - the hub demo

A single tiny book demonstrating the quantities above: micro-price, the market-order walk, and the limit/IOC/FOK distinction. Runs on the standard library only and is re-executed and reproduced below (full scripts live on each sub-page).

Read the numbers. The 800-share bid versus the 300-share ask pulls the micro-price () above the mid () toward the ask - a real-time bid-pressure signal. The same 1000-share buy costs as a market order (5.50 bps worse than the best ask) but only as a crossing limit; an FOK of that size is simply rejected because only 300 shares are shown at 100.05.


4. Failure Modes & First-Principles Breakdowns

Hub signposts - the full analysis is in 05 · Failure Modes & Practice. In one line each:

  1. Order-type misuse - using a market order for size in a thin book (walks the levels), or an FOK where partial fills are acceptable, converts a controllable cost into a binary loss.
  2. Hidden-liquidity illusion - iceberg reloads forfeit FIFO and dark/midpoint orders have low hit-rates; the visible tip under-represents the true queue.
  3. Latency as adverse selection - a stale quote is a free option written to faster traders; pick-off loss scales like in the latency .

5. References

  • Hasbrouck, Joel - Empirical Market Microstructure (2007)
  • O’Hara, Maureen - Market Microstructure Theory (1995). The theoretical bedrock: price formation, dealer and sequential-trade models.
  • Harris, Larry - Trading and Exchanges (2003). The plain-English practitioner map of who trades, how venues are structured, and how every order type behaves.
  • Foucault, Pagano & Röell - Market Liquidity (2013)
  • Abergel, Anane, Chakraborti, Jedidi & Toke (eds.) - Limit Order Books (2016); Gould et al. - “Limit order books,” Quantitative Finance 13(11), 2013. *Deep LOB modeling

6. Connected Graph Bridges

Beginner: start at 01 · Practitioner: start at 05