Package com.quantfinlib.persist


@NullMarked package com.quantfinlib.persist
Persistence of learned intraday state across trading days. Checkpoint writes one binary file of named sections at end of day and restores it at session start. The write goes to a temporary file that is forced to disk and renamed, so a crash mid-save leaves the previous file intact.

The models that learn across days expose writeState(DataOutput) / readState(DataInput) pairs: the seasonality trio (microstructure.VolumeCurve, VolatilityCurve, SpreadForecaster), microstructure.OnlineAlphaLearner (weights and the out-of-sample IC evidence), microstructure.LeadLagEstimator, microstructure.EwmaCovariance (the basket risk matrix), microstructure.KylesLambda (learned depth), microstructure.ClosingAuctionModel (learned auction share), microstructure.AlphaEnsemble (per-component IC evidence), rfq.RfqDealerScorecard (learned dealer-panel quality), and the venue-quality cards (execution.VenueScorecard, format v2 with fill markouts, still reads v1; and fx.LpScorecard). Intraday state resets on read; configuration (bucket/venue counts) must match or the read throws. HiddenLiquidityDetector is not persistable: its state is keyed by price level, and overnight the price ladder moves. Restoring it would attribute yesterday's icebergs to today's unrelated levels.

4.0. This package stays in the stable jar in 4.0. The 3.1 design proposed moving it out, but stable packages (crb, fx, execution, microstructure) depend on it, and a move would make the module graph cyclic. See docs/DESIGN_4.0.md.

  • Class
    Description
    Multi-day persistence of learned state.
    Random access to a loaded checkpoint's sections by name.
    A model's state deserializer — typically a readState reference.
    A model's state serializer — typically a writeState reference.
    Collects named sections and commits them atomically on close.