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 Asian Backend

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


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

Overview

Concrete tool for pricing geometric continuous average-rate Asian options analytically provided by the RustQuant library.

Description

This module implements the AsianOptionAnalyticBackend struct (aliased as AsianOption) for pricing Asian options with geometric continuous averaging. The price_geometric_average() method computes a closed-form solution that adjusts the volatility and cost-of-carry parameters for the geometric average: v_a = v / sqrt(3) and b_a = 0.5 * (b - v^2 / 6). These adjusted parameters are then used in a standard BSM-like formula with the Gaussian CDF. The method returns a tuple of (call_price, put_price). Date handling uses the time crate with a default day count convention, and the struct supports the builder pattern via derive_builder.

Usage

Use when pricing European-style Asian options with geometric continuous average rate, which admits a closed-form solution unlike arithmetic average Asian options.

Code Reference

Source Location

Signature

#[derive(derive_builder::Builder, Debug, Clone, Copy)]
pub struct AsianOptionAnalyticBackend {
    pub initial_price: f64,
    pub strike_price: f64,
    pub risk_free_rate: f64,
    pub volatility: f64,
    pub dividend_rate: f64,
    pub evaluation_date: Option<Date>,
    pub expiration_date: Date,
}

impl AsianOption {
    pub const fn new(
        initial_price: f64,
        strike_price: f64,
        risk_free_rate: f64,
        volatility: f64,
        dividend_rate: f64,
        evaluation_date: Option<Date>,
        expiration_date: Date,
    ) -> Self

    #[must_use]
    pub fn price_geometric_average(&self) -> (f64, f64)
}

Import

use RustQuant::instruments::AsianOption;

I/O Contract

Inputs

Name Type Required Description
initial_price f64 Yes Initial price of the underlying (S)
strike_price f64 Yes Strike price (K)
risk_free_rate f64 Yes Risk-free interest rate (r)
volatility f64 Yes Volatility parameter (v)
dividend_rate f64 Yes Continuous dividend rate (q)
evaluation_date Option<Date> No Valuation date; defaults to today
expiration_date Date Yes Option expiration date

Outputs

Name Type Description
(call, put) (f64, f64) Tuple of geometric average call and put prices

Usage Examples

use RustQuant::instruments::AsianOption;
use RustQuant::time::today;
use time::Duration;

let asian = AsianOption {
    initial_price: 80.0,
    strike_price: 85.0,
    risk_free_rate: 0.05,
    volatility: 0.2,
    evaluation_date: None,
    expiration_date: today() + Duration::days(92),
    dividend_rate: -0.03,
};

let (call_price, put_price) = asian.price_geometric_average();

Related Pages

Page Connections

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