6.3.2 · Stock-Market › Market Microstructure
Intuition Ek-line mein poori picture
Ek limit order book (LOB) ek stacked queue hai unfilled buy aur sell orders ki, price ke hisaab se sort ki hui. Depth measure karti hai har price level par (ya uske paas) kitna volume resting hai , isliye yeh batati hai ki ek bada trade book mein kitni door "walk" karega fill hone se pehle. Shallow book = ek order price ko bahut move kar sakta hai; deep book = price muskil se hilti hai.
Limit order : ek order buy/sell karne ka ek fixed quantity ko specified price ya usse better price par . Yeh book mein rest karta hai jab tak match na ho (market order se alag, jo immediately available price par execute hota hai).
Bid side : saare resting buy limit orders, highest price (best bid) se neeche sort kiye hue.
Ask (offer) side : saare resting sell limit orders, lowest price (best ask) se upar sort kiye hue.
Best bid b 1 / best ask a 1 : har side ka top — current tradable prices.
Spread : s = a 1 − b 1 (hamesha ≥ 0 ; agar yeh 0 ho jaaye toh orders match ho jaate).
Mid price : m = 2 a 1 + b 1 .
Depth at a level : price p i par total resting quantity q i .
Cumulative depth level k tak: Q k = ∑ i = 1 k q i — total shares available agar tum pehle k levels sweep karo.
Intuition Book KYU exist karti hai
Markets ko kisi aise insaan ki zaroorat hoti hai jo abhi trade karne ke liye tayaar ho. Limit orders standing promises hain ("Main ₹99 par 200 shares khareedunga"). Yeh liquidity provide karte hain; market orders use consume karte hain. Depth literally us liquidity ki inventory hai har price par.
Jab ek market buy of size V aata hai, toh yeh ask side ko top se khaata hai:
Derivation Effective execution price — first principles se
WHAT we want: V shares kharidne ke liye ask ladder ke against average price paid.
Setup. Ask levels hain ( a 1 , q 1 ) , ( a 2 , q 2 ) , … jisme a 1 < a 2 < …
Market buy sabse sasti shares pehle fill karta hai (price–time priority).
Step 1 — kitne levels consume hote hain? Sabse chhota k dhundo jisme cumulative depth order cover kare:
Q k − 1 < V ≤ Q k , Q k = ∑ i = 1 k q i .
Yeh step kyun? Kyunki order level k + 1 tak nahi pahunch sakta jab tak levels 1.. k exhaust na ho jaayein — yahi price-time priority rule hai.
Step 2 — fill karne ki cost. Levels 1.. k − 1 fully consume karo, phir remainder V − Q k − 1 level k se lo:
Cost = ∑ i = 1 k − 1 q i a i + ( V − Q k − 1 ) a k .
Yeh step kyun? Har share ki cost usi level ki price hoti hai jahan se woh aaya; hum last level ko sirf partially fill karte hain.
Step 3 — average (VWAP) execution price:
p ˉ ( V ) = V ∑ i = 1 k − 1 q i a i + ( V − Q k − 1 ) a k
Step 4 — price impact / slippage mid ke relative:
Impact ( V ) = p ˉ ( V ) − m .
Yeh step kyun? Impact isolate karta hai finite depth ki wajah se extra cost . Agar book infinitely deep hoti a 1 par, toh impact sirf half spread hota.
Worked example 150 shares kharidna
Ask ladder: ( a 1 , q 1 ) = ( 100.0 , 500 ) , ( a 2 , q 2 ) = ( 100.1 , 300 ) . Best bid b 1 = 99.9 .
Step 1: Q 1 = 500 ≥ 150 , isliye k = 1 . Kyun? Level 1 akele order cover kar leta hai.
Step 2: Cost = 150 × 100.0 = 15000 .
Step 3: p ˉ = 15000/150 = 100.0 .
Step 4: m = ( 100.0 + 99.9 ) /2 = 99.95 , impact = 100.0 − 99.95 = 0.05 .
Takeaway: chhota order vs. deep top level ⇒ impact ≈ sirf half spread. Koi walking nahi.
Worked example 700 shares kharidna (same ladder, add
( a 3 , q 3 ) = ( 100.3 , 400 ) )
Step 1: Q 1 = 500 < 700 ≤ Q 2 = 800 , isliye k = 2 . Kyun? Level 1 (500) kaafi nahi; level 2 complete karta hai.
Step 2: Cost = 500 ( 100.0 ) + ( 700 − 500 ) ( 100.1 ) = 50000 + 200 ( 100.1 ) = 50000 + 20020 = 70020 .
Step 3: p ˉ = 70020/700 = 100.0286 .
Step 4: impact = 100.0286 − 99.95 = 0.0786 — zyada Example 1 se. Kyun? Order mehengi doosri level mein walk kar gaya.
Worked example 700 kharidna, lekin
q 1 = 200 instead of 500
Ladder: ( 100.0 , 200 ) , ( 100.1 , 300 ) , ( 100.3 , 400 ) .
Step 1: Q 1 = 200 , Q 2 = 500 < 700 ≤ Q 3 = 900 ⇒ k = 3 .
Step 2: Cost = 200 ( 100.0 ) + 300 ( 100.1 ) + ( 700 − 500 ) ( 100.3 ) = 20000 + 30030 + 20060 = 70090 .
Step 3: p ˉ = 70090/700 = 100.1286 .
Step 4: impact = 0.1786 — Example 2 se double se bhi zyada same order size ke liye.
Steel-man lesson: identical trade, identical top-of-book price, lekin thin depth ⇒ bahut kharab fill . Depth, sirf spread nahi, tumhari cost control karta hai.
Common mistake "Spread mujhe meri trading cost batata hai."
Kyun sahi lagta hai: spread sabse visible number hai aur chhote trade ke liye hai bhi cost. Fix: cost = spread + slippage from walking the book . Paper-thin top level ke saath tight spread size ke liye zyada expensive ho sakta hai wide spread with deep levels se. Hamesha cumulative depth dekho, sirf s nahi.
Common mistake "Best-bid volume = poore stock ki liquidity."
Kyun sahi lagta hai: top-of-book number wahi hai jo quote screens dikhate hain. Fix: liquidity poora ladder {( p i , q i )} hai. Ek single displayed 100-lot neeche lakho shares chhupa sakta hai (ya reveal nahi karta) — ya hidden/iceberg orders jo tum bilkul nahi dekh sakte.
Common mistake "Depth symmetric hai, isliye mid price fair hai."
Kyun sahi lagta hai: hum book ko mirror image ki tarah draw karte hain. Fix: bid aur ask depth aksar imbalanced hoti hai. Order-book imbalance I = Q k bi d + Q k a s k Q k bi d − Q k a s k short-term price drift predict karta hai: bids zyada hain asks se ⇒ upward pressure. Mid biased ho sakta hai.
Common mistake Price-time priority / partial fills bhool jaana.
Kyun sahi lagta hai: sabhi touched levels ko equally average karna tempting lagta hai. Fix: last level usually sirf partially consume hota hai — ise remainder ( V − Q k − 1 ) se weight karo, uske poore q k se nahi.
Limit order kya hota hai (market order se compare mein)? Ek resting order ek fixed quantity trade karne ka ek specified price ya better par; yeh book mein wait karta hai. Market order immediately best available prices par execute hota hai, liquidity consume karta hai.
Ek price level par depth define karo. Us price par total resting order quantity q i available.
Cumulative depth Q k define karo. Q k = ∑ i = 1 k q i — best level se level k tak ka total volume.
Spread aur mid price ka formula? s = a 1 − b 1 ; m = ( a 1 + b 1 ) /2 .
Tum kaise pata karte ho ki size V ka market buy kitne ask levels consume karta hai? Sabse chhota k jisme Q k − 1 < V ≤ Q k ho.
V kharidne ka VWAP (average) execution price likho.p ˉ ( V ) = V ∑ i = 1 k − 1 q i a i + ( V − Q k − 1 ) a k .
Trade ka slippage / price impact define karo. p ˉ ( V ) − m : mid se upar extra average cost jo finite-depth book ko walk karne se aati hai.
Kyun tight-spread stock size mein expensive trade karna ho sakta hai? Agar depth thin hai, toh bada order bahut kharab levels mein walk kar jaata hai, isliye slippage chhote spread ko dwarf kar deta hai.
Order-book imbalance kya hai aur yeh kya hint karta hai? I = Q bi d + Q a s k Q bi d − Q a s k ; positive I (zyada bids) short-term upward price pressure suggest karta hai.
Book walk karte waqt, last level ko V − Q k − 1 se kyun weight karte hain? Kyunki final level sirf partially fill hota hai — sirf remaining shares jo earlier levels exhaust karne ke baad bachte hain wahan se aate hain.
Recall Feynman: 12-saal ke bachche ko explain karo
Ek candy shop imagine karo jahan log notes laga ke jaate hain "Main tumhe ₹10 mein candy BECHUNGA" ya "Main tumhari candy ₹9 mein KHAREEDUNGA". Sell notes sabse saste-pehle stack hote hain, buy notes highest-pehle. Depth hai kitni candies ke liye har note valid hai. Agar tum 100 candies kharidna chahte ho lekin sabse sasta note sirf 20 cover karta hai, toh tumhe agla note pakadna hoga (thoda mehenga), phir agla… toh bahut saari candies kharidna price ko upar push karta hai jaate jaate . Bade fat notes wali dukaan (deep book) mein price muskil se badlti hai; tiny notes wali dukaan (thin book) mein bahut jump karta hai. Bas yahi poora idea hai!
"BAD SLIP" — B ids below, A sks above, D epth is the stack; SL ippage I ncreases when the book is P oor (thin). Aur yeh bhi: "Spread is the door, depth is the room."
Bid-Ask Spread — top-of-book cost; depth explain karta hai cost usse aage .
Market Orders vs Limit Orders — kaun liquidity consume karta hai vs supply karta hai.
Price-Time Priority — matching rule jo fill order dictate karta hai.
Slippage and Market Impact — finite depth ka direct consequence.
Order-Book Imbalance — depth asymmetry as a short-term price signal.
VWAP and TWAP Execution — algorithms jo orders slice karte hain book walk karne se bachne ke liye.
Liquidity — depth uske teen pillars mein se ek hai (tightness, depth, resiliency).