Class CrbRouter
java.lang.Object
com.quantfinlib.crb.CrbRouter
The central risk book's order router — internal cross first, dark
pools second, lit last, each leg priced honestly:
- Internal — crossing against the book's own offsetting inventory costs ZERO bps and leaks nothing: the CRB itself is the firm's first and best dark pool. Capped at the crossable inventory the caller reports;
- Dark pools — midpoint fills pay no spread, but a venue
whose fills systematically fade is not free: each venue carries
an ADVERSE-SELECTION charge in bps (a post-fill markout
estimate —
VenueScorecardproduces exactly this), and expected liquidity is discounted by fill probability. A dark venue is only used while its charge undercuts the lit cost; - Lit — pays the half spread plus expected impact, but fills. Whatever the dark legs are not EXPECTED to fill routes lit as well — hedges that might fill are not hedges.
Allocation is greedy by expected cost, deterministic, allocation only at decision time (arrays sized to the venue count). Research/ warm lane; the caller owns venue statistics and their honesty.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordWhere the notional went.static final recordA dark venue as the router sees it. -
Method Summary
Modifier and TypeMethodDescriptionstatic CrbRouter.Allocationroute(double notional, double crossableInternal, CrbRouter.DarkVenue[] venues, double halfSpreadBps, double impactBps) Routesnotional(positive, in book-currency units).
-
Method Details
-
route
public static CrbRouter.Allocation route(double notional, double crossableInternal, CrbRouter.DarkVenue[] venues, double halfSpreadBps, double impactBps) Routesnotional(positive, in book-currency units).- Parameters:
notional- amount to execute, > 0crossableInternal- offsetting book inventory available to cross against, ≥ 0venues- dark venues with honest statisticshalfSpreadBps- lit half spread, > 0impactBps- expected lit impact for this size, ≥ 0 (aKylesLambdaestimate slots in)
-