Skip to content

Per-Option Greeks

Overview

Per-option Greeks provide contract-level risk measures for each option in a single chain snapshot. They are the foundation for aggregate exposure features and option-level modeling workflows. The per-option Greeks module:

  • Operates on a single option chain snapshot
  • Uses Black–Scholes pricing
  • Computes Greeks for both calls and puts
  • Produces one row per contract per option type
  • Makes no trading or forecasting assumptions

Each option contract is treated independently.


API Entry Point

from ocf.greeks.api import per_option_greeks
per_option_greeks(
    *,
    chain_snapshot: polars.DataFrame,
    underlying_row: dict | polars.DataFrame,
    rate_field: str = "rate_sofr_90d",
) -> polars.DataFrame

Required Inputs

1. Option Chain Snapshot

The chain_snapshot DataFrame must contain the following columns:

Column Description
symbol Underlying symbol
date Valuation date
expiration Option expiration date
strike Option strike
call_ticker Call option identifier
put_ticker Put option identifier
contract_size Contract multiplier

Each row represents a strike / expiration pair.


2. Underlying Row

The underlying_row must provide:

Field Description
date Valuation date
px_close Underlying spot price
{rate_field} Risk-free rate (decimal)

The underlying row is typically sourced from canonical_underlying_daily.


Volatility Mapping

Implied volatility (sigma) is not taken from option prices.

Instead, volatility is mapped using:

from ocf.greeks.vol_mapping import map_sigma

Mapping uses:

  • ATM historical IV
  • IV moneyness surfaces (e.g. 30D, 60D)
  • Strike, spot, and time-to-expiry

This ensures:

  • Deterministic volatility inputs
  • Consistency across calls and puts
  • No circular dependence on option prices

Time to Expiry

Time to expiry is computed as:

T_days = max(expiration_date − valuation_date, 0)
T_years = T_days / 365

Contracts with:

  • T_days <= 0 are excluded

Greek Computation

Greeks are computed using a Black–Scholes implementation:

from ocf.greeks.black_scholes import bs_greeks

For each contract:

  • One call row is generated
  • One put row is generated

Output Columns

Each output row corresponds to one option contract.

Column Description
symbol Underlying symbol
date Valuation date
expiration Option expiration
option_type call or put
ticker Option identifier
strike Strike price
days_to_expiry Calendar days to expiration
sigma Implied volatility used
price Black–Scholes price
delta Delta
gamma Gamma
vega Vega
theta Theta
charm Charm
vanna Vanna
vomma Vomma
contract_size Contract multiplier

Domain Checks & Validation

The implementation enforces:

  • Positive underlying spot price
  • Positive strike prices
  • Positive time to expiry
  • Required schema presence

If no valid contracts remain, an empty DataFrame is returned.


Note

  • Greeks are computed per contract, not aggregated
  • No filtering by moneyness or liquidity
  • No implied forward assumptions