Module Algostream_analytics.Snapshot

Immutable per-symbol snapshot.

Cross-Domain reads: a Per_symbol.t writes its current state into a Snapshot.t Atomic.t via Atomic.set. Readers in other Domains call Atomic.get and receive the whole immutable record — no torn reads, no per-field atomicity dance. The release-acquire ordering on Atomic.set/Atomic.get is sufficient because the published value is itself immutable.

type t = {
  1. symbol : string;
  2. last_event_ts_ns : int64;
  3. n_ticks : int;
  4. last_price : float;
  5. denoised_price : float;
  6. realized_vol : float;
  7. ewma_vol : float;
  8. rolling_mean_price : float;
  9. rolling_std_price : float;
  10. drawdown_from_peak : float;
  11. regime : Regime.t;
  12. regime_dwell_ns : int64;
  13. rejected_count : int;
  14. ready : bool;
}
val empty : symbol:string -> t
val to_string : t -> string