The Matching Engine: Order-Driven Markets (Chapter 6)
Inside the Matching Engine
In Chapter 6, we get into the “code” of the market. Order-driven markets don’t rely on a dealer to set prices; they rely on a set of rules. If you’re a developer building an exchange, these are your requirements.
The Two Golden Rules
Every order-driven market has two sets of rules:
- Order Precedence Rules: Who gets to trade first?
- Trade Pricing Rules: What price do they actually pay?
Rule 1: Who’s First in Line? (Precedence)
When multiple people want to trade, the market needs a way to rank them.
- Price Priority (The Big One): The best price always wins. If you’re willing to pay more than me, you go first. This is self-enforcing because everyone wants the best deal.
- Time Precedence: If two people offer the same price, the person who got there first wins.
- Side note: This is why “low latency” is such a big deal. If the “tick” (minimum price change) is large, being first at a price is very valuable.
- Display Precedence: Markets often give priority to orders that are visible to everyone over “hidden” (iceberg) orders. They want to reward people for showing their cards.
- Public Order Precedence: Some exchanges (like the NYSE) once had rules that said a regular person’s order goes ahead of a professional floor trader’s order at the same price.
Rule 2: What’s the Price? (Pricing)
Once we have a match, what is the actual price of the trade? There are three main ways this happens:
1. Discriminatory Pricing (Continuous Auctions)
This is what happens in most stock markets. If you send a big market order to buy 1,000 shares, and there are 500 shares at $10.01 and 500 at $10.02, you pay $10.01 for the first half and $10.02 for the second. You “discriminate” between the different sellers.
2. Uniform Pricing (Call Markets)
Used in “opening auctions.” Everyone’s orders are gathered in a bucket. The market finds the one single price that allows the most shares to trade. Everyone pays that same price, even if they were willing to pay more. This maximizes the “surplus” for the traders.
3. Derivative Pricing (Crossing Networks)
The market doesn’t even look at its own orders to set the price. It just “derives” the price from another market (like the midpoint of the NYSE bid and ask). This is how many “dark pools” work.
The Oral Auction: “Sold!”
Before computers, this was all done via Open Outcry.
- The Pit: A literal depression in the floor so everyone can see each other.
- The Rule: You have to shout your bid so everyone can hear it. No secret side deals allowed.
Why This Matters
The rules determine the strategy.
- If the tick size is small (like 1 cent), time precedence doesn’t matter much. Someone can just “jump” you by a penny.
- If the market is order-driven, you need to be careful about showing your full size, or people will “front-run” you (jump in front of your price).
Next time, we’ll look at the Brokers—the people who navigate these rules on your behalf.
Next Post: Brokers and Their Conflict of Interest