paft-domain
Domain modeling primitives for the paft ecosystem: instruments, exchanges, periods, and market state.
- Strongly-typed identifiers (
Isin,Figi) with optional validation Instrumentwith hierarchical identifiers (FIGI → ISIN → Symbol@Exchange → Symbol)- Canonical, serde-stable enums (
Exchange,AssetKind,MarketState) Periodparsing for quarters, years, and dates with a canonical wire format
Install
Prefer the facade crate for most applications:
[]
= "0.3.2"
Advanced (direct dependency, minimal):
[]
= { = "0.3.2", = false, = ["rust-decimal"] }
Alternate decimal backend:
[]
= { = "0.3.2", = false, = ["bigdecimal"] }
Enable identifiers and DataFrame helpers as needed:
[]
= { = "0.3.2", = false, = ["rust-decimal", "ident-validate", "dataframe"] }
Features
rust-decimal(default) |bigdecimal: choose the money backend viapaft-moneydataframe: enable DataFrame traits for Polars integrationisin-validate: strict ISIN normalization/validationfigi-validate: strict FIGI checksum validationident-validate: convenience feature enabling both validations
Quickstart
use ;
// Instrument with optional global identifiers
let aapl = try_new.unwrap;
assert!;
assert_eq!;
// Period parsing with canonical output
let q4 = "2023-Q4"..unwrap;
assert_eq!;
Links
- API docs: https://docs.rs/paft-domain
- Workspace overview: https://github.com/paft-rs/paft/blob/main/README.md
- License: https://github.com/paft-rs/paft/blob/main/LICENSE