Skip to main content

py_black_scholes_greeks

Function py_black_scholes_greeks 

Source
pub fn py_black_scholes_greeks(
    s: f64,
    r: f64,
    b: f64,
    vol: f64,
    is_call: bool,
    k: f64,
    t: f64,
    db_dr: f64,
) -> PyResult<BlackScholesGreeksResult>
Expand description

Computes Black-Scholes greeks using the fast compute_greeks implementation. This function uses compute_greeks from black_scholes.rs which is optimized for performance.

db_dr is zero for fixed carry and one for carry defined as r - q, including r == q. Rho is per percentage point. The exact implementation is used when the fast result is nonfinite or inconsistent.

ยงErrors

Returns an error if:

  • Model inputs are invalid.
  • Valuation results are nonfinite or inconsistent.