Phase 1 · Market Foundations

    How a Stock Exchange Really Works

    What actually happens in the microseconds after you tap 'Buy' — order books, price-time priority, order types, and how a trade is cleared and settled into your demat account.

    Beginner9 min read7 sectionsUpdated June 2026

    A stock exchange is an electronic marketplace that matches buyers and sellers in real time. Once you understand the order book, how orders are matched, and how a trade is settled, the market stops feeling mysterious — and you start placing orders with intent instead of guesswork.

    You open your broker app, type a stock name, and tap 'Buy'. A second later it says 'Executed'. It feels like magic — but it is actually a precise, regulated process happening at incredible speed.

    Behind that single tap, your order travels to an exchange, joins a queue of thousands of other orders, gets matched against a willing seller by strict rules, and is then cleared and settled into your demat account a day later.

    Understanding this journey makes you a better trader. You learn why some orders fill instantly and others do not, why prices 'jump', and how to avoid paying more than you should.

    An exchange does not set prices. It simply provides a fair place for buyers and sellers to discover them.
    Learning Path
    Why the market existsHow an exchange worksReading a quotePlacing your first order
    Section 1

    What an Exchange Actually Does

    The electronic marketplace

    A stock exchange is a regulated, electronic platform whose single job is to match buy orders with sell orders, fairly and fast. In India, the two main exchanges are the NSE (National Stock Exchange) and the BSE (Bombay Stock Exchange).

    The exchange itself does not decide a stock's price and does not take a side. It simply maintains an orderly marketplace where the forces of demand (buyers) and supply (sellers) meet. The price you see is the result of those forces, not a number the exchange sets.

    Everything runs through a central system called the order matching engine, which processes an enormous volume of orders — lakhs per second at peak — using fixed, transparent rules so that no participant gets unfair priority.

    Buy ordersSell ordersEXCHANGEmatching engineneutral · fair · fast
    The exchange is a neutral referee, not a player. Price is decided by buyers and sellers — never by the exchange.
    Key Ideas
    • An exchange is a regulated electronic platform that matches buyers and sellers
    • NSE and BSE are India's two primary equity exchanges
    • The exchange never sets prices or takes sides — demand and supply do
    • A matching engine applies fixed, transparent rules at very high speed
    Takeaway
    An exchange is a fair, fast, electronic marketplace. Its only job is to match orders transparently — price emerges from demand and supply.
    Section 2

    The Order Book: Bids, Asks & the Spread

    The market's live queue

    At the heart of every stock is its order book — a live list of all pending buy orders (bids) and sell orders (asks/offers) at different price levels.

    The highest price a buyer is currently willing to pay is the Best Bid. The lowest price a seller is currently willing to accept is the Best Ask. The gap between them is called the spread.

    The spread is a quiet but important cost. A tight spread means the stock is liquid (lots of buyers and sellers close together). A wide spread means the stock is illiquid — and you can lose money just crossing it.

    Order Book₹501.0₹500.5₹500.2Spread = ₹0.40₹499.8₹499.5₹499.0Asks (sell)Bids (buy)
    Key Ideas
    • The order book lists all pending bids and asks at each price level
    • Best Bid = highest buy price waiting; Best Ask = lowest sell price waiting
    • Spread = Best Ask − Best Bid; tighter spread means more liquidity
    • Crossing a wide spread is a hidden cost, especially in small stocks
    Example
    A liquid large-cap may show a bid of ₹3,980 and an ask of ₹3,981 — a ₹1 spread. A thinly traded small-cap might show a bid of ₹142 and an ask of ₹148 — a ₹6 spread, meaning you lose roughly 4% the instant you buy at market.
    Takeaway
    The order book is the market's live queue of bids and asks. The spread between best bid and best ask is a real cost — always check it before trading thin stocks.
    Section 3

    How Orders Get Matched: Price-Time Priority

    The rule that keeps it fair

    The matching engine follows one core rule: price-time priority. Price comes first — the best price always gets matched ahead of worse prices. If two orders share the same price, time decides — whoever placed their order earlier gets filled first.

    This is why a large, patient queue can form at a popular price level, and why being early matters when many people want the same price. It also explains why your limit order at a certain price may sit unfilled while the price trades around it — there were orders ahead of you in the queue.

    The rule is completely mechanical and blind to who you are. A retail order and an institutional order at the same price are treated by the same priority logic.

    1. Best price first₹500 ← matched₹499₹4982. Then earliest firstOrder @ 9:15:01Order @ 9:15:04Order @ 9:15:09
    Price first, then time. That single rule is what makes the market fair for a beginner and an institution alike.
    Key Ideas
    • Best price is matched first (price priority)
    • At the same price, the earliest order is matched first (time priority)
    • The engine is blind to participant identity — the rule is the same for all
    • Your limit order can sit unfilled if others are ahead in the queue
    Takeaway
    Orders are matched by price-time priority: best price wins, ties broken by who was earliest. It is mechanical, transparent, and identity-blind.
    Section 4

    Order Types Every Beginner Must Know

    Market, Limit, Stop-Loss

    How your order behaves depends on the order type you choose. Getting this right is one of the fastest ways to stop losing money to careless execution.

    Key Ideas
    • Market order = speed and certainty of execution, but not of price
    • Limit order = control of price, but not certainty of execution
    • Stop-loss orders activate only after a trigger price is touched
    • SL becomes a limit order; SL-M becomes a market order once triggered
    Order typeWhat it doesBest used when
    MarketExecutes immediately at the best available priceYou need certainty of execution in a liquid stock
    LimitExecutes only at your chosen price or betterYou want price control and can wait
    Stop-Loss (SL)Triggers a limit order once a trigger price is hitProtecting a position with a defined exit
    Stop-Loss Market (SL-M)Triggers a market order once the trigger is hitYou need the exit to fill for sure once triggered
    The four order types you will use most as a beginner.
    Pro Tip
    Always use limit orders in illiquid stocks. A market order in a thin stock can fill far away from the last price because it eats through the order book.
    Watch Out
    A plain market order in a low-volume stock can cause severe slippage — you may buy much higher (or sell much lower) than the price you saw. When in doubt, use a limit order.
    Takeaway
    Master four order types: Market (speed), Limit (price control), and Stop-Loss SL/SL-M (defined exits). Choosing the right one is half of good execution.
    Section 5

    From Click to Confirmation

    The journey of a single order

    When you tap 'Buy', your order does not go straight to the exchange — it travels through a chain, each part regulated and accountable.

    Youtap BuyBrokerrisk checkExchangematchDematshares in
    1. You → Broker
    Your broker's app (Zerodha, Groww, Angel One, etc.) receives and risk-checks your order — margin, limits, validity.
    2. Broker → Exchange
    The order is forwarded to the NSE/BSE matching engine and joins the order book by price-time priority.
    3. Match
    The engine pairs your order with a willing counterparty at the agreed price. A trade is born.
    4. Confirmation
    The trade confirmation flows back to your broker and into your app — usually within a fraction of a second.
    Key Ideas
    • Orders pass through your broker before reaching the exchange
    • The broker performs margin and risk checks first
    • Matching happens at the exchange by price-time priority
    • Confirmation returns to you almost instantly
    Takeaway
    A trade flows: you → broker (risk check) → exchange (match) → confirmation back to you. Each step is regulated, and it all happens in a fraction of a second.
    Section 6

    Clearing & Settlement: T+1

    How shares actually reach your demat

    A matched trade is only the beginning. The shares and money must still change hands safely — this is clearing and settlement, handled by clearing corporations that guarantee both sides of the deal.

    India runs on a T+1 settlement cycle: if you buy today (T), the shares are credited to your demat account the next business day (T+1), and the money moves from your account in the same cycle. T+1 is among the fastest standard cycles in the world.

    This is why you hold three linked accounts: a bank account (money), a demat account (holds your shares in electronic form), and a trading account (places orders). Clearing corporations sit in the middle and remove the risk of the other party defaulting.

    Day TYou buy (trade)Day T+1Shares in demat · settlednext business day
    Key Ideas
    • Clearing corporations guarantee both sides of every trade
    • India settles equity trades on a T+1 cycle — shares credited the next business day
    • You need three linked accounts: bank, demat, and trading
    • Settlement removes counterparty default risk for you
    Example
    Buy shares on Monday (T). They appear in your demat account on Tuesday (T+1). Sell on Tuesday, and the cycle repeats from that day.
    Takeaway
    Matching is step one; clearing and settlement (T+1 in India) safely move shares and money. Clearing corporations guarantee the trade, so you never worry about the other side defaulting.
    Section 7

    Liquidity & Circuit Limits

    Why some stocks are safer to trade

    Liquidity is how easily you can buy or sell without moving the price. High-volume stocks are liquid — tight spreads, easy fills. Low-volume stocks are illiquid — wide spreads, hard fills, and nasty surprises.

    To keep markets orderly, exchanges also apply circuit limits — daily caps on how far a stock or index can move. An Upper Circuit means it cannot rise further that day; a Lower Circuit means it cannot fall further. Circuits prevent panic-driven free-falls and runaway spikes.

    As a beginner, favour liquid stocks. They are easier to enter and exit, cost less in spread, and are far less prone to manipulation than thin, low-volume counters.

    Liquid — tight spreadAsk ₹500.0Bid ₹499.9spread ₹0.10 ✓ easyIlliquid — wide spreadAsk ₹148Bid ₹142spread ₹6 ✗ costly
    Key Ideas
    • Liquidity = how easily you trade without moving the price
    • Liquid stocks: tight spreads, easy fills; illiquid: wide spreads, hard fills
    • Circuit limits cap daily price moves to keep markets orderly
    • Beginners should favour liquid, high-volume stocks
    Watch Out
    Illiquid small-caps can hit upper/lower circuits and trap you — you may be unable to exit at any reasonable price. Prioritise liquidity over the lure of a 'cheap' stock.
    Takeaway
    Liquidity decides how cleanly you can trade; circuit limits keep the market orderly. As a beginner, stick to liquid stocks — they are cheaper and safer to trade.

    Frequently Asked Questions

    Does the stock exchange decide the price of a stock?

    No. The exchange only matches buyers and sellers. The price is set by demand and supply — the highest price a buyer will pay meeting the lowest price a seller will accept. The exchange is a neutral referee, not a price-setter.

    What is the difference between a market order and a limit order?

    A market order executes immediately at the best available price — you get certainty of execution but not of price. A limit order executes only at your specified price or better — you get price control but the order may not fill. Use limit orders in illiquid stocks to avoid slippage.

    What does T+1 settlement mean?

    T+1 means a trade settles one business day after it is executed. If you buy on Monday (T), the shares are credited to your demat account on Tuesday (T+1). India's T+1 cycle is among the fastest standard settlement cycles globally.

    Why didn't my limit order get filled even though the price reached it?

    Because of price-time priority. Other orders at the same price were placed before yours and sit ahead in the queue. If the available quantity at that price gets used up before reaching your order, the price can move away without filling you.

    What is the bid-ask spread and why does it matter?

    The spread is the gap between the best buy price (bid) and the best sell price (ask). It is a hidden cost: in a wide-spread (illiquid) stock, you can lose several percent the moment you buy at market. Tight spreads in liquid stocks keep this cost tiny.

    What happens if the person on the other side of my trade defaults?

    You are protected. Clearing corporations sit between buyers and sellers and guarantee settlement of every trade. This removes counterparty risk, so you don't need to worry about who is on the other side.

    RS
    Rohit Singh
    SEBI Registered Research Analyst · INH000015297

    Founder of Mr. Chartist. Helping Indian retail traders learn the markets the right way — price action, risk, and real businesses over hype.