6.5.5HFT & Advanced Concepts

Understand smart order routing

2,097 words10 min readdifficulty · medium1 backlinks

WHAT is Smart Order Routing?

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.


HOW does the router decide? (First-principles derivation)

We want the venue (or mix of venues) that minimizes the total effective cost of buying Q shares.

Step 1 — Define effective cost per venue

For a buy order at venue ii:

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.

Step 2 — Account for fill probability

An order sitting at a great price is worthless if it never executes. Weight the benefit by the probability ρi\rho_i that the fill actually happens:

Step 3 — The optimization

Choose child sizes q1,q2,,qnq_1, q_2, \dots, q_n to solve:

maxq1,,qn i=1nEi(qi)subject toiqi=Q,0qiLi\max_{q_1,\dots,q_n}\ \sum_{i=1}^{n} E_i(q_i)\quad \text{subject to}\quad \sum_i q_i = Q,\quad 0 \le q_i \le L_i

  • LiL_i = available liquidity (displayed size) at venue ii
  • The constraint qi=Q\sum q_i = 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 LiL_i until QQ shares are placed — a classic fill-cheapest-first (waterfall) strategy. This is optimal when cost per share is constant within a venue.

Figure — Understand smart order routing

Routing styles


Worked Examples


Common Mistakes


Active Recall

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+fr+impactP^{\text{eff}} = P^{\text{ask}} + f - r + \text{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.



Flashcards

What is a Smart Order Router?
An automated engine that splits a parent order into child orders and routes them across venues to get best price, liquidity, and net cost.
Why does SOR exist?
Because modern markets are fragmented — liquidity is spread across many exchanges/dark pools/ECNs, and no single venue has it all.
Effective buy price formula
Peff=Pask+fr+impactP^{eff} = P^{ask} + f - r + \text{impact} (ask + taker fee − rebate + market impact).
Why weight by fill probability ρ?
A great resting price is worthless if it never executes; expected value = ρ × edge × size.
Aggressive vs passive routing
Aggressive crosses the spread (pays fee, certain fast fill); passive posts to earn rebate (uncertain fill, cheaper).
Spray vs waterfall routing
Spray sends to all venues at once (fast, over-fill risk); waterfall goes venue-by-venue (fee-saving, liquidity-fade risk).
What is liquidity fading?
Quotes on other venues being pulled before your later child orders arrive, in sequential routing.
Maker–taker model
Venues charge takers a fee (ff) and pay makers a rebate (rr) to attract liquidity providers.
Adverse selection in passive posting
You tend to get filled precisely when the market is about to move against you.
Waterfall optimality condition
Fill-cheapest-first is optimal when per-share cost is constant within each venue.

Connections

Concept Map

motivates

splits

steered across

provide

input to

input to

weighted by

gives

maximized under

bounded by

achieves

Market fragmentation

Smart Order Router

Parent order into child orders

Multiple venues

Consolidated order book

Effective price P_eff

Fees rebates and latency

Fill probability

Expected value E_i

Optimization sum q_i equals Q

Available liquidity L_i

Best net execution

Hinglish (regional understanding)

Intuition Hinglish mein samjho

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+feerebate+impactP^{eff} = P^{ask} + \text{fee} - \text{rebate} + \text{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\rho < 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.

Test yourself — HFT & Advanced Concepts

Connections