Suppose you want to buyQ shares as a market order. The ask side has levels:
(p1,q1),(p2,q2),(p3,q3),…p1<p2<p3<…
where p1 is the best ask and qi is the quantity at price pi.
Step 1 — Fill greedily. You consume q1 at p1, then q2 at p2, ... until total =Q.
Why this step? The matching engine always fills you at the best available price first — you can't skip a cheaper seller.
Step 2 — Total cost. If levels 1..k−1 fill fully and you take r from level k:
Cost=∑i=1k−1piqi+pkr,r=Q−∑i=1k−1qi
Why this step? Cost is just price × quantity summed across each level you touch.
Step 3 — Average execution price (VWAP of your fills).
pˉ=QCost
Step 4 — Price impact = slippage vs the pre-trade mid. Let mid price before trade be m0:
Impact=pˉ−m0
Why this step? The mid m0 is the "fair" reference before you disturbed anything; how far your average fill sits above it is your cost of impact (a.k.a. slippage).
The cumulative quantity available to trade at/near the best prices before the price moves a given amount; deep = large volume absorbable with little movement.
What is price impact?
The price change caused by your own trade — average fill price minus the pre-trade mid price (slippage).
Difference between temporary and permanent impact?
Temporary reverts after the order finishes (liquidity consumed then refilled); permanent persists because the trade revealed information updating fair value.
Why does buying push the price up (two mechanisms)?
(1) Mechanical: you consume cheap sellers and climb to pricier ones; (2) Informational: market makers raise quotes on seeing a large buyer.
Formula for average execution price when walking the book?
pˉ=Cost/Q where Cost =∑piqi across consumed levels.
State the square-root law of impact.
Δp≈YσQ/V, with σ volatility, V daily volume, Y∼0.5–1.
Why is impact concave (square-root) not linear?
As price moves, latent/limit liquidity replenishes, so each additional share hurts less — the book is elastic.
Is the bid-ask spread the same as price impact?
No — spread is the fixed cost of a tiny round trip; impact grows with order size beyond the top of book.
Depth up to price P formula?
D(P)=∑pi≤Pqi — total quantity sellable at or below P.
Buy 400 with book (100.0,200),(100.1,300); what's avg price?
(200⋅100.0+200⋅100.1)/400=100.05.
Recall Feynman: explain to a 12-year-old
Imagine a candy shop where the cheapest candy is at the front and the more expensive ones are behind it. If you buy just one candy, you pay the cheap front price. But if you want to buy all the candy, you finish the cheap ones and start paying for the pricey ones at the back — so your average price goes up just because you bought a lot. "Price impact" is that extra you pay for wanting a lot at once. "Market depth" is how much cheap candy sits at the front: a shop stacked high (deep) barely changes price; a shop with 2 candies (thin) jumps in price instantly.
Dekho, jab tum market mein ek bada order bhejte ho, to price khud tumhare against move kar jaati hai — buy karoge to price upar chadhegi, sell karoge to niche giregi. Iska reason simple hai: order book mein har price level pe limited quantity hoti hai. Agar tumhe best ask pe available shares se zyada chahiye, to tum pehle sabse saste sellers kha jaate ho, phir mehnge wale sellers tak pahunchte ho. Isse tumhari average fill price badh jaati hai. Yehi extra cost hai price impact (ya slippage), jo hum measure karte hain pre-trade mid price ke against — na ki ask ke against.
Market depth ka matlab hai ki best prices ke aas-paas kitni quantity ready padi hai absorb karne ke liye. Agar depth zyada hai (deep book), to tumhara bada order aaram se fill ho jaata hai bina price hilaaye. Agar depth kam hai (thin book), wahi order price ko jhatka de deta hai. Isliye yaad rakho: DEEP absorbs, THIN jolts.
Ek important baat — impact linear nahi hota, balki square-root follow karta hai: Δp≈YσQ/V. Matlab agar tum order double kar do, cost sirf ~1.4 guna badhta hai, 2 guna nahi. Kyun? Kyunki jaise-jaise price move karti hai, naye sellers (latent liquidity) aa jaate hain, to har extra share thoda kam dard deta hai. Isiliye smart traders bade order ko chhote tukdon mein todte hain (VWAP/TWAP algos) taaki impact kam ho.
Yeh cheez trading mein bahut matter karti hai kyunki agar tum apna cost estimate galat karoge, to profit khatam ho sakta hai. Spread ko impact samajhna sabse common galti hai — spread to chhoti round trip ka cost hai, jabki impact size ke saath badhta hai. Toh hamesha size aur depth dono dekh ke trade karo.