v0.17.2 — Black-76 + Garman–Kohlhagen pricing models
Release adding two new closed-form pricing models:
- Black-76 (Black 1976) for European options on futures and forwards.
- Garman–Kohlhagen (1983) for European FX options.
0.17.0 and 0.17.1 were preparatory iterations of this work
(0.17.0 was never published; 0.17.1 shipped to crates.io with a
partial subset). 0.17.2 is the first version that ships both models
together. PricingEngine is #[non_exhaustive] (semver-major from the
0.16.x line) and the two new variants are appended at the tail of the
enum so existing discriminants are preserved.
Added
Black-76 model (Black 1976):
pricing::black_76: closed-formblack_76(option) -> Result<Decimal, PricingError>
for European options on futures / forwards. Reuses the existingd1
/d2/big_nhelpers;Decimalend-to-end viad_mul/d_sub;
tracing::instrumenton the entry point. OnlyOptionType::European
is supported — American, Bermuda and exotics return
PricingError::UnsupportedOptionType.pricing::Black76trait with defaultcalculate_price_black_76
(mirrorsBlackScholes).pricing::PricingEngine::ClosedFormBlack76variant + dispatch from
price_option.greeks::utils::calculate_d_values_black_76pub(crate)helper.examples/examples_pricing/src/bin/black_76.rs: runnable demo
(Hull canonical example, ITM commodity-futures call, unified-API
dispatch, short-side sign convention).
Garman–Kohlhagen model (Garman & Kohlhagen 1983):
pricing::garman_kohlhagen: closed-form
garman_kohlhagen(option) -> Result<Decimal, PricingError>for
European options on FX spot rates. Structurally identical to BSM
withq = r_f; the implementation delegates toblack_scholes
after type validation, guaranteeing bit-exact equivalence (verified
to1e-9in the tests).pricing::GarmanKohlhagentrait with default
calculate_price_garman_kohlhagen(mirrors theBlackScholes
trait pattern).pricing::PricingEngine::ClosedFormGKvariant + dispatch from
price_option.examples/examples_pricing/src/bin/garman_kohlhagen.rs: runnable
demo (Hull canonical USD/GBP, ITM EUR/USD with FX parity check,
unified-API dispatch, symmetric-rate degenerate case).
Infrastructure updates:
examples/examples_pricing/: new workspace member with binaries for
both models.lib.rsmermaid:Forward-Pricedsubgraph routing
black_76 -> {Future, Forward}; newFX / Currencysubgraph routing
garman_kohlhagen -> FX Spot.
Changed
pricing::PricingEngineis now#[non_exhaustive]so future engine
variants do not require a new major bump.pricing::mod.rsCore Models / Model Selection Guidelines /
Performance Considerations now include both Black-76 and
Garman–Kohlhagen with explicit field mapping documentation.financial_typesbumped to0.2.2(addsUnderlyingAssetType::Future
andUnderlyingAssetType::Forward).PricingErrorandGreeksErrorpass-through in closed-form dispatch
(BS, Black-76, GK) for full error-variant fidelity.