optionstratlib-pricing
Option pricing models, Greeks and implied volatility of
OptionStratLib, on the core
domain types. The crate depends only on optionstratlib-core,
optionstratlib-math and general numeric crates: no option chain, simulation
engine, strategy, plotting, I/O or async runtime.
| Module | Contents |
|---|---|
pricing |
Black-Scholes, Black-76, Garman-Kohlhagen, binomial, Monte Carlo over supplied paths, telegraph, American and exotic kernels; OptionPricing; price_option_with; Profit; solver defaults |
greeks |
First and higher-order Greeks, Greeks, model-specific and numerical Greeks, Greeks of the leg types |
volatility |
Implied-volatility solvers, volatility models and traits |
error |
PricingError, GreeksError, VolatilityError |
Prices, premia and Greeks cross the public boundary as rust_decimal::Decimal
or Positive; f64 stays inside the numerical kernels.
Place in the workspace
- Depends on
optionstratlib-coreandoptionstratlib-math. - Must not depend on
optionstratlib-simulation,-market,-analytics,-strategies,-backtestand-visualization;make check-graphenforces the layering (ADR-0001 D9). - In the facade:
optionstratlib::{pricing, greeks, volatility}and the pricing errors inoptionstratlib::error, under the facade featurepricing. The facade paths are the same types as the paths here; the ownership map lists every one with its feature.
Moving from 0.21? The 0.22 architecture and adoption guide maps each redesign to its replacement workflow; 0.22 keeps no compatibility with 0.21.
Minimal example
use PricingError;
use ;
use pos_or_panic;
use black_scholes;
use dec;
Runnable example
A runnable program that depends on this crate directly, with the smallest
dependency set and no facade, is osl-example-direct-pricing; make tree-example-direct-pricing
asserts its resolved graph.
Features
| Feature | Default | Effect |
|---|---|---|
schema |
no | Derives utoipa::ToSchema on pricing types and enables schema in core and math |
License
MIT