Swaption Prices
Calculates the prices of European or Bermudan swaptions for a grid of expiries and swap tenors in a one-factor short-rate model fitted to today’s government zero-coupon curve: what the right to enter an interest rate swap at the option’s expiry is worth.
A payer swaption is the right to pay the fixed rate (it gains when rates rise), a receiver swaption the right to receive it. Without a strike every swaption is at the money: struck at the forward swap rate of its expiry and tenor on the same curve (get_swap_rate on the government curve, starting at the expiry).
Two models reproduce the curve and so price at-the-money swaptions consistently:
\[\text{Hull-White (1990):}\;\; \,\mathrm{d}r = \left[\theta(t) - a r\right] \,\mathrm{d}t + \sigma \,\mathrm{d}W,\;\; \text{Vasicek with a time-varying mean, so rates are normal and can turn negative}\] \[\text{CIR++ (Brigo and Mercurio, 2001):}\;\; r = x + \phi(t),\;\; \text{with}\;\; x \;\text{a Cox-Ingersoll-Ross process}\; \,\mathrm{d}x = a (b - x) \,\mathrm{d}t + \sigma \sqrt{x} \,\mathrm{d}W \;\text{and}\; \phi \;\text{the deterministic shift that fits the curve},\;\; \text{so the volatility grows with the level of rates}\]The speed of mean reversion a and the volatility \(\sigma\) (and for CIR++ the long-run mean b) are calibrated to the history of the short_rate yield between the start and end date, see get_short_rate_model; CIR++ starts its process at today’s short rate. The price follows from Jamshidian’s (1989) decomposition: at expiry the payer swaption is a put on a coupon bond paying the fixed rate, which in a one-factor model splits into puts on its zero-coupon bonds, each priced in closed form (see short_rate_model.get_swaption and get_zero_coupon_bond_option).
A Bermudan swaption (Hull-White only) can also be exercised on every fixed payment date after the expiry, into the rest of a swap that ends at the expiry plus the tenor (co-terminal, “10 non-call 1”). It has no closed form and is valued on a Hull-White trinomial tree fitted exactly to the zero curve with the two-stage procedure of Hull and White (1994), with at most 1/50 of a year between two dates of the tree, comparing at every exercise date the value of the swap with the value of waiting (see trinomial_tree_model.get_bermudan_swaption). It is worth at least the European swaption of the same expiry, tenor and strike.
The formula is as follows:
\[c_{i} = K \tau_{i},\;\; \text{plus 1 on the last date } T_{n}\] \[x^{*} \;\text{solves} \;\sum(c_{i} P(T,\; T_{i} ; x^{*})) = 1,\;\; X_{i} = P(T,\; T_{i} ; x^{*})\] \[\text{Payer Swaption} = \sum(c_{i} \;\text{ZBP}(T,\; T_{i},\; X_{i}))\] \[\text{Receiver Swaption} = \sum(c_{i} \;\text{ZBC}(T,\; T_{i},\; X_{i}))\] \[\text{Bermudan:}\;\; \text{Option} = \max(E\left[\text{Option next date}\right] \cdot e^{- r \Delta t},\; \pm (1 - B(T_{k}))) \;\text{at}\; T_{0} = T,\;\; T_{1} \text{, } \ldots , T_{n - 1},\;\; \text{with} \;B(T_{k}) \;\text{the coupon bond's payments after}\; T_{k} \;\text{on the tree} \;(+ \text{for a payer},\; - \text{for a receiver})\]with T the expiry, \(T_{i}\) the fixed payment dates every 1 / fixed_frequency years after it, \(\tau_{i} = 1\) / fixed_frequency, K the strike, P(T, T_i; x) the bond price at expiry in state x of the model and ZBP and ZBC the zero-coupon bond puts and calls of the model. The price is per 1 of notional (0.01 is 1% of the notional).
The short rate and the model parameters are continuously compounded (the yield is converted from its quote convention, as in get_short_rate_model). The zero-coupon curve is that of the end date, bootstrapped from the par yields and annually compounded, and the strike is a nominal annual rate paid fixed_frequency times a year, with no day count. The calibration uses the history up to the end date only.
Also known as: swaption price, Bermudan swaption, Hull-White swaption, CIR++ swaption, Jamshidian decomposition, interest rate option.
Example · 2000 to 2026
Install the Finance Toolkit with pip install financetoolkit -U, then call get_swaption_price:
from financetoolkit import FixedIncome
fixedincome = FixedIncome(start_date='2000-01-01', end_date='2026-10-23')
fixedincome.get_swaption_price(short_rate='6M')
Or, with the Finance Toolkit MCP set up, ask an AI assistant such as Claude or ChatGPT:
What were payer swaptions on the US curve worth on 23 October 2026, for expiries of 1 to 10 years and swaps of 1 to 30 years, with the 6-month rate as the short rate?
Which returns:
| Expiry | 1 | 2 | 5 | 10 | 30 |
|---|---|---|---|---|---|
| 1 | 0.0021 | 0.0039 | 0.0080 | 0.0120 | 0.0154 |
| 2 | 0.0027 | 0.0050 | 0.0103 | 0.0154 | 0.0198 |
| 5 | 0.0032 | 0.0061 | 0.0125 | 0.0185 | 0.0240 |
| 10 | 0.0030 | 0.0055 | 0.0114 | 0.0167 | 0.0221 |
4 rows
Parameters
get_swaption_price accepts the following parameters.
| Parameter | Type | Description | Example |
|---|---|---|---|
expiries | float | str | list | None | The expiries of the swaptions, in years or as labels such as ‘6M’. Defaults to None, 1, 2, 5 and 10 years. | None, 1, 2, 5 and 10 years |
tenors | float | str | list | None | The tenors of the underlying swaps, in years or as labels such as ‘10Y’. Defaults to None, 1, 2, 5, 10 and 30 years. | None, 1, 2, 5, 10 and 30 years |
model | str | The model. Options are: “hull_white” (Hull-White), “cir++” (CIR++ of Brigo and Mercurio). Defaults to “hull_white”. | "hull_white" |
swaption_type | str | The swaption. Options are: “payer” (the right to pay the fixed rate), “receiver” (the right to receive it). Defaults to “payer”. | "payer" |
strike | float | None | The fixed rate of the swaps (decimal). Defaults to None, the at-the-money forward swap rate of each expiry and tenor. | None, the at-the-money forward swap rate of each expiry and tenor |
fixed_frequency | int | The fixed payments per year, at least 1. Defaults to 1. | 1 |
country | str | The country, see get_government_bond_yield_curve. Defaults to “United States”. | "US" |
short_rate | str | The maturity of the yield used as the short rate, such as “1M”, “3M” or “6M”. Defaults to “3M”. | "3M" |
period | str | The frequency of the rates. Options are: “daily”, “weekly”, “monthly”. Defaults to “daily”. | "weekly" |
rounding | int | None | The number of decimals to round the results to. Defaults to None. | 2 |
show_columns | str | list[str] | None | The columns to keep, a name or a list of names, matched on every column level, or the rows when no column has those names (such as the line items of a financial statement). Names that do not exist are logged, and when none exist the result is returned in full. Defaults to None, which keeps every column. | None, which keeps every column |
exercise | str | The exercise. Options are: “european” (at the expiry only), “bermudan” (on every fixed payment date from the expiry on, Hull-White only). Defaults to “european”. | "european" |
References
- Paper Jamshidian, F. (1989). “An Exact Bond Option Formula.” Journal of Finance, 44(1), 205-209.
- Paper Hull, J. and White, A. (1990). “Pricing Interest-Rate-Derivative Securities.” The Review of Financial Studies, 3(4), 573-592.
- Paper Brigo, D. and Mercurio, F. (2001). “A Deterministic-Shift Extension of Analytically Tractable and Time-Homogeneous Short-Rate Models.” Finance and Stochastics, 5(3), 369-387.
- Paper Hull, J. and White, A. (1994). “Numerical Procedures for Implementing Term Structure Models I: Single-Factor Models.” Journal of Derivatives, 2(1), 7-16.
- Library Referenced against QuantLib’s JamshidianSwaptionEngine (european)
- Library Referenced against QuantLib’s TreeSwaptionEngine (bermudan)