A stock exchange works by running an electronic order book that pairs your buy or sell instruction with someone else’s at an agreed price, then handing the matched trade to a clearinghouse that guarantees both sides and settles the cash and shares one business day later. Everything else — the fee models, the order types, the circuit breakers, the regulators — exists to make that core match-and-settle loop fast, fair, and survivable when something goes wrong.
Exchanges aren’t all the same. Stock exchanges such as the New York Stock Exchange and Nasdaq handle equities, exchange-traded funds, and certain bonds. Commodity exchanges like the Chicago Mercantile Exchange trade futures tied to oil, wheat, livestock, and interest rates. Options exchanges handle contracts giving the holder a right to buy or sell at a set price before a deadline. Securities exchanges answer to the Securities and Exchange Commission; commodity and derivatives exchanges answer to the Commodity Futures Trading Commission. The product dictates the rulebook.
The Order Book and the Matching Engine
The order book is the electronic ledger sitting at the center of every exchange. It lists every pending instruction to buy or sell, with the specific price and quantity attached to each one. Buy orders are called bids. Sell orders are called asks. The gap between the highest bid and the lowest ask is the bid-ask spread, and it tells you the immediate cost of trading. A tight spread signals an active market. A wide spread signals fewer participants or more uncertainty about what the asset is worth.
The matching engine is the software that pairs compatible orders. Most equity exchanges use price-time priority, sometimes called first-in-first-out. Price comes first: the highest bid gets matched before any lower bid, and the lowest ask gets matched before any higher ask. When two orders sit at the same price, the one that arrived first fills first. An order submitted at 10:00:01 beats one submitted at 10:00:02 if both carry the same price.
Some futures products use pro-rata matching instead, where an incoming order is split across all resting orders at the best price based on their size rather than their arrival time. The CME Group applies pro-rata matching to specific interest rate futures while using price-time priority for most other contracts.
When the engine finds a buy order that meets or exceeds the price of a sell order, the trade fires instantly. The matched volume disappears from the book, and the last traded price updates in real time. Modern engines handle thousands of these transactions per second, in microseconds each. That continuous cycle of orders arriving, matching, and republishing the price is what the industry calls price discovery.
Order Types and What They Actually Do
The order type you choose decides how much control you have over price versus how certain you are the trade will fill. More price control, less fill certainty. That tradeoff never goes away.
- A market order executes immediately at the best available price. You get speed and no price guarantee, which can hurt in a fast-moving or thinly traded name.
- A limit order sets a maximum price for buys or a minimum price for sells. It fills at your price or better, or it sits unfilled if the market never reaches your level.
- A stop-loss order stays dormant until the asset hits a trigger price, then converts into a market order. It caps your downside, but because it becomes a market order, the real execution price can slip from the trigger when things move fast.
- A stop-limit order works the same way but converts into a limit order once triggered. You set both a trigger and a limit, which gives you more price control at the risk of not filling at all if the price blows past your limit.
- A trailing stop order adjusts as the price moves in your favor. You set a trailing distance in dollars or percent, the trigger follows the high-water mark by that distance, and if the price reverses by the trailing amount the order triggers and typically becomes a market order.
Who’s on the Other Side
For your order to fill, someone has to be willing to take the other side at a workable price. That willingness is what the industry calls liquidity. A stock where you can trade 10,000 shares and barely nudge the price has deep liquidity. A stock where 500 shares shift the price by a full percent does not. The depth of the order book at each price level is what makes the difference.
Market makers are the firms that keep the book populated. They continuously post both a bid and an ask on specific assets, committing to buy at one price and sell at a slightly higher one throughout the session. The spread between the two is their profit. In return for quoting prices even when the market is choppy, exchanges often give them reduced fees or rebates. Their constant presence is why there’s almost always a counterparty when you want to trade.
Market takers are everyone else trading against those posted quotes. When your market order fills instantly against a resting bid or ask, you’re consuming the liquidity a maker provided. Heavy taker activity can thin the book temporarily and widen spreads until makers refresh their quotes.
What a Trade Actually Costs
Trading on an exchange is never free, even when a broker advertises zero commissions. The costs sit in layers.
Most U.S. equity exchanges use a maker-taker fee model. The exchange charges a per-share fee to whoever removes liquidity and pays a small rebate to whoever adds it. Under Rule 610 of Regulation NMS, the maximum access fee an exchange can charge on quotations priced at $1.00 or more is capped at $0.001 per share as of November 2025.1Federal Register. Regulation NMS: Minimum Pricing Increments, Access Fees, and Transparency of Better Priced Orders That cap was previously $0.003 per share for years. The maker rebate is typically a bit less than the taker fee, and the exchange keeps the difference.
On top of exchange fees, the SEC charges a transaction fee on securities sales under Section 31 of the Securities Exchange Act. For fiscal year 2026, that fee is $20.60 per million dollars in sales volume.2Federal Register. Order Making Fiscal Year 2026 Annual Adjustments to Transaction Fee Rates The exchange collects it and passes it through, so it shows as a small line item on your trade confirmation. On a $10,000 sale, the SEC fee works out to about two cents.
From Click to Ownership: Execution, Clearing, Settlement
When you submit an order through your broker, it travels to the exchange’s matching engine using standardized messaging protocols. The most common is the Financial Information eXchange (FIX) protocol, an open standard used across global markets to transmit trade data between brokers, exchanges, and other systems.3FIX Trading Community. What is FIX? If the engine finds a compatible counterparty, the trade executes and both sides receive an electronic confirmation locking in the price.
Execution is only the agreement. The actual transfer of securities and cash happens at settlement. For U.S. stocks, bonds, ETFs, and most mutual funds, the standard settlement cycle is T+1, meaning one business day after the trade date. The SEC shortened this from the previous T+2 standard effective May 28, 2024, to reduce the window of counterparty risk between execution and final delivery.4U.S. Securities and Exchange Commission. Shortening the Securities Transaction Settlement Cycle – A Small Entity Compliance Guide
How Clearinghouses Guarantee the Trade
Between execution and settlement sits the clearinghouse. The National Securities Clearing Corporation, which handles essentially all U.S. equity trades, steps into every transaction through a process called novation. The original contract between buyer and seller is replaced by two new contracts: one between the clearinghouse and the buyer, and another between the clearinghouse and the seller. From that point on, neither side depends on the other. They each depend on the clearinghouse.5Federal Register. Securities Transaction Settlement Cycle
The clearinghouse also nets trades across the day. If a firm bought 5,000 shares of a stock and sold 3,000 shares of the same stock, only the net 2,000 shares need to change hands at settlement. That cuts the total cash and securities moving between accounts dramatically. To protect against a member firm defaulting, the clearinghouse collects clearing fund deposits from every participant, sized to cover potential losses. Those layers are what keep one firm’s failure from cascading through the system.
When the Match-and-Settle Loop Pauses
If markets drop fast enough, automatic safeguards stop the whole process. Market-wide circuit breakers tied to the S&P 500 Index trigger at three levels, measured against the prior day’s closing price:6New York Stock Exchange. Market-Wide Circuit Breakers FAQ
- Level 1 (7% decline): trading halts for 15 minutes if triggered before 3:25 p.m. ET. No halt if triggered at or after 3:25 p.m.
- Level 2 (13% decline): same rules as Level 1.
- Level 3 (20% decline): trading halts for the rest of the day, regardless of when it triggers.
The logic is simple. Forced pauses give participants time to process information, reassess positions, and restore some rationality to order flow. Without them, automated selling can feed on itself and drive prices well below any reasonable valuation before human judgment catches up. Individual stocks can also be halted by the exchange or by SEC order for reasons like pending news or unusual trading activity.
Who Writes the Rules the Exchange Follows
U.S. exchange regulation splits by product. The SEC oversees securities exchanges under the Securities Exchange Act of 1934. Under 15 U.S.C. § 78f, any exchange that wants to operate as a national securities exchange must register with the SEC and show that its rules are designed to prevent fraud, promote fair trading, and protect investors.7Office of the Law Revision Counsel. 15 USC 78f – National Securities Exchanges The SEC can deny or revoke registration if an exchange fails those standards.
Commodity and derivatives exchanges answer to the CFTC under the Commodity Exchange Act. Under 7 U.S.C. § 7, a board of trade must apply to the CFTC for designation as a contract market and comply with core principles covering trade monitoring, position limits, and prevention of market manipulation.8Office of the Law Revision Counsel. 7 USC 7 – Designation of Boards of Trade as Contract Markets
Regulation NMS shapes how securities exchanges interact with each other. Rule 611, the Order Protection Rule, requires every trading center to have policies preventing trade-throughs, where an order executes at a price worse than a better quote displayed on another exchange.9U.S. Securities and Exchange Commission. Final Rule: Regulation NMS In practice, your broker must route your order to the exchange showing the best price, even if it’s not the one the broker would prefer to use. The result is a national market system where competition between exchanges flows through to the price you actually get.
Both regulators conduct periodic examinations of exchange operations, technology, and financial condition. Violations can bring civil penalties, forced operational changes, or revocation of registration.