Skip to main content

Module implied_vol

Module implied_vol 

Source
Expand description

§Implied volatility

Invert a European market premium → annualized σ for BSM, Black ’76, or Garman–Kohlhagen (same Newton + bisection core).


§Trading perspective

The market does not quote “model vol”; it quotes prices. IV is the σ that makes the model match that price — the language of surfaces, skew, and “IV crush”.

UseHow
Mark a bookMid → IV → store on the contract
Relative valueCompare IV across strikes/expiries (skew, term structure)
EventsIV vs realized (realized from underlier returns / TA path)

Gotchas desks already know: American early exercise, discrete dividends, and wide markets break naive European IV — treat results as model-dependent.


§Engineering perspective

  • Solver: Newton–Raphson on vega, Brent bracketed fallback (not plain bisection).
  • Model vol field is ignored as a seed (only other market/contract inputs matter).
  • Prefer *State::set_vol_from_price in live loops so IV is stored once.
  • Hot path cost: a handful of model evaluations — fine per quote; batch chains may parallelize across strikes in your engine.

§Word problem

Market call mid is ~10.45 with S=K=100, T=1, r=5%, q=0. What is IV?

Expect: about 20%.

use finance_solution::derivatives::{
    bsm_implied_vol, BsmParams, OptionType,
};
let p = BsmParams::atm_one_year(100.0, 0.05, 0.20);
let iv = bsm_implied_vol(p, OptionType::Call, 10.4506).unwrap();
assert!((iv - 0.20).abs() < 1e-3);

Functions§

bsm_implied_vol
Solve for annualized vol given a target BSM premium.