Routing across venues with access costs
Allocate a complete order across venues and prove when fixed access charges defeat marginal sorting.
36 minutes · intermediate · Original Poker4Quant lessonWhat you will learn
Optimize a capacity-constrained multi-venue allocation, certify the separable optimum and derive an activation-fee threshold with discrete tied optima.
Prerequisites: Book depth and execution curves · Price-time order matching · Implementation shortfall and unfilled orders
Declare the executable experiment
A routing decision chooses where units of one intention will execute. The cheapest visible quote can be expensive after charges, and the cheapest venue can have too little capacity to complete the intention. We will construct a finite allocation problem, solve it with an exchange argument when costs are separable, and then break that argument with a fixed access charge. The objective is a complete six-unit purchase at minimum total customer outlay. It is neither a forecast nor an invitation to trade. The useful habit is to state the feasible set before sorting anything.
Assume one fictional asset, integer units, simultaneous frozen offers and guaranteed execution of every allocated unit up to each displayed capacity. Venue A offers two units at 100 chips each and charges two chips per executed unit. Venue B offers four at 101 and credits one chip per executed unit. Venue C offers six at 103 with no per-unit charge. All charges and credits pass through to this customer. There are initially no fixed fees, latency, hidden depth, price protection restrictions, taxes, financing, queue competition or cross-venue dependencies. These deliberately strong assumptions define a teaching optimization, not an executable algorithm for regulated markets.
Separate price, transfers and capacity
Write xA, xB and xC for routed quantities. Feasibility requires nonnegative integers, xA≤2, xB≤4, xC≤6 and xA+xB+xC=6. A credit is a negative fee, so all-in marginal purchase costs are 102, 100 and 103 respectively. The ledger separates gross purchase value G=100xA+101xB+103xC from net transfers F=2xA−xB. Customer outlay is T=G+F. Do not subtract the credit from the displayed price and then subtract it again in transfers. The two ledger columns are complementary ways to reconstruct one cash total.
The price-only allocation exhausts A first and buys four from B: (2,4,0). Gross value is 200+404=604; transfers are 4−4=0; total is 604. Interestingly this is also the fee-aware optimum for six units, but agreement of final allocations does not validate the price-only ranking. For a four-unit intention, price-only routing gives (2,2,0), with total 204+200=404, while using four B units costs 400. Capacity can mask a ranking error at one order size. Testing a smaller intention exposes the substantive difference without changing any quotes.
Prove a marginal allocation certificate
When each venue has a constant per-unit cost and no activation charge, suppose an allocation uses a more expensive venue while a cheaper one has spare capacity. Move one unit from the expensive venue to the cheaper one. Completion and capacity remain valid, and total cost falls by their marginal-cost difference. Repeat until no such improving transfer exists. This terminates because there are finitely many feasible integer allocations and each strict transfer reduces cost. Tied marginal costs permit several optima; the proof does not justify rejecting a different allocation with the same minimum outlay.
Here B is cheapest at 100, followed by A at 102 and C at 103. Allocate four units to B, then two to A: T=4×100+2×102=604. A second certificate uses a lower bound: at most four of six units can cost 100, and each remaining unit costs at least 102. Therefore every feasible allocation costs at least 400+204=604. Our allocation attains that bound. If the intention exceeded twelve units, completion would be impossible under these capacities. A low cost on a partial fill would not solve the stated full-completion problem.
A fixed charge changes the reasoning
Now charge three additional chips whenever A receives a positive allocation. The charge applies once per intention, not per unit and not when A is unused. The cost becomes T=102xA+100xB+103xC+3×1{xA>0}. Sorting the three marginal prices still proposes (2,4,0), but its total is now 607. Avoiding A and choosing (0,4,2) costs 400+206=606. The cheaper marginal offer loses because its two-unit saving relative to C is only two chips, less than its three-chip activation cost. This is a change in cost structure, not a rounding error.
Prove global optimality by separating activation cases. If A is unused, B is cheaper than C, so four B and two C minimize cost at 606. If A is used, B is still the cheapest venue and its four-unit capacity should be exhausted. Using one A and one C costs 400+102+103+3=608; using two A costs 400+204+3=607. Thus the best activated plan is 607 and the global minimum is 606. This case split enumerates a discrete decision that the previous unit-exchange certificate omitted. Moving a unit can activate or eliminate a charge, so its cost is no longer determined solely by its destination’s quoted marginal price.
Derive the threshold and construct a witness
Replace the activation charge by K≥0. The best plan using A costs 604+K; the best avoiding A costs 606. A is strictly preferable when K<2, avoiding A is strictly preferable when K>2, and both plans minimize at K=2. At that boundary, (1,4,1) costs 605+2=607 and is not optimal. Equality between the two candidate minima does not make every interpolation optimal because activating A still costs the full K. This is a concrete witness to the discrete nature of access decisions.
In the workshop increment or decrement each venue allocation, inspect the cash ledger, switch among K=0,2,3 and submit a complete plan for audit. Construct the two different optimal plans at K=2, then try their one-unit intermediate allocation. The audit first checks capacity and completion, then compares total cash with all feasible allocations. A feasible but costly plan receives a specific cheaper witness; it is not confused with an infeasible plan. Editing either the allocations or the charge invalidates the previous success message. Reset begins a new construction rather than silently retaining a certificate for old inputs.
Interpret the boundary of the model
The SEC investor explanation read for this lesson describes quotes as quantity-limited and identifies timing and execution likelihood as additional considerations. Its historical examples are not reused here. The SEC’s 2018 order-handling release discusses fee and rebate disclosure and potential conflicts. Those sources motivate keeping execution and transfers visible; they do not establish our fictional prices, capacities, mathematical optimum or present regulatory obligations. In particular, a rebate retained by an intermediary would not reduce this customer’s outlay in the way our pass-through assumption does.
Before transferring the method to another experiment, ask whose cash objective is being optimized, whether displayed units remain available, whether orders can all execute simultaneously, and whether any fixed fees or contingent fills link decisions. An optimal solution within an incomplete feasible set can be operationally wrong. The lesson’s central result is conditional: separable costs permit a marginal exchange proof, while activation costs require reasoning over venue-use cases or an equivalent complete search. Both methods require the same explicit completion constraint and an independently reconciled cash ledger.
Worked example
Buy six units under the supplied A/B/C offers. Compare K=0,2,3.
- Per-unit costs: A=100+2=102, B=101−1=100, C=103.
- Without activation: (2,4,0) gives G=604, F=0 and total 604; the capacity lower bound is 4×100+2×102=604.
- Avoid A: (0,4,2) gives G=610 and F=−4, total 606.
- With K=3 the best activated plan costs 604+3=607; avoiding A costs 606.
- Solve 604+K=606 to obtain K=2. Endpoints tie at 606; (1,4,1) costs 605+2=607.
A fixed charge changes the optimization structure; preserve completion and reconcile customer cash before ranking routes.
Hands-on: Construct a venue allocation
Allocate six units, vary an activation fee and construct both discrete boundary optima.
Construct a venue allocation
Buy exactly six integer units. A: two at 100 plus two per unit. B: four at 101 with one credited per unit. C: six at 103, no per-unit fee. Frozen guaranteed fills; every transfer passes to the customer. K is charged once only if A is used.
Activation charge K: 0 chips
Venue A: 0 units
Capacity 2; price 100; signed per-unit fee 2.
Venue B: 0 units
Capacity 4; price 101; signed per-unit fee -1.
Venue C: 0 units
Capacity 6; price 103; signed per-unit fee 0.
Allocated: 0/6. Gross: 0. Transfers: 0. Activation: 0. Total: 0 chips.
Construct a complete allocation.
Common mistakes
- Sorting displayed prices while ignoring pass-through fees.
- Subtracting the same credit twice.
- Paying an activation charge per unit or on an unused venue.
- Treating a partial fill as a solution to full completion.
- Assuming interpolation preserves optimality with an activation indicator.
Keep these ideas
- Feasibility is a quantity equation plus venue capacities.
- For separable costs, an improving unit transfer certifies suboptimality.
- Fixed charges require comparing activated and inactive cases.
- At K=2 two discrete optima tie but their intermediate allocation loses.
Further reading
- SEC: Trade Execution (2013) ↗
Read quantity-limited quotes, execution destinations, timing and execution likelihood sections. Historical conceptual background only, not present regulatory guidance. Fictional offers, pass-through costs and optimization proof are original. Checked 2026-10-25.
- SEC: Order Handling Disclosure release 2018-253 ↗
Read opening disclosure paragraphs and fact sheet execution fee/rebate and conflicts sections. Historical policy motivation for separate transfer ledgers, not a claim of current compliance. No source examples, quotations or video reused. Checked 2026-10-25.