Class CrbPnlLedger
Accounting model (realized flow economics, deliberately simple
and stated): internalized client flow captures the street half
spread minus whatever improvement was given back
(notional·(halfSpread − improvement)/1e4); routed flow
captures nothing (it went to the street); hedge executions cost
their all-in bps; router allocations cost their blended expected
bps. Inventory MARK-TO-MARKET P&L is deliberately out of scope —
that is the risk report's domain (CentralRiskBook.report),
and mixing realized spread economics with unrealized inventory marks
is how desks fool themselves. All notionals positive, all bps
non-negative, book-currency units. Persistable via
writeState/readState (persist.Checkpoint section);
deterministic, single-threaded, research/warm lane.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoublelonghedges()doubleImprovement handed to clients — the cost of being worth trading with.longdoubleThe desk's realized economics: captured spread minus hedging and routing costs.voidonDecision(InternalizationEngine.Decision decision, double halfSpreadBps) Convenience: books a wholeInternalizationEngine.Decision.voidonHedge(double notional, double costBps) Records a hedge execution's all-in cost.voidonInternalized(double internalizedNotional, double halfSpreadBps, double improvementBps) Records one internalization decision's economics.voidonRoute(double notional, CrbRouter.Allocation allocation) Records a router allocation's blended expected cost.voiddoubledoubleSpread captured by internalizing, net of improvement given back.voidwriteState(DataOutput out)
-
Constructor Details
-
CrbPnlLedger
public CrbPnlLedger()
-
-
Method Details
-
onInternalized
public void onInternalized(double internalizedNotional, double halfSpreadBps, double improvementBps) Records one internalization decision's economics.- Parameters:
internalizedNotional- |notional| kept on the book, ≥ 0halfSpreadBps- the street half spread saved, > 0improvementBps- improvement given to the client, ≥ 0 and ≤ halfSpreadBps
-
onDecision
Convenience: books a wholeInternalizationEngine.Decision. -
onHedge
public void onHedge(double notional, double costBps) Records a hedge execution's all-in cost. -
onRoute
Records a router allocation's blended expected cost. -
spreadCaptured
public double spreadCaptured()Spread captured by internalizing, net of improvement given back. -
improvementPaid
public double improvementPaid()Improvement handed to clients — the cost of being worth trading with. -
hedgeCost
public double hedgeCost() -
routerCost
public double routerCost() -
netEconomics
public double netEconomics()The desk's realized economics: captured spread minus hedging and routing costs. POSITIVE means the netting engine paid for its own risk management — the CRB's entire commercial argument. -
internalizations
public long internalizations() -
hedges
public long hedges() -
writeState
- Throws:
IOException
-
readState
- Throws:
IOException
-