Expand description
Pure trading primitives — cross-cutting value objects for quantitative finance.
Leaf crate: no internal dependencies. Only external: chrono, rust_decimal, serde, thiserror.
§Provided types
Candle— OHLCV bar with timestampInterval— time granularity (minute, hour, day, week)Symbol— trading pair (e.g., BTC/USDT)Ticker— universal asset identifier with venue/asset class metadataCurrency— currency code (e.g., USD, BTC)PositionConfig— position sizing rulesprecision_boundary— canonicalDecimal ↔ f64crossings with rich error enum
Re-exports§
pub use precision_boundary::decimal_to_f64_checked;pub use precision_boundary::f64_to_decimal_checked;pub use precision_boundary::NonFiniteKind;pub use precision_boundary::PrecisionBoundaryError;pub use taxonomy::AssetClass;pub use taxonomy::AssetType;pub use taxonomy::Derivative;pub use taxonomy::Ticker;pub use taxonomy::TickerError;pub use taxonomy::Underlying;pub use taxonomy::VenueType;
Modules§
- crypto_
classifier - Crypto classification heuristics — single source of truth.
- precision_
boundary - Precision boundary between
FinancialValue(Decimal) andStatisticalValue(f64). - taxonomy
- Ticker taxonomy - universal asset identification.
Structs§
- Bps
- A basis-points value validated to the range [0, 10000].
- Candle
- Candle
Range - Time boundaries extracted from a candle slice.
- Currency
- A currency identifier (e.g., USD, EUR, BTC).
- Fraction
- A fraction value validated to the range [0, 1].
- Percentage
- A percentage value validated to the range [0, 100].
- Position
Config - Configuration for position sizing within a strategy.
- Symbol
- A trading symbol representing a base/quote currency pair.
Enums§
- BpsError
- Error for invalid basis-points construction.
- Candle
Error - Candle
Quality - Data quality flag for OHLCV candles.
- Fraction
Error - Error for invalid fraction construction.
- Interval
- Candle aggregation interval.
- Interval
Error - Errors from parsing an
Intervalfrom a string. - Percentage
Error - Error for invalid percentage construction.
- Position
Config Error - Error for invalid
PositionConfigconstruction. - Symbol
Error - Errors from parsing a
Symbolfrom a string. - Volume
Source - Origin of the candle volume figure.
Functions§
- interval_
duration - Get duration for an interval.