WHY these inputs? Because "best price" on screen is not the same as "best net outcome." A venue may show a great price but charge a huge fee, or be so far away that by the time your order arrives the price is gone.
Why this form? Cost = what you pay for shares + what the venue charges − what the venue pays you back + how much you move the market. Each term is a real cash flow, so we just sum them. There are no hidden constants — this is literally your bank statement.
Li = available liquidity (displayed size) at venue i
The constraint ∑qi=Q says: fill the whole parent order.
HOW it's solved in practice: the router sorts venues by marginal effective cost (cheapest first), then fills greedily up to each venue's available size Li until Q shares are placed — a classic fill-cheapest-first (waterfall) strategy. This is optimal when cost per share is constant within a venue.
Recall Why can't we just use the National Best Bid/Offer and stop?
Because NBBO shows displayed price only. Real execution cost also depends on venue fees/rebates, latency (price may vanish before you arrive), and fill probability. SOR optimizes net effective cost, not the headline quote.
Recall Derive effective buy price from scratch.
Cost per share = ask you pay + taker fee − rebate received + market-impact penalty. Sum the cash flows: Peff=Pask+f−r+impact.
Recall When is sequential (waterfall) routing risky?
When liquidity fades — a fast trader sees your first child order and pulls quotes on other venues before your later child orders arrive.
Recall Feynman: explain SOR to a 12-year-old
You want to buy 100 marbles but no one shop has 100. A smart helper checks every shop at the same time, notices which shop has cheap marbles and low entry-fee, and instantly sends the right number of your marbles-orders to each shop — so you get all 100 for the least money without one shop noticing and raising its price.
Dekho, aajkal ek hi stock kai alag-alag exchanges aur dark pools par trade hota hai — liquidity ek jagah nahi, poori market mein fragmented (bikhri hui) hoti hai. Ab agar tumhe 1000 share kharidne hain, toh kisi ek venue par pura order daal doge toh ya toh fill nahi hoga, ya price tumhare against bhaag jayega (market impact). Yahan Smart Order Router (SOR) kaam aata hai — ek automatic system jo tumhare bade "parent" order ko chhote "child" orders mein tod ke best venues par microseconds mein bhej deta hai.
SOR sirf screen ka best price nahi dekhta. Woh effective price nikalta hai: Peff=Pask+fee−rebate+impact. Matlab jo asli paisa tumhare pocket se jayega. Kabhi ek venue ka price thoda accha dikhta hai par uski fee zyada hoti hai — toh woh actually mehnga padta hai. Isliye hamesha effective cost compare karo, headline quote nahi.
Routing do style ki hoti hai: aggressive (spread cross karke turant le lo, fee doge par fill pakka) aur passive (bid par order post karo, rebate kamao, par fill guarantee nahi — probability ρ<1). Aur order bhejne ka tarika spray (sab venues par ek saath, fast par over-fill risk) ya waterfall (ek-ek karke cheapest se, fee bachti hai par "liquidity fade" ka risk — doosre traders quote hata dete hain).
Yaad rakhne ka formula: PLFF — Price, Liquidity, Fees, Fill-probability. Yehi chaar cheezein SOR optimize karta hai. Exam ya interview mein agar poochhe "SOR kyun chahiye?", jawab simple hai — market fragmented hai, aur best net execution paane ke liye smartly split-and-route karna padta hai.