Lecture 1: Concepts and Institutions
Real markets don't clear at one price the way an economics textbook says they do. This lecture lays out why — and introduces the bid-ask spread, liquidity, and market structure, the ideas the rest of the course (and your own trading) builds on.
- Source
- Real transcript, verified via yt-dlp captions
- Textbook chapter
- Foucault/Pagano/Röell, Ch. 1
- Course focus here
- Secondary markets
Why financial markets exist
A market, broadly, is wherever property rights change hands — a square, a platform, or something with no physical form at all. Markets matter because trade (ideally) moves an asset from whoever values it least to whoever values it most, raising total welfare. Financial markets are a special case: you're buying money with money. The lecture gives two reasons anyone does that:
Moving wealth across time — invest now, consume more later.
Moving wealth across contingencies — different possible futures. The example from the lecture: if you work in coal, your income is fine only in the world where renewables don't take off. Buying renewable-energy stock isn't a bet that it's mispriced — it's insurance, balancing your exposure across the futures that could happen.
Markets are efficient when everyone shares the same information. The moment information becomes asymmetric — some traders know more than others — efficiency breaks down. Almost everything later in the course traces back to this.
Primary vs. secondary markets
Primary markets — money flows to the issuer. An IPO, a Treasury auction: you hand over cash, the firm or government gets to use it.
Secondary markets — trade between existing owners. You bought at the IPO, you resell to someone else tomorrow — that resale is secondary-market trade. Stocks, bonds, derivatives, FX, and commodity-futures markets are the standard examples.
This course — and almost everything below — is about secondary markets. That's also where you, as a personal trader, actually operate.
Prices aren't one number
Intro economics assumes a single market-clearing price. Real markets quote two: a bid (what you can sell at) and an ask (what you can buy at), with ask always above bid — otherwise you could buy and instantly resell for a risk-free profit. The gap is the bid-ask spread, and it's a genuine friction: if your valuation and someone else's both sit inside the spread, you can't trade with each other even though a mutually beneficial trade exists.
- Context
- GOOG quoted $518.80 bid / $520.95 ask — a $2.15 spread, 0.41% of the $519.875 mid-price.
- Algo-relevant?
- Yes, directly — the spread is the first line in every execution algorithm's cost model.
- What's applied
- Round-trip cost of crossing the spread with market orders = spread × shares. This is the core of "implementation shortfall": (execution price − decision price) × shares.
- Action
- The algorithm chooses: cross the spread now with a market order (pay for certainty), or post a limit order and wait to earn the spread instead of paying it.
- Why
- Whoever is on the other side of that limit order — a dealer or a market-making algorithm — needs compensation for adverse selection and inventory risk. Ch. 3's Glosten-Milgrom model formalizes exactly this price.
Buy 100 sh. now (market order) at ask 100 × $520.95 = $52,095.00 Forced to exit now (market order) at bid 100 × $518.80 = $51,880.00 Round-trip cost from the spread alone $215.00 (0.41% of notional) — before any price move, before commission Same 100 sh. via two patient limit orders (buy at bid $518.80, later sell at ask $520.95) +$215.00 earned, not paid
Liquidity and depth
Liquidity: the market's ability to let you sell quickly without moving the price much. Depth is the sharper version of that — how much order size it takes to move the price by a fixed amount.
Google trades ~$1B/day: deep and liquid, your order barely dents the price. A thin small-cap has far fewer buyers and sellers present at any moment — sell a large position and you visibly push the price down against yourself.
| Stock | Bid | Ask | $ spread | % spread |
|---|---|---|---|---|
| IBM | 124.88 | 124.89 | 0.01 | 0.01% |
| Amazon | 135.06 | 135.14 | 0.08 | 0.06% |
| Barnes & Noble | 16.02 | 16.10 | 0.08 | 0.50% |
| Borders | 1.05 | 1.06 | 0.01 | 0.95% |
| Books-A-Million | 5.40 | 5.94 | 0.54 | 9.52% |
That last row is the whole point of "liquidity" made concrete: on the same afternoon, one round-trip trade cost 0.01% on IBM and 9.52% on Books-A-Million. Same asset class, wildly different friction.
- Context
- GOOG trades ~$1B/day (stated in the lecture) — deep. Books-A-Million's spread is 9.52% on the same afternoon — the signature of a thin book.
- Algo-relevant?
- Yes, directly — depth is the direct input to how large an order an algorithm can safely place at once.
- What's applied
- A market order doesn't fill at one price — it "walks the book," consuming each price level in turn until the full size is filled. Average execution price rises above the top-of-book quote as size grows.
- Action
- The algorithm checks size available at each price level before sizing an order, and splits large orders into smaller clips when the book is thin, instead of firing one large market order.
- Why
- Depth — not just the quoted spread — determines your actual average execution price. This is exactly what Ch. 4, "market depth," formalizes.
Ask side: $520.95 × 50 sh. $521.10 × 80 sh. $521.40 × 150 sh. Market buy for 150 shares "walks" up through the book: 50 sh. @ $520.95 = $26,047.50 80 sh. @ $521.10 = $41,688.00 20 sh. @ $521.40 = $10,428.00 ───────────────────────────── 150 sh. total = $78,163.50 → avg price $521.09/sh. vs. top-of-book ask $520.95 → extra slippage $0.14/sh. × 150 = $21 — a real cost on top of the quoted spread, invisible until you size against the book
How trades actually get matched
Order-driven markets — orders sit in a shared limit order book and get matched directly against each other (NYSE, NASDAQ's book, LSE, Euronext).
Dealer markets — a market maker quotes both sides and trades against you directly, earning the spread to cover inventory risk, operating costs, and the risk of trading against someone better informed (NASDAQ historically ran this way).
Two order types you'll use directly: a limit order sets a price and quantity and waits in the book — patient traders use these; they "provide liquidity." A market order executes immediately at the best available price — impatient traders use these; they "take liquidity" and pay the spread for certainty.
Continuous trading (orders persist and match anytime) vs. call auctions (orders batch over a window, then all clear at one uniform price — used at many exchanges' open/close). Order precedence within a book: price priority first, then usually time priority (first-in-first-out); visible orders execute before hidden ones at the same price.
- Context
- Same GOOG quote: mid $519.875, natural half-spread $1.075 either side.
- Algo-relevant?
- Yes — this section is the mechanical layer a market-making bot runs on, tick by tick. This is the dealer role, automated.
- What's applied
bid = fair_value − half_spread − skew,ask = fair_value + half_spread − skew— the same skew shifts both quotes in the same direction.- Action
- As the bot accumulates inventory in one direction, it shifts both quotes to make the direction it wants (offloading) more attractive and the direction it doesn't (adding more) less attractive.
- Why
- Holding inventory is risk — if price moves before the position is unwound, the bot can lose more than the spread it captured. This is inventory risk, the other half of Ch. 3's pricing models alongside adverse selection.
Flat inventory (0 shares): bid $518.80 / ask $520.95 — mirrors the market exactly Bot accumulates +200 shares (bought more than sold) skew = −$0.10 applied to both quotes new bid $518.70 / new ask $520.85 — ask now cheaper: more attractive to a buyer, sheds inventory — bid now lower: less attractive to sellers, discourages adding more If the $518.70 bid gets hit for 50 more shares inventory → 250 shares, skew widens further on the next tick — the loop is self-correcting by design, not by accident
Exchanges, OTC, and dark pools
Exchanges (NYSE, NASDAQ, LSE) are heavily regulated and bundle in clearing/settlement, liquidity support, and transparency. OTC venues sit off-exchange with lighter disclosure requirements — and often thinner liquidity as a result. Dark pools are internal venues (e.g. a bank matching its own clients' orders instead of routing to an exchange) — increasingly prominent, and a live regulatory focus in the US and EU.
- Context
- NYSE quotes GOOG at $518.80 / $520.95 — but the same stock trades simultaneously on other venues too.
- Algo-relevant?
- Yes — a whole strategy category (smart order routers) exists purely for this decision.
- What's applied
- Compare the best available price for the needed side at every reachable venue; route to price improvement first, sweep remaining size to the primary venue.
- Action
- The router splits one order across venues instead of sending it all to one exchange.
- Why
- A few basis points saved per trade, multiplied across thousands of trades a day, is real money — and Ch. 7's "fragmentation" is the formal theory behind why this liquidity is scattered in the first place.
Sweep everything to NYSE: 150 × $520.95 = $78,142.50 Route smartly instead — dark pool: 50 sh. @ NBBO midpoint $519.875 = $25,993.75 ECN B: 100 sh. @ $520.90 = $52,090.00 ───────────────────────────── 150 sh. total = $78,083.75 Savings vs. sweeping NYSE alone $58.75 (≈0.075% of notional) — small per order, but it's why SOR exists as infrastructure
Who you're actually trading against
Retail investors (individuals, usually treated as "uninformed") vs. institutional investors (pension/mutual funds, PE — usually "informed" professionals) — with one notable exception: pension funds are institutional but typically treated as uninformed, since they trade to manage liabilities, not on an information edge.
Informed traders act on private information the market doesn't have yet. Uninformed traders trade for idiosyncratic reasons — hedging, rebalancing — not because they think the price is wrong.
Dealers/market makers supply liquidity when no one else will. Brokers sit between retail traders and the market, executing orders on your behalf (with their own potential conflicts of interest, flagged but not explored deeply in this lecture).
This taxonomy is the map of algo-trading strategy types — most trading algorithms are best understood as an automated version of one of these roles: a market-making bot plays the dealer; a statistical-arbitrage strategy plays the informed trader, trading on a modeled edge rather than an idiosyncratic need; an execution algorithm plays a very disciplined, cost-minimizing broker. Knowing which role your algorithm plays determines what it should optimize for — spread capture, information edge, or impact minimization are different goals, not the same problem in different clothes.
What regulators are actually trying to balance
Protect uninformed traders from being picked off by better-informed ones — but price discovery only happens if informed traders are willing to trade. Push too hard on one and you damage the other. Regulators also care about stabilizing markets against shocks (since risk-averse traders pull back when they fear big swings) and choosing the right trading structure per asset — liquid, popular names don't need the same rules as thin, illiquid ones.
Tools: forced order-routing between fragmented markets, transaction taxes/subsidies, margin/collateral requirements, rules on algorithmic and high-frequency trading, and how much competition to allow between exchanges (one big liquid market vs. many small competing ones — a real, unresolved trade-off).
- Context
- The lecturer names "policies on algorithmic and high-frequency trading" as one of the regulator's actual levers.
- Algo-relevant?
- Yes — directly. These aren't market mechanics to model, they're hard constraints the code has to obey.
- What's applied
- A common constraint type: exchanges cap message rates (orders + cancels per second) or penalize a high order-to-trade ratio to discourage quote-spam.
- Action
- The bot's re-quote logic has to throttle itself — it can't just re-quote on every book update.
- Why
- Breaching a rate limit triggers throttling, fees, or in extreme cases a trading halt for that participant — a cost that has nothing to do with the market itself, only the rulebook.
Illustrative venue rule: max 10 order messages/second before fees kick in Naive bot: re-quotes bid + ask on every book update book updates ~50×/second here → bot sends ~100 messages/second — breaches the limit 10× over Constrained bot: only re-quotes when fair_value moves > $0.01 cuts re-quote frequency to roughly the 10 msg/sec budget — the regulatory limit becomes a literal parameter in the loop, not a compliance footnote read once and forgotten
What this changes about how you trade
| Concept | What to actually do |
|---|---|
| Bid-ask spread | Check spread as a % of price before entering any trade — worst on illiquid small-caps and options. It's a real cost, before commission. |
| Depth / liquidity | Look at order book size before sizing a trade in anything thin. A large market order in a thin book moves the price against you (slippage) — see the Books-A-Million row above. |
| Limit vs. market orders | Default to limit orders in anything illiquid or volatile. Reserve market orders for names liquid enough that the spread is a rounding error. |
| Call auctions | The first/last minutes of a trading session are often auction-driven, not continuous — a real reason experienced traders avoid trading right at the open. |
| Informed vs. uninformed | Assume you're the uninformed side against institutional counterparties by default. Trade on a plan, not a belief that you know something the market doesn't. |
| Dealer markets | Explains why FX/OTC spreads vary by who's quoting you — you're trading against one dealer's price, not a neutral book. |
Before the next lecture
- 1
Look up real bid/ask quotes for a stock you'd actually trade — the lecturer suggests Facebook or Microsoft — and identify which exchange it's actually trading on.Lecturer's own assigned exercise
- 2
Compute the spread as a % of price for something liquid (e.g. AAPL) and something you'd consider thin. Feel the gap directly, the way the IBM vs. Books-A-Million row does above.Derived from the lecture's real-world example
- 3
Read the article on the London Metal Exchange — one of Europe's last open-outcry trading floors. Question to sit with: what's the value of a physical trading floor in the age of digital trading?Lecturer's own assigned exercise
- 4
If you have the Foucault/Pagano/Röell textbook, work Chapter 1, exercises 1–3 — they compare continuous vs. call-auction outcomes on the same order set.Lecturer's own assigned exercise
Where this is heading: building a trading algorithm
Every concept above is a component of the same machine. Here's the taxonomy of algorithmic trading strategies mapped onto what this lecture actually covered:
Automate the dealer role: continuously quote a bid and ask, earn the spread, manage inventory risk. This is the strategy type most directly built on today's material.
Work a large order over time to minimize spread cost and market impact — the automated version of "how do I trade a lot without moving the price against myself."
Decide, order by order, which venue (lit exchange, dark pool, OTC) to send to — a direct response to the fragmentation described above.
Trade on a modeled information edge rather than an idiosyncratic need — the "informed trader" role, automated and systematized.
To make this concrete, here's a simplified version of a market-making algorithm's core loop — the most direct automation of a dealer, and the strategy type today's lecture maps onto most cleanly:
// runs on every order-book update fair_value = mid_price(order_book) // §03 — price discovery inventory_skew = f(current_position) // dealer's inventory risk, §05/§07 half_spread = base_spread(volatility) + inventory_skew bid = fair_value - half_spread // §03 — quoting the two-sided spread ask = fair_value + half_spread size = depth_limit(order_book, max_impact) // §04 — sized against real depth post_limit_order(BUY, bid, size) // §05 — limit order, provides liquidity post_limit_order(SELL, ask, size) // on fill: inventory changes, re-quote from the top
Every line traces back to something in this lecture: fair_value is price discovery (§03); half_spread is the bid-ask spread economics that Ch. 3's Glosten-Milgrom/Kyle models will formalize; size depends on the depth concept from §04; and posting two limit orders is literally "acting as the dealer" from §05. As the course reaches Ch. 3 (price formation) and Ch. 4 (depth), those chapters fill in exactly how to compute half_spread and max_impact rigorously, rather than as placeholders.
If the bot completes ~500 round trips today, each capturing roughly the $2.15 spread from §03 (before any losses to adverse selection): 500 round trips × $2.15/share × 100 sh./trip = $107,500 gross spread capture This is gross, not net — every one of these fills carries the risk from §05 (inventory moving against the bot before it re-balances) and §03's flip side: some counterparties on the other side of these trades are the informed traders from §07 — trading against them is exactly what erodes this number. Ch. 3 is where the course formalizes how much that erosion actually costs.