fin-primitives provides:
- Price and Quantity newtypes over rust_decimal::Decimal, validated at construction — an invalid Price literally can't exist at runtime - L2 OrderBook with sequence validation and atomic rollback if a delta would produce an inverted spread - OHLCV aggregation from tick streams with bar invariants enforced on every push - Streaming SMA, EMA (SMA-seeded), and RSI (Wilder smoothing matching TradingView/Bloomberg) that return SignalValue::Unavailable until warm-up completes - Position ledger with VWAP average cost, realized/unrealized P&L net of commissions - Composable RiskRule trait — plug in your own rules, breaches returned as typed Vec, never swallowed
No unwrap, no expect, no panic in library code. cargo clippy denies all of them.
This is part of a larger set of 11 crates I've published for LLM and trading infrastructure (https://crates.io/users/Mattbusel) but fin-primitives is the one I think fills the biggest gap in the Rust ecosystem right now.
Happy to answer questions about the design decisions, especially the order book rollback mechanism and the indicator warm-up approach.