Skip to content
TotalFinance

Options · @insiderfinance/totalfinance

@insiderfinance/totalfinance/options/black76

import { … } from '@insiderfinance/totalfinance/options/black76'
stable-by-law (pre-1.0; not a 1.0 stability guarantee)iface 4type 1const 1fn 5JSON ↗
iface

Black76ImpliedVolatilityInput

#

Public declaration. Read the signature and member contracts below; no additional behaviour is inferred.

Signature
import type { Black76ImpliedVolatilityInput } from '@insiderfinance/totalfinance/options/black76';

export interface Black76ImpliedVolatilityInput {
    price: number;
    forward: number;
    strike: number;
    timeToExpiryYears: number;
    riskFreeRate: number;
    type: OptionType;
}
Fields, parameters and returned members (6)
Name · typeMeaning · unitRequired · default
forwardnumber—unitless by nameRequiredNo @default declared
pricenumber—unitless by nameRequiredNo @default declared
riskFreeRatenumber—decimal rate (0.05 = 5%)RequiredNo @default declared
strikenumber—unitless by nameRequiredNo @default declared
timeToExpiryYearsnumber—years (decimal)RequiredNo @default declared
typeOptionType—unitless by nameRequiredNo @default declared

Stability: stable-by-law (pre-1.0; not a 1.0 stability guarantee). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.

iface

Black76ImpliedVolatilityResult

#

Public declaration. Read the signature and member contracts below; no additional behaviour is inferred.

Signature
import type { Black76ImpliedVolatilityResult } from '@insiderfinance/totalfinance/options/black76';

export interface Black76ImpliedVolatilityResult {
    value: number;
    converged: boolean;
    iterations: number;
    reason?: 'below_intrinsic' | 'above_max_bound' | 'price_below_resolvable' | 'no_bracket' | 'max_iterations';
    /** Explanatory detail when a usable numeric pricing bracket cannot be established. */
    message?: string;
}
Fields, parameters and returned members (5)
Name · typeMeaning · unitRequired · default
convergedboolean—unitless by nameRequiredNo @default declared
iterationsnumber—unitless by nameRequiredNo @default declared
messagestring

Explanatory detail when a usable numeric pricing bracket cannot be established.

unitless by name
OptionalNo @default declared
reason'below_intrinsic' | 'above_max_bound' | 'price_below_resolvable' | 'no_bracket' | 'max_iterations'—unitless by nameOptionalNo @default declared
valuenumber—unitless by nameRequiredNo @default declared

Stability: stable-by-law (pre-1.0; not a 1.0 stability guarantee). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.

iface

Black76Input

#

Public declaration. Read the signature and member contracts below; no additional behaviour is inferred.

Signature
import type { Black76Input } from '@insiderfinance/totalfinance/options/black76';

export interface Black76Input {
    forward: number;
    strike: number;
    timeToExpiryYears: number;
    riskFreeRate: number;
    volatility: number;
}
Fields, parameters and returned members (5)
Name · typeMeaning · unitRequired · default
forwardnumber—unitless by nameRequiredNo @default declared
riskFreeRatenumber—decimal rate (0.05 = 5%)RequiredNo @default declared
strikenumber—unitless by nameRequiredNo @default declared
timeToExpiryYearsnumber—years (decimal)RequiredNo @default declared
volatilitynumber—unitless by nameRequiredNo @default declared

Stability: stable-by-law (pre-1.0; not a 1.0 stability guarantee). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.

type

Black76PriceBoundsInput

#

Public declaration. Read the signature and member contracts below; no additional behaviour is inferred.

Signature
import type { Black76PriceBoundsInput } from '@insiderfinance/totalfinance/options/black76';

export type Black76PriceBoundsInput = Omit<Black76TypedInput, 'volatility'>;
Fields, parameters and returned members (5)
Name · typeMeaning · unitRequired · default
forwardnumber—unitless by nameRequiredNo @default declared
riskFreeRatenumber—decimal rate (0.05 = 5%)RequiredNo @default declared
strikenumber—unitless by nameRequiredNo @default declared
timeToExpiryYearsnumber—years (decimal)RequiredNo @default declared
typeOptionType—unitless by nameRequiredNo @default declared

Stability: stable-by-law (pre-1.0; not a 1.0 stability guarantee). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.

iface

Black76TypedInput

#

Public declaration. Read the signature and member contracts below; no additional behaviour is inferred.

Signature
import type { Black76TypedInput } from '@insiderfinance/totalfinance/options/black76';

export interface Black76TypedInput extends Black76Input {
    type: OptionType;
}
Fields, parameters and returned members (6)
Name · typeMeaning · unitRequired · default
forwardnumber—unitless by nameRequiredNo @default declared
riskFreeRatenumber—decimal rate (0.05 = 5%)RequiredNo @default declared
strikenumber—unitless by nameRequiredNo @default declared
timeToExpiryYearsnumber—years (decimal)RequiredNo @default declared
typeOptionType—unitless by nameRequiredNo @default declared
volatilitynumber—unitless by nameRequiredNo @default declared

Stability: stable-by-law (pre-1.0; not a 1.0 stability guarantee). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.

const

black76

#

The Black-76 facade namespace.

Signature
import { black76 } from '@insiderfinance/totalfinance/options/black76';

export declare const black76: { call: Facade<Black76Input, number>; extendedGreeks: Facade<Black76TypedInput, ExtendedGreeks>; greeks: Facade<Black76TypedInput, Greeks>; impliedVolatility: Facade<Black76ImpliedVolatilityInput, number, Record<never, never>, number | null>; price: Facade<Black76TypedInput, number>; put: Facade<Black76Input, number>; };
Fields, parameters and returned members (137)

Loading 137 members…

Stability: stable-by-law (pre-1.0; not a 1.0 stability guarantee). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.

fn

black76ExtendedGreeks

#

Black-76 higher-order Greeks (w.r.t. the forward F). The forward-price derivatives (vanna, charm, vomma, speed, color, zomma, veta, ultima) coincide with BSM's at S = F, q = r — Black-76 has the same d1/d2 and discount as that BSM instance — so they are borrowed from blackScholesExtendedGreeks; the forward-model-specific ones are computed directly: - vera = ∂rho/∂σ = ∂(−T·price)/∂σ = −T·vega, - phi = 0 (the forward model has no dividend yield; carry is embedded in F), - lambda = Δ·F/V. First-order fields (theta/rho) come from black76Greeks, which are the Black-76 conventions.

Signature
import { black76ExtendedGreeks } from '@insiderfinance/totalfinance/options/black76';

export declare function black76ExtendedGreeks(input: Black76TypedInput): ExtendedGreeks;
Fields, parameters and returned members (23)

Loading 23 members…

Stability: stable-by-law (pre-1.0; not a 1.0 stability guarantee). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.

fn

black76Greeks

#

Black-76 first-order Greeks (theta/day, vega/1%, rho/1%; delta/gamma w.r.t. the forward).

Signature
import { black76Greeks } from '@insiderfinance/totalfinance/options/black76';

export declare function black76Greeks(input: Black76TypedInput): Greeks;
Fields, parameters and returned members (12)
Name · typeMeaning · unitRequired · default
(input)Black76TypedInput—unitless by nameRequiredNo @default declared
(input).forwardnumber—unitless by nameRequiredNo @default declared
(input).riskFreeRatenumber—decimal rate (0.05 = 5%)RequiredNo @default declared
(input).strikenumber—unitless by nameRequiredNo @default declared
(input).timeToExpiryYearsnumber—years (decimal)RequiredNo @default declared
(input).typeOptionType—unitless by nameRequiredNo @default declared
(input).volatilitynumber—unitless by nameRequiredNo @default declared
return.deltanumber—unitless by nameRequiredNo @default declared
return.gammanumber—unitless by nameRequiredNo @default declared
return.rhonumber—unitless by nameRequiredNo @default declared
return.thetanumber—unitless by nameRequiredNo @default declared
return.veganumber—unitless by nameRequiredNo @default declared

Stability: stable-by-law (pre-1.0; not a 1.0 stability guarantee). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.

fn

black76ImpliedVolatility

#

Solve Black-76 implied volatility. Reports failure honestly; never fabricates a value. Bounds and endpoint acceptance follow the same RELATIVE-tolerance rules as the BSM kernel (see impliedVolatilityPriceTolerance): a target below the σ→0 price floor fails as price_below_resolvable, and a target at the σ→∞ upper bound as above_max_bound.

Signature
import { black76ImpliedVolatility } from '@insiderfinance/totalfinance/options/black76';

export declare function black76ImpliedVolatility(input: Black76ImpliedVolatilityInput): Black76ImpliedVolatilityResult;
Fields, parameters and returned members (12)
Name · typeMeaning · unitRequired · default
(input)Black76ImpliedVolatilityInput—unitless by nameRequiredNo @default declared
(input).forwardnumber—unitless by nameRequiredNo @default declared
(input).pricenumber—unitless by nameRequiredNo @default declared
(input).riskFreeRatenumber—decimal rate (0.05 = 5%)RequiredNo @default declared
(input).strikenumber—unitless by nameRequiredNo @default declared
(input).timeToExpiryYearsnumber—years (decimal)RequiredNo @default declared
(input).typeOptionType—unitless by nameRequiredNo @default declared
return.convergedboolean—unitless by nameRequiredNo @default declared
return.iterationsnumber—unitless by nameRequiredNo @default declared
return.messagestring

Explanatory detail when a usable numeric pricing bracket cannot be established.

unitless by name
OptionalNo @default declared
return.reason'below_intrinsic' | 'above_max_bound' | 'price_below_resolvable' | 'no_bracket' | 'max_iterations'—unitless by nameOptionalNo @default declared
return.valuenumber—unitless by nameRequiredNo @default declared

Stability: stable-by-law (pre-1.0; not a 1.0 stability guarantee). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.

fn

black76Price

#

Black-76 price.

The second seed defect named in the spec, and the same shape as the first: omitting volatility made sigma undefined, d1 NaN, and the returned price NaN — a success-typed wrong number.

Signature
import { black76Price } from '@insiderfinance/totalfinance/options/black76';

export declare function black76Price(input: Black76TypedInput): number;
Fields, parameters and returned members (7)
Name · typeMeaning · unitRequired · default
(input)Black76TypedInput—unitless by nameRequiredNo @default declared
(input).forwardnumber—unitless by nameRequiredNo @default declared
(input).riskFreeRatenumber—decimal rate (0.05 = 5%)RequiredNo @default declared
(input).strikenumber—unitless by nameRequiredNo @default declared
(input).timeToExpiryYearsnumber—years (decimal)RequiredNo @default declared
(input).typeOptionType—unitless by nameRequiredNo @default declared
(input).volatilitynumber—unitless by nameRequiredNo @default declared

Stability: stable-by-law (pre-1.0; not a 1.0 stability guarantee). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.

fn

black76PriceBounds

#

No-arbitrage price bounds for Black-76.

Signature
import { black76PriceBounds } from '@insiderfinance/totalfinance/options/black76';

export declare function black76PriceBounds(input: Black76PriceBoundsInput): { lower: number; upper: number; };
Fields, parameters and returned members (8)
Name · typeMeaning · unitRequired · default
(input)Black76PriceBoundsInput—unitless by nameRequiredNo @default declared
(input).forwardnumber—unitless by nameRequiredNo @default declared
(input).riskFreeRatenumber—decimal rate (0.05 = 5%)RequiredNo @default declared
(input).strikenumber—unitless by nameRequiredNo @default declared
(input).timeToExpiryYearsnumber—years (decimal)RequiredNo @default declared
(input).typeOptionType—unitless by nameRequiredNo @default declared
return.lowernumber—unitless by nameRequiredNo @default declared
return.uppernumber—unitless by nameRequiredNo @default declared

Stability: stable-by-law (pre-1.0; not a 1.0 stability guarantee). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.