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 at its expected all-in cost:
- 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, which
VenueScorecardproduces), 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 the venue statistics and their accuracy.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classWhere 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 their measured statisticshalfSpreadBps- lit half spread, > 0impactBps- expected lit impact for this size, ≥ 0 (aKylesLambdaestimate slots in)
-