abaquant.derivatives.forwards

Import path: abaquant.derivatives.forwards

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

Purpose

Forward, futures-style carry, foreign-exchange forward, and FRA valuation.

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: forward_price — Compute the no-arbitrage forward price under the stated carry convention.

  • function: forward_price_with_yield — Compute a forward price with continuous or periodic yield carry.

  • function: forward_contract_value — Compute the value of an existing long or short forward contract.

  • function: simple_forward_price — Compute the forward price with financing carry only.

  • function: forward_price_with_continuous_dividend — Compute an equity forward price with continuous dividend yield.

  • function: forward_price_with_discrete_dividends — Compute an equity forward price after subtracting present-value discrete dividends.

  • function: commodity_forward_price — Compute a commodity forward price with deterministic storage cost.

  • function: fx_forward_price — Compute a foreign-exchange forward price from domestic and foreign rates.

  • function: live_forward_value — Compute the current value of a forward with a fixed delivery price.

  • function: fra — Value the forward-rate-agreement cash-flow relationship implemented by this routine.

Detailed reference

Forward, futures-style carry, foreign-exchange forward, and FRA valuation.

Purpose

The module implements deterministic cost-of-carry identities and the value of existing forward-style contracts under several rate-compounding conventions.

Conventions

Rates are decimal rates. The compounding argument determines whether a rate is interpreted as continuously compounded or periodically compounded. Times are measured in years.

Scope and limitations

It assumes deterministic financing and carry inputs and does not model stochastic interest rates or default risk.

References

[ 1 ] Kellison, S. G. (2009), The Theory of Interest.

abaquant.derivatives.forwards.commodity_forward_price(spot, rate, storage_cost, maturity, compounding='Continuous')

Compute a commodity forward price with deterministic storage cost.

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

  • rate (float) – Interest rate in decimal units under the stated compounding convention.

  • storage_cost (float) – Annual deterministic storage-cost rate or amount under the function convention.

  • maturity (float) – Time to option expiry in years.

  • compounding (str, default='Continuous') – Compounding convention or frequency accepted by the implementation.

Returns:

Computed commodity forward price as a scalar in the units implied by the input values.

Return type:

float

Notes

Model inputs are interpreted according to the module-level rate, maturity, and volatility conventions. Numerical outputs depend on the validity of those assumptions.

abaquant.derivatives.forwards.forward_contract_value(spot, delivery_price, rate, yield_rate, time_to_maturity, position='Long', compounding='Continuous')

Compute the value of an existing long or short forward contract.

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

  • delivery_price (float) – Forward delivery price fixed at trade inception, in currency units.

  • rate (float) – Interest rate in decimal units under the stated compounding convention.

  • yield_rate (float) – Dividend, income, or carry yield in decimal annual units.

  • time_to_maturity (float) – Remaining time to contract maturity in years.

  • position (str, default='Long') – Position side, such as long or short, under the function convention.

  • compounding (str, default='Continuous') – Compounding convention or frequency accepted by the implementation.

Returns:

Computed forward contract value as a scalar in the units implied by the input values.

Return type:

float

abaquant.derivatives.forwards.forward_price(spot, rate, maturity, carry=0.0, compounding='Continuous')

Compute the no-arbitrage forward price under the stated carry convention.

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

  • rate (float) – Interest rate in decimal units under the stated compounding convention.

  • maturity (float) – Time to option expiry in years.

  • carry (float, default=0.0) – Net annual carry rate in decimal units.

  • compounding (str, default='Continuous') – Compounding convention or frequency accepted by the implementation.

Returns:

Computed forward price as a scalar in the units implied by the input values.

Return type:

float

Notes

Model inputs are interpreted according to the module-level rate, maturity, and volatility conventions. Numerical outputs depend on the validity of those assumptions.

abaquant.derivatives.forwards.forward_price_with_continuous_dividend(spot, rate, dividend_yield, maturity, compounding='Continuous')

Compute an equity forward price with continuous dividend yield.

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

  • rate (float) – Interest rate in decimal units under the stated compounding convention.

  • dividend_yield (float) – Continuous dividend yield in decimal annual units.

  • maturity (float) – Time to option expiry in years.

  • compounding (str, default='Continuous') – Compounding convention or frequency accepted by the implementation.

Returns:

Computed forward price with continuous dividend as a scalar in the units implied by the input values.

Return type:

float

Notes

Model inputs are interpreted according to the module-level rate, maturity, and volatility conventions. Numerical outputs depend on the validity of those assumptions.

abaquant.derivatives.forwards.forward_price_with_discrete_dividends(spot, rate, maturity, present_value_dividends, compounding='Continuous')

Compute an equity forward price after subtracting present-value discrete dividends.

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

  • rate (float) – Interest rate in decimal units under the stated compounding convention.

  • maturity (float) – Time to option expiry in years.

  • present_value_dividends (float) – Present value of known discrete dividends in currency units.

  • compounding (str, default='Continuous') – Compounding convention or frequency accepted by the implementation.

Returns:

Computed forward price with discrete dividends as a scalar in the units implied by the input values.

Return type:

float

Notes

Model inputs are interpreted according to the module-level rate, maturity, and volatility conventions. Numerical outputs depend on the validity of those assumptions.

abaquant.derivatives.forwards.forward_price_with_yield(spot, rate, yield_rate, maturity, compounding='Continuous')

Compute a forward price with continuous or periodic yield carry.

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

  • rate (float) – Interest rate in decimal units under the stated compounding convention.

  • yield_rate (float) – Dividend, income, or carry yield in decimal annual units.

  • maturity (float) – Time to option expiry in years.

  • compounding (str, default='Continuous') – Compounding convention or frequency accepted by the implementation.

Returns:

Computed forward price with yield as a dimensionless decimal quantity.

Return type:

float

Notes

Model inputs are interpreted according to the module-level rate, maturity, and volatility conventions. Numerical outputs depend on the validity of those assumptions.

abaquant.derivatives.forwards.fra(r1, r2, t1, t2, notional, fixed_rate, compounding='Continuous')

Value the forward-rate-agreement cash-flow relationship implemented by this routine.

Parameters:
  • r1 (float) – First interest-rate input in decimal units.

  • r2 (float) – Second interest-rate input in decimal units.

  • t1 (float) – First accrual or settlement time in years.

  • t2 (float) – Second accrual or settlement time in years.

  • notional (float) – Forward-rate-agreement notional amount in currency units.

  • fixed_rate (float) – Contractual fixed rate in decimal units.

  • compounding (str, default='Continuous') – Compounding convention or frequency accepted by the implementation.

Returns:

Positional outputs produced by the fra calculation.

Return type:

tuple[float, float]

abaquant.derivatives.forwards.fx_forward_price(spot, domestic_rate, foreign_rate, maturity, compounding='Continuous')

Compute a foreign-exchange forward price from domestic and foreign rates.

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

  • domestic_rate (float) – Domestic annual interest rate in decimal units.

  • foreign_rate (float) – Foreign annual interest rate in decimal units.

  • maturity (float) – Time to option expiry in years.

  • compounding (str, default='Continuous') – Compounding convention or frequency accepted by the implementation.

Returns:

Computed fx forward price as a scalar in the units implied by the input values.

Return type:

float

Notes

Model inputs are interpreted according to the module-level rate, maturity, and volatility conventions. Numerical outputs depend on the validity of those assumptions.

abaquant.derivatives.forwards.live_forward_value(spot, delivery_price, rate, yield_rate, time_to_maturity, compounding='Continuous')

Compute the current value of a forward with a fixed delivery price.

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

  • delivery_price (float) – Forward delivery price fixed at trade inception, in currency units.

  • rate (float) – Interest rate in decimal units under the stated compounding convention.

  • yield_rate (float) – Dividend, income, or carry yield in decimal annual units.

  • time_to_maturity (float) – Remaining time to contract maturity in years.

  • compounding (str, default='Continuous') – Compounding convention or frequency accepted by the implementation.

Returns:

Computed live forward value as a scalar in the units implied by the input values.

Return type:

float

abaquant.derivatives.forwards.simple_forward_price(spot, rate, maturity, compounding='Continuous')

Compute the forward price with financing carry only.

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

  • rate (float) – Interest rate in decimal units under the stated compounding convention.

  • maturity (float) – Time to option expiry in years.

  • compounding (str, default='Continuous') – Compounding convention or frequency accepted by the implementation.

Returns:

Computed simple forward price as a scalar in the units implied by the input values.

Return type:

float

Notes

Model inputs are interpreted according to the module-level rate, maturity, and volatility conventions. Numerical outputs depend on the validity of those assumptions.