Module temporal

Module temporal 

Source
Expand description

Temporal interpolation for fixed time grid construction

This module provides functionality to interpolate volatility metrics across multiple maturities to construct standardized time grids. It extends the single-maturity linear IV interpolation to handle multi-maturity option chains.

§Overview

The temporal interpolation module enables traders and quants to:

  • Build consistent volatility surfaces across standardized expiry ladders
  • Interpolate between observed maturities using different methodologies
  • Extrapolate to shorter/longer tenors when appropriate
  • Maintain mathematical consistency with strike-space interpolation

§Interpolation Methods

Three temporal interpolation methods are supported:

§LinearTte

Direct linear interpolation on time-to-expiration vs metric value pairs. Simple and intuitive, suitable for most applications.

§LinearVariance

Interpolates total variance (ω = σ²T) and converts back to implied volatility. Mathematically consistent with no-arbitrage conditions and variance swaps. Recommended for professional trading systems.

§SquareRootTime

Scales volatility by √(T_target/T_base). Common approximation for short-term extrapolation when volatility is mean-reverting.

§Usage Pattern

  1. Collect multi-maturity option chain data
  2. Configure TemporalConfig with desired fixed days and interpolation method
  3. Call build_fixed_time_metrics() to generate standardized time grid
  4. Use resulting metrics for pricing, Greeks, and risk management

§Example

use surface_lib::{MarketDataRow, LinearIvConfig, TemporalConfig, build_fixed_time_metrics};

let temporal_config = TemporalConfig {
    fixed_days: vec![1, 7, 14, 30],
    ..Default::default()
};
let strike_config = LinearIvConfig::default();

let metrics = build_fixed_time_metrics(
    &market_data, forward, &temporal_config, &strike_config
)?;

Functions§

build_fixed_time_metrics
Build fixed time metrics by interpolating across multiple maturities