Workflow:Avhz RustQuant Yield Curve Construction
| Knowledge Sources | |
|---|---|
| Domains | Quantitative_Finance, Fixed_Income, Yield_Curves |
| Last Updated | 2026-02-07 19:00 GMT |
Overview
End-to-end process for constructing yield curves from market rate data, interpolating between observed tenors, and generating continuous rate term structures.
Description
This workflow covers the construction and interpolation of yield curves (term structures of interest rates) from discrete market observations. RustQuant provides a Curve type backed by a BTreeMap that stores date-rate pairs and supports multiple interpolation methods (linear, exponential). The curve can also be fitted to parametric models such as Nelson-Siegel and Nelson-Siegel-Svensson for smooth yield curve representation. The resulting curve serves as a foundational input for bond pricing, discounting cash flows, and derivative valuation.
Usage
Execute this workflow when you have observed market interest rates at discrete tenors (e.g., US Treasury yields at 1M, 3M, 1Y, 5Y, 10Y, 30Y) and need a continuous rate curve for pricing fixed-income instruments, computing discount factors, or performing present-value calculations at arbitrary maturities.
Execution Steps
Step 1: Assemble Market Rate Data
Gather the observed market rates and their corresponding dates. Rates are typically sourced from central bank publications, market data providers, or exchange data. Each observation consists of a date and a rate value.
Key considerations:
- Dates use the time crate date type
- Rates are in percentage or decimal form depending on convention
- The data should cover the relevant maturity range for the use case
- Common tenors include 1M, 2M, 3M, 6M, 1Y, 2Y, 3Y, 5Y, 7Y, 10Y, 20Y, 30Y
Step 2: Construct the Curve Object
Create a Curve instance from the date-rate pairs, specifying the curve type (spot, forward, or zero) and the interpolation method (linear or exponential). The constructor validates inputs and builds an ordered map of the rate observations.
Curve configuration:
- CurveType - Spot, Forward, or Zero curve
- InterpolationMethod - Linear interpolation between tenors, or exponential interpolation for smoother curvature
- The curve stores rates in a BTreeMap keyed by date for efficient lookup and ordered traversal
Step 3: Interpolate at Arbitrary Dates
Query the curve for rates at dates between (or beyond) the observed tenors. The interpolation engine computes rate values using the specified method, filling in the gaps in the term structure.
What happens:
- For dates between observed tenors, the interpolation method produces a smooth rate estimate
- Multiple dates can be queried at once using get_rates_and_insert, which also adds the interpolated points to the curve
- The result is a dense term structure suitable for continuous discounting
Step 4: Use Curve for Pricing
Apply the constructed yield curve as an input to pricing models, discount factor calculations, or present-value computations. The curve provides a rate for any date within its range, enabling consistent valuation across instruments.
Common applications:
- Compute discount factors for bond pricing
- Determine forward rates between any two dates
- Use as the risk-free rate input for option pricing models
- Fit Nelson-Siegel or Nelson-Siegel-Svensson parametric models for analytical representation