Calculates the derivative price for a fixed income instrument.

It is possible to use two different models to calculate the derivative price:

  • Black Model: A mathematical model used for pricing financial derivatives, its primary applications are for pricing options on future contracts, bond options, interest rate cap and floors, and swaptions. For more information, see: https://en.wikipedia.org/wiki/Black_model
  • Bachelier Model: A deviation of the Black Model that is used for pricing future contracts. It is a simple model that assumes the price of the underlying asset follows a normal distribution with constant volatility. This is in contrast to the Black Model which assumes the price of the underlying asset follows a log-normal distribution. For more information, see: https://en.wikipedia.org/wiki/Bachelier_model

It is possible to alter all parameters within the models, e.g. strike rate, volatility, years to maturity, risk-free rate, notional amount, and whether the holder is the receiver or payer of the derivative. Next to that, you can provide lists of values for the fixed rate, strike rate, volatility, and years to maturity to calculate the derivative price for multiple scenarios outside of the standard sample.

Exercising a swaption is not a single payment at expiration - it is the right to enter a swap that exchanges cash flows at every payment date over the underlying swap’s tenor. The price therefore discounts the option payoff by the swap’s annuity (present value of a basis point) rather than a single discount factor to expiration, which is why the tenor and payment frequency of the underlying swap matter.

Note that a swaption’s price scales with the tenor of the underlying swap (a right to enter a longer-dated swap is worth more, since it exchanges cash flows over more payment dates) - pass tenor explicitly to price a swaption whose underlying swap tenor differs from its years to maturity, e.g. a 1-year option into a 5-year swap: tenor=5, years_to_maturity=1.

The two models do not quote volatility on the same basis, and this matters a great deal. Black’s model, being lognormal, reads volatility as a fraction of the forward rate, so 0.20 is a 20% volatility. The Bachelier model, being normal, reads it as an absolute movement in rate units, so 0.0065 is 65 basis points. On a 3.25% forward those two quotes describe the same market, but swapping one for the other misprices the swaption by a factor of roughly thirty. By default volatility is therefore interpreted on whichever basis the chosen model is defined in; set volatility_type explicitly to supply a quote on the other basis and have it converted, using the at-the-money approximation sigma_normal ≈ sigma_lognormal * forward_rate.

Black’s model is undefined at a zero or negative forward or strike rate because it takes the logarithm of their ratio, and raises rather than returning a silent NaN in that case. Use the Bachelier model for the negative rates seen in the euro area and Japan.

Also known as: bond derivative pricing, fixed income derivative, swaption pricing.

No programming experience? With the Finance Toolkit MCP server, AI assistants such as Claude and ChatGPT can calculate the Black Model for you. Just ask in plain English.

Calculate the Black Model in Python

The Black Model is available in the Fixed Income module of the open-source Finance Toolkit. Install it with:

pip install financetoolkit -U

Then call get_derivative_price as shown below.

from financetoolkit import FixedIncome

fixedincome = FixedIncome()

fixedincome.get_derivative_price(
    model='black',
    forward_rate=0.0325,
    strike_rate=[0.0275, 0.0325, 0.0375, 0.0425],
    years_to_maturity=[1, 2, 5, 10],
    show_input_info=False,
)

Parameters

get_derivative_price accepts the following parameters:

  • model (str, optional): The type of model to use for calculating the derivative price. Defaults to “black”.
  • forward_rate (float, optional): The forward rate as derived from the swap curve. Defaults to None.
  • strike_rate (float | list, optional): The strike rate for the derivative. Defaults to None which means it calculates the derivative price a range of strike prices. Can also be a list of strike rates (e.g. [0.01, 0.02, 0.03, 0.04, 0.05]).
  • volatility (float, optional): The volatility of the underlying swap rate, quoted on the basis given by volatility_type. Defaults to 0.01, read as a 1% lognormal volatility by the Black model and as 100 basis points of normal volatility by the Bachelier model.
  • years_to_maturity (float | list, optional): The years to maturity of the derivative in years. Defaults to None which means it plots the derivative price for the next 10 years. Can also be a list of years to maturity (e.g. [1, 2.3, 2.5, 3])
  • risk_free_rate (float, optional): The risk-free interest rate. Defaults to None which means it is equal to the fixed rate.
  • notional (float, optional): The notional amount of the derivative. Defaults to 10_000_000.
  • tenor (float | None, optional): The tenor (length in years) of the underlying swap. Defaults to None, which means it is equal to years_to_maturity for each scenario.
  • payment_frequency (int, optional): Number of fixed-leg payments per year on the underlying swap (e.g. 1 for annual, 2 for semi-annual, 4 for quarterly). Defaults to 2 (semi-annual).
  • is_receiver (bool, optional): True if the holder is the receiver of the derivative, False if the holder is the payer. Defaults to True.
  • volatility_type (str | None, optional): The convention volatility is quoted on, either ‘lognormal’ (relative to the forward rate) or ‘normal’ (absolute, in rate units). Defaults to None, which uses the convention the chosen model is natively defined in: ‘lognormal’ for the Black model and ‘normal’ for the Bachelier model.
  • include_payoff (bool, optional): True to include the payoff in the output, False otherwise. Defaults to False.
  • show_input_info (bool, optional): True to display input information, False otherwise. Defaults to True.

The Fixed Income module page introduces the module, and the sidebar lists all of its functions.

Share