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 GarmanKohlhagen83 Model

From Leeroopedia
Revision as of 14:31, 16 February 2026 by Admin (talk | contribs) (Auto-imported from implementations/Avhz_RustQuant_GarmanKohlhagen83_Model.md)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


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

Overview

Concrete tool for Garman-Kohlhagen (1983) currency option pricing provided by the RustQuant library.

Description

The GarmanKohlhagen83 struct defines the parameter set for the Garman-Kohlhagen (1983) foreign exchange option pricing model. This is a specialization of the Generalized Black-Scholes-Merton framework where the cost of carry b is set to the difference between the domestic and foreign risk-free rates: b = r_d - r_f.

This reflects the economics of holding a foreign currency: you earn the foreign risk-free rate r_f on the foreign currency position while financing at the domestic rate r_d. The net cost of carry is therefore r_d - r_f, which is consistent with covered interest rate parity.

The struct stores four parameters:

  • s -- The spot exchange rate (domestic per unit of foreign currency).
  • r_d -- The domestic risk-free interest rate.
  • r_f -- The foreign risk-free interest rate.
  • v -- The volatility of the exchange rate.

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 Garman-Kohlhagen model for pricing European options on foreign exchange rates. It is the standard model for FX option pricing and is widely used in interbank markets for quoting FX option prices and implied volatilities.

Code Reference

Source Location

Signature

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GarmanKohlhagen83 {
    s: f64,    // Spot exchange rate
    r_d: f64,  // Domestic risk-free rate
    r_f: f64,  // Foreign risk-free rate
    v: f64,    // Volatility
}

impl GarmanKohlhagen83 {
    pub fn new(s: f64, r_d: f64, r_f: f64, v: f64) -> Self;
    fn s(&self) -> f64;  // Returns s (spot exchange rate)
    fn r(&self) -> f64;  // Returns r_d (domestic rate)
    fn b(&self) -> f64;  // Returns r_d - r_f (interest rate differential)
}

Import

use RustQuant::models::GarmanKohlhagen83;

I/O Contract

Inputs

Name Type Required Description
s f64 Yes Spot exchange rate (domestic currency per unit of foreign currency).
r_d f64 Yes Domestic risk-free interest rate.
r_f f64 Yes Foreign risk-free interest rate.
v f64 Yes Volatility of the exchange rate.

Outputs

Name Type Description
s() f64 Returns the spot exchange rate s.
r() f64 Returns the domestic rate r_d (used for discounting).
b() f64 Returns r_d - r_f (cost of carry reflecting interest rate differential).

Usage Examples

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

// Create Garman-Kohlhagen model for a EUR/USD option
let model = GarmanKohlhagen83::new(
    1.10,   // spot EUR/USD exchange rate
    0.05,   // domestic (USD) risk-free rate
    0.03,   // foreign (EUR) risk-free rate
    0.12,   // volatility (12%)
);

// The GarmanKohlhagen83 model parameters feed into the Generalized BSM pricer:
// s = 1.10, r = 0.05 (domestic), b = 0.05 - 0.03 = 0.02
// 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