Instantaneous Forward Curve
Calculates the instantaneous forward curve of a country’s zero-coupon curve on a day: at every maturity t, the rate the curve implies for borrowing over an infinitesimal period starting at t. Where a zero rate averages the forward rates up to its maturity, the instantaneous forward shows each part of the curve on its own, which makes it the sharpest view of the curve’s shape and the curve the Heath-Jarrow-Morton and Hull-White models start from.
The formula is as follows:
\[f(t) = - \frac{d \ln P(t)}{\,\mathrm{d}t} = r(t) + t \cdot \frac{\operatorname{dr}(t)}{\,\mathrm{d}t}\] \[r(t) = \frac{1}{t} \cdot \text{∫} \;f(s) \,\mathrm{d}s,\;\; \text{from 0 to } t\]where P(t) is the discount factor and r(t) the continuously compounded zero rate of maturity t, read from the zero-coupon curve of get_zero_coupon_curve (bootstrapped from the par yields) with the interpolation. As the forward rate is the slope of r(t) t, it shows every kink of the interpolation: it jumps at every maturity of the linear zero and linear par interpolations and is flat between those of the log-linear one. The default, Hagan and West’s (2006) monotone convex method, gives a continuous forward curve that keeps the discrete forwards between the maturities and does not oscillate, which is why it is the default here (the other curve methods default to linear par, the curve of get_zero_coupon_curve). At a maturity of the curve itself the forward is that of the interval that starts there; beyond the last maturity the zero rate, and so the forward, is held at the last zero rate.
The instantaneous forward rate is continuously compounded, as it is defined.
Also known as: instantaneous forward rate, forward curve, short forward curve.
Example
Install the Finance Toolkit with pip install financetoolkit -U, then call get_instantaneous_forward_curve:
from financetoolkit import FixedIncome
fixedincome = FixedIncome()
fixedincome.get_instantaneous_forward_curve(maturities=[0.5, 1, 2, 5, 10, 20, 30], date="2026-11-05")
Or, with the Finance Toolkit MCP set up, ask an AI assistant such as Claude or ChatGPT:
What instantaneous forward rates and zero rates did the US Treasury curve imply at half a year and 1, 2, 5, 10, 20 and 30 years on 5 November 2026?
Which returns:
| Maturity | Instantaneous Forward Rate | Zero Rate |
|---|---|---|
| 0.5 | 0.0421 | 0.0423 |
| 1.0 | 0.0441 | 0.0433 |
| 2.0 | 0.0461 | 0.0451 |
| 5.0 | 0.0480 | 0.0465 |
| 10.0 | 0.0536 | 0.0494 |
| 20.0 | 0.0549 | 0.0552 |
| 30.0 | 0.0485 | 0.0541 |
7 rows
Parameters
get_instantaneous_forward_curve accepts the following parameters.
| Parameter | Type | Description | Example |
|---|---|---|---|
maturities | float | str | list | None | The maturities, in years or as labels such as ‘6M’ (a list or a comma-separated string). Defaults to None, 3 and 6 months and 1 to 30 years. | ["3M", "6M"] |
country | str | The country, see get_zero_coupon_curve. Defaults to “United States”. | "US" |
date | str | None | The day of the curve (YYYY-MM-DD), or the last day before it with a curve. Defaults to None, the end date. | "2025-03-31" |
interpolation | str | How the zero-coupon curve is read between its maturities, see get_zero_coupon_curve. Options are: “linear_par” (linear annually compounded zero rates on every coupon date), “linear_zero” (linear zero rates), “log_linear” (linear log discount factors), “natural_cubic” (a natural cubic spline), “monotone_cubic” (a monotone cubic spline), “monotone_convex” (Hagan and West’s monotone convex method). Defaults to “monotone_convex”. | "monotone_convex" |
rounding | int | None | The number of decimals to round the results to. Defaults to None, which uses the rounding of the class. | 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 |
References
- Paper Hagan, P.S. and West, G. (2006). “Interpolation Methods for Curve Construction.” Applied Mathematical Finance, 13(2), 89-129.
- Paper Hagan, P.S. and West, G. (2008). “Methods for Constructing a Yield Curve.” Wilmott Magazine, May, 70-81.
- Library Referenced against QuantLib’s ZeroCurve (linear_zero)
- Library Referenced against QuantLib’s DiscountCurve (log_linear)
- Library Referenced against QuantLib’s NaturalCubicZeroCurve (natural_cubic)
- Library Referenced against QuantLib’s MonotonicCubicZeroCurve (monotone_cubic)
- Library Referenced against QuantLib’s PiecewiseYieldCurve with ConvexMonotone (monotone_convex)