Skip to content

ZeroCouponBond#

Represents a zero-coupon bond contract.

Parameters:

Name Type Description Default
maturity float

The time to maturity of the bond, in years.

required
face_value float

The face value of the bond, paid at maturity. Defaults to 1.0.

1.0
Source code in src/quantfin/atoms/bond.py
@dataclass(frozen=True, slots=True)
class ZeroCouponBond:
    """
    Represents a zero-coupon bond contract.

    Parameters
    ----------
    maturity : float
        The time to maturity of the bond, in years.
    face_value : float, optional
        The face value of the bond, paid at maturity. Defaults to 1.0.
    """

    maturity: float
    face_value: float = 1.0

    def __post_init__(self):
        if self.maturity <= 0:
            raise ValueError(f"Maturity must be positive, got {self.maturity}")