Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Principle:Avhz RustQuant Bond Pricing

From Leeroopedia


Knowledge Sources
Domains Fixed_Income, Quantitative_Finance
Last Updated 2026-02-07 21:00 GMT

Overview

Bond pricing theory provides the mathematical framework for valuing fixed-income securities, including zero-coupon bonds and coupon-bearing bonds, using discount factors derived from short-rate models such as Vasicek, Cox-Ingersoll-Ross, and Hull-White.

Description

Bond pricing is the process of determining the fair value of a debt instrument by discounting its future cashflows to the present. In RustQuant, bonds are modeled as instruments that implement the Instrument trait, which provides a price() method returning the net present value.

A zero-coupon bond (also called a pure discount bond) pays no periodic interest and instead returns its full face value at maturity. Its price equals the present value of the face value discounted at the appropriate rate.

A coupon bond pays periodic interest and can be viewed as a portfolio of zero-coupon bonds. For example, a 2-year bond with semi-annual 5% coupons and $100 face value is equivalent to four zero-coupon bonds corresponding to each coupon payment plus the final principal repayment.

RustQuant implements three analytic short-rate models for pricing zero-coupon bonds:

  • Vasicek model: The short rate follows dr(t)=k[θr(t)]dt+σdW(t), with mean-reversion speed k, long-term level θ, and volatility σ. The bond price is P(t,T)=A(t,T)eB(t,T)r(t).
  • Cox-Ingersoll-Ross (CIR) model: The short rate follows dr=a(br)dt+σrdW, where the volatility is proportional to r, ensuring non-negative interest rates when 2ab>σ2.
  • Hull-White model: The short rate follows dr=(θ(t)art)dt+σdWt, where θ(t) is a time-dependent function that allows exact calibration to the initial term structure.

Usage

Use bond pricing when valuing fixed-income securities, constructing yield curves, computing bond portfolio present values, or calibrating short-rate models to market data. The analytic formulas are preferred over numerical methods when closed-form solutions are available, as they provide exact results with no simulation error.

Theoretical Basis

The general zero-coupon bond price under an affine short-rate model takes the form:

P(t,T)=A(t,T)exp(B(t,T)r(t))

For the Vasicek model:

B(τ)=1ekτk

A(τ)=exp((B(τ)τ)(k2θσ2/2)k2σ2B(τ)24k)

For the CIR model, with γ=a2+2σ2:

B(τ)=2(eγτ1)(γ+a)(eγτ1)+2γ

A(τ)=(2γe(a+γ)τ/2(γ+a)(eγτ1)+2γ)2ab/σ2

For the coupon bond, the price is the sum of discounted cashflows:

P=i=1ncid(ti)

where ci is the cashflow at time ti and d(ti) is the corresponding discount factor from the discount curve.

Related Pages

Implemented By

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment