Market microstructure is the plumbing of markets — order types, the order book, price-time priority, the matching engine. Every trader interacts with this plumbing every day; surprisingly few traders actually understand it. The ones who do gain real edge from execution alone.
Order types
- Market order: 'buy now at whatever price is available'. Guarantees execution; doesn't guarantee price. Risks slippage in thin markets.
- Limit order: 'buy at $100 or better' / 'sell at $105 or better'. Guarantees price; doesn't guarantee execution. May rest in the order book without filling.
- Stop (stop-loss / stop-buy): 'when the price reaches $X, send a market order'. Used to limit losses or enter on breakout.
- Stop-limit: 'when the price reaches $X, send a limit order at $Y'. More control over fill price but may not execute in fast-moving markets.
- IOC (Immediate-Or-Cancel): execute available portion immediately; cancel the rest.
- FOK (Fill-Or-Kill): execute the entire order immediately or cancel. Used for block trades that don't want partial fills.
- GTD / GTC: Good-Til-Date / Good-Til-Cancelled — order persists until filled or the timeout.
The order book
Safaricom (SCOM) — order book snapshot────────────────────────────────────────────────BIDS (buyers) ASKS (sellers)────────────────────────────────────────────────Qty Price Price Qty────────────────────────────────────────────────50,000 17.40 17.45 32,00025,000 17.35 17.50 80,000100,000 17.30 17.55 45,00080,000 17.25 17.60 120,000200,000 17.20 17.65 300,000────────────────────────────────────────────────Best bid: 17.40 × 50,000 sharesBest ask: 17.45 × 32,000 sharesBid-ask spread: 0.05 KES (0.29% of mid)Mid-price: 17.425A market BUY of 100,000 shares would clear:32,000 @ 17.45 (best ask)68,000 @ 17.50 (next level)────────────────────────────────────────Average price: 17.484 → 0.06 KES slippage vs mid
Bid-ask spread — what it pays for
Market makers post both a bid and an ask. They make money when buyers cross to the ask and sellers cross to the bid — earning the spread on each round trip. The spread compensates the market maker for: (1) inventory risk (the position they accumulate while waiting for the other side); (2) adverse selection (informed traders pick them off); (3) operating costs (technology, capital, fees). For a trader, the spread is the round-trip cost of trading. Tight spreads (1-2 bps on US large-cap equities) mean low cost; wide spreads (50+ bps on small-cap Kenyan equities) mean high cost.
Price-time priority
When orders match, exchanges use price-time priority: better-priced orders fill first; among orders at the same price, the order placed earlier fills first. This means market makers who post tight quotes early get preferential fills. HFT firms invest heavily in low-latency infrastructure precisely to be earlier in the queue at any given price.
Slippage and market impact
Slippage is the difference between your expected execution price and the price you actually got. For a market buy in a deep market, slippage is small (the spread). For a market buy of 5% of daily volume in a thin stock, slippage can be 1-5% of price — sometimes more. Professional traders break large orders into smaller pieces (execution algorithms — TWAP, VWAP, implementation shortfall) precisely to minimise market impact.
Exercise
You want to buy 200,000 shares of a Kenyan listed stock. Daily volume is 500,000 shares; bid-ask spread is 1%. Using the order book above as a model, walk through three execution strategies and their tradeoffs.