Why this step? Because a limit is a worst acceptable price, not an exact one — buyers accept any lower price, sellers any higher.
Step 2 — Executable volume at price p. You can only trade the smaller of the two sides (no trade happens with an unmatched share):
V(p)=min(B(p),S(p))
Why min? If 500 want to buy but only 300 want to sell, only 300 trades occur — the extra 200 buyers go unfilled.
Step 3 — The auction price. Choose the price that maximises executable volume:
p∗=argpmaxV(p)=argpmaxmin(B(p),S(p))
Why max? The exchange's stated objective is maximum executable volume — the most shares changing hands.
Step 4 — Tie-breaking rules (WHY they exist).B is a non-increasing step function and S is non-decreasing, so min(B,S) is often flat over a range of prices. Exchanges break ties in order:
Max volume (already done).
Minimum imbalance — pick p minimising ∣B(p)−S(p)∣ (least leftover).
Market pressure — if imbalance sign is fixed, pick the price closer to the pressured side.
Reference price — closest to the last / previous close.
Imagine a school selling 350 cookies. Some kids write "I'll pay up to 3 rupees," others "up to 2 rupees." Some bakers say "I'll sell for at least 1 rupee." The teacher lines everybody up and asks: "At what single price can the MOST cookies be sold?" Too high a price and few kids buy; too low and few bakers sell. There's a sweet middle price where the biggest crowd trades — and everyone pays that one price. That sweet price is the auction price.
Dekho, ek stock exchange basically ek bada matching machine hai. Auction ka matlab hai — saare buy orders aur sell orders ko ek jagah collect karo, aur woh ek single price dhoondo jahan sabse zyada shares trade ho sakein. Isko hum "call auction" kehte hain, jaise market open aur close ke time hota hai. Continuous trading actually chhote-chhote auctions ki ek fast stream hai.
Ab derivation samjho. Har buyer ka ek limit hota hai — "main is price tak pay karunga." Agar buyer $50 tak ready hai, toh woh $47 pe bhi khush hai. Isliye demand B(p) = un saare buyers ka total quantity jinki limit price p se zyada ya barabar hai — yeh price badhne pe girti jaati hai. Ulta, supply S(p) = un sellers ka total jinki limit p se kam ya barabar hai — yeh price badhne pe badhti jaati hai. Trade sirf chhoti side ke barabar hota hai, isliye V(p)=min(B,S). Jis price pe Vmaximum hai, wahi hai clearing price p∗.
Ek important baat: agar B>S, toh sabhi buyers fill nahi honge — sirf min(B,S) shares trade karenge, baaki priority (price-time) se ration honge. Yeh common galti hai — "main count hua toh mera order bhar gaya" — nahi bhai, count hona aur fill hona alag cheez hai.
Yaad rakhne ke liye mantra: "Build, Min, Max, Break" — pehle B aur S banao, phir min lo, phir max volume wali price pick karo, aur tie ho toh minimum imbalance se break karo. Yeh mechanism price discovery ka dil hai, isliye market open/close ka official price yahin se banta hai.