Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Avhz RustQuant Black76 Model

From Leeroopedia


Knowledge Sources
Domains Option_Pricing, Futures_Options, Quantitative_Finance
Last Updated 2026-02-07 19:00 GMT

Overview

Concrete tool for Black (1976) futures option pricing provided by the RustQuant library.

Description

The Black76 struct defines the parameter set for the Black (1976) futures option model. This is a specialization of the Generalized Black-Scholes-Merton framework where the cost of carry b is set to zero, reflecting the fact that futures contracts require no upfront investment and thus have zero cost of carry.

The Black-76 model is the standard model for pricing European options on futures and forward contracts. It differs from the original Black-Scholes model in that the underlying is a futures price rather than a spot price, and the discount factor uses the risk-free rate r without a carry adjustment.

The struct stores three parameters:

  • f -- The futures price (used as the underlying spot price s in the GBS framework).
  • r -- The risk-free interest rate (used for discounting).
  • v -- The volatility of the futures price.

The actual option pricing, Greeks, and implied volatility computations are provided by the shared Generalized Black-Scholes-Merton engine, which dispatches based on the s(), r(), and b() accessor methods.

Usage

Use the Black-76 model for pricing European options on futures contracts, commodity forwards, bond futures options, and interest rate caps/floors. It is the most widely used model in commodity and fixed income derivatives markets.

Code Reference

Source Location

Signature

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Black76 {
    f: f64,  // Futures price
    r: f64,  // Risk-free rate
    v: f64,  // Volatility
}

impl Black76 {
    pub fn new(f: f64, r: f64, v: f64) -> Self;
    fn s(&self) -> f64;  // Returns f (futures price as spot)
    fn r(&self) -> f64;  // Returns r
    fn b(&self) -> f64;  // Returns 0.0 (zero cost of carry)
}

Import

use RustQuant::models::Black76;

I/O Contract

Inputs

Name Type Required Description
f f64 Yes Futures price of the underlying.
r f64 Yes Risk-free interest rate for discounting.
v f64 Yes Volatility of the futures price.

Outputs

Name Type Description
s() f64 Returns the futures price f as the effective spot price for the GBS framework.
r() f64 Returns the risk-free rate r for discounting.
b() f64 Returns 0.0 (zero cost of carry for futures).

Usage Examples

use RustQuant::models::Black76;
use RustQuant::instruments::{BlackScholesMerton, TypeFlag};

// Create Black76 model for a futures option
let model = Black76::new(
    100.0,  // futures price
    0.05,   // risk-free rate
    0.20,   // volatility (20%)
);

// The Black76 model parameters feed into the Generalized BSM pricer:
// s = 100.0 (futures price), r = 0.05, b = 0.0
// These are used by the shared GBS option pricing engine.

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment