abaquant.derivatives.exotics

Import path: abaquant.derivatives.exotics

Domain: Derivative pricing, simulation, calibration, diagnostics, and strategy analysis.

Purpose

Exotic-option formulas and closed-form approximations.

When to use it

Use this package when valuing contingent claims, calculating Greeks, building option strategies, simulating stochastic processes, or fitting models to market observations.

Public objects

  • function: gap_options — Price a gap option under the Black–Scholes–Merton closed-form convention.

  • function: cash_or_nothing_options — Price a cash-or-nothing digital option under Black–Scholes–Merton.

  • function: asset_or_nothing_options — Price an asset-or-nothing digital option under Black–Scholes–Merton.

  • function: down_and_out_barrier_option — Price the implemented down-and-out barrier option formula.

  • function: arithmetic_asian_options — Price an arithmetic-average Asian option using the module approximation.

  • function: geometric_asian_options — Price a geometric-average Asian option using its closed-form lognormal reduction.

  • function: floating_lookback_options — Price the implemented floating-strike lookback option formula.

  • function: compound_options — Price an option on an option using the implemented compound-option formula.

  • function: exchange_options — Price an option to exchange one risky asset for another under the Margrabe-style formula.

  • function: exotic_payoff_leg — Evaluate terminal payoff and profit for an exotic option leg.

  • function: simple_chooser_option — Price a simple chooser option under the implemented Black–Scholes–Merton relation.

  • function: perpetual_option — Price the implemented perpetual American-style option formula.

Detailed reference

Exotic-option formulas and closed-form approximations.

Purpose

The module contains pricing routines for gap, binary, Asian, barrier, lookback, compound, exchange, chooser, and perpetual options.

Conventions

Inputs follow the Black–Scholes–Merton convention: maturity in years; rates, yields, and volatility as decimal annual quantities; prices and strikes in common currency units.

Scope and limitations

Several instruments use analytical approximations or implementation-specific conventions. They should not be treated as substitutes for a calibrated production exotic-options model.

References

[ 1 ] Black, F., and M. Scholes (1973), “The Pricing of Options and Corporate Liabilities”; Merton, R. C. (1973), “Theory of Rational Option Pricing”.

abaquant.derivatives.exotics.arithmetic_asian_options(S, K, T, r, sigma, q=0.0, option_type='call')

Price an arithmetic-average Asian option using the module approximation.

Parameters:
  • S (float) – Current underlying spot price in currency units.

  • K (float) – Option strike price in the same currency units as the underlying.

  • T (float) – Time to maturity in years.

  • r (float) – Continuously compounded risk-free annual rate in decimal units.

  • sigma (float) – Annualized lognormal volatility in decimal units; for example, 0.20 denotes 20%.

  • q (float, default=0.0) – Continuous dividend or carry yield in decimal annual units.

  • option_type (str, default='call') – Option type label, normally "call" or "put".

Returns:

Computed arithmetic asian options as a scalar in the units implied by the input values.

Return type:

float

abaquant.derivatives.exotics.asset_or_nothing_options(S, K, T, r, sigma, q=0.0, option_type='call')

Price an asset-or-nothing digital option under Black–Scholes–Merton.

Parameters:
  • S (float) – Current underlying spot price in currency units.

  • K (float) – Option strike price in the same currency units as the underlying.

  • T (float) – Time to maturity in years.

  • r (float) – Continuously compounded risk-free annual rate in decimal units.

  • sigma (float) – Annualized lognormal volatility in decimal units; for example, 0.20 denotes 20%.

  • q (float, default=0.0) – Continuous dividend or carry yield in decimal annual units.

  • option_type (str, default='call') – Option type label, normally "call" or "put".

Returns:

Computed asset or nothing options as a scalar in the units implied by the input values.

Return type:

float

abaquant.derivatives.exotics.cash_or_nothing_options(S, K, Q, T, r, sigma, q=0.0, option_type='call')

Price a cash-or-nothing digital option under Black–Scholes–Merton.

Parameters:
  • S (float) – Current underlying spot price in currency units.

  • K (float) – Option strike price in the same currency units as the underlying.

  • Q (float) – Fixed cash amount paid by a cash-or-nothing option, in currency units.

  • T (float) – Time to maturity in years.

  • r (float) – Continuously compounded risk-free annual rate in decimal units.

  • sigma (float) – Annualized lognormal volatility in decimal units; for example, 0.20 denotes 20%.

  • q (float, default=0.0) – Continuous dividend or carry yield in decimal annual units.

  • option_type (str, default='call') – Option type label, normally "call" or "put".

Returns:

Computed cash or nothing options as a scalar in the units implied by the input values.

Return type:

float

abaquant.derivatives.exotics.compound_options(S, K1, K2, T1, T2, r, sigma, q=0.0, option_type='call_on_call')

Price an option on an option using the implemented compound-option formula.

Parameters:
  • S (float) – Current underlying spot price in currency units.

  • K1 (float) – First strike or trigger price in the instrument-specific payoff.

  • K2 (float) – Second strike price in the instrument-specific payoff.

  • T1 (float) – First decision or exercise time in years.

  • T2 (float) – Second maturity or exercise time in years.

  • r (float) – Continuously compounded risk-free annual rate in decimal units.

  • sigma (float) – Annualized lognormal volatility in decimal units; for example, 0.20 denotes 20%.

  • q (float, default=0.0) – Continuous dividend or carry yield in decimal annual units.

  • option_type (str, default='call_on_call') – Compound option type: "call_on_call", "put_on_call", "call_on_put", or "put_on_put".

Returns:

Computed compound options as a scalar in the units implied by the input values.

Return type:

float

abaquant.derivatives.exotics.down_and_out_barrier_option(S, K, H, T, r, sigma, q=0.0, option_type='call')

Price the implemented down-and-out barrier option formula.

Parameters:
  • S (float) – Current underlying spot price in currency units.

  • K (float) – Option strike price in the same currency units as the underlying.

  • H (float) – Barrier level in the same currency units as the underlying price.

  • T (float) – Time to maturity in years.

  • r (float) – Continuously compounded risk-free annual rate in decimal units.

  • sigma (float) – Annualized lognormal volatility in decimal units; for example, 0.20 denotes 20%.

  • q (float, default=0.0) – Continuous dividend or carry yield in decimal annual units.

  • option_type (str, default='call') – Option type label, normally "call" or "put".

Returns:

Computed down and out barrier option as a scalar in the units implied by the input values.

Return type:

float

abaquant.derivatives.exotics.exchange_options(U, V, q_u, q_v, sigma_u, sigma_v, rho, T)

Price an option to exchange one risky asset for another under the Margrabe-style formula.

Parameters:
  • U (float) – Price of the asset delivered or exchanged in currency units.

  • V (float) – Price of the asset received or benchmarked in currency units.

  • q_u (float) – Continuous yield of the first exchanged asset in decimal annual units.

  • q_v (float) – Continuous yield of the second exchanged asset in decimal annual units.

  • sigma_u (float) – Annualized lognormal volatility of the first asset in decimal units.

  • sigma_v (float) – Annualized lognormal volatility of the second asset in decimal units.

  • rho (float) – Correlation parameter constrained to the interval [-1, 1].

  • T (float) – Time to maturity in years.

Returns:

Computed exchange options as a scalar in the units implied by the input values.

Return type:

float

abaquant.derivatives.exotics.exotic_payoff_leg(option_type, position, S_T, params, premium)

Evaluate terminal payoff and profit for an exotic option leg.

Parameters:
  • option_type (str) – Option type label, normally "call" or "put".

  • position (int) – Position sign, usually 1 for long and -1 for short.

  • S_T (np.ndarray) – Underlying terminal price or terminal-price vector, in currency units.

  • params (dict) – Instrument-specific payoff parameters.

  • premium (float) – Premium paid or received at inception in currency units.

Returns:

Result of the exotic payoff leg calculation.

Return type:

np.ndarray

abaquant.derivatives.exotics.floating_lookback_options(S, S_ref, T, r, sigma, q=0.0, option_type='call')

Price the implemented floating-strike lookback option formula.

Parameters:
  • S (float) – Current underlying spot price in currency units.

  • S_ref (float) – Reference running minimum, maximum, or observed price required by the payoff, in currency units.

  • T (float) – Time to maturity in years.

  • r (float) – Continuously compounded risk-free annual rate in decimal units.

  • sigma (float) – Annualized lognormal volatility in decimal units; for example, 0.20 denotes 20%.

  • q (float, default=0.0) – Continuous dividend or carry yield in decimal annual units.

  • option_type (str, default='call') – Option type label, normally "call" or "put".

Returns:

Computed floating lookback options as a scalar in the units implied by the input values.

Return type:

float

abaquant.derivatives.exotics.gap_options(S, K1, K2, T, r, sigma, q=0.0, option_type='call')

Price a gap option under the Black–Scholes–Merton closed-form convention.

Parameters:
  • S (float) – Current underlying spot price in currency units.

  • K1 (float) – First strike or trigger price in the instrument-specific payoff.

  • K2 (float) – Second strike price in the instrument-specific payoff.

  • T (float) – Time to maturity in years.

  • r (float) – Continuously compounded risk-free annual rate in decimal units.

  • sigma (float) – Annualized lognormal volatility in decimal units; for example, 0.20 denotes 20%.

  • q (float, default=0.0) – Continuous dividend or carry yield in decimal annual units.

  • option_type (str, default='call') – Option type label, normally "call" or "put".

Returns:

Computed gap options as a scalar in the units implied by the input values.

Return type:

float

abaquant.derivatives.exotics.geometric_asian_options(S, K, T, r, sigma, q=0.0, option_type='call')

Price a geometric-average Asian option using its closed-form lognormal reduction.

Parameters:
  • S (float) – Current underlying spot price in currency units.

  • K (float) – Option strike price in the same currency units as the underlying.

  • T (float) – Time to maturity in years.

  • r (float) – Continuously compounded risk-free annual rate in decimal units.

  • sigma (float) – Annualized lognormal volatility in decimal units; for example, 0.20 denotes 20%.

  • q (float, default=0.0) – Continuous dividend or carry yield in decimal annual units.

  • option_type (str, default='call') – Option type label, normally "call" or "put".

Returns:

Computed geometric asian options as a scalar in the units implied by the input values.

Return type:

float

abaquant.derivatives.exotics.perpetual_option(S, K, r, sigma, is_call=True)

Price the implemented perpetual American-style option formula.

Parameters:
  • S (float) – Current underlying spot price in currency units.

  • K (float) – Option strike price in the same currency units as the underlying.

  • r (float) – Continuously compounded risk-free annual rate in decimal units.

  • sigma (float) – Annualized lognormal volatility in decimal units; for example, 0.20 denotes 20%.

  • is_call (bool, default=True) – Whether the instrument is a call; false selects a put.

Returns:

Computed perpetual option as a scalar in the units implied by the input values.

Return type:

float

abaquant.derivatives.exotics.simple_chooser_option(S, K, T1, T2, r, sigma, q=0.0)

Price a simple chooser option under the implemented Black–Scholes–Merton relation.

Parameters:
  • S (float) – Current underlying spot price in currency units.

  • K (float) – Option strike price in the same currency units as the underlying.

  • T1 (float) – First decision or exercise time in years.

  • T2 (float) – Second maturity or exercise time in years.

  • r (float) – Continuously compounded risk-free annual rate in decimal units.

  • sigma (float) – Annualized lognormal volatility in decimal units; for example, 0.20 denotes 20%.

  • q (float, default=0.0) – Continuous dividend or carry yield in decimal annual units.

Returns:

Computed simple chooser option as a scalar in the units implied by the input values.

Return type:

float