paft-aggregates
Instant-in-time aggregate snapshot models for the paft ecosystem.
Snapshot: standard no-metadata alias forGenericSnapshot<()>GenericSnapshot<M>: instrument identity, session prices/ranges, volume, market state, UTCas_of, and flattened provider metadata- Fundamentals, analyst coverage, and ESG fields live in
paft-fundamentals
Install
Prefer the facade crate for most applications:
[]
= { = "0.9.0", = ["aggregates"] }
Advanced (direct dependency, minimal features):
[]
= { = "0.9.0", = false }
Alternate decimal backend:
[]
= { = "0.9.0", = false, = ["bigdecimal"] }
With DataFrame integration:
[]
= { = "0.9.0", = false, = ["dataframe"] }
= { = "0.9.0", = false, = ["dataframe"] } # trait imports for direct users
Features
bigdecimal: switch the shared decimal backend fromrust_decimaltobigdecimalpanicking-money-ops: forward topaft-moneyto enable panicking arithmetic operatorsdataframe: Polars integration forSnapshot; direct users importToDataFrame/ToDataFrameVecfrompaft_utils::dataframe
Quickstart
The quickstart below uses direct crate imports. Direct users should also add
the companion crates used by their constructors (paft-decimal, paft-domain,
and paft-money). Facade users can enable paft/aggregates and import through
paft::prelude.
use Snapshot;
use Decimal;
use ;
use ;
let instrument = from_symbol.unwrap;
let mut snapshot = new;
snapshot.last = Some;
snapshot.previous_close = Some;
snapshot.volume = Some;
assert_eq!;
assert_eq!;
Snapshot notes
instrumentandcurrencyare required; all observed market fields are optional.- Provider metadata is serde-flattened into the snapshot JSON object. Avoid field names that collide with paft fields; prefix or nest provider fields when needed.
Links
- API docs: docs.rs/paft-aggregates
- Workspace overview: GitHub: workspace README
- License: LICENSE