Lesson 07

    How a Stock Exchange Works

    The order book, the one rule that decides who trades first and at what price, why depth matters, the rails that keep trading orderly, and the same machine around the world.

    The order book as two staircases: buyers queue on green steps and sellers on red steps, and at the top the first buyer and the first seller shake hands as a coin and a share change hands, while Maya and Mr. Chartist look up

    On Thursday 22 October 2026, shares of State Bank of India (SBI), a large Indian bank, changed hands in 98641 separate trades on the National Stock Exchange of India (NSE). Say one buyer was Maya, who runs a burger restaurant and is learning to invest. She sent an order that morning: buy 5 SBI shares at up to ₹960.00 each. She paid ₹959.55, less than she offered. Who picked that price, and who sold to her?

    By the end you can answer three questions. Who sets the price you pay, and who is on the other side of your trade? Why can your order wait unfilled even when the price touches it? Why is one share easy to trade in size and another hard?

    Maya and her trade are made up, and so is each illustration, labelled where it appears. SBI, its prices and every other company, number and date are real. Times are India time (IST) and amounts are in rupees (₹). The last lesson, who takes part, met the people on both sides of every trade; this one opens the exchange.

    Chapter 1The exchange

    What an Exchange Does, and What It Does Not

    One share, two books, one referee

    An exchange is a referee with one book of waiting orders per share: it matches them and never sells. Before the lunch rush on Thursday 22 October 2026, Maya looks up SBI in a market app and finds two opening prices: ₹959.55 on NSE and ₹958.00 on BSE, India's other big exchange (formerly the Bombay Stock Exchange).

    Maya

    SBI opened at ₹959.55 on NSE and ₹958.00 on BSE. Which one is the real price?

    Mr. Chartist

    Both are real, Maya. Each exchange keeps its own order book, and each shows its own last trade.

    Maya

    So when I buy on NSE, is NSE the one selling me the shares?

    Mr. Chartist

    Careful, Maya. NSE owns none of them. It matches your order with a seller's. It's anonymous: neither of you learns the other's name.

    Maya

    Then what does an exchange actually do all day?

    Each exchange keeps its own book, so one share can trade at slightly different prices at once. The two books still differed at the close, ₹970.00 on NSE and ₹968.30 on BSE, as the figure shows.

    It is still one share: its ISIN, the share's ID number, is on both. The prices stay close because anyone can buy on the cheaper exchange and sell on the dearer one. The exchange Maya picks decides which book her order joins.

    Figure 1The exchange

    One share, two books, one referee

    SBI

    One share: State Bank of Indiathe same ISIN, INE062A01020, on both exchanges

    NSE's book

    opened₹959.55NSE's first price on Thursday, ₹3.45 below its own close of the day before, ₹963.00.closed₹970.00NSE's last price, ₹7.00 above its previous close.

    BSE's book

    opened₹958.00BSE's first price. It starts from its own close of the day before, ₹963.90, not NSE's ₹963.00.closed₹968.30BSE's last price on Thursday.

    Two books, so two prices: close, because anyone can buy on the cheaper exchange and sell on the dearer one. The exchange Maya picks decides which book her order joins.

    The exchange is the referee of each book

    The referee

    • Keeps one book per shareA live list of waiting orders, best price first.
    • Matches orders by fixed rulesThe rules ignore who sent the order and how big it is.
    • Publishes every tradeEvery trade and the best waiting prices, so everyone sees the same market.
    • Enforces the trading rulesIts member brokers follow them, and it can pause trading.

    It never

    • Set the priceThe price is only the last match between a buyer and a seller.
    • Take a sideIt never buys from you or sells to you; it matches you with someone who does.
    • Hold your sharesA depository holds them, in your demat account.
    • Vouch for a companyListing is permission to trade, not a judgement that the company is good.
    Same share, two books, two slightly different prices all day.

    A stock exchange is a company licensed to run a market in shares by its country's market regulator. In India that is SEBI, the Securities and Exchange Board of India (how investors are protected explains regulators).

    You cannot send an order to an exchange yourself. Only its member brokers can, and they follow its rules. So Maya's broker, Sahi, checks her money and passes her order to the exchange she picks.

    Four things an exchange never does. It never sets the price: the price is only the last match between a buyer and a seller. It never takes a side, so it never buys from you or sells to you. It never holds your shares; they sit in your demat account at a depository. And it never vouches for a company: listing is permission to trade, not a judgement that the shares are a sound buy.

    Maya

    So what is actually inside that book when I open it?

    Chapter 2Order book

    The Order Book: Bids, Asks and the Spread

    SBI's book, read twice, 75 seconds apart

    An order book is two queues facing each other: buyers on the left, sellers on the right. When Maya sold the restaurant's old delivery scooter, the best buyer would pay up to ₹38000 and she wanted at least ₹40000; nothing happened until one of them moved. A book holds thousands of such offers for one share, sorted by price.

    Maya

    NSE's page shows SBI at ₹965.15. Is that what I would pay right now?

    Mr. Chartist

    Not necessarily. ₹965.15 is the last trade. What you can get now is the lowest price a seller is waiting for.

    Maya

    So there is one price for buyers and another for sellers?

    Mr. Chartist

    Exactly: the best bid below, the best ask above. Let's read SBI's real book, twice.

    Waiting buy orders are bids and waiting sell orders are asks (many apps say offers). Each side is sorted best first: the best bid is the highest price any buyer is waiting to pay, and the best ask is the lowest price any seller will accept.

    An exchange shows its book only live, so here is SBI's, as NSE's own page showed it at 2:01:26 pm on Thursday 29 October 2026, a week after Maya's trade. The best bid was ₹965.00 and the best ask ₹965.15.

    Figure 2The order book

    Buyers wait on the left, sellers on the right, and nothing trades in the gap

    SBINSESBI on NSEThursday 29 Oct 2026 · last price ₹965.15 at both moments

    Pick a moment
    Spread ₹0.15three ticks of ₹0.05Spread ₹0.15: the gap between the best ask ₹965.15 and the best bid ₹965.00, three ticks of ₹0.05. No order sits here, so nothing can trade here.Best bid₹965.00the most a buyer will pay211 shares waiting211 shares waiting to buy at ₹965.00. The most any buyer will pay.Best ask₹965.15the least a seller will accept59 shares waiting59 shares waiting to sell at ₹965.15. The cheapest any seller will take.

    Who else is waiting+ more rungs each side, not drawn

    211965.00211 shares waiting to buy at ₹965.00. The most any buyer will pay.965.155959 shares waiting to sell at ₹965.15. The cheapest any seller will take.
    5964.905 shares waiting to buy at ₹964.90. Further from the middle, so it waits behind the best price.965.2040994099 shares waiting to sell at ₹965.20. Further from the middle, so it waits behind the best price.
    167964.80167 shares waiting to buy at ₹964.80. Further from the middle, so it waits behind the best price.965.25397397 shares waiting to sell at ₹965.25. Further from the middle, so it waits behind the best price.

    The price did not move; the book did. The bars show only the front of the queue: the five best rungs held 5604 of the 622662 shares waiting to sell (0.90%).

    Switch to 75 s later and watch the gap shrink from three ticks to one. A break mark means a bar runs past the scale.

    SBI's price moves in steps of ₹0.05, its (NSE's step for shares priced ₹250 to ₹1000, reviewed monthly). So ₹965.12 is not a price anyone can enter.

    The gap between the best bid and the best ask is the spread: 965.15 − 965.00 = ₹0.15, three ticks. It is a real cost: buy at ₹965.15, sell straight back at ₹965.00, and you are ₹0.15 a share poorer before any charges.

    The book is alive. Switch the figure to 75 s later, 2:02:41 pm: the last price is still ₹965.15, but a buyer now waits at ₹965.10 and the spread has shrunk to ₹0.05, one tick. The price on the screen is history, the last trade; what a buyer can get now is the best ask.

    Your app shows the same five best prices on each side, never names or times. They are only the front of the queue. NSE's page also gives a for each side, every share waiting at every price: at 2:01:26 pm the five best asks held 5604 of the 622662 SBI shares waiting to be sold, under 1%.

    Nothing trades inside the gap. An order is an instruction to buy or sell a number of shares, and it becomes a trade only when it meets another. A market order takes whatever price is waiting, so a market buy crosses the gap and pays the best ask. A limit order names its price, the most you will pay or the least you will take; if nothing waiting meets it, it joins the queue. Placing your first order covers each type.

    Figure 3Two kinds of order

    A market order crosses the gap; a limit order can wait

    Neither order sets a new price. One takes the best price waiting; the other becomes a waiting price.

    Two made-up buy orders for 5 SBI shares meet the same book.
    Maya

    If two buyers wait at the same price, who gets the next seller's shares?

    Chapter 3Matching

    Price First, Then Time

    Who trades first, and at what price

    Maya

    A fund wants 5000 SBI shares and I want 5. Doesn't the exchange serve the big order first?

    Mr. Chartist

    Never. The matching rule ignores who you are and how big your order is. It reads price, then time.

    Maya

    So whoever joins the queue first gets the shares first?

    Mr. Chartist

    Only among orders at the same price. Offer more and you move ahead, even if you came later.

    Price comes first, then time: the better price goes first, and at one price the earlier order goes first. Exchanges call this price-time priority. The clock that counts is the exchange's: NSE time-stamps every order the moment it arrives, so a place in the queue is set by that stamp, not by the tap on Buy.

    Each row of a book is really a queue of separate orders, each with its time stamp. The figure draws the buy side of SBI's book on NSE that way at 9:20:30 am on 22 October 2026: an illustration, with made-up sizes and times around that morning's real opening price, ₹959.55.

    Figure 4Matching

    Price first, then time

    Who gets a seller's 30 shares?two rules decide who goes first

    Best price firstSame price: earliest first
    Seller, 9:20:31: sell 30 at ₹959.5030 left to sell
    same price
    B3buy 80 sharesBid price₹959.45Arrived9:20:01No. 1 to arrive
    B1buy 20 sharesBid price₹959.50Arrived9:20:02No. 2 to arrive
    B4buy 40 sharesBid price₹959.40Arrived9:20:04No. 3 to arrive
    B2buy 15 sharesBid price₹959.50Arrived9:20:05No. 4 to arrive

    Four buy orders wait, listed as they arrived. B3 came first, at 9:20:01.

    Step through: price sorts the queue first, then arrival time. Order sizes and times are made up.

    At 9:20:31 a seller arrives to sell 30 shares at ₹959.50. Price decides first: B3 has waited longest, but it bids only ₹959.45, so it waits. Time decides next: at ₹959.50, B1 arrived three seconds before B2, so B1 gets all 20 of its shares and B2 the last 10. B2's other 5 keep waiting.

    During normal trading, every trade happens at the price of the order already waiting. At 9:20:32 Maya's order arrives: buy 5 at up to ₹960.00. A seller is already waiting with 5 shares at ₹959.55, so Maya pays ₹959.55 a share, ₹2.25 less in all than her limit allowed. A limit is the most you will pay, not the price you pay.

    Why a limit can wait. Say Maya had bid ₹959.50 at 9:20:06 instead (the figure's last step, Maya late). B1 and B2, 35 shares between them, stand ahead of her, so all 30 shares go to them. The price touches hers, and she gets none.

    Maya

    I wanted 5 shares. What would that fund's 5000 have cost?

    Chapter 4Depth

    Depth: Why Some Shares Are Easier to Trade

    How far does your order walk?

    A best price holds only for the shares waiting at it. Maya buys 200 burger buns every morning from the bakery down the road, at one price. The week a party ordered 1000 burgers, the bakery had only 300 at that price, and the rest cost her more at two other bakeries.

    Maya

    If 5 SBI shares cost ₹965.15 each, do 5000 cost ₹965.15 each too?

    Mr. Chartist

    Only if 5000 are waiting at ₹965.15. At 2:01:26 pm on 29 October, only 59 were.

    Maya

    Then the rest come from sellers asking more?

    Mr. Chartist

    Yes. Your order walks up the book, and how far depends on its depth.

    A share's best price works the same way. Depth is how many shares wait at and near the best prices. Liquidity is how easily a real amount can be bought or sold without moving the price much.

    A market order fills at the best ask first, then walks up to the next price. At 2:01:26 pm on 29 October, only 59 SBI shares waited at the best ask, ₹965.15. A buy of 100 took those 59, then 41 at ₹965.20, and paid ₹2.05 more; a fund's 5000 would have reached ₹965.30 and paid ₹311.40 more.

    Depth comes and goes. 75 seconds later, 1617 shares waited at ₹965.15, and an order for 1000 would have paid nothing extra.

    A thin book is different. In the figure's made-up share, only 25 shares wait up to ₹975.00. Those 25 cost ₹107.00 more than at the best ask, and an order for 100 finds no seller for 75 of them. Small, rarely traded shares often carry far wider spreads than SBI's ₹0.05 to ₹0.15.

    Figure 5Depth

    An order bigger than the best ask walks up to worse prices

    Buy how many SBI shares at market?the order takes the best ask first, then the next

    SBI on NSE · 2:01:26 pmdeepA deep book: many shares wait close to the best ask. Tap the ladder to replay the walk.

    +₹2.05above the best ask · average ₹965.17The extra money the whole order pays compared with buying every share at the best ask.

    A thin bookthinA thin book (made up): a rarely traded share with few sellers near the best ask. Tap the ladder to replay the walk.

    +₹107.00above the best ask · average ₹969.43 · only 25 filledThe extra money the whole order pays compared with buying every share at the best ask.

    75 seconds later 1617 shares waited at ₹965.15: 1000 would have paid ₹0 extra. Depth comes and goes.

    Pick a size and watch the order walk up the book. The thin book on the right is made up.

    The reason, so farSo the spread is the cost of a small trade; for a bigger one, the cost is how far the order walks. NSE calls this , measured against the middle of the spread, and shows it on a share's quote page. A busy day's is not depth: only the depth view shows what waits now. Reading a stock quote shows how to read depth with your own quantity.

    Maya

    If a thin book lets the price jump, what stops a rush of orders from pushing it anywhere?

    Chapter 5Orderly

    Keeping Trading Orderly

    The gate, the pause, and the day the referee stopped

    Maya

    Could a rush of orders push SBI to any price at all?

    Mr. Chartist

    No. The exchange checks every order at the gate and can pause the market. That keeps the process fair, never your price.

    Exchange rules protect a fair process, not your price. The first rule is a gate on how far a price may move: an order priced outside the day's permitted range never enters the book. SBI, which has futures and options (contracts on the share's price), has an of 10% either side of the previous close: ₹866.70 to ₹1059.30 on 22 October 2026.

    SBI traded far inside that range. The range is set afresh each day, and NSE widens it in steps if trading presses against an edge.

    Figure 6The referee

    The gate: an order outside the day's range never enters the book

    One share: its price rangeSBI's: 10% either side of its ₹963.00 close. An order outside it is refused.

    Tap a slip to send it to the gate. Every control is in lesson 26.

    The exchange also watches for unusual price and volume patterns and can put a share on a surveillance list. Its biggest control is a pause: if the Nifty 50 or the Sensex, India's two best-known share indices (market indices), moves 10%, 15% or 20% from the previous day's close, trading in all shares can stop, then restart through a short auction. Circuit limits and surveillance covers every control.

    The day the referee stopped. At 11:40 am on Wednesday 24 February 2021, NSE halted all trading. NSE said at the time that unstable links from both of its telecom providers had hit its online risk-management system, and that without it "market functioning could not continue normally". BSE stayed open, and NSE reopened only late in the afternoon: the figure below shows the day.

    That day shows three things. An exchange would rather stop than trade without its risk checks. A second exchange can keep the market open. And an exchange's own systems are part of the risk.

    Figure 7When trading stops

    Trading stops for everyone after a big index move, or when an exchange fails

    The whole market: a pausea 10%, 15% or 20% move in the Nifty 50 or the Sensex, down or up, stops every share, then an auction restarts them

    10%45 minutesbefore 1:00 pmA 10% move. Before 1:00 pm, a 45-minute halt; from 1:00 to 2:30 pm, 15 minutes; after 2:30 pm, no halt.15%a longer pausethe rest of the day after 2:00 pmA 15% move. After 2:00 pm, trading stops for the rest of the day; earlier, for a set time (lesson 26).20%the rest of the dayat any hourA 20% move, at any hour: trading stops for the rest of the day.

    24 February 2021: NSE stopped, BSE stayed open

    Neither gate creates a buyer or protects your price. The rules protect a fair process: every order checked at the gate, every share paused together.

    Pauses apply to a fall or a rise. Normal hours are 9:15 am to 3:30 pm.
    Maya

    Say the match goes through. Are the shares mine the moment the app says executed?

    Chapter 6Records

    After the Match: Three Records

    One trade, three keepers, the next working day

    Maya

    My order for 5 SBI shares is matched. Are they mine now?

    Mr. Chartist

    On the next working day, Friday 23 October. Until then, three keepers hold three records: the exchange, the clearing corporation and the depository.

    A match ends the exchange's job; three keepers take over, one record each. The exchange records the trade, and it reaches Maya as her broker's contract note, the official record of the trade and its charges (brokerage charges and taxes). The clearing corporation, NSE Clearing, records what each side owes, ₹4797.75 for the shares, and settles it. The depository, CDSL, records that the 5 shares are now hers.

    India settles most trades on T+1, the next working day: matched on Thursday 22 October, Maya's 5 SBI shares reach her CDSL demat account on Friday 23 October. Clearing and T+1 settlement follows each record, and what is the stock market follows the whole chain from phone to demat account.

    Figure 8After the match

    One trade, three records

    1. Maya taps Buy5 SBI shares
    2. Sahi sends it to NSEafter checking her money
    3. NSE matches it09:20:32
    4. NSE Clearing settlesT+1, the next working day
    5. CDSL credits the sharesinto Maya's demat

    The tradeNSE, the exchange, records the match

    ₹4797.75the amount of the tradeThe contract note: SBIN, a buy of 5 shares at ₹959.55, matched on 22-10-2026 at 09:20:32 on NSE.

    Reaches Maya as her broker's contract note

    • 22-10-2026 · 09:20:32NSE
    • SBIN · Buy5 shares
    • Rate₹959.55

    Thu 22 OctT · matched

    What each side owesNSE Clearing settles it

    ₹4797.75 infunds in, from SahiSettlement, T+1: on Fri 23 Oct 2026 the money arrives from Sahi and the 5 SBIN shares go out to Maya's demat.
    • SettlesFri 23 Oct 2026
    • Shares out5 SBIN
    • ToMaya's demat

    Fri 23 OctT+1 · settled, shares in

    Who owns it nowCDSL, the depository, records the shares

    5 SBIshares now in Maya's dematThe statement of transactions: an on-market credit of 5 shares of State Bank of India (INE062A01020) on 23-Oct-2026.
    • INE062A01020STATE BANK OF INDIA
    • 23-Oct-2026On-market credit
    • Credit5

    Fri 23 OctT+1 · settled, shares in

    One trade, three keepers, and the shares arrive the next working day. Maya's trade is an illustration; ₹4797.75 is before charges (lesson 16). Lesson 19 follows each record.
    Maya

    Does every exchange in the world work like this?

    Chapter 7The world

    Exchanges Around the World

    The same machine, set up differently

    Maya

    Is New York's exchange a different machine from NSE?

    Mr. Chartist

    The same machine: a book of waiting orders, matched by published rules.

    Maya

    Then what is different?

    Exchanges around the world run the same machine: a book of waiting orders, matched by published rules, best price first. The New York Stock Exchange (NYSE) and Nasdaq, the exchanges of Tokyo, Shanghai and Hong Kong, and NSE and BSE in Mumbai all work this way. Tokyo's own rules even use the two words: price priority and time priority. Only the tie-break at one price varies: the NYSE shares a fill among the orders waiting there, "on parity".

    They differ first in size. By the value of the shares listed on them, Nasdaq and the NYSE are the world's two biggest, each several times the size of NSE or BSE.

    India splits differently. BSE lists almost twice as many companies as NSE, but NSE does almost all the trading in the cash market, where shares themselves are bought and sold. The figure puts both side by side.

    Figure 9Size

    New York's exchanges are the biggest; in India, BSE lists more and NSE trades more

    Value of the shares listed on eachUS$ trillion, end of January 2026

    • Nasdaq $38.0 tn
    • NYSE $29.5 tn
    • BSE $5.0 tnBSE $5.0 tn
    • NSE $5.0 tnNSE $5.0 tn

    India: who lists, who trades

    Companies listed

    • 5581
    • 2941

    Value of shares traded, cash market, FY26

    BSE and others 7.01%

    The value of the shares listed on each exchange, and how India's cash trading splits.

    They differ in where your order goes. In India your broker sends it to the exchange you pick, NSE or BSE. In the US a broker may send it to an exchange or to a market maker, or fill it from shares its own firm holds, and must still seek the best terms reasonably available.

    And they differ in who supplies the prices. A market maker, met in the last lesson, is a firm that stands ready to buy and sell a share at prices it quotes. NSE's main market appoints none: it is , so anyone's waiting order can be the best price.

    Figure 10The world

    In India you pick the exchange; in the US your broker may

    Your broker sends the order to the book you chose.

    YoudecideBrokerNSE's bookNSE: about $4.98 trillion of listed shares (January 2026), and 92.99% of India's cash-market trading in FY26.NSE: about $4.98 trillion of listed shares (January 2026), and 92.99% of India's cash-market trading in FY26.BSE's bookBSE: about $4.99 trillion of listed shares (January 2026), from almost twice as many companies as NSE: 5581 against 2941.BSE: about $4.99 trillion of listed shares (January 2026), from almost twice as many companies as NSE: 5581 against 2941.
    Switch country: in India you choose the book; in the US the broker may route your order. Tap a destination.
    Maya

    SBI closed ₹7.00 higher on NSE that day, and nobody at NSE moved it. So why did buyers pay more?

    Before you go

    Check yourself

    4 questions from this lesson. Pick an answer to see why, then slide on to the next.

    Question 1 of 4

    Maya buys 5 SBI shares on NSE. What does NSE itself do in that trade?

    Questions readers ask

    Common questions

    Does the stock exchange decide the share price?

    No. It matches orders by one fixed rule; the price is where a buyer and a seller agree. Because each exchange keeps its own book, one share can even trade at slightly different prices on two exchanges at once: on 22 October 2026 SBI opened at ₹959.55 on NSE and ₹958.00 on BSE.

    Who sells me the shares when I buy on a stock exchange?

    Another investor or trader whose sell order was waiting in the book, or who arrived after yours. You never learn who, because matching is anonymous; once the trade is matched, a clearing corporation stands between the two sides until it settles.

    What is the bid-ask spread?

    The gap between the highest price a buyer is waiting to pay (the bid) and the lowest price a seller is waiting to accept (the ask). At 2:02:41 pm on 29 October 2026, SBI's best bid on NSE was ₹965.10 and its best ask ₹965.15: a spread of ₹0.05, one tick. Buying and selling straight back costs that gap.

    Why didn't my limit order fill when the price touched my price?

    At the same price, earlier orders go first. If others were ahead of you and the shares that traded at your price ran out, your order is still waiting.

    Why is a share's price different on NSE and BSE?

    Each exchange keeps its own order book, so their last trades can differ at any moment. The gap stays small because traders buy on the cheaper exchange and sell on the dearer one. Most of India's trading is on NSE: 92.99% of the value of shares traded (the cash market) in FY26, April 2025 to March 2026.

    What happens if a stock exchange stops working?

    Trading on that exchange stops until it reopens, while others can keep trading. On 24 February 2021 NSE halted all trading at 11:40 am while BSE stayed open. NSE reopened with a short auction at 3:30 pm, and trading hours were extended to 5:00 pm.

    Words to keep

    The 11 words this lesson used, in plain English

    The market1 of 11

    Stock exchange

    A regulated company that keeps one book of orders per share and matches them by fixed rules; it never sets the price or takes a side.

    The stock market is the idea: one place where buyers and sellers meet. A stock exchange is the real, organised place where that happens, with its own rules, trading screens and hours.

    Sources for further reading

    13 sources

    Privacy settings

    Essential sign-in storage and your saved preferences stay enabled. Analytics is optional, and you can change your choice anytime.

    Turning analytics off clears our analytics cookies and local assistant metrics. The page reloads to stop a previously loaded analytics service. Your account and learning progress stay saved.

    Read the Privacy Policy