10 releases (4 breaking)
Uses new Rust 2024
| 0.7.1 | Oct 31, 2025 |
|---|---|
| 0.7.0 | Oct 28, 2025 |
| 0.6.0 | Oct 21, 2025 |
| 0.5.2 | Oct 19, 2025 |
| 0.3.2 | Oct 3, 2025 |
#443 in Finance
360 downloads per month
Used in 11 crates
(4 directly)
88KB
1.5K
SLoC
paft-domain
Domain modeling primitives for the paft ecosystem: instruments, exchanges, periods, and market state.
- Strongly-typed identifiers (
Isin,Figi) with enforced 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:
[dependencies]
paft = "0.7.1"
Advanced (direct dependency, minimal):
[dependencies]
paft-domain = { version = "0.7.1", default-features = false }
Alternate decimal backend: enable on dependent crates (e.g., via the facade):
[dependencies]
paft = { version = "0.7.1", features = ["bigdecimal"] }
Enable DataFrame helpers as needed:
[dependencies]
paft-domain = { version = "0.7.1", default-features = false, features = ["dataframe"] }
Features
bigdecimal: change money backend fromrust_decimaltobigdecimalviapaft-moneydataframe: enable DataFrame traits for Polars integration
Quickstart
use paft_domain::{Instrument, AssetKind, Exchange, Period};
// Instrument with optional global identifiers
let aapl = Instrument::try_new(
"AAPL",
AssetKind::Equity,
Some("BBG000B9XRY4"), // FIGI
Some("US0378331005"), // ISIN
Some(Exchange::NASDAQ),
).unwrap();
assert!(aapl.is_globally_identified());
assert_eq!(aapl.unique_key(), "BBG000B9XRY4");
// Period parsing with canonical output
let q4 = "2023-Q4".parse::<Period>().unwrap();
assert_eq!(q4.to_string(), "2023Q4");
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
Dependencies
~3–20MB
~194K SLoC