fuggers_py.bonds

fuggers_py.bonds is the public entry point for bond instruments, bond quotes, cash flows, pricing, yields, risk, spread analytics, YAS-style output, and simple bond-option tools.

Import bond objects from this layer, not from internal module paths.

from fuggers_py.bonds import BondPricer, BondQuote, FixedBondBuilder, RiskMetrics

Units And Signs

  • Clean and dirty bond prices are percent of par. 99.25 means 99.25 percent of face value.

  • Coupon rates, most yields, spreads, repo rates, and funding rates are raw decimals. 0.05 means 5 percent.

  • One basis point is 0.0001.

  • Helpers ending in _pct return percentage points. 4.5 means 4.5 percent.

  • Helpers ending in _bps return basis points. 125 means 125 basis points.

  • Money-market helpers are the exception: discount_yield, bond_equivalent_yield, cd_equivalent_yield, money_market_yield, and money_market_yield_with_horizon return quoted percentage points even though their names do not end in _pct.

  • Spread helpers without _bps return raw decimals.

  • RiskMetrics.dv01 and BondRiskMetrics.dv01 are percent-of-par price changes per 1 bp yield move. dv01_from_duration() returns a cash amount only because you pass a face amount.

  • DV01 and PV01 are positive when the bond price rises as yield falls by 1 bp.

  • Face amounts and settlement invoice cash fields are currency amounts.

Public Surface Rule

The public surface is the names listed in fuggers_py.bonds.__all__ and in specs/public_api_surface.json for fuggers_py.bonds.

Bond-local support records are available from fuggers_py.bonds.types. Use that package for identifiers, quote conventions, rating or sector metadata, embedded put schedules, and amortization schedules.

ZSpreadCalculator is importable today because the package imports it internally, but it is not in __all__ and not in the public surface spec. Do not document it or rely on it as public API. Use z_spread() and z_spread_from_curve() instead.

Core Examples

Build, Price, And Read Cash Flows

from decimal import Decimal

from fuggers_py import Compounding, Currency, Date, Frequency, Price
from fuggers_py import Yield, YieldCalculationRules
from fuggers_py.bonds import BondPricer, FixedBondBuilder

rules = YieldCalculationRules.us_treasury()
bond = (
    FixedBondBuilder.new()
    .with_issue_date(Date.from_ymd(2021, 1, 15))
    .with_maturity_date(Date.from_ymd(2031, 1, 15))
    .with_coupon_rate(Decimal("0.045"))
    .with_frequency(Frequency.SEMI_ANNUAL)
    .with_currency(Currency.USD)
    .with_rules(rules)
    .build()
)

settlement = Date.from_ymd(2026, 4, 22)
ytm = Yield.new(Decimal("0.0475"), Compounding.SEMI_ANNUAL)

pricer = BondPricer()
priced = pricer.price_from_yield(bond, ytm, settlement)

clean = priced.clean.as_percentage()
dirty = priced.dirty.as_percentage()
accrued = priced.accrued

round_trip_yield = pricer.yield_to_maturity(
    bond,
    Price.new(clean, Currency.USD),
    settlement,
)

future_flows = bond.cash_flows(settlement)
next_coupon = bond.next_coupon_date(settlement)
previous_coupon = bond.previous_coupon_date(settlement)

BondPricer.price_from_yield() discounts future cash flows after settlement. It returns dirty price, clean price, and accrued interest. yield_from_price() adds accrued interest to the clean price before solving for yield.

Price From A Curve

price_from_curve() accepts any public curve object that provides a reference date, day-count spec, and discount_factor_at(tenor).

from dataclasses import dataclass
from decimal import Decimal
from math import exp

from fuggers_py import Currency, Date, Frequency, YieldCalculationRules
from fuggers_py.bonds import BondPricer, FixedBondBuilder


@dataclass(frozen=True)
class CurveSpec:
    day_count: str = "ACT/365F"


@dataclass(frozen=True)
class FlatCurve:
    reference_date: Date
    zero_rate: float
    spec: CurveSpec = CurveSpec()

    def discount_factor_at(self, tenor: float) -> float:
        return exp(-self.zero_rate * tenor)


settlement = Date.from_ymd(2026, 4, 22)
curve = FlatCurve(reference_date=settlement, zero_rate=0.04)

bond = (
    FixedBondBuilder.new()
    .with_issue_date(Date.from_ymd(2021, 1, 15))
    .with_maturity_date(Date.from_ymd(2031, 1, 15))
    .with_coupon_rate(Decimal("0.045"))
    .with_frequency(Frequency.SEMI_ANNUAL)
    .with_currency(Currency.USD)
    .with_rules(YieldCalculationRules.us_treasury())
    .build()
)

curve_price = BondPricer().price_from_curve(bond, curve, settlement)
dirty_percent = curve_price.dirty.as_percentage()

The curve price uses discount factors at each cash-flow date divided by the discount factor at settlement. Settlement after maturity raises a pricing error.

Callable, Floating-Rate, And Sinking-Fund Builders

Builders collect fields step by step and validate them in build(). Required dates, rates, frequency, currency, and rules must be present. The bond frequency must match YieldCalculationRules.frequency.

from dataclasses import replace
from decimal import Decimal

from fuggers_py import Currency, Date, Frequency, YieldCalculationRules
from fuggers_py.bonds import CallableBondBuilder, FixedBondBuilder
from fuggers_py.bonds import FloatingRateNoteBuilder, RateIndex
from fuggers_py.bonds import SinkingFundBondBuilder

base = (
    FixedBondBuilder.new()
    .with_issue_date(Date.from_ymd(2021, 1, 15))
    .with_maturity_date(Date.from_ymd(2031, 1, 15))
    .with_coupon_rate(Decimal("0.045"))
    .with_frequency(Frequency.SEMI_ANNUAL)
    .with_currency(Currency.USD)
    .with_rules(YieldCalculationRules.us_treasury())
    .build()
)

callable_bond = (
    CallableBondBuilder.new()
    .with_base_bond(base)
    .add_call(call_date=Date.from_ymd(2028, 1, 15), call_price=Decimal("100"))
    .build()
)
call_price = callable_bond.call_price_on(Date.from_ymd(2028, 1, 15))
worst_yield = callable_bond.yield_to_worst(Decimal("99.25"), Date.from_ymd(2026, 4, 22))

quarterly_rules = replace(
    YieldCalculationRules.us_corporate(),
    frequency=Frequency.QUARTERLY,
)
frn = (
    FloatingRateNoteBuilder.new()
    .with_issue_date(Date.from_ymd(2024, 1, 15))
    .with_maturity_date(Date.from_ymd(2027, 1, 15))
    .with_index(RateIndex.SOFR)
    .with_quoted_spread(Decimal("0.0075"))
    .with_current_reference_rate(Decimal("0.0520"))
    .with_frequency(Frequency.QUARTERLY)
    .with_currency(Currency.USD)
    .with_rules(quarterly_rules)
    .build()
)
coupon_rate = frn.effective_rate()

annual_rules = replace(YieldCalculationRules.us_corporate(), frequency=Frequency.ANNUAL)
sinker = (
    SinkingFundBondBuilder.new()
    .with_issue_date(Date.from_ymd(2024, 1, 15))
    .with_maturity_date(Date.from_ymd(2029, 1, 15))
    .with_coupon_rate(Decimal("0.05"))
    .with_frequency(Frequency.ANNUAL)
    .with_currency(Currency.USD)
    .with_rules(annual_rules)
    .add_sinking_entry(Date.from_ymd(2027, 1, 15), Decimal("0.25"))
    .add_sinking_entry(Date.from_ymd(2028, 1, 15), Decimal("0.25"))
    .build()
)
remaining_factor = sinker.factor_on(Date.from_ymd(2027, 1, 15))
average_life = sinker.average_life()

Schedules, Accrued Interest, And Settlement

Schedules store both unadjusted accrual dates and adjusted payment dates. Accrued interest inputs are currency or percent-of-par values depending on the calling object; bond methods return accrued interest in the bond’s quoted price basis.

from decimal import Decimal

from fuggers_py import CalendarId, Date, Frequency, YieldCalculationRules
from fuggers_py.bonds import AccruedInterestCalculator, AccruedInterestInputs
from fuggers_py.bonds import Schedule, ScheduleConfig, SettlementCalculator

rules = YieldCalculationRules.us_treasury()

schedule = Schedule.generate(
    ScheduleConfig(
        start_date=Date.from_ymd(2026, 1, 15),
        end_date=Date.from_ymd(2027, 1, 15),
        frequency=Frequency.SEMI_ANNUAL,
        calendar=rules.calendar,
        business_day_convention=rules.business_day_convention,
    )
)
payment_dates = schedule.dates

inputs = AccruedInterestInputs(
    settlement_date=Date.from_ymd(2026, 4, 22),
    accrual_start=Date.from_ymd(2026, 1, 15),
    accrual_end=Date.from_ymd(2026, 7, 15),
    coupon_amount=Decimal("2.25"),
    coupon_date=Date.from_ymd(2026, 7, 15),
    full_coupon_amount=Decimal("2.25"),
)
accrued = AccruedInterestCalculator.standard(inputs, rules=rules)

settlement_date = SettlementCalculator(
    calendar=CalendarId.weekend_only(),
    rules=rules.settlement_rules,
).settlement_date(Date.from_ymd(2026, 4, 22))

Quotes And Reference Data

BondQuote stores only the fields in its constructor. It does not have bid, ask, or mid fields. It validates that the quote currency matches the bond currency. It also converts regressors to finite floats.

from decimal import Decimal

from fuggers_py import Currency, Date, Frequency, YieldCalculationRules
from fuggers_py.bonds import BondQuote, FixedBondBuilder, deliverable_bpv_regressor
from fuggers_py.bonds import BondReferenceData, BondType, IssuerType

bond = (
    FixedBondBuilder.new()
    .with_issue_date(Date.from_ymd(2021, 1, 15))
    .with_maturity_date(Date.from_ymd(2031, 1, 15))
    .with_coupon_rate(Decimal("0.045"))
    .with_frequency(Frequency.SEMI_ANNUAL)
    .with_currency(Currency.USD)
    .with_rules(YieldCalculationRules.us_treasury())
    .with_instrument_id("UST-2031-4.5")
    .build()
)

quote = BondQuote(
    instrument=bond,
    clean_price=Decimal("99.25"),
    yield_to_maturity=Decimal("0.0468"),
    as_of=Date.from_ymd(2026, 4, 22),
    regressors={
        "deliverable_bpv": deliverable_bpv_regressor(81.2, deliverable=True),
    },
)
instrument_id = quote.instrument_id
quote_date = quote.resolved_settlement_date()

reference = BondReferenceData(
    instrument_id="corp-2029",
    bond_type=BondType.FIXED_RATE,
    issuer_type=IssuerType.CORPORATE,
    issue_date=Date.from_ymd(2024, 1, 15),
    maturity_date=Date.from_ymd(2029, 1, 15),
    coupon_rate=Decimal("0.0525"),
    frequency=Frequency.SEMI_ANNUAL,
    currency=Currency.USD,
    issuer_name="Example Corp",
)
reference_bond = reference.to_instrument()

Risk And DV01

RiskMetrics returns percent-of-par sensitivities. Use Position or dv01_from_duration() when you need cash DV01 for a face amount.

from decimal import Decimal

from fuggers_py import Compounding, Currency, Date, Frequency
from fuggers_py import Yield, YieldCalculationRules
from fuggers_py.bonds import FixedBondBuilder, Position, RiskMetrics
from fuggers_py.bonds import aggregate_portfolio_risk, dv01_from_duration

bond = (
    FixedBondBuilder.new()
    .with_issue_date(Date.from_ymd(2021, 1, 15))
    .with_maturity_date(Date.from_ymd(2031, 1, 15))
    .with_coupon_rate(Decimal("0.045"))
    .with_frequency(Frequency.SEMI_ANNUAL)
    .with_currency(Currency.USD)
    .with_rules(YieldCalculationRules.us_treasury())
    .build()
)

settlement = Date.from_ymd(2026, 4, 22)
ytm = Yield.new(Decimal("0.0475"), Compounding.SEMI_ANNUAL)
metrics = RiskMetrics.from_bond(bond, ytm, settlement)

percent_of_par_dv01 = metrics.dv01
cash_dv01 = dv01_from_duration(
    metrics.modified_duration,
    dirty_price=Decimal("100.15"),
    face=Decimal("1000000"),
)

position = Position(
    modified_duration=metrics.modified_duration,
    dirty_price=Decimal("100.15"),
    face=Decimal("1000000"),
)
portfolio = aggregate_portfolio_risk([position])
portfolio_cash_dv01 = portfolio.dv01

Yields

Current-yield helpers return raw decimals unless the name ends in _pct. Money-market helpers return percentage points.

from decimal import Decimal

from fuggers_py.bonds import bond_equivalent_yield, current_yield
from fuggers_py.bonds import current_yield_pct, discount_yield

raw_current = current_yield(Decimal("0.045"), Decimal("99.25"))
display_current = current_yield_pct(Decimal("0.045"), Decimal("99.25"))

# Money-market helpers return percentage points, not raw decimals.
discount_display = discount_yield(
    face_value=Decimal("100"),
    price=Decimal("98.75"),
    days_to_maturity=Decimal("180"),
)
bey_display = bond_equivalent_yield(
    face_value=Decimal("100"),
    price=Decimal("98.75"),
    days_to_maturity=Decimal("180"),
)

Spreads And Balance-Sheet Overlays

Unsuffixed spread helpers return raw decimals. _bps helpers return basis points.

from decimal import Decimal

from fuggers_py import Date, Tenor
from fuggers_py.bonds import BenchmarkSpec, GovernmentCurve, SecurityId
from fuggers_py.bonds import GSpreadCalculator, g_spread_bps
from fuggers_py.bonds import CapitalSpreadAdjustment, HaircutSpreadAdjustment
from fuggers_py.bonds import apply_balance_sheet_overlays
from fuggers_py.bonds import reference_rate_decomposition

curve = (
    GovernmentCurve.us_treasury(Date.from_ymd(2026, 4, 22))
    .add_benchmark(Tenor.parse("5Y"), Decimal("0.041"))
    .add_benchmark(Tenor.parse("10Y"), Decimal("0.044"))
)

benchmark_yield = curve.yield_for_tenor(Tenor.parse("7Y"))
spread_bps = g_spread_bps(Decimal("0.0525"), benchmark_yield)
nearest_spec = BenchmarkSpec.nearest()

security_id = SecurityId.cusip_unchecked("91282CJL6")

capital = CapitalSpreadAdjustment(
    exposure=Decimal("1000000"),
    risk_weight=Decimal("0.20"),
    capital_ratio=Decimal("0.08"),
    hurdle_rate=Decimal("0.12"),
)
haircut = HaircutSpreadAdjustment(
    collateral_value=Decimal("1000000"),
    haircut=Decimal("0.02"),
    repo_rate=Decimal("0.050"),
    haircut_funding_rate=Decimal("0.058"),
)
overlay = apply_balance_sheet_overlays(
    base_spread=Decimal("0.0125"),
    adjustments=(capital, haircut),
)
adjusted_spread = overlay.adjusted_spread

funding = reference_rate_decomposition(
    repo_rate=Decimal("0.050"),
    general_collateral_rate=Decimal("0.051"),
    unsecured_overnight_rate=Decimal("0.052"),
    term_rate=Decimal("0.054"),
)
total_funding_basis = funding.total_funding_basis

TIPS

TipsBond uses inflation fixings to compute an index ratio. The ratio scales principal and coupons. TipsPricer prices projected inflation-adjusted cash flows from a real yield.

from decimal import Decimal

from fuggers_py import Compounding, Currency, Date, Frequency, YearMonth
from fuggers_py import Yield, YieldCalculationRules
from fuggers_py.bonds import TipsBond, TipsPricer
from fuggers_py.inflation import InMemoryInflationFixingSource, InflationFixing
from fuggers_py.inflation import USD_CPI_U_NSA

fixings = []
level = Decimal("300.0")
for year in range(2023, 2035):
    for month in range(1, 13):
        fixings.append(InflationFixing("CPURNSA", YearMonth(year, month), level))
        level += Decimal("0.2")

source = InMemoryInflationFixingSource(fixings)
tips = TipsBond.new(
    issue_date=Date.from_ymd(2024, 1, 15),
    maturity_date=Date.from_ymd(2034, 1, 15),
    coupon_rate=Decimal("0.0125"),
    inflation_convention=USD_CPI_U_NSA,
    base_reference_date=Date.from_ymd(2024, 1, 15),
    frequency=Frequency.SEMI_ANNUAL,
    currency=Currency.USD,
    rules=YieldCalculationRules.us_treasury(),
    fixing_source=source,
)

settlement = Date.from_ymd(2026, 4, 22)
ratio = tips.index_ratio(settlement, fixing_source=source)
adjusted_principal = tips.adjusted_principal(settlement, fixing_source=source)

real_yield = Yield.new(Decimal("0.018"), Compounding.SEMI_ANNUAL)
tips_price = TipsPricer().price_from_real_yield(
    tips,
    real_yield,
    settlement,
    fixing_source=source,
)

YAS And Settlement Invoice

YAS output is display-oriented: yields are percentage points, spreads are basis points, and the attached invoice has both percent-of-par and cash fields.

from dataclasses import dataclass
from decimal import Decimal
from math import exp

from fuggers_py import Currency, Date, Frequency, Price, YieldCalculationRules
from fuggers_py.bonds import FixedBondBuilder, SettlementInvoiceBuilder, YASCalculator
from fuggers_py.bonds import calculate_accrued_amount, calculate_proceeds


@dataclass(frozen=True)
class CurveSpec:
    day_count: str = "ACT/365F"


@dataclass(frozen=True)
class FlatCurve:
    reference_date: Date
    zero_rate: float
    spec: CurveSpec = CurveSpec()

    def discount_factor_at(self, tenor: float) -> float:
        return exp(-self.zero_rate * tenor)

    def rate_at(self, tenor: float) -> float:
        return self.zero_rate

    def zero_rate_at(self, tenor: float) -> float:
        return self.zero_rate


bond = (
    FixedBondBuilder.new()
    .with_issue_date(Date.from_ymd(2021, 1, 15))
    .with_maturity_date(Date.from_ymd(2031, 1, 15))
    .with_coupon_rate(Decimal("0.045"))
    .with_frequency(Frequency.SEMI_ANNUAL)
    .with_currency(Currency.USD)
    .with_rules(YieldCalculationRules.us_treasury())
    .build()
)
settlement = Date.from_ymd(2026, 4, 22)

invoice = SettlementInvoiceBuilder(
    settlement_date=settlement,
    clean_price=Decimal("99.25"),
    accrued_interest=bond.accrued_interest(settlement),
    face_value=Decimal("1000000"),
).build()

accrued_cash = calculate_accrued_amount(
    face_value=Decimal("1000000"),
    accrued_interest=invoice.accrued_interest,
)
settlement_cash = calculate_proceeds(invoice.principal_amount, accrued_cash)

yas = YASCalculator(curve=FlatCurve(settlement, 0.04)).calculate(
    bond,
    Price.new(Decimal("99.25"), Currency.USD),
    settlement,
)
yas_duration = yas.modified_duration()

Bond Options

Bond options use a short-rate model and a recombining tree. The returned option price is in the same value units as the tree cash flows, not a yield.

from dataclasses import dataclass
from decimal import Decimal
from math import exp

from fuggers_py import Currency, Date, Frequency, OptionType, YieldCalculationRules
from fuggers_py.bonds import BondOption, ExerciseStyle, FixedBondBuilder, HullWhiteModel


@dataclass(frozen=True)
class CurveSpec:
    day_count: str = "ACT/365F"


@dataclass(frozen=True)
class FlatCurve:
    reference_date: Date
    zero_rate: float
    spec: CurveSpec = CurveSpec()

    def discount_factor_at(self, tenor: float) -> float:
        return exp(-self.zero_rate * tenor)

    def rate_at(self, tenor: float) -> float:
        return self.zero_rate

    def zero_rate_at(self, tenor: float) -> float:
        return self.zero_rate


valuation_date = Date.from_ymd(2026, 4, 22)
bond = (
    FixedBondBuilder.new()
    .with_issue_date(Date.from_ymd(2024, 1, 15))
    .with_maturity_date(Date.from_ymd(2029, 1, 15))
    .with_coupon_rate(Decimal("0.04"))
    .with_frequency(Frequency.SEMI_ANNUAL)
    .with_currency(Currency.USD)
    .with_rules(YieldCalculationRules.us_treasury())
    .build()
)
model = HullWhiteModel(
    mean_reversion=Decimal("0.03"),
    volatility=Decimal("0.01"),
    term_structure=FlatCurve(reference_date=valuation_date, zero_rate=0.04),
)
option = BondOption(
    expiry=Date.from_ymd(2027, 1, 15),
    strike=Decimal("100"),
    bond=bond,
    model=model,
    option_type=OptionType.CALL,
    exercise_style=ExerciseStyle.EUROPEAN,
    valuation_date=valuation_date,
)
option_value = option.price()

Public Export Reference

Contracts, Instruments, Cash Flows, And Builders

Export

What It Represents

Behavior, Methods, And Properties

Bond

Abstract bond contract used by pricing, cash-flow, and risk code.

Concrete bonds implement identifiers(), currency(), notional(), issue_date(), maturity_date(), frequency(), rules(), cash_flows(), and accrued_interest(). The helper methods max_date(), next_coupon_date(), and previous_coupon_date() read the cash-flow list.

BondAnalytics

Mixin that adds convenience analytics to concrete bonds.

Methods call public pricing/risk objects: price_from_yield(), yield_from_price(), risk_metrics(), and modified_duration().

BondCashFlow

One dated bond cash flow.

Fields are date, amount, flow_type, optional accrual dates, factor, and optional reference_rate. Methods: is_coupon(), is_principal(), and factored_amount(). factored_amount() returns amount * factor.

CashFlowType

Labels a cash flow as coupon, principal, inflation coupon, inflation principal, combined coupon/principal, or fee.

Used by BondCashFlow.is_coupon() and BondCashFlow.is_principal().

CashFlowGenerator

Helper that builds cash flows from schedule dates.

fixed_rate_bond_cashflows() builds coupon and redemption flows. future_cashflows() filters flows strictly after a cutoff date.

FixedBond

Concrete fixed-coupon bond.

Constructor validation checks dates, positive notional, coupon between 0 and 1, non-zero frequency, and matching rules frequency. Useful methods: new(), identifiers(), currency(), notional(), issue_date(), maturity_date(), frequency(), coupon_rate(), rules(), schedule(), cash_flows(), and accrued_interest().

FixedBondBuilder

Builder for FixedBond.

Use new(), with_issue_date(), with_maturity_date(), with_coupon_rate(), with_frequency(), with_currency(), with_notional(), with_identifiers(), with_instrument_id(), with_rules(), with_stub_rules(), and build(). Missing required fields raise MissingRequiredField.

FixedRateBond

Alias of FixedBond.

Use the same methods and behavior as FixedBond.

FixedRateBondBuilder

Alias of FixedBondBuilder.

Use the same builder methods as FixedBondBuilder.

FixedCouponBond

Protocol for objects with coupon_rate().

Use it for type checks or functions that only need a fixed coupon rate. It is not a concrete instrument.

CallableBond

Bond with call and optional put workouts.

Wraps a fixed base bond. Useful methods include is_callable_on(), first_call(), next_call(), call_price_on(), cash_flows_to_call(), yield_to_call(), yield_to_first_call(), put_schedule(), is_putable_on(), put_price_on(), yield_to_put(), yield_to_first_put(), yield_to_worst(), workout_dates(), first_workout_date(), and yield_to_first_workout().

CallableBondBuilder

Builder for CallableBond.

Use new(), with_base_bond(), with_call_schedule(), with_put_schedule(), add_call(), with_protection_end_date(), add_put(), and build(). Call prices and put prices are percent of par.

CallEntry

One call date and redemption price.

Coerces call_price and make_whole_spread to Decimal. Validates positive call price and valid call end date. Method: is_exercisable_on().

CallSchedule

Ordered list of call entries plus optional protection end date.

new() sorts entries. Methods: is_protected(), future_entries(), first_call_after(), entry_for_date(), and call_price_on().

CallType

Exercise style for a call entry.

Values include European, American, Bermudan, and make-whole.

AccelerationOption

Alias of CallType.

Kept as a public name for call-style option classification.

CallScheduleEntry

Reference-data call or put entry.

Fields are exercise_date and price. The constructor coerces price to Decimal. Used by BondReferenceData, not by CallableBond directly.

EmbeddedOptionBond

Protocol for bonds with workout yields or put schedules.

Methods: yield_to_worst() and put_schedule(). It is a shape contract, not a concrete bond.

FloatingRateNote

Concrete floating-rate bond.

Stores index, quoted spread, reset frequency, current reference rate, optional cap/floor, and rules. Useful methods: new(), index(), quoted_spread(), cap_rate(), floor_rate(), current_reference_rate(), current_coupon_rate(), effective_rate(), required_fixing_dates(), period_coupon(), cash_flows(), projected_cash_flows(), cash_flows_with_fixings(), and accrued_interest(). Cap and floor are raw decimal rates.

FloatingRateNoteBuilder

Builder for FloatingRateNote.

Use new(), date/rate/currency/rules methods, with_index(), with_quoted_spread(), with_cap(), with_floor(), with_current_reference_rate(), with_index_definition(), and build(). Quoted spread is a raw decimal.

FloatingCouponBond

Protocol for floating-rate coupon objects.

Methods: index(), quoted_spread(), and current_coupon_rate().

FloatingRateTerms

Reference-data terms for a floating-rate note.

Constructor uppercases index_name and coerces spread, current reference rate, cap, and floor to Decimal. Method: rate_index() maps the name to RateIndex.

SinkingFundEntry

One sinking-fund payment date and factor.

Constructor coerces factor to Decimal and validates the schedule in SinkingFundSchedule.

SinkingFundPayment

Alias of SinkingFundEntry.

Same fields and behavior as SinkingFundEntry.

SinkingFundSchedule

Ordered principal-reduction schedule.

new() sorts entries. Methods: factor_on(), factor_for_payment(), and to_amortization(). Factors are raw decimal principal reductions.

SinkingFundBond

Fixed-coupon bond with scheduled principal reductions.

Useful methods include sinking_schedule(), factor_on(), amortization_schedule(), average_life(), yield_to_average_life(), plus the normal fixed-bond methods.

SinkingFundBondBuilder

Builder for SinkingFundBond.

Use fixed-bond builder methods plus with_sinking_schedule(), add_sinking_entry(), build_schedule(), and build().

TipsBond

Inflation-linked US Treasury-style bond.

Validates dated date, maturity, currency match with inflation convention, positive notional, coupon bounds, and frequency/rules match. Useful methods: new(), dated_date(), inflation_convention(), inflation_index_definition(), inflation_index_type(), base_reference_date(), reference_cpi(), index_ratio(), adjusted_principal(), final_principal_redemption(), projected_coupon_cash_flows(), projected_cash_flows(), cash_flow_schedule(), cash_flows(), and accrued_interest().

InflationLinkedBond

Protocol for inflation-linked bond objects.

Method: inflation_index_type(). It is not a concrete bond.

AmortizingBond

Protocol for bonds with principal reductions.

Method: amortization_schedule().

ZeroCouponBond

Concrete bond with one principal payment and no coupons.

Methods: identifiers(), currency(), notional(), issue_date(), maturity_date(), frequency(), rules(), cash_flows(), and accrued_interest(). Accrued interest is zero.

ScheduleConfig

Inputs for coupon schedule generation.

Fields are start/end dates, frequency, calendar, business-day convention, end-of-month flag, and stub rules. Methods: first_regular_date(), penultimate_date(), stub_type(), and uses_forward_generation().

Schedule

Generated coupon schedule.

Fields are unadjusted_dates, adjusted dates, and config. generate() validates dates, generates forward or backward, deduplicates, sorts, and applies the calendar.

AccruedInterestInputs

Inputs for accrued-interest calculations.

Holds settlement date, accrual period, coupon amount, coupon date, full coupon amount, and optional reference period bounds.

AccruedInterestCalculator

Accrued-interest calculation helpers.

Static methods: standard(), ex_dividend(), and irregular_period(). They validate accrual periods and use YieldCalculationRules.

SettlementCalculator

Resolves settlement date from trade date, calendar, and settlement rules.

Method: settlement_date(). You can pass YieldCalculationRules.*().settlement_rules.

Bond Types And Classification Records

Export

What It Represents

Behavior, Methods, And Properties

BondType

Bond kind used in reference data.

Used by BondReferenceData.to_instrument() to choose fixed, floating, callable, puttable, or zero-coupon construction.

IssuerType

Issuer category.

BondReferenceData uses it to choose default yield rules when no explicit rules are supplied. Corporate records default to corporate rules; others default to Treasury rules.

CreditRating

Rating bucket enum.

Method: score() returns an ordered numeric score for comparison.

RatingInfo

Rating metadata record.

Fields are rating, optional agency, and optional outlook.

RateIndex

Floating-rate index enum.

Method: display_name() returns a readable index name. FloatingRateTerms.rate_index() maps text to this enum.

Sector

Sector enum.

Used by issuer and reference data.

SectorInfo

Sector metadata record.

Fields are sector, optional issuer, optional country, optional region, and optional subsector.

Seniority

Capital-structure seniority enum.

Used in reference data and spread/risk grouping.

SeniorityInfo

Seniority metadata record.

Fields are seniority and secured.

ASWType

Asset-swap type enum.

Used by asset-swap calculators.

Quotes And Reference Data

Export

What It Represents

Behavior, Methods, And Properties

BondQuote

Market quote attached to one concrete bond.

Fields are instrument, clean/dirty price, accrued interest, yield-to-maturity, yield-to-worst, as_of, source, currency, regressors, and fit weight. Decimal fields are coerced to Decimal. Source is stripped. Currency must match the bond. Regressors and fit weight must be finite floats. Methods/properties: instrument_id and resolved_settlement_date().

deliverable_bpv_regressor

Encodes a deliverable-bond BPV regressor.

Returns bpv as a float when deliverable, otherwise 0.0. Rejects non-finite values.

BondReferenceData

Static bond record that can build an instrument.

Coerces identifiers and decimal fields, sorts call/put schedules, normalizes text fields, validates non-negative outstanding amount and liquidity score. Method: to_instrument().

BondReferenceSource

Protocol for lookup by instrument id.

Method: get_bond_reference().

IssuerReferenceData

Static issuer record.

Strips issuer text, uppercases country, and rejects empty issuer names.

IssuerReferenceSource

Protocol for issuer lookup.

Method: get_issuer_reference().

RatingRecord

Rating record keyed by instrument or issuer.

Strips rating, agency, outlook, and issuer name. Parses instrument_id when supplied.

RatingSource

Protocol for rating lookup.

Method: get_rating().

EtfHoldingsSource

Protocol for ETF holdings lookup.

Method: get_etf_holdings().

ReferenceDataProvider

Small delegating provider over optional sources.

Methods: get_bond_reference(), get_issuer_reference(), get_rating(), and get_etf_holdings(). Missing sources return None or an empty tuple.

Pricing And Yield Engines

Export

What It Represents

Behavior, Methods, And Properties

BondPricer

Main price/yield converter for bonds.

Methods: price_from_curve(), price_from_yield(), yield_from_price(), and yield_to_maturity(). Prices are percent of par. TIPS are routed to TipsPricer. Price currency must match bond currency when solving yield.

TipsPricer

Real-yield pricer for TipsBond.

Methods: accrued_interest(), present_value_from_real_yield(), dirty_price_from_real_yield(), clean_price_from_real_yield(), price_from_real_yield(), real_yield_from_clean_price(), and risk_metrics_from_real_yield(). Uses projected inflation-adjusted cash flows.

PriceResult

Clean/dirty price result.

Fields are dirty, clean, and accrued. Properties: dirty_price, clean_price, accrued_interest, and present_value. present_value is dirty price as percent of par.

BondResult

Alias of PriceResult.

Same fields and properties as PriceResult.

YieldResult

Result from BondPricer.yield_from_price().

Fields are ytm and engine. This is not the same class returned by YieldSolver.solve().

YieldEngineResult

Lower-level solver result.

Fields are yield_rate, iterations, converged, residual, method, and convention.

CashFlowData

Solver input cash flow.

Fields are settlement-relative years and cash-flow amount in percent-of-par terms.

StandardYieldEngine

Low-level price/yield engine.

Methods: yield_from_price() and dirty_price_from_yield(). The one-layer public import uses the pricing engine version.

YieldEngine

Protocol for price/yield engines.

Methods: yield_from_price(), dirty_price_from_yield(), and clean_price_from_yield().

YieldSolver

Standalone numerical yield solver.

Method: solve(). It solves from dirty price, cash-flow amounts, times, frequency, and convention. It translates bond pricing failures into analytics errors.

RiskMetrics

Pricing-layer duration, convexity, and DV01 record.

Fields are modified_duration, macaulay_duration, convexity, and dv01. Properties: duration and pv01. Class methods: from_bond() and from_projected_cashflows(). pv01 is an alias for dv01.

DurationResult

Alias of RiskMetrics.

Same fields, properties, and class methods as RiskMetrics.

current_yield

Current yield from coupon rate and clean price.

Returns raw decimal. Clean price is percent of par.

current_yield_pct

Display current yield from coupon rate and clean price.

Returns percentage points.

current_yield_simple

Float current-yield helper.

Returns raw decimal using float arithmetic.

current_yield_simple_pct

Float current-yield display helper.

Returns percentage points.

current_yield_from_amount

Current yield from coupon amount and clean price.

Coupon amount is annual cash coupon per 100 face. Returns raw decimal.

current_yield_from_amount_pct

Display current yield from coupon amount.

Returns percentage points.

current_yield_from_bond

Current yield from a bond-like object.

Reads coupon_rate from a method or attribute. Returns raw decimal.

current_yield_from_bond_pct

Display current yield from a bond-like object.

Returns percentage points.

simple_yield

Simple annualized yield helper.

Uses coupon amount, price, redemption value, and years. Returns raw decimal.

simple_yield_f64

Float version of simple yield.

Returns a float raw decimal.

street_convention_yield

Street-convention yield helper.

Returns raw decimal yield using street-style inputs.

true_yield

Adjusts a street yield by settlement adjustment.

Inputs and output are percentage-point display values in the YAS path.

settlement_adjustment

Computes the adjustment between street and true yield.

Used by true_yield().

discount_yield

Money-market discount yield.

Returns percentage points. Inputs are face value, price, and days to maturity.

bond_equivalent_yield

Bond-equivalent money-market yield.

Returns percentage points.

cd_equivalent_yield

Certificate-of-deposit equivalent yield.

Returns percentage points.

money_market_yield

Default money-market yield.

Returns percentage points and currently maps to bond-equivalent yield.

money_market_yield_with_horizon

Money-market yield with a horizon argument.

Returns the base money-market yield; the current implementation does not change the result for horizon.

discount_yield_simple

Simple discount-yield helper.

Returns raw decimal in the YieldEngine helper set.

bond_equivalent_yield_simple

Simple bond-equivalent helper.

Returns raw decimal in the YieldEngine helper set.

RollForwardMethod

Short-date roll-forward decision enum.

Used by ShortDateCalculator.

ShortDateCalculator

Decides when short-dated bonds use money-market logic.

Constructors: new() and bloomberg(). Methods: is_short_dated(), use_money_market_below(), and roll_forward_method().

Risk

Export

What It Represents

Behavior, Methods, And Properties

BondRiskMetrics

Risk result record.

Fields are modified_duration, macaulay_duration, convexity, and dv01. DV01 is percent-of-par per 1 bp.

BondRiskCalculator

Convenience wrapper around risk functions for one bond/yield/date.

Methods: modified_duration(), macaulay_duration(), convexity(), dv01(), and all_metrics().

EffectiveDurationCalculator

Bumped-duration calculator.

Field bump is a raw decimal yield shift. Method: calculate().

Duration

Small value wrapper for a duration.

Method: as_decimal().

DurationType

Alias of Duration.

Same behavior as Duration.

Convexity

Small value wrapper for convexity.

Method: as_decimal().

DV01

Small value wrapper for DV01.

Method: as_decimal().

KeyRateDuration

One key-rate duration point.

Fields are tenor and duration.

KeyRateDurations

Collection of key-rate duration points.

Field items; method as_dict().

KeyRateDurationCalculator

Key-rate bumped curve calculator.

Field bump; method calculate().

HedgeDirection

Hedge direction enum.

Values describe whether the hedge should be long or short.

HedgeRecommendation

Hedge recommendation record.

Fields are ratio, direction, and optional reason.

Position

Duration/price/face position for portfolio risk.

Methods: dv01() returns cash DV01 using face; market_value() returns dirty-price market value.

PortfolioRisk

Aggregated portfolio risk record.

Fields are total cash dv01 and market-value-weighted duration.

VaRMethod

Value-at-risk method enum.

Values are historical and parametric.

VaRResult

Value-at-risk result.

Fields are value, confidence, and method.

DEFAULT_BUMP_SIZE

Standard yield bump.

Raw decimal 1 bp bump used by risk functions.

SMALL_BUMP_SIZE

Smaller yield bump.

Raw decimal bump for high-precision sensitivity calculations.

modified_duration

Calculates modified duration from bond, yield, and settlement date.

Returns a raw duration number. Uses a 1 bp finite difference around the dirty price/yield relation.

macaulay_duration

Calculates Macaulay duration.

Returns a raw duration number.

modified_from_macaulay

Converts Macaulay duration to modified duration.

Uses compounding frequency from the yield when possible; defaults to semiannual-like behavior when frequency is omitted.

effective_duration

Bumped effective duration.

Uses price down and price up around a raw decimal yield bump.

analytical_convexity

Analytical convexity with fallback.

Falls back to effective_convexity() if the analytical path cannot compute.

effective_convexity

Bumped convexity.

Uses dirty prices at yield plus/minus bump.

price_change_with_convexity

Estimates price change from duration and convexity.

Inputs are duration, convexity, price, and raw yield change.

dv01_per_100_face

DV01 for 100 face.

Uses modified duration and dirty price. Result is percent-of-par cash change for 100 face.

dv01_from_duration

Cash DV01 from duration, dirty price, and face.

dirty_price is percent of par; face is currency amount.

dv01_from_prices

DV01 from down/up bumped prices.

Returns (price_down - price_up) / 2.

notional_from_dv01

Face amount needed for a target DV01.

Requires non-zero duration and price.

key_rate_duration_at_tenor

Single-tenor key-rate duration.

Adds the requested tenor to the grid when missing.

spread_duration

Duration to a spread move.

Uses yield duration when no curve is supplied; uses shifted discount curve when a curve is supplied.

duration_hedge_ratio

Hedge ratio from target and hedge duration/price/face.

Returns target dollar duration divided by hedge dollar duration.

dv01_hedge_ratio

Hedge ratio from target and hedge DV01.

Returns zero when hedge DV01 is zero.

aggregate_portfolio_risk

Aggregates a list of Position records.

Empty list returns zero DV01 and zero weighted duration.

historical_var

Historical value-at-risk from return observations.

Returns zero for empty returns. Confidence must be between 0 and 1.

parametric_var

Normal-curve value-at-risk from return observations.

Returns zero for empty returns.

parametric_var_from_dv01

Value-at-risk from DV01 and a shock size in basis points.

Uses absolute DV01 and absolute shock.

Spreads, Asset Swaps, And Funding Adjustments

Export

What It Represents

Behavior, Methods, And Properties

SecurityId

Typed security identifier for spread analytics.

Constructors: cusip(), cusip_unchecked(), isin(), sedol(), and figi(). cusip(), isin(), sedol(), and figi() validate. Methods: id_type(), as_str(), and __str__().

BenchmarkKind

Benchmark selection enum.

Used inside BenchmarkSpec.

BenchmarkSpec

Benchmark-selection record.

Constructors: interpolated(), nearest(), ten_year(), five_year(), and explicit(). Method: description(). Explicit yield is a raw decimal.

GovernmentBenchmark

One government curve point.

Fields are tenor and raw decimal yield_rate.

GovernmentCurve

Sparse government curve with interpolation.

Methods: add_benchmark(), benchmark_for_tenor(), nearest_benchmark(), interpolated_yield(), yield_for_tenor(), yield_for_date(), us_treasury(), and uk_gilt(). Ties in nearest lookup choose the shorter tenor.

GSpreadCalculator

Curve-backed government-spread calculator.

Methods: spread_decimal() and spread_bps(). Decimal spreads are raw decimals; bps spreads are basis points.

ISpreadCalculator

Curve-backed swap-spread calculator.

Methods: spread_decimal() and spread_bps(). It reads a zero rate from the supplied curve at bond maturity.

DiscountMarginCalculator

Floating-rate discount-margin solver.

Methods: calculate(), price_with_dm(), spread_dv01(), and spread_duration(). Discount margin is a raw decimal. spread_dv01() uses (price_down - price_up) / 2.

OASCalculator

Option-adjusted spread calculator.

Methods: calculate(), price_with_oas(), effective_duration(), effective_convexity(), and option_value(). OAS is a raw decimal spread.

ParParAssetSwap

Par/par asset-swap calculator.

Method: calculate().

ProceedsAssetSwap

Proceeds asset-swap calculator.

Method: calculate().

ReferenceRateBreakdown

Repo-to-term funding breakdown.

Fields hold raw decimal rates and ladder differences, including total_funding_basis.

CompoundingConvexityBreakdown

Term-rate compounding/convexity adjustment record.

Fields hold raw decimal adjustment pieces.

SpreadAdjustmentBreakdown

One named spread adjustment.

Coerces spread_adjustment to Decimal; strips name and description.

SpreadAdjustment

Protocol for spread overlay objects.

Methods: breakdown() and spread_adjustment().

BaseSpreadAdjustment

Base class for spread overlay classes.

spread_adjustment() returns breakdown().spread_adjustment; subclasses implement breakdown().

SpreadAdjustmentSummary

Base spread plus component overlays.

Fields are base_spread, total_adjustment, adjusted_spread, and component breakdowns. Numeric fields are coerced to Decimal.

BalanceSheetSpreadOverlay

Container for spread adjustments.

Methods: summary(), apply(), and apply_to_funding_spread().

FundingSpreadOverlayResult

Funding-spread overlay result.

Fields are base funding spread, adjusted funding spread, optional credit spread, optional all-in spread, and overlay summary.

CapitalSpreadAdjustment

Capital-charge overlay object.

Stores exposure, risk weight, capital ratio, hurdle rate, pass-through, and name. Method: breakdown().

CapitalAdjustmentBreakdown

Capital overlay breakdown.

Includes capital consumed, annual capital cost, passed-through cost, and raw decimal spread adjustment.

HaircutSpreadAdjustment

Haircut-funding overlay object.

Stores collateral value, haircut, repo rate, haircut funding rate, year fraction, optional financing base, and name. Method: breakdown().

HaircutAdjustmentBreakdown

Haircut overlay breakdown.

Includes haircut amount, drag amount, financing base, and spread adjustment.

ShadowCostSpreadAdjustment

Shadow-cost overlay object.

Stores shadow cost rate, utilization or usage/capacity, pass-through, and name. Method: breakdown().

ShadowCostAdjustmentBreakdown

Shadow-cost overlay breakdown.

Includes utilization, optional usage/capacity, pass-through, and spread adjustment.

SecuredUnsecuredBasisModel

Protocol for secured/unsecured overnight basis models.

Method: basis().

GQDSecuredUnsecuredBasisModel

GQD-style secured/unsecured basis model.

Method: basis().

Sovereign

Sovereign issuer helper.

Methods: currency(), bond_name(), standard_tenors(), us_treasury(), uk_gilt(), and german_bund().

SupranationalIssuer

Supranational issuer classification.

Use for spread/reference classification where issuer is not one sovereign.

g_spread

Bond yield minus government yield.

Returns raw decimal. Positive means bond yield is above benchmark yield.

g_spread_bps

G-spread in basis points.

Returns g_spread() * 10000.

g_spread_with_benchmark

G-spread against a GovernmentCurve.

Returns raw decimal using interpolated, nearest, tenor-specific, or explicit benchmark selection.

g_spread_with_benchmark_bps

Curve-backed G-spread in basis points.

Returns basis points.

i_spread

Bond yield minus swap rate.

Returns raw decimal.

i_spread_bps

I-spread in basis points.

Returns i_spread() * 10000.

z_spread

Solves Z-spread from bond, clean price, curve, and settlement date.

Adds accrued interest to clean price before solving. Returns raw decimal.

z_spread_from_curve

Solves Z-spread from explicit cash flows and dirty price.

Returns raw decimal.

z_discount_margin

Z-style discount margin helper.

Returns raw decimal spread.

simple_margin

Simple margin helper for floating-rate pricing.

Returns raw decimal margin.

reference_rate_decomposition

Breaks funding rates into repo, GC, overnight unsecured, and term pieces.

Returns ReferenceRateBreakdown. All inputs and outputs are raw decimals.

simple_to_compounded_equivalent_rate

Converts simple rate to compounded equivalent.

Returns raw decimal rate.

compounding_convexity_breakdown

Builds compounding and convexity adjustment breakdown.

Returns CompoundingConvexityBreakdown.

adjusted_term_rate

Applies compounding and convexity adjustments to a term rate.

Returns raw decimal rate.

compose_spread_adjustments

Adds component spread adjustments to a base spread.

Returns SpreadAdjustmentSummary.

apply_balance_sheet_overlays

Applies adjustment objects to a base spread.

Returns SpreadAdjustmentSummary.

apply_funding_spread_overlays

Applies adjustment objects to a funding spread and optional credit spread.

Returns FundingSpreadOverlayResult.

capital_adjustment_breakdown

Computes capital overlay details.

Validates positive exposure, non-negative risk weight/hurdle/pass-through, and capital ratio between 0 and 1.

capital_spread_adjustment

Computes only the raw decimal capital spread adjustment.

Uses the same validation as capital_adjustment_breakdown().

haircut_adjustment_breakdown

Computes haircut funding-drag details.

Validates positive collateral value, positive financing base, positive year fraction, and haircut between 0 and 1.

haircut_spread_adjustment

Computes only the raw decimal haircut spread adjustment.

Uses the same validation as haircut_adjustment_breakdown().

utilization_ratio

Computes usage divided by capacity.

Requires non-negative usage and positive capacity.

shadow_cost_adjustment_breakdown

Computes shadow-cost overlay details.

Accepts direct utilization or usage/capacity. Requires non-negative rates and pass-through.

shadow_cost_spread_adjustment

Computes only the raw decimal shadow-cost spread adjustment.

Uses the same validation as shadow_cost_adjustment_breakdown().

secured_unsecured_overnight_basis

Computes secured/unsecured overnight basis.

Returns raw decimal basis.

YAS And Settlement Output

Export

What It Represents

Behavior, Methods, And Properties

YASCalculator

Builds Bloomberg-style bond analysis output.

Methods: calculate() and validate_bloomberg(). calculate() solves yield from clean price, computes display yields, spreads, risk, and settlement invoice.

BatchYASCalculator

Runs one YASCalculator over many bonds.

Method: calculate_many(). Bond and price list lengths must match.

YasAnalysis

YAS output record.

Yields are percentage points; spreads are basis points. Fields include YTM, street yield, true yield, current yield, simple yield, optional money-market yield, spreads, benchmark tenor, risk, and invoice. Methods: modified_duration(), convexity(), and dv01().

YASResult

Alias of YasAnalysis.

Same fields and methods as YasAnalysis.

YasAnalysisBuilder

Builder for YasAnalysis.

Method: build(). It validates required yield, current-yield, simple-yield, risk, and invoice fields.

BloombergReference

Reference values for YAS validation.

Constructor stores expected YTM, spreads, duration, and convexity. Class method: boeing_2025().

ValidationFailure

One YAS validation mismatch.

Fields are field, expected, actual, and tolerance.

SettlementInvoice

Settlement invoice result.

Fields include settlement date, clean price, accrued interest, dirty price, accrued days, principal cash amount, accrued cash amount, settlement cash amount, and face value.

SettlementInvoiceBuilder

Builder for SettlementInvoice.

Method: build(). Clean price and accrued interest are percent of par. Principal, accrued amount, and settlement amount are cash.

calculate_accrued_amount

Converts percent-of-par accrued interest to cash.

Returns face_value * accrued_interest / 100.

calculate_proceeds

Adds principal and accrued cash.

Returns settlement cash amount.

calculate_settlement_date

Resolves settlement date from trade date and settlement rules.

The required rules object is available as YieldCalculationRules.*().settlement_rules.

Callable-Bond Options

Export

What It Represents

Behavior, Methods, And Properties

BondOption

Option on a bond.

Fields are expiry, strike, optional bond, optional model, option type, exercise style, and valuation date. Strike is coerced to Decimal and must be positive. Method: price().

BinomialTree

Recombining tree over event dates.

Constructor new() sorts and deduplicates dates and requires at least two dates. Methods: value_lattice() and price_cashflows().

HullWhiteModel

Short-rate model used by the tree pricer.

Coerces mean reversion and volatility to Decimal; both must be non-negative. Methods: base_forward_rate(), short_rate(), node_rate(), and discount().

ExerciseStyle

Bond-option exercise timing enum.

Values are European and American. American exercise compares immediate payoff with continuation value at each node.

Exceptions

Export

What It Means

BondError

Base bond-domain error with constructors invalid_spec(), missing_field(), and pricing_failed().

AnalyticsError

Analytics-layer error with constructors invalid_input(), invalid_settlement(), yield_solver_failed(), pricing_failed(), and spread_failed().

IdentifierError

Base identifier error.

InvalidIdentifier

Invalid identifier value.

InvalidBondSpec

Invalid bond specification, such as bad dates, coupon bounds, or frequency/rules mismatch.

MissingRequiredField

Builder is missing a required field.

BondPricingError

Bond pricing failed.

YieldConvergenceFailed

Yield solver did not converge.

ScheduleError

Schedule generation failed.

SettlementError

Settlement calculation failed.

InvalidInput

Analytics input is invalid.

InvalidSettlement

Settlement date is invalid for the requested calculation.

YieldSolverError

Yield solver failed at the analytics layer.

PricingError

Pricing failed at the analytics layer.

SpreadError

Spread calculation failed.

Boundaries

  • Built fitted curves live in fuggers_py.curves.

  • Inflation fixings, CPI history, and index-ratio helpers live in fuggers_py.inflation.

  • CDS instruments and CDS pricing live in fuggers_py.credit.

  • Repo and financing analytics live in fuggers_py.funding.

  • Portfolio aggregation outside bond-specific Position helpers lives in fuggers_py.portfolio.

First-layer public facade for bond-domain objects.

class fuggers_py.bonds.AccruedInterestCalculator

Accrued-interest routines for standard and irregular coupon periods.

static standard(inputs, *, rules)

Return accrued interest for the supplied bond rules.

Parameters:
  • inputs (AccruedInterestInputs) – Coupon-period inputs for the settlement being priced.

  • rules (YieldCalculationRules) – Yield and accrual rules that define the day-count basis and accrued interest convention.

Returns:

Accrued coupon amount in currency units, not percent-of-par.

Return type:

Decimal

static ex_dividend(inputs, *, rules)

Return accrued interest after applying ex-dividend detachment rules.

Return type:

Decimal

Parameters:
static irregular_period(inputs, *, rules)

Return accrued interest for stub periods using the active rules.

Return type:

Decimal

Parameters:
class fuggers_py.bonds.AccruedInterestInputs(settlement_date, accrual_start, accrual_end, coupon_amount, coupon_date, full_coupon_amount, period_start=None, period_end=None)

Inputs for coupon accrual calculations.

Parameters:
  • settlement_date (Date) – Settlement date at which accrued interest is measured.

  • accrual_start (Date) – Unadjusted coupon-accrual bounds for the active coupon period.

  • accrual_end (Date) – Unadjusted coupon-accrual bounds for the active coupon period.

  • coupon_amount (Decimal) – Coupon cash amount earned over the active accrual period.

  • coupon_date (Date) – Adjusted payment date for the coupon period.

  • full_coupon_amount (Decimal) – Full coupon amount used by ex-dividend logic when the next coupon is economically detached from the bond.

  • period_start (Date | None) – Optional reference-period bounds used by ICMA-style stub accrual.

  • period_end (Date | None) – Optional reference-period bounds used by ICMA-style stub accrual.

fuggers_py.bonds.AccelerationOption

alias of CallType

exception fuggers_py.bonds.AnalyticsError

Base exception for bond analytics failures.

class fuggers_py.bonds.AmortizingBond(*args, **kwargs)

Protocol for bonds with a principal amortization schedule.

amortization_schedule()

Return the scheduled principal reductions.

Return type:

AmortizationSchedule

class fuggers_py.bonds.ASWType(value)

Asset-swap quote convention.

class fuggers_py.bonds.BaseSpreadAdjustment

Base class for spread adjustments with a default scalar implementation.

breakdown()

Return the detailed adjustment breakdown.

Return type:

SpreadAdjustmentBreakdown

spread_adjustment()

Return the raw decimal spread adjustment.

Return type:

Decimal

class fuggers_py.bonds.BalanceSheetSpreadOverlay(adjustments=())

Container for composable balance-sheet spread adjustments.

Parameters:

adjustments (tuple[SpreadAdjustment, ...])

summary(*, base_spread=Decimal('0'))

Return the overlay summary for a base spread.

Return type:

SpreadAdjustmentSummary

Parameters:

base_spread (object)

apply(*, base_spread=Decimal('0'))

Alias for summary().

Return type:

SpreadAdjustmentSummary

Parameters:

base_spread (object)

apply_to_funding_spread(*, base_funding_spread, credit_spread=None)

Apply the overlay to a funding spread and optional credit spread.

Return type:

FundingSpreadOverlayResult

Parameters:
  • base_funding_spread (object)

  • credit_spread (object | None)

class fuggers_py.bonds.BatchYASCalculator(calculator)

Apply a single YAS calculator across many bonds.

Parameters:

calculator (YASCalculator) – Shared calculator instance used for each bond-price pair.

calculate_many(bonds, clean_prices, settlement_date)

Return YAS analyses for each bond-price pair in order.

Return type:

list[YasAnalysis]

Parameters:
  • bonds (list[Bond])

  • clean_prices (list[Price | Decimal])

  • settlement_date (Date)

class fuggers_py.bonds.BenchmarkKind(value)

Benchmark selection mode for government-curve comparisons.

class fuggers_py.bonds.BenchmarkSpec(kind, tenor=None, explicit_yield=None)

Government-curve benchmark selection and explicit override.

Parameters:
  • kind (BenchmarkKind)

  • tenor (Tenor | None)

  • explicit_yield (Decimal | None)

kind

Benchmark selection mode.

tenor

Optional tenor used when kind is TENOR.

explicit_yield

Raw decimal benchmark yield used when kind is EXPLICIT.

classmethod interpolated()

Select the interpolated government-curve yield.

Return type:

BenchmarkSpec

classmethod nearest()

Select the nearest benchmark tenor.

Return type:

BenchmarkSpec

classmethod ten_year()

Select the 10Y benchmark tenor.

Return type:

BenchmarkSpec

classmethod five_year()

Select the 5Y benchmark tenor.

Return type:

BenchmarkSpec

classmethod explicit(yield_value)

Select an explicit raw-decimal benchmark yield.

Return type:

BenchmarkSpec

Parameters:

yield_value (object)

description()

Return a human-readable benchmark description.

Return type:

str

class fuggers_py.bonds.BinomialTree(model, dates)

Recombining binomial tree over a sorted set of event dates.

The tree propagates bond cash flows or option payoffs through a recombining short-rate lattice on the supplied event dates.

Parameters:
  • model (ShortRateModel)

  • dates (tuple[Date, ...])

classmethod new(model, dates)

Create a tree from a model and a set of event dates.

Return type:

BinomialTree

Parameters:
  • model (ShortRateModel)

  • dates (list[Date])

value_lattice(cashflows, *, spread=Decimal('0'), coupon_map=None, principal_map=None)

Return the bond value lattice discounted with an additive spread.

spread is a raw decimal spread added to the short rate in the discount factor. The optional maps override the cash-flow allocation by date when the caller needs custom coupon/principal splits.

Return type:

list[list[float]]

Parameters:
  • cashflows (list[BondCashFlow])

  • spread (Decimal)

  • coupon_map (dict[Date, Decimal] | None)

  • principal_map (dict[Date, Decimal] | None)

price_cashflows(cashflows, *, spread=Decimal('0'), exercise=None, coupon_map=None, principal_map=None)

Price cash flows across the tree, optionally applying exercise logic.

Return type:

Decimal

Parameters:
  • cashflows (list[BondCashFlow])

  • spread (Decimal)

  • exercise (Callable[[Date, float, float], float] | None)

  • coupon_map (dict[Date, Decimal] | None)

  • principal_map (dict[Date, Decimal] | None)

class fuggers_py.bonds.BloombergReference(ytm, g_spread_bps, z_spread_bps, modified_duration, convexity)

Reference values used by the Bloomberg validation helper.

Parameters:
  • ytm (Decimal)

  • g_spread_bps (Decimal)

  • z_spread_bps (Decimal)

  • modified_duration (Decimal)

  • convexity (Decimal)

classmethod boeing_2025()

Return the Boeing 2025 reference values used by the tests.

Return type:

BloombergReference

class fuggers_py.bonds.Bond

Minimal bond interface used by pricing and cash-flow tooling.

Parameters:

None – This is an abstract contract, not a concrete data object.

Notes

Implementations are expected to return raw-decimal coupons and accrued interest in the bond’s quoted price basis. Schedule dates may be adjusted for payment, but the underlying accrual logic should remain visible through the returned cash-flow objects.

abstractmethod identifiers()

Return the bond’s identifier set, such as ISIN or CUSIP.

Return type:

BondIdentifiers

abstractmethod currency()

Return the bond currency.

Return type:

Currency

abstractmethod notional()

Return the bond notional used to scale cash flows.

Return type:

Decimal

abstractmethod issue_date()

Return the issue/effective date.

Return type:

Date

abstractmethod maturity_date()

Return the contractual maturity date.

Return type:

Date

abstractmethod frequency()

Return the coupon frequency used to build the schedule.

Return type:

Frequency

abstractmethod rules()

Return the yield and accrual rules used by the bond.

Return type:

YieldCalculationRules

abstractmethod cash_flows(from_date=None)

Return future cash flows sorted by date.

Parameters:

from_date (Date | None) – Optional cutoff date. When supplied, only flows strictly after this date are returned.

Return type:

list[BondCashFlow]

abstractmethod accrued_interest(settlement_date)

Return accrued interest in the bond’s quoted price basis.

Return type:

Decimal

Parameters:

settlement_date (Date)

max_date()

Return the latest contractual date used by analytics.

Return type:

Date

next_coupon_date(settlement_date)

Return the next coupon date strictly after settlement.

Return type:

Date | None

Parameters:

settlement_date (Date)

previous_coupon_date(settlement_date)

Return the most recent coupon date on or before settlement.

Return type:

Date | None

Parameters:

settlement_date (Date)

class fuggers_py.bonds.BondAnalytics

Convenience mixin providing common bond analytics wrappers.

The mixin keeps pricing, yield, and risk calls close to the bond object while delegating the actual calculations to the pricing engine.

price_from_yield(ytm, settlement_date)

Return the settlement-date price implied by ytm.

Return type:

PriceResult

Parameters:
  • self (Bond)

  • ytm (Yield)

  • settlement_date (Date)

yield_from_price(clean_price, settlement_date)

Return the yield implied by a clean price.

Return type:

YieldResult

Parameters:
  • self (Bond)

  • clean_price (Price)

  • settlement_date (Date)

risk_metrics(ytm, settlement_date)

Return duration, convexity, and DV01 for the bond.

Return type:

RiskMetrics

Parameters:
  • self (Bond)

  • ytm (Yield)

  • settlement_date (Date)

modified_duration(ytm, settlement_date)

Return modified duration as a positive sensitivity magnitude.

Return type:

Decimal

Parameters:
  • self (Bond)

  • ytm (Yield)

  • settlement_date (Date)

class fuggers_py.bonds.BondCashFlow(date, amount, flow_type, accrual_start=None, accrual_end=None, factor=Decimal('1'), reference_rate=None)

Single bond cash flow with optional accrual metadata.

Parameters:
  • date (Date) – Payment date, usually the adjusted coupon or redemption date.

  • amount (Decimal) – Cash amount before factoring.

  • flow_type (CashFlowType) – Classification of the flow.

  • accrual_start (Date | None) – Optional unadjusted accrual bounds for coupon flows.

  • accrual_end (Date | None) – Optional unadjusted accrual bounds for coupon flows.

  • factor (Decimal) – Remaining-principal or adjustment factor applied to amount.

  • reference_rate (Decimal | None) – Optional projected index or coupon rate attached to floating flows.

Notes

factor scales the payment amount, which is used for amortizing bonds and for cases where projected cash flows should be adjusted by a remaining principal fraction.

is_coupon()

Return whether the cash flow contains coupon cash.

Return type:

bool

is_principal()

Return whether the cash flow contains principal repayment.

Return type:

bool

factored_amount()

Return the amount after applying the cash-flow factor.

Return type:

Decimal

exception fuggers_py.bonds.BondError

Base exception for bond and bond-convention failures.

class fuggers_py.bonds.BondOption(expiry, strike, bond=None, model=None, option_type=OptionType.CALL, exercise_style=ExerciseStyle.EUROPEAN, valuation_date=None)

Option on a bond valued by a short-rate recombining tree.

The option is priced off the bond’s cash flows and a supplied short-rate model. The returned value is in the same pricing units as the bond cash-flow lattice, not a quoted yield.

Parameters:
  • expiry (Date)

  • strike (Decimal)

  • bond (Bond | None)

  • model (ShortRateModel | None)

  • option_type (OptionType)

  • exercise_style (ExerciseStyle)

  • valuation_date (Date | None)

price(*, bond=None, model=None, valuation_date=None)

Price the option with the configured or supplied bond and model.

The result is the option value in the same pricing units as the bond cash flows passed through the tree. American exercise compares the immediate payoff with the discounted continuation value at each node.

Return type:

Decimal

Parameters:
  • bond (Bond | None)

  • model (ShortRateModel | None)

  • valuation_date (Date | None)

class fuggers_py.bonds.BondPricer(engine=StandardYieldEngine(tolerance=1e-10, max_iterations=100))

Convert between bond yields and clean/dirty prices.

The pricer works in percent-of-par price space and maps yields through the bond’s configured compounding convention before discounting cash flows.

Parameters:

engine (StandardYieldEngine)

price_from_curve(bond, curve, settlement_date)

Price a bond from a discounting curve using settlement-relative discounting.

Return type:

PriceResult

Parameters:
  • bond (Bond)

  • settlement_date (Date)

price_from_yield(bond, ytm, settlement_date, *, fixing_source=None)

Return dirty and clean prices from a yield-to-maturity input.

The yield is converted to the bond’s configured compounding convention before discounting. The dirty price is the percent-of-par present value; the clean price excludes accrued interest.

Return type:

PriceResult

Parameters:
  • bond (Bond)

  • ytm (Yield)

  • settlement_date (Date)

  • fixing_source (object | None)

yield_from_price(bond, clean_price, settlement_date, *, fixing_source=None)

Return the yield implied by a clean price and settlement date.

Return type:

YieldResult

Parameters:
  • bond (Bond)

  • clean_price (Price)

  • settlement_date (Date)

  • fixing_source (object | None)

yield_to_maturity(bond, clean_price, settlement_date, *, fixing_source=None)

Return the yield implied by a clean price.

Return type:

Yield

Parameters:
  • bond (Bond)

  • clean_price (Price)

  • settlement_date (Date)

  • fixing_source (object | None)

exception fuggers_py.bonds.BondPricingError(reason)

Raised when pricing inputs do not admit a valid result.

Parameters:

reason (str)

Return type:

None

class fuggers_py.bonds.BondQuote(instrument, clean_price=None, dirty_price=None, accrued_interest=None, yield_to_maturity=None, yield_to_worst=None, as_of=None, source=None, currency=None, regressors=None, fit_weight=None)

Market quote bound to a concrete bond instrument.

regressors is the quote-level home for time-varying external variables used by GlobalFitCalibrator. Examples include issue_size_bn, issue_age_years, deliverable_bpv, and repo_specialness_bp. Those values live on the quote, not on the bond instrument, because they can change from one observation date to the next.

fit_weight is the quote-level weight used by GlobalFitCalibrator in its weighted least-squares fit.

Parameters:
  • instrument (Bond)

  • clean_price (Decimal | None)

  • dirty_price (Decimal | None)

  • accrued_interest (Decimal | None)

  • yield_to_maturity (Decimal | None)

  • yield_to_worst (Decimal | None)

  • as_of (Date | None)

  • source (str | None)

  • currency (Currency | None)

  • regressors (Mapping[str, float] | None)

  • fit_weight (float | None)

property instrument_id: InstrumentId

Return the instrument id of the bound bond.

resolved_settlement_date()

Return the pricing date carried by the quote.

Return type:

Date

class fuggers_py.bonds.BondReferenceData(instrument_id, bond_type, issuer_type, issue_date, maturity_date, currency=Currency.<bound method Currency.name of <Currency.USD: 'USD'>>, notional=Decimal('100'), coupon_rate=None, frequency=None, yield_rules=None, floating_rate_terms=None, call_schedule=<factory>, put_schedule=<factory>, issuer_name=None, sector=None, rating=None, amount_outstanding=None, benchmark_flag=None, futures_deliverable_flags=<factory>, liquidity_score=None)

Bond reference record used to construct bond instruments.

The record normalizes identifiers, sorts optional schedules, and uses the issuer type to infer default yield rules when none are supplied. Coupon rate, notional, and amount fields are stored as raw decimals.

Parameters:
  • instrument_id (InstrumentId)

  • bond_type (BondType)

  • issuer_type (IssuerType)

  • issue_date (Date)

  • maturity_date (Date)

  • currency (Currency)

  • notional (Decimal)

  • coupon_rate (Decimal | None)

  • frequency (Frequency | None)

  • yield_rules (YieldCalculationRules | None)

  • floating_rate_terms (FloatingRateTerms | None)

  • call_schedule (tuple[CallScheduleEntry, ...])

  • put_schedule (tuple[CallScheduleEntry, ...])

  • issuer_name (str | None)

  • sector (str | None)

  • rating (str | None)

  • amount_outstanding (Decimal | None)

  • benchmark_flag (bool | None)

  • futures_deliverable_flags (tuple[str, ...])

  • liquidity_score (Decimal | None)

to_instrument()

Convert the reference record into a bond instrument instance.

Fixed-rate and zero-coupon records are converted directly. Callable and puttable records use the sorted embedded exercise schedules, and floating-rate records require floating_rate_terms.

class fuggers_py.bonds.BondReferenceSource(*args, **kwargs)

Protocol for retrieving bond reference records by instrument id.

fuggers_py.bonds.BondResult

alias of PriceResult

class fuggers_py.bonds.BondRiskCalculator(bond, ytm, settlement_date, bump=0.0001)
Parameters:
  • bond (_BondLike)

  • ytm (Yield)

  • settlement_date (Date)

  • bump (float)

class fuggers_py.bonds.BondRiskMetrics(modified_duration, macaulay_duration, convexity, dv01)
Parameters:
  • modified_duration (Decimal)

  • macaulay_duration (Decimal)

  • convexity (Decimal)

  • dv01 (Decimal)

class fuggers_py.bonds.BondType(value)

Classification of the bond product for analytics and reporting.

class fuggers_py.bonds.CreditRating(value)

Issuer credit rating buckets.

score()

Return an ordinal score where lower numbers indicate stronger credit.

Return type:

int

class fuggers_py.bonds.CashFlowData(years, amount)

Single discounted cash flow used by the yield solver.

years is the settlement-relative year fraction and amount is the factored cash-flow amount in percent-of-par terms.

Parameters:
  • years (float)

  • amount (float)

class fuggers_py.bonds.CashFlowGenerator

Generate deterministic bond cashflow schedules from bond metadata.

static fixed_rate_bond_cashflows(*, schedule, coupon_rate, notional, rules)

Build coupon and principal cashflows for a fixed-rate bond.

Returns:

Cash flows ordered by payment date. Coupon-bearing instruments return coupon flows plus a final coupon-and-principal redemption amount. Zero-coupon schedules return principal repayment only.

Return type:

list[BondCashFlow]

Parameters:
  • schedule (Schedule)

  • coupon_rate (Decimal)

  • notional (Decimal)

  • rules (YieldCalculationRules)

static future_cashflows(cashflows, from_date)

Filter cash flows strictly after from_date when provided.

Return type:

list[BondCashFlow]

Parameters:
class fuggers_py.bonds.CashFlowType(value)

Classification of a bond cash flow.

class fuggers_py.bonds.CallEntry(call_date, call_price, call_type=CallType.EUROPEAN, call_end_date=None, make_whole_spread=None)

One callable exercise date and redemption price.

Parameters:
  • call_date (Date) – Exercise date.

  • call_price (Decimal) – Redemption price quoted in percent of par.

  • call_type (CallType) – Exercise style for the entry.

  • call_end_date (Date | None) – Optional end date for American-style windows.

  • make_whole_spread (Decimal | None) – Optional make-whole spread as a raw decimal.

is_exercisable_on(date, *, next_call_date=None)

Return whether the call may be exercised on date.

Return type:

bool

Parameters:
  • date (Date)

  • next_call_date (Date | None)

class fuggers_py.bonds.CallScheduleEntry(exercise_date, price)

Single callable or puttable exercise point.

Parameters:
  • exercise_date (Date) – Exercise date in the bond’s schedule, stored as a calendar date.

  • price (Decimal) – Exercise price as a raw decimal amount, typically per 100 notional.

class fuggers_py.bonds.CallSchedule(entries, protection_end_date=None)

Ordered collection of call exercises with optional protection.

Parameters:
  • entries (tuple[CallEntry, ...]) – Callable exercise entries.

  • protection_end_date (Date | None) – Optional end date for the call protection window.

classmethod new(entries, *, protection_end_date=None)

Create a schedule from an iterable of call entries.

Return type:

CallSchedule

Parameters:
  • entries (Iterable[CallEntry])

  • protection_end_date (Date | None)

is_protected(date)

Return whether date falls inside the call protection window.

Return type:

bool

Parameters:

date (Date)

future_entries(settlement_date)

Return call entries strictly after settlement_date.

Return type:

list[CallEntry]

Parameters:

settlement_date (Date)

first_call_after(settlement_date)

Return the first exercisable call after settlement, if any.

Return type:

CallEntry | None

Parameters:

settlement_date (Date)

entry_for_date(date, *, maturity_date=None)

Return the entry exercisable on date or None if protected.

Return type:

CallEntry | None

Parameters:
  • date (Date)

  • maturity_date (Date | None)

call_price_on(date, *, maturity_date=None)

Return the call redemption price on date if exercisable.

Return type:

Decimal | None

Parameters:
  • date (Date)

  • maturity_date (Date | None)

class fuggers_py.bonds.CallType(value)

Exercise style for a call schedule.

class fuggers_py.bonds.CallableBond(base_bond, call_schedule=None, put_schedule_data=None)

Fixed-rate bond with embedded call and/or put schedules.

Parameters:
  • base_bond (FixedBond) – Fixed-rate bond that serves as the base cash-flow stream.

  • call_schedule (CallSchedule | None) – Optional call schedule.

  • put_schedule_data (PutSchedule | None) – Optional put schedule.

Notes

Yield calculations are reported as raw decimal yields. Workout dates are the future call, put, and maturity dates that remain after settlement.

identifiers()

Return the bond’s identifier set, such as ISIN or CUSIP.

Return type:

BondIdentifiers

property instrument_id: InstrumentId | None

Return the wrapped base bond identity.

currency()

Return the bond currency.

Return type:

Currency

notional()

Return the bond notional used to scale cash flows.

Return type:

Decimal

issue_date()

Return the issue/effective date.

Return type:

Date

maturity_date()

Return the contractual maturity date.

Return type:

Date

frequency()

Return the coupon frequency used to build the schedule.

Return type:

Frequency

rules()

Return the yield and accrual rules used by the bond.

Return type:

YieldCalculationRules

cash_flows(from_date=None)

Return future cash flows sorted by date.

Parameters:

from_date (Date | None) – Optional cutoff date. When supplied, only flows strictly after this date are returned.

Return type:

list[BondCashFlow]

accrued_interest(settlement_date)

Return accrued interest in the bond’s quoted price basis.

Return type:

Decimal

Parameters:

settlement_date (Date)

is_callable_on(date)

Return whether the bond is callable on date.

Return type:

bool

Parameters:

date (Date)

put_schedule()

Return the embedded put schedule, if one exists.

Return type:

PutSchedule | None

first_call(settlement_date)

Return the first future call entry after settlement.

Return type:

CallEntry | None

Parameters:

settlement_date (Date)

next_call(settlement_date)

Alias for first_call().

Return type:

CallEntry | None

Parameters:

settlement_date (Date)

first_put(settlement_date)

Return the first future put entry after settlement.

Return type:

PutEntry | None

Parameters:

settlement_date (Date)

next_put(settlement_date)

Alias for first_put().

Return type:

PutEntry | None

Parameters:

settlement_date (Date)

is_putable_on(date)

Return whether the bond is putable on date.

Return type:

bool

Parameters:

date (Date)

call_price_on(date, *, benchmark_yield=None)

Return the call price on date.

For make-whole calls, benchmark_yield is the reference yield used to discount remaining cash flows at benchmark_yield + make_whole_spread. The make-whole value is floored at the contractual call price.

Return type:

Decimal | None

Parameters:
  • date (Date)

  • benchmark_yield (Decimal | None)

cash_flows_to_call(call_date)

Return cash flows truncated at the call date and redeemed there.

Return type:

list[BondCashFlow]

Parameters:

call_date (Date)

cash_flows_to_put(put_date)

Return cash flows truncated at the put date and redeemed there.

Return type:

list[BondCashFlow]

Parameters:

put_date (Date)

yield_to_maturity(clean_price, settlement_date)

Return the raw decimal yield to maturity.

Return type:

Decimal

Parameters:
  • clean_price (object)

  • settlement_date (Date)

yield_to_first_call(clean_price, settlement_date)

Return the raw decimal yield to the first future call.

Return type:

Decimal

Parameters:
  • clean_price (object)

  • settlement_date (Date)

yield_to_call(clean_price, settlement_date, call_date)

Return the raw decimal yield to the specified call date.

Return type:

Decimal

Parameters:
  • clean_price (object)

  • settlement_date (Date)

  • call_date (Date)

yield_to_first_put(clean_price, settlement_date)

Return the raw decimal yield to the first future put.

Return type:

Decimal

Parameters:
  • clean_price (object)

  • settlement_date (Date)

yield_to_put(clean_price, settlement_date, put_date)

Return the raw decimal yield to the specified put date.

Return type:

Decimal

Parameters:
  • clean_price (object)

  • settlement_date (Date)

  • put_date (Date)

yield_to_worst(clean_price, settlement_date)

Return the lowest raw decimal yield across maturity and workouts.

Return type:

Decimal

Parameters:
  • clean_price (object)

  • settlement_date (Date)

workout_dates(settlement_date)

Return sorted future workout dates after settlement.

Return type:

list[Date]

Parameters:

settlement_date (Date)

first_workout_date(settlement_date)

Return the earliest remaining workout date after settlement.

Return type:

Date

Parameters:

settlement_date (Date)

yield_to_first_workout(clean_price, settlement_date)

Return the raw decimal yield to the first future workout date.

Return type:

Decimal

Parameters:
  • clean_price (object)

  • settlement_date (Date)

class fuggers_py.bonds.CallableBondBuilder(base_bond=None, _entries=<factory>, _put_entries=<factory>, protection_end_date=None)

Fluent builder for CallableBond.

The builder collects optional call and put entries and combines them with a required base bond before instantiation.

Parameters:
  • base_bond (FixedBond | None)

  • _entries (list[CallEntry])

  • _put_entries (list[PutEntry])

  • protection_end_date (Date | None)

class fuggers_py.bonds.CapitalAdjustmentBreakdown(*, name, spread_adjustment, description=None, exposure, risk_weight, capital_ratio, hurdle_rate, pass_through, capital_consumed, annual_capital_cost, passed_through_cost)

Detailed capital spread adjustment breakdown.

Parameters:
  • name (str)

  • spread_adjustment (Decimal)

  • description (str | None)

  • exposure (Decimal)

  • risk_weight (Decimal)

  • capital_ratio (Decimal)

  • hurdle_rate (Decimal)

  • pass_through (Decimal)

  • capital_consumed (Decimal)

  • annual_capital_cost (Decimal)

  • passed_through_cost (Decimal)

class fuggers_py.bonds.CapitalSpreadAdjustment(exposure, risk_weight, capital_ratio, hurdle_rate, pass_through=Decimal('1'), name='capital')

Capital-charge spread adjustment with stored input assumptions.

Parameters:
  • exposure (Decimal)

  • risk_weight (Decimal)

  • capital_ratio (Decimal)

  • hurdle_rate (Decimal)

  • pass_through (Decimal)

  • name (str)

breakdown()

Return the capital adjustment breakdown.

Return type:

CapitalAdjustmentBreakdown

class fuggers_py.bonds.CompoundingConvexityBreakdown(simple_rate, year_fraction, compounded_equivalent_rate, compounding_adjustment, convexity_adjustment, adjusted_term_rate)

Breakdown of compounding and convexity adjustments in raw decimals.

Parameters:
  • simple_rate (Decimal)

  • year_fraction (Decimal)

  • compounded_equivalent_rate (Decimal)

  • compounding_adjustment (Decimal)

  • convexity_adjustment (Decimal)

  • adjusted_term_rate (Decimal)

simple_rate

Input simple rate.

year_fraction

Accrual fraction used in the conversion.

compounded_equivalent_rate

Compounded-equivalent rate.

compounding_adjustment

Difference between compounded-equivalent and simple rate.

convexity_adjustment

Additional convexity adjustment.

adjusted_term_rate

Final adjusted term rate.

class fuggers_py.bonds.Convexity(value)
Parameters:

value (Decimal)

class fuggers_py.bonds.DV01(value)
Parameters:

value (Decimal)

class fuggers_py.bonds.DiscountMarginCalculator(forward_curve, discount_curve, solver_config=SolverConfig(tolerance=1e-10, max_iterations=200))

Discount-margin solver and spread-sensitivity helper.

Parameters:
  • forward_curve (object) – Curve used for projected floating coupons.

  • discount_curve (DiscountingCurve) – Curve used for discounting future cash flows.

  • solver_config (SolverConfig) – Numerical solver configuration.

calculate(frn, dirty_price, settlement_date)

Solve the discount margin as a raw decimal spread.

Return type:

Decimal

Parameters:
price_with_dm(frn, dm_decimal, settlement_date)

Return the dirty price implied by a raw-decimal discount margin.

Return type:

Decimal

Parameters:
spread_dv01(frn, dm_decimal, settlement_date)

Return price change for a 1 bp discount-margin move.

Return type:

Decimal

Parameters:
spread_duration(frn, dm_decimal, settlement_date)

Return spread duration in spread-basis-point units.

Return type:

Decimal

Parameters:
class fuggers_py.bonds.Duration(value)
Parameters:

value (Decimal)

fuggers_py.bonds.DurationResult

alias of RiskMetrics

fuggers_py.bonds.DurationType

alias of Duration

class fuggers_py.bonds.EffectiveDurationCalculator(bump=0.0001)
Parameters:

bump (float)

fuggers_py.bonds.EmbeddedOptionBond

alias of CallableBond

class fuggers_py.bonds.EtfHoldingsSource(*args, **kwargs)

Protocol for retrieving ETF holdings as a normalized tuple.

class fuggers_py.bonds.ExerciseStyle(value)

Exercise timing supported by the tree pricer.

class fuggers_py.bonds.FixedBond(_issue_date, _maturity_date, _coupon_rate, _frequency, _currency=Currency.<bound method Currency.name of <Currency.USD: 'USD'>>, _notional=Decimal('100'), _identifiers=<factory>, _rules=<factory>, _stub_rules=None, instrument_id=None)

Plain fixed-rate coupon bond.

Parameters:
  • _issue_date (Date) – Bond issue and maturity dates.

  • _maturity_date (Date) – Bond issue and maturity dates.

  • _coupon_rate (Decimal) – Fixed coupon rate as a raw decimal.

  • _frequency (Frequency) – Coupon frequency used to build the schedule.

  • _currency (Currency) – Bond currency.

  • _notional (Decimal) – Face amount used to scale cash flows.

  • _identifiers (BondIdentifiers) – Optional identifier set.

  • _rules (YieldCalculationRules) – Yield and accrual rules.

  • _stub_rules (StubPeriodRules | None) – Optional explicit stub-period rules.

  • instrument_id (InstrumentId | None) – Optional stable instrument identifier.

Notes

Coupon rates are stored as raw decimal rates, so 0.05 means a 5 percent annual coupon. Cash flows are generated from the bond’s schedule and yield calculation rules, and accrued interest follows the configured accrued convention.

classmethod new(*, issue_date, maturity_date, coupon_rate, frequency, currency=Currency.<bound method Currency.name of <Currency.USD: 'USD'>>, notional=Decimal('100'), identifiers=None, rules=None, stub_rules=None, instrument_id=None)

Construct a fixed-rate bond from its contractual inputs.

Return type:

FixedBond

Parameters:
  • issue_date (Date)

  • maturity_date (Date)

  • coupon_rate (Decimal)

  • frequency (Frequency)

  • currency (Currency)

  • notional (Decimal)

  • identifiers (BondIdentifiers | None)

  • rules (YieldCalculationRules | None)

  • stub_rules (StubPeriodRules | None)

  • instrument_id (InstrumentId | None)

identifiers()

Return the bond’s identifier set, such as ISIN or CUSIP.

Return type:

BondIdentifiers

currency()

Return the bond currency.

Return type:

Currency

notional()

Return the bond notional used to scale cash flows.

Return type:

Decimal

issue_date()

Return the issue/effective date.

Return type:

Date

maturity_date()

Return the contractual maturity date.

Return type:

Date

frequency()

Return the coupon frequency used to build the schedule.

Return type:

Frequency

rules()

Return the yield and accrual rules used by the bond.

Return type:

YieldCalculationRules

cash_flows(from_date=None)

Return future cash flows from from_date onward.

Return type:

list[BondCashFlow]

Parameters:

from_date (Date | None)

accrued_interest(settlement_date)

Return accrued interest at settlement in the bond’s quote basis.

Return type:

Decimal

Parameters:

settlement_date (Date)

class fuggers_py.bonds.FixedBondBuilder(issue_date=None, maturity_date=None, coupon_rate=None, frequency=None, currency=Currency.<bound method Currency.name of <Currency.USD: 'USD'>>, notional=Decimal('100'), identifiers=<factory>, rules=<factory>, stub_rules=None, instrument_id=None)

Fluent builder for FixedBond.

The builder accumulates contractual inputs and resolves missing defaults from the selected yield rules before constructing the bond.

Parameters:
  • issue_date (Date | None)

  • maturity_date (Date | None)

  • coupon_rate (Decimal | None)

  • frequency (Frequency | None)

  • currency (Currency)

  • notional (Decimal)

  • identifiers (BondIdentifiers)

  • rules (YieldCalculationRules)

  • stub_rules (StubPeriodRules | None)

  • instrument_id (InstrumentId | None)

class fuggers_py.bonds.FixedCouponBond(*args, **kwargs)

Protocol for bonds exposing a fixed coupon rate.

coupon_rate()

Return the raw decimal coupon rate.

fuggers_py.bonds.FixedRateBond

alias of FixedBond

fuggers_py.bonds.FixedRateBondBuilder

alias of FixedBondBuilder

class fuggers_py.bonds.FloatingCouponBond(*args, **kwargs)

Protocol for floating-rate bonds with spread and reset semantics.

index()

Return the reference index used by the bond.

Return type:

RateIndex

quoted_spread()

Return the raw decimal spread over the reference index.

current_coupon_rate()

Return the current effective coupon rate after spread and bounds.

class fuggers_py.bonds.FloatingRateTerms(index_name, spread, reset_frequency, current_reference_rate=None, cap_rate=None, floor_rate=None)

Floating-rate note terms with raw decimal rate fields.

The index name is normalized to uppercase and the spread, caps, floors, and current reference rate are stored as raw decimals.

Parameters:
  • index_name (str)

  • spread (Decimal)

  • reset_frequency (Frequency)

  • current_reference_rate (Decimal | None)

  • cap_rate (Decimal | None)

  • floor_rate (Decimal | None)

rate_index()

Map the normalized index name to the bond-layer rate index.

Return type:

RateIndex

class fuggers_py.bonds.FloatingRateNote(_issue_date, _maturity_date, _index, _quoted_spread, _frequency, _currency=Currency.<bound method Currency.name of <Currency.USD: 'USD'>>, _notional=Decimal('100'), _identifiers=<factory>, _rules=<factory>, _stub_rules=None, _cap_rate=None, _floor_rate=None, _current_reference_rate=Decimal('0'), _index_definition=None, instrument_id=None)

Floating-rate note with optional caps, floors, and fixing support.

Parameters:
  • _issue_date (Date) – Bond issue and maturity dates.

  • _maturity_date (Date) – Bond issue and maturity dates.

  • _index (RateIndex) – Reference rate index used for projection.

  • _quoted_spread (Decimal) – Spread over the reference rate as a raw decimal.

  • _frequency (Frequency) – Coupon frequency used to build the schedule.

  • _currency (Currency) – Bond currency.

  • _notional (Decimal) – Face amount used to scale cash flows.

  • _identifiers (BondIdentifiers) – Optional identifier set.

  • _rules (YieldCalculationRules) – Yield and accrual rules.

  • _stub_rules (StubPeriodRules | None) – Optional explicit stub-period rules.

  • _cap_rate (Decimal | None) – Optional coupon bounds applied after the reference rate and spread are combined.

  • _floor_rate (Decimal | None) – Optional coupon bounds applied after the reference rate and spread are combined.

  • _current_reference_rate (Decimal) – Fallback reference rate used when no fixing or forward curve is available.

  • _index_definition (object | None) – Optional market-data helper for resolving fixings and conventions.

  • instrument_id (InstrumentId | None) – Optional stable instrument identifier.

Notes

Quoted spread and reference-rate inputs are raw decimal rates. The projected coupon uses the current reference rate plus spread, then applies the optional cap and floor.

identifiers()

Return the bond’s identifier set, such as ISIN or CUSIP.

Return type:

BondIdentifiers

currency()

Return the bond currency.

Return type:

Currency

notional()

Return the bond notional used to scale cash flows.

Return type:

Decimal

issue_date()

Return the issue/effective date.

Return type:

Date

maturity_date()

Return the contractual maturity date.

Return type:

Date

frequency()

Return the coupon frequency used to build the schedule.

Return type:

Frequency

rules()

Return the yield and accrual rules used by the bond.

Return type:

YieldCalculationRules

quoted_spread()

Return the raw decimal quoted spread over the reference index.

Return type:

Decimal

current_reference_rate()

Return the current or fallback reference rate as a raw decimal.

Return type:

Decimal

current_coupon_rate()

Return the current effective coupon rate after spread and bounds.

Return type:

Decimal

effective_rate(reference_rate=None)

Return the coupon rate implied by reference_rate plus spread.

Return type:

Decimal

Parameters:

reference_rate (object | None)

required_fixing_dates(accrual_start, accrual_end, *, index_conventions=None)

Return fixing dates required to determine the accrual-period rate.

Return type:

list[Date]

Parameters:
  • accrual_start (Date)

  • accrual_end (Date)

  • index_conventions (IndexConventions | None)

period_coupon(accrual_start, accrual_end, *, fixing_store=None, forward_curve=None, index_conventions=None, as_of=None)

Return the coupon cash amount for one accrual period.

The quoted spread is a raw decimal added to the reference rate before cap and floor bounds are applied.

Return type:

Decimal

Parameters:
  • accrual_start (Date)

  • accrual_end (Date)

  • fixing_store (IndexFixingStore | None)

  • forward_curve (ForwardRateSource | None)

  • index_conventions (IndexConventions | None)

  • as_of (Date | None)

cash_flows(from_date=None)

Return future cash flows sorted by date.

Parameters:

from_date (Date | None) – Optional cutoff date. When supplied, only flows strictly after this date are returned.

Return type:

list[BondCashFlow]

projected_cash_flows(forward_curve, settlement_date=None, *, fixing_store=None, index_conventions=None)

Project future cash flows using a forward curve and available fixings.

Return type:

list[BondCashFlow]

Parameters:
cash_flows_with_fixings(fixing_store, *, settlement_date=None, forward_curve=None, index_conventions=None)

Return future cash flows using stored fixings where available.

Return type:

list[BondCashFlow]

Parameters:
accrued_interest(settlement_date, *, fixing_store=None, forward_curve=None, index_conventions=None)

Return accrued interest at settlement using the effective FRN rate.

Return type:

Decimal

Parameters:
class fuggers_py.bonds.FloatingRateNoteBuilder(issue_date=None, maturity_date=None, index=RateIndex.SOFR, quoted_spread=Decimal('0'), frequency=None, currency=Currency.<bound method Currency.name of <Currency.USD: 'USD'>>, notional=Decimal('100'), identifiers=<factory>, rules=<factory>, stub_rules=None, cap_rate=None, floor_rate=None, current_reference_rate=Decimal('0'), index_definition=None, instrument_id=None)

Fluent builder for FloatingRateNote.

The builder resolves missing defaults from the selected rules and keeps the floating-rate contract inputs in one place before instantiation.

Parameters:
  • issue_date (Date | None)

  • maturity_date (Date | None)

  • index (RateIndex)

  • quoted_spread (Decimal)

  • frequency (Frequency | None)

  • currency (Currency)

  • notional (Decimal)

  • identifiers (BondIdentifiers)

  • rules (YieldCalculationRules)

  • stub_rules (StubPeriodRules | None)

  • cap_rate (Decimal | None)

  • floor_rate (Decimal | None)

  • current_reference_rate (Decimal)

  • index_definition (object | None)

  • instrument_id (InstrumentId | None)

class fuggers_py.bonds.FundingSpreadOverlayResult(base_funding_spread, adjusted_funding_spread, credit_spread, adjusted_all_in_spread, overlay_summary)

Funding-spread overlay summary with optional credit-spread linkage.

Parameters:
  • base_funding_spread (Decimal)

  • adjusted_funding_spread (Decimal)

  • credit_spread (Decimal | None)

  • adjusted_all_in_spread (Decimal | None)

  • overlay_summary (SpreadAdjustmentSummary)

class fuggers_py.bonds.GQDSecuredUnsecuredBasisModel

Basis approximation g * q * d in raw decimal form.

basis(*, loss_given_default, default_probability, discount_factor)

Return the overnight basis as a raw decimal spread.

Return type:

Decimal

Parameters:
  • loss_given_default (object)

  • default_probability (object)

  • discount_factor (object)

class fuggers_py.bonds.GSpreadCalculator(curve)

Curve-backed g-spread calculator with decimal and bps outputs.

Parameters:

curve (GovernmentCurve) – Government curve used to locate the benchmark yield.

spread_decimal(bond, bond_yield, *, benchmark=None)

Return the g-spread as a raw decimal for bond.

Return type:

Decimal

Parameters:
spread_bps(bond, bond_yield, *, benchmark=None)

Return the g-spread in basis points for bond.

Return type:

Decimal

Parameters:
class fuggers_py.bonds.GovernmentBenchmark(tenor, yield_rate)

Single government benchmark point on the curve.

Parameters:
  • tenor (Tenor) – Benchmark tenor.

  • yield_rate (Decimal) – Benchmark yield as a raw decimal.

class fuggers_py.bonds.GovernmentCurve(sovereign, reference_date, _benchmarks=<factory>)

Sparse government curve with interpolation and tenor lookup helpers.

Parameters:
  • sovereign (Sovereign) – Sovereign issuer tag for the curve.

  • reference_date (Date) – Date from which date-based maturities are measured.

  • _benchmarks (dict[Tenor, GovernmentBenchmark])

add_benchmark(tenor, yield_rate)

Add or replace a benchmark yield on the curve.

Return type:

GovernmentCurve

Parameters:
  • tenor (Tenor)

  • yield_rate (object)

benchmark_for_tenor(tenor)

Return the stored benchmark for tenor, if any.

Return type:

GovernmentBenchmark | None

Parameters:

tenor (Tenor)

nearest_benchmark(years)

Return the benchmark tenor closest to years.

Return type:

GovernmentBenchmark

Parameters:

years (float)

interpolated_yield(years)

Interpolate a raw-decimal yield across the stored benchmarks.

Return type:

Decimal

Parameters:

years (float)

yield_for_tenor(tenor, *, spec=None)

Resolve a benchmark yield for the supplied tenor.

When spec is omitted or interpolated, the return value is a raw decimal yield. Explicit benchmark overrides are also interpreted as raw decimal yields.

Return type:

Decimal

Parameters:
yield_for_date(maturity_date, *, spec=None)

Resolve a benchmark yield for a maturity date.

Return type:

Decimal

Parameters:
classmethod us_treasury(reference_date)

Build a curve tagged as U.S. Treasury.

Return type:

GovernmentCurve

Parameters:

reference_date (Date)

classmethod uk_gilt(reference_date)

Build a curve tagged as U.K. gilt.

Return type:

GovernmentCurve

Parameters:

reference_date (Date)

class fuggers_py.bonds.HaircutAdjustmentBreakdown(*, name, spread_adjustment, description=None, haircut, repo_rate, haircut_funding_rate, year_fraction, collateral_value, financing_base, haircut_amount, drag_amount)

Detailed haircut spread adjustment breakdown.

Parameters:
  • name (str)

  • spread_adjustment (Decimal)

  • description (str | None)

  • haircut (Decimal)

  • repo_rate (Decimal)

  • haircut_funding_rate (Decimal)

  • year_fraction (Decimal)

  • collateral_value (Decimal)

  • financing_base (Decimal)

  • haircut_amount (Decimal)

  • drag_amount (Decimal)

class fuggers_py.bonds.HaircutSpreadAdjustment(collateral_value, haircut, repo_rate, haircut_funding_rate, year_fraction=Decimal('1'), financing_base=None, name='haircut')

Haircut-driven spread adjustment with stored inputs.

Parameters:
  • collateral_value (Decimal)

  • haircut (Decimal)

  • repo_rate (Decimal)

  • haircut_funding_rate (Decimal)

  • year_fraction (Decimal)

  • financing_base (Decimal | None)

  • name (str)

breakdown()

Return the haircut adjustment breakdown.

Return type:

HaircutAdjustmentBreakdown

class fuggers_py.bonds.HedgeDirection(value)
class fuggers_py.bonds.HedgeRecommendation(ratio, direction, reason=None)
Parameters:
class fuggers_py.bonds.HullWhiteModel(mean_reversion, volatility, term_structure)

Hull-White-style short-rate model with a flat mean-reversion tree.

Parameters:
  • mean_reversion (Decimal)

  • volatility (Decimal)

  • term_structure (DiscountingCurve)

base_forward_rate(start, end)

Return the continuously compounded forward rate between dates.

Return type:

float

Parameters:
  • start (Date)

  • end (Date)

short_rate(date)

Return the model short rate at date from the term structure.

Return type:

float

Parameters:

date (Date)

node_rate(start, end, *, level, width)

Return the node short rate with a mean-reverting dispersion term.

Return type:

float

Parameters:
  • start (Date)

  • end (Date)

  • level (int)

  • width (int)

discount(rate, dt, spread=0.0)

Return the exponential discount factor for a raw decimal rate.

Return type:

float

Parameters:
  • rate (float)

  • dt (float)

  • spread (float)

class fuggers_py.bonds.ISpreadCalculator(curve)

Curve-backed I-spread calculator with decimal and bps outputs.

Parameters:

curve (DiscountingCurve) – Curve used to extract the swap rate at maturity.

spread_decimal(bond, bond_yield, settlement_date=None)

Return the I-spread as a raw decimal for bond.

Return type:

Decimal

Parameters:
  • bond (Bond)

  • bond_yield (object)

  • settlement_date (Date | None)

spread_bps(bond, bond_yield, settlement_date=None)

Return the I-spread in basis points for bond.

Return type:

Decimal

Parameters:
  • bond (Bond)

  • bond_yield (object)

  • settlement_date (Date | None)

exception fuggers_py.bonds.IdentifierError

Raised when an instrument identifier is invalid.

class fuggers_py.bonds.InflationLinkedBond(*args, **kwargs)

Protocol for inflation-linked bond references.

inflation_index_type()

Return the inflation index family used by the bond.

Return type:

InflationIndexType

exception fuggers_py.bonds.InvalidBondSpec(reason)

Raised when a bond or convention definition is internally inconsistent.

Parameters:

reason (str)

Return type:

None

exception fuggers_py.bonds.InvalidIdentifier(identifier_type, value, reason)

Raised when an identifier fails format or checksum validation.

Parameters:
  • identifier_type (str)

  • value (str)

  • reason (str)

Return type:

None

exception fuggers_py.bonds.InvalidInput(reason)
Parameters:

reason (str)

Return type:

None

exception fuggers_py.bonds.InvalidSettlement(reason)
Parameters:

reason (str)

Return type:

None

class fuggers_py.bonds.IssuerReferenceData(issuer_name, issuer_type=IssuerType.OTHER, issuer_id=None, country=None, sector=None, rating=None)

Issuer metadata used as a lookup and normalization target.

The issuer name is required and non-empty; optional fields are normalized but otherwise left as descriptive text.

Parameters:
  • issuer_name (str)

  • issuer_type (IssuerType)

  • issuer_id (str | None)

  • country (str | None)

  • sector (str | None)

  • rating (str | None)

class fuggers_py.bonds.IssuerReferenceSource(*args, **kwargs)

Protocol for retrieving issuer reference records by issuer name.

class fuggers_py.bonds.IssuerType(value)

Normalized issuer categories used by bond reference records.

class fuggers_py.bonds.KeyRateDuration(tenor, duration)
Parameters:
  • tenor (Tenor)

  • duration (Decimal)

class fuggers_py.bonds.KeyRateDurationCalculator(bump=0.0001)
Parameters:

bump (float)

class fuggers_py.bonds.KeyRateDurations(items)
Parameters:

items (list[KeyRateDuration])

exception fuggers_py.bonds.MissingRequiredField(field)

Raised when a required field is missing.

Parameters:

field (str)

Return type:

None

class fuggers_py.bonds.OASCalculator(model, solver_config=SolverConfig(tolerance=1e-10, max_iterations=200))

Hull-White callable-bond OAS solver and sensitivity helper.

Parameters:
calculate(callable_bond, market_price, settlement)

Solve the callable bond OAS as a raw decimal spread.

Return type:

Decimal

Parameters:
  • callable_bond (CallableBond)

  • market_price (object)

  • settlement (Date)

price_with_oas(callable_bond, oas_decimal, settlement)

Price the callable bond using a raw-decimal OAS.

Return type:

Decimal

Parameters:
  • callable_bond (CallableBond)

  • oas_decimal (object)

  • settlement (Date)

effective_duration(callable_bond, oas_decimal, settlement, *, bump=0.0001)

Return effective duration around a 1 bp curve bump.

Return type:

Decimal

Parameters:
  • callable_bond (CallableBond)

  • oas_decimal (object)

  • settlement (Date)

  • bump (float)

effective_convexity(callable_bond, oas_decimal, settlement, *, bump=0.0001)

Return effective convexity around a 1 bp curve bump.

Return type:

Decimal

Parameters:
  • callable_bond (CallableBond)

  • oas_decimal (object)

  • settlement (Date)

  • bump (float)

option_value(callable_bond, oas_decimal, settlement)

Return the embedded-option value as bullet price minus callable price.

Return type:

Decimal

Parameters:
  • callable_bond (CallableBond)

  • oas_decimal (object)

  • settlement (Date)

class fuggers_py.bonds.ParParAssetSwap(curve)

Par-par asset-swap spread calculator.

Parameters:

curve (DiscountingCurve)

calculate(bond, dirty_price, settlement_date)

Return the par-par asset-swap spread as a raw decimal.

dirty_price must be supplied in percent-of-par.

Return type:

Decimal

Parameters:
  • bond (FixedBond)

  • dirty_price (object)

  • settlement_date (Date)

class fuggers_py.bonds.PortfolioRisk(dv01, weighted_duration)
Parameters:
  • dv01 (Decimal)

  • weighted_duration (Decimal)

class fuggers_py.bonds.Position(modified_duration, dirty_price, face=Decimal('100'))
Parameters:
  • modified_duration (Decimal)

  • dirty_price (Decimal)

  • face (Decimal)

class fuggers_py.bonds.PriceResult(dirty, clean, accrued)

Bond price decomposition at a settlement date.

Dirty and clean prices are represented as Price values in the bond currency. The present_value property exposes the dirty price as a raw percent-of-par decimal for downstream analytics that expect a numeric quote rather than a currency object.

Parameters:
  • dirty (Price)

  • clean (Price)

  • accrued (Decimal)

property present_value: Decimal

Return the dirty price as a percent-of-par decimal.

exception fuggers_py.bonds.PricingError(reason)
Parameters:

reason (str)

Return type:

None

class fuggers_py.bonds.ProceedsAssetSwap(curve)

Proceeds-style asset-swap spread calculator.

Parameters:

curve (DiscountingCurve)

calculate(bond, dirty_price, settlement_date)

Return the proceeds-style asset-swap spread as a raw decimal.

dirty_price must be supplied in percent-of-par.

Return type:

Decimal

Parameters:
  • bond (FixedBond)

  • dirty_price (object)

  • settlement_date (Date)

class fuggers_py.bonds.ReferenceRateBreakdown(repo_rate, general_collateral_rate, unsecured_overnight_rate, term_rate, compounding_adjustment, convexity_adjustment, adjusted_term_rate, repo_vs_gc, gc_vs_unsecured_overnight, unsecured_overnight_vs_term, total_funding_basis)

Decomposition from repo to term unsecured funding in raw decimals.

Parameters:
  • repo_rate (Decimal)

  • general_collateral_rate (Decimal)

  • unsecured_overnight_rate (Decimal)

  • term_rate (Decimal)

  • compounding_adjustment (Decimal)

  • convexity_adjustment (Decimal)

  • adjusted_term_rate (Decimal)

  • repo_vs_gc (Decimal)

  • gc_vs_unsecured_overnight (Decimal)

  • unsecured_overnight_vs_term (Decimal)

  • total_funding_basis (Decimal)

class fuggers_py.bonds.ReferenceDataProvider(bond_source=None, issuer_source=None, rating_source=None, etf_holdings_source=None)

Composite provider that delegates to optional reference-data sources.

Each source is optional. Missing sources return None or an empty tuple instead of raising, which keeps snapshot-backed workflows deterministic.

Parameters:
get_bond_reference(instrument_id)

Return a bond reference from the configured bond source.

Return type:

BondReferenceData | None

Parameters:

instrument_id (InstrumentId | str)

get_issuer_reference(issuer_name)

Return an issuer reference from the configured issuer source.

Return type:

IssuerReferenceData | None

Parameters:

issuer_name (str)

get_rating(*, instrument_id=None, issuer_name=None)

Return a rating from the configured rating source.

Return type:

RatingRecord | None

Parameters:
  • instrument_id (InstrumentId | str | None)

  • issuer_name (str | None)

get_etf_holdings(etf_id)

Return ETF holdings from the configured holdings source.

Return type:

tuple[object, ...]

Parameters:

etf_id (EtfId | str)

class fuggers_py.bonds.RatingInfo(rating, agency=None, outlook=None)

Rating metadata from an agency or internal source.

Parameters:
  • rating (CreditRating)

  • agency (str | None)

  • outlook (str | None)

class fuggers_py.bonds.RatingRecord(rating, agency=None, outlook=None, instrument_id=None, issuer_name=None, effective_date=None)

Credit rating record keyed by instrument or issuer.

Ratings are kept as simple agency buckets with optional outlook, issuer, instrument, and effective-date metadata.

Parameters:
  • rating (str)

  • agency (str | None)

  • outlook (str | None)

  • instrument_id (InstrumentId | None)

  • issuer_name (str | None)

  • effective_date (Date | None)

class fuggers_py.bonds.RatingSource(*args, **kwargs)

Protocol for retrieving ratings by instrument or issuer.

class fuggers_py.bonds.RateIndex(value)

Reference rate indices used by floating-rate notes.

display_name()

Return a presentation-friendly name for the index.

Return type:

str

class fuggers_py.bonds.RiskMetrics(modified_duration, macaulay_duration, convexity, dv01)

Duration, convexity, and signed DV01 measured off a bond yield.

The measures are computed from the bond’s dirty-price/yield relationship using the bond’s configured compounding and settlement rules.

Parameters:
  • modified_duration (Decimal)

  • macaulay_duration (Decimal)

  • convexity (Decimal)

  • dv01 (Decimal)

property duration: Decimal

Alias for modified duration.

property pv01: Decimal

Compatibility alias for DV01.

The sign convention follows the library DV01 rule: the value is positive when bond value rises as yield falls by 1 basis point.

classmethod from_bond(bond, ytm, settlement_date, *, bump=0.0001)

Compute analytical and bumped risk measures for a bond.

Modified duration is reported per unit yield. DV01 is the percent-of-par price change per 1 basis point move in yield, signed positive when bond value rises as yield falls by 1 bp. pv01 is a compatibility alias of the same value.

Return type:

RiskMetrics

Parameters:
  • bond (Bond)

  • ytm (Yield)

  • settlement_date (Date)

  • bump (float)

classmethod from_projected_cashflows(cashflows, ytm, settlement_date, *, rules, bump=0.0001)

Compute analytical and bumped risk measures from explicit cash flows.

cashflows must already be settlement-relative bond cash flows with the bond’s convention metadata attached.

Return type:

RiskMetrics

Parameters:
  • ytm (Yield)

  • settlement_date (Date)

  • rules (YieldCalculationRules)

  • bump (float)

class fuggers_py.bonds.RollForwardMethod(value)

Roll-forward strategy used for short-dated yield handling.

class fuggers_py.bonds.Schedule(unadjusted_dates, dates, config)

Generated coupon schedule with unadjusted and adjusted dates.

Parameters:
  • unadjusted_dates (list[Date])

  • dates (list[Date])

  • config (ScheduleConfig)

classmethod generate(config)

Generate a schedule from the supplied configuration.

Return type:

Schedule

Parameters:

config (ScheduleConfig)

class fuggers_py.bonds.ScheduleConfig(start_date, end_date, frequency, calendar=CalendarId(value='WEEKEND'), business_day_convention=BusinessDayConvention.MODIFIED_FOLLOWING, end_of_month=True, stub_rules=StubPeriodRules(stub_type=None, first_regular_date=None, penultimate_date=None))

Configuration for coupon-schedule generation.

Parameters:
  • start_date (Date) – Unadjusted schedule endpoints. The generated schedule always includes both dates.

  • end_date (Date) – Unadjusted schedule endpoints. The generated schedule always includes both dates.

  • frequency (Frequency) – Coupon frequency used to step between regular dates.

  • calendar (CalendarId) – Calendar applied when adjusted payment dates are produced.

  • business_day_convention (BusinessDayConvention) – Adjustment rule for turning unadjusted dates into payment dates.

  • end_of_month (bool) – Whether end-of-month anchors are preserved when rolling by months.

  • stub_rules (StubPeriodRules) – Explicit front-stub or back-stub instructions, including regular-date anchors where applicable.

first_regular_date()

Return the explicit first regular coupon date, if any.

Return type:

Date | None

penultimate_date()

Return the explicit penultimate coupon date, if any.

Return type:

Date | None

stub_type()

Return the configured stub type, if present.

Return type:

StubType | None

uses_forward_generation()

Return whether the schedule should be rolled forward from start_date.

Return type:

bool

exception fuggers_py.bonds.ScheduleError(reason)

Raised when coupon schedule generation fails.

Parameters:

reason (str)

Return type:

None

class fuggers_py.bonds.SecuredUnsecuredBasisModel(*args, **kwargs)

Protocol for secured-versus-unsecured overnight basis models.

basis(*, loss_given_default, default_probability, discount_factor)

Return the overnight basis as a raw decimal spread.

Return type:

Decimal

Parameters:
  • loss_given_default (object)

  • default_probability (object)

  • discount_factor (object)

class fuggers_py.bonds.SecurityId(identifier_type, value)

Typed security identifier used by bond spread analytics.

Parameters:
  • identifier_type (str)

  • value (str)

class fuggers_py.bonds.Sector(value)

High-level issuer sector classification.

class fuggers_py.bonds.SectorInfo(sector, issuer=None, country=None, region=None, subsector=None)

Sector metadata attached to a bond or issuer.

Parameters:
  • sector (Sector)

  • issuer (str | None)

  • country (str | None)

  • region (str | None)

  • subsector (str | None)

class fuggers_py.bonds.Seniority(value)

Issuer seniority classification.

class fuggers_py.bonds.SeniorityInfo(seniority, secured=False)

Seniority metadata attached to a bond or issuer.

Parameters:
class fuggers_py.bonds.SettlementCalculator(calendar, rules)

Resolve settlement dates from trade dates and bond settlement rules.

Parameters:
  • calendar (CalendarId)

  • rules (SettlementRules)

settlement_date(trade_date)

Return the adjusted settlement date for trade_date.

Return type:

Date

Parameters:

trade_date (Date)

exception fuggers_py.bonds.SettlementError(reason)

Raised when settlement-date resolution fails.

Parameters:

reason (str)

Return type:

None

class fuggers_py.bonds.SettlementInvoice(settlement_date, clean_price, accrued_interest, dirty_price, accrued_days, principal_amount, accrued_amount, settlement_amount, face_value)

Settlement invoice values for a bond trade.

Parameters:
  • settlement_date (Date)

  • clean_price (Decimal)

  • accrued_interest (Decimal)

  • dirty_price (Decimal)

  • accrued_days (int)

  • principal_amount (Decimal)

  • accrued_amount (Decimal)

  • settlement_amount (Decimal)

  • face_value (Decimal)

settlement_date

Calculated settlement date.

clean_price

Clean price in percent of par.

accrued_interest

Accrued interest in percent of par.

dirty_price

Clean price plus accrued interest in percent of par.

accrued_days

Number of accrued days.

principal_amount

Principal cash amount.

accrued_amount

Accrued cash amount.

settlement_amount

Total settlement cash amount.

face_value

Face amount used for the calculation.

class fuggers_py.bonds.SettlementInvoiceBuilder(settlement_date, clean_price, accrued_interest, face_value=Decimal('100'), accrued_days=0, principal_amount=None)

Build a settlement invoice from clean price and accrued interest.

Parameters:
  • settlement_date (Date) – Settlement date to record on the invoice.

  • clean_price (Decimal) – Clean price in percent of par.

  • accrued_interest (Decimal) – Accrued interest in percent of par.

  • face_value (Decimal) – Face amount used to compute cash values.

  • accrued_days (int) – Number of accrued days to store on the invoice.

  • principal_amount (Decimal | None) – Optional explicit principal cash amount.

build()

Construct the invoice with percent-of-par and cash fields.

Return type:

SettlementInvoice

class fuggers_py.bonds.ShadowCostAdjustmentBreakdown(*, name, spread_adjustment, description=None, shadow_cost_rate, utilization, pass_through, usage=None, capacity=None)

Detailed shadow-cost spread adjustment breakdown.

Parameters:
  • name (str)

  • spread_adjustment (Decimal)

  • description (str | None)

  • shadow_cost_rate (Decimal)

  • utilization (Decimal)

  • pass_through (Decimal)

  • usage (Decimal | None)

  • capacity (Decimal | None)

class fuggers_py.bonds.ShadowCostSpreadAdjustment(shadow_cost_rate, utilization=None, usage=None, capacity=None, pass_through=Decimal('1'), name='shadow_cost')

Shadow-cost spread adjustment with stored assumptions.

Parameters:
  • shadow_cost_rate (Decimal)

  • utilization (Decimal | None)

  • usage (Decimal | None)

  • capacity (Decimal | None)

  • pass_through (Decimal)

  • name (str)

breakdown()

Return the shadow-cost adjustment breakdown.

Return type:

ShadowCostAdjustmentBreakdown

class fuggers_py.bonds.ShortDateCalculator(money_market_threshold=0.08333333333333333, short_date_threshold=1.0)

Determine which yield shortcut to use for a maturity bucket.

Parameters:
  • money_market_threshold (float) – Year-fraction cutoff below which money-market style quoting is used.

  • short_date_threshold (float) – Year-fraction cutoff below which the instrument is treated as short-dated.

classmethod new(money_market_threshold=None, short_date_threshold=None)

Construct a calculator with optional threshold overrides.

Return type:

ShortDateCalculator

Parameters:
  • money_market_threshold (float | None)

  • short_date_threshold (float | None)

classmethod bloomberg()

Return the default Bloomberg-style short-date configuration.

Return type:

ShortDateCalculator

is_short_dated(years_to_maturity)

Return True when maturity is at or below the short-date cutoff.

Return type:

bool

Parameters:

years_to_maturity (float)

use_money_market_below(years_to_maturity)

Return True when the money-market shortcut should apply.

Return type:

bool

Parameters:

years_to_maturity (float)

roll_forward_method(years_to_maturity)

Select the roll-forward strategy for the supplied maturity.

Return type:

RollForwardMethod

Parameters:

years_to_maturity (float)

class fuggers_py.bonds.SinkingFundBond(_issue_date, _maturity_date, _coupon_rate, _frequency, _sinking_schedule, _currency=Currency.<bound method Currency.name of <Currency.USD: 'USD'>>, _notional=Decimal('100'), _identifiers=<factory>, _rules=<factory>, _stub_rules=None, instrument_id=None)

Fixed-rate bond with scheduled principal amortization.

Parameters:
  • _issue_date (Date) – Bond issue and maturity dates.

  • _maturity_date (Date) – Bond issue and maturity dates.

  • _coupon_rate (Decimal) – Fixed coupon rate as a raw decimal.

  • _frequency (Frequency) – Coupon frequency used to build the schedule.

  • _sinking_schedule (SinkingFundSchedule) – Remaining-principal factor schedule.

  • _currency (Currency) – Bond currency.

  • _notional (Decimal) – Face amount used to scale cash flows.

  • _identifiers (BondIdentifiers) – Optional identifier set.

  • _rules (YieldCalculationRules) – Yield and accrual rules.

  • _stub_rules (StubPeriodRules | None) – Optional explicit stub-period rules.

  • instrument_id (InstrumentId | None) – Optional stable instrument identifier.

classmethod new(*, issue_date, maturity_date, coupon_rate, frequency, sinking_schedule, currency=Currency.<bound method Currency.name of <Currency.USD: 'USD'>>, notional=Decimal('100'), identifiers=None, rules=None, stub_rules=None, instrument_id=None)

Construct a sinking-fund bond from its contractual inputs.

Return type:

SinkingFundBond

Parameters:
  • issue_date (Date)

  • maturity_date (Date)

  • coupon_rate (Decimal)

  • frequency (Frequency)

  • sinking_schedule (SinkingFundSchedule)

  • currency (Currency)

  • notional (Decimal)

  • identifiers (BondIdentifiers | None)

  • rules (YieldCalculationRules | None)

  • stub_rules (StubPeriodRules | None)

  • instrument_id (InstrumentId | None)

identifiers()

Return the bond’s identifier set, such as ISIN or CUSIP.

Return type:

BondIdentifiers

currency()

Return the bond currency.

Return type:

Currency

notional()

Return the bond notional used to scale cash flows.

Return type:

Decimal

issue_date()

Return the issue/effective date.

Return type:

Date

maturity_date()

Return the contractual maturity date.

Return type:

Date

frequency()

Return the coupon frequency used to build the schedule.

Return type:

Frequency

rules()

Return the yield and accrual rules used by the bond.

Return type:

YieldCalculationRules

cash_flows(from_date=None)

Return future cash flows sorted by date.

Parameters:

from_date (Date | None) – Optional cutoff date. When supplied, only flows strictly after this date are returned.

Return type:

list[BondCashFlow]

accrued_interest(settlement_date)

Return accrued interest adjusted for the outstanding sinking factor.

Return type:

Decimal

Parameters:

settlement_date (Date)

factor_on(date)

Return the remaining principal factor on date.

Return type:

Decimal

Parameters:

date (Date)

amortization_schedule()

Return scheduled principal reductions in currency or face units.

Return type:

list[tuple[Date, Decimal]]

average_life(*, as_of_date=None)

Return the weighted-average time to remaining principal payments, in years.

Return type:

Decimal

Parameters:

as_of_date (Date | None)

yield_to_average_life(clean_price, settlement_date)

Return the raw decimal yield implied by the average-life cash flows.

Return type:

Decimal

Parameters:
  • clean_price (object)

  • settlement_date (Date)

class fuggers_py.bonds.SinkingFundBondBuilder(issue_date=None, maturity_date=None, coupon_rate=None, frequency=None, currency=Currency.<bound method Currency.name of <Currency.USD: 'USD'>>, notional=Decimal('100'), identifiers=<factory>, rules=<factory>, stub_rules=None, sinking_schedule=None, instrument_id=None, _entries=<factory>)

Fluent builder for SinkingFundBond.

The builder collects the sinking-fund schedule alongside the standard bond inputs before instantiating the bond.

Parameters:
  • issue_date (Date | None)

  • maturity_date (Date | None)

  • coupon_rate (Decimal | None)

  • frequency (Frequency | None)

  • currency (Currency)

  • notional (Decimal)

  • identifiers (BondIdentifiers)

  • rules (YieldCalculationRules)

  • stub_rules (StubPeriodRules | None)

  • sinking_schedule (SinkingFundSchedule | None)

  • instrument_id (InstrumentId | None)

  • _entries (list[SinkingFundEntry])

class fuggers_py.bonds.SinkingFundEntry(payment_date, factor)

One scheduled sinking-fund factor reset.

Parameters:
  • payment_date (Date) – Date on which the remaining principal factor changes.

  • factor (Decimal) – Remaining principal fraction after the payment date.

fuggers_py.bonds.SinkingFundPayment

alias of SinkingFundEntry

class fuggers_py.bonds.SinkingFundSchedule(entries)

Ordered sinking-fund factors with non-increasing outstanding principal.

Parameters:

entries (tuple[SinkingFundEntry, ...]) – Sinking-fund factor resets in payment-date order.

classmethod new(entries)

Create a sinking-fund schedule from the supplied entries.

Return type:

SinkingFundSchedule

Parameters:

entries (list[SinkingFundEntry])

factor_on(date)

Return the remaining principal factor in force on date.

Return type:

Decimal

Parameters:

date (Date)

factor_for_payment(payment_date, *, default=Decimal('0'))

Return the factor applied on the payment date, if scheduled.

Return type:

Decimal

Parameters:
  • payment_date (Date)

  • default (Decimal)

to_amortization(*, notional)

Convert remaining-principal factors into principal amortization cash flows.

Return type:

list[tuple[Date, Decimal]]

Parameters:

notional (Decimal)

class fuggers_py.bonds.Sovereign(value)

Supported sovereign issuers and their standard curve metadata.

currency()

Return the home currency for the sovereign issuer.

Return type:

Currency

bond_name()

Return the market name used for the sovereign curve.

Return type:

str

standard_tenors()

Return the standard benchmark tenors for the sovereign curve.

Return type:

list[Tenor]

classmethod us_treasury()

Return the U.S. Treasury sovereign label.

Return type:

Sovereign

classmethod uk_gilt()

Return the U.K. gilt sovereign label.

Return type:

Sovereign

classmethod german_bund()

Return the German Bund sovereign label.

Return type:

Sovereign

class fuggers_py.bonds.SpreadAdjustment(*args, **kwargs)

Protocol for spread adjustments that expose a breakdown and scalar view.

breakdown()

Return the detailed adjustment breakdown.

Return type:

SpreadAdjustmentBreakdown

spread_adjustment()

Return the raw decimal spread adjustment.

Return type:

Decimal

class fuggers_py.bonds.SpreadAdjustmentBreakdown(*, name, spread_adjustment, description=None)

Single spread-adjustment component.

Parameters:
  • name (str)

  • spread_adjustment (Decimal)

  • description (str | None)

class fuggers_py.bonds.SpreadAdjustmentSummary(base_spread, total_adjustment, adjusted_spread, components=())

Summary of a base spread plus its component adjustments.

Parameters:
  • base_spread (Decimal)

  • total_adjustment (Decimal)

  • adjusted_spread (Decimal)

  • components (tuple[SpreadAdjustmentBreakdown, ...])

exception fuggers_py.bonds.SpreadError(reason)
Parameters:

reason (str)

Return type:

None

class fuggers_py.bonds.StandardYieldEngine(tolerance=1e-10, max_iterations=100)

Standard dirty-price/yield solver for bond cash flows.

The engine prices future cash flows to a dirty price and inverts that relationship to solve for yield under the bond’s configured day-count and compounding rules.

Parameters:
  • tolerance (float)

  • max_iterations (int)

yield_from_price(cashflows, *, clean_price, accrued, settlement_date, rules)

Solve the raw decimal yield that matches a clean price plus accrued.

clean_price and accrued are summed to obtain the dirty price used by the solver. The returned yield is a raw decimal quote in the bond’s configured convention.

Return type:

YieldEngineResult

Parameters:
  • cashflows (list[BondCashFlow])

  • clean_price (Decimal)

  • accrued (Decimal)

  • settlement_date (Date)

  • rules (YieldCalculationRules)

dirty_price_from_yield(cashflows, *, yield_rate, settlement_date, rules)

Return the dirty price implied by a raw decimal yield.

The result is a percent-of-par dirty price on the supplied settlement date.

Return type:

float

Parameters:
  • cashflows (list[BondCashFlow])

  • yield_rate (float)

  • settlement_date (Date)

  • rules (YieldCalculationRules)

class fuggers_py.bonds.SupranationalIssuer(value)

Supranational issuer labels used by spread analytics.

class fuggers_py.bonds.TipsBond(_issue_date, _dated_date, _maturity_date, _coupon_rate, _inflation_convention, _base_reference_date, _frequency=Frequency.SEMI_ANNUAL, _currency=Currency.<bound method Currency.name of <Currency.USD: 'USD'>>, _notional=Decimal('100'), _identifiers=<factory>, _rules=<factory>, _stub_rules=None, _default_fixing_source=None, instrument_id=None)

Inflation-linked US Treasury security with explicit index-ratio plumbing.

Parameters:
  • _issue_date (Date) – Bond issue, dated, and maturity dates.

  • _dated_date (Date) – Bond issue, dated, and maturity dates.

  • _maturity_date (Date) – Bond issue, dated, and maturity dates.

  • _coupon_rate (Decimal) – Fixed coupon rate as a raw decimal.

  • _inflation_convention (InflationConvention) – Inflation convention used to resolve reference CPI values.

  • _base_reference_date (Date) – Reference date used for the base CPI ratio.

  • _frequency (Frequency) – Coupon frequency used to build the schedule.

  • _currency (Currency) – Bond currency.

  • _notional (Decimal) – Face amount used to scale cash flows.

  • _identifiers (BondIdentifiers) – Optional identifier set.

  • _rules (YieldCalculationRules) – Yield and accrual rules.

  • _stub_rules (StubPeriodRules | None) – Optional explicit stub-period rules.

  • _default_fixing_source (object | None) – Optional default inflation fixing source.

  • instrument_id (InstrumentId | None) – Optional stable instrument identifier.

identifiers()

Return the bond’s identifier set, such as ISIN or CUSIP.

Return type:

BondIdentifiers

currency()

Return the bond currency.

Return type:

Currency

notional()

Return the bond notional used to scale cash flows.

Return type:

Decimal

issue_date()

Return the issue/effective date.

Return type:

Date

maturity_date()

Return the contractual maturity date.

Return type:

Date

frequency()

Return the coupon frequency used to build the schedule.

Return type:

Frequency

rules()

Return the yield and accrual rules used by the bond.

Return type:

YieldCalculationRules

reference_cpi(settlement_date, *, fixing_source=None)

Return the reference CPI for settlement_date.

Return type:

Decimal

Parameters:
  • settlement_date (Date)

  • fixing_source (object | None)

index_ratio(settlement_date, *, fixing_source=None, base_date=None)

Return the reference-index ratio relative to base_date.

Return type:

Decimal

Parameters:
  • settlement_date (Date)

  • fixing_source (object | None)

  • base_date (Date | None)

adjusted_principal(settlement_date, *, fixing_source=None, base_date=None)

Return the inflation-adjusted principal without a maturity floor.

Return type:

Decimal

Parameters:
  • settlement_date (Date)

  • fixing_source (object | None)

  • base_date (Date | None)

final_principal_redemption(*, fixing_source=None, base_date=None)

Return the maturity principal amount with the TIPS par floor.

Return type:

Decimal

Parameters:
  • fixing_source (object | None)

  • base_date (Date | None)

projected_coupon_cash_flows(*, fixing_source=None, settlement_date=None, base_date=None)

Return coupon cash flows tagged as inflation-linked.

Return type:

list[BondCashFlow]

Parameters:
  • fixing_source (object | None)

  • settlement_date (Date | None)

  • base_date (Date | None)

projected_cash_flows(*, fixing_source=None, settlement_date=None, base_date=None)

Return projected coupon and principal cash flows.

Return type:

list[BondCashFlow]

Parameters:
  • fixing_source (object | None)

  • settlement_date (Date | None)

  • base_date (Date | None)

cash_flow_schedule(*, fixing_source=None, settlement_date=None, base_date=None)

Return a core cash-flow schedule using inflation cash-flow helpers.

Return type:

CashFlowSchedule

Parameters:
  • fixing_source (object | None)

  • settlement_date (Date | None)

  • base_date (Date | None)

cash_flows(from_date=None, *, fixing_source=None)

Return projected cash flows using the attached default fixing source.

Return type:

list[BondCashFlow]

Parameters:
  • from_date (Date | None)

  • fixing_source (object | None)

accrued_interest(settlement_date, *, fixing_source=None)

Return accrued interest on settlement-date adjusted principal.

Return type:

Decimal

Parameters:
  • settlement_date (Date)

  • fixing_source (object | None)

class fuggers_py.bonds.TipsPricer(engine=StandardYieldEngine(tolerance=1e-10, max_iterations=100))

Real-yield pricer for TipsBond.

The class prices inflation-linked bonds off real yield and projected inflation-adjusted cash flows. Returned prices are in the bond currency and quoted in percent of par unless wrapped in Price.

Parameters:

engine (StandardYieldEngine)

accrued_interest(bond, settlement_date, *, fixing_source=None)

Return settlement-date accrued interest on inflation-adjusted principal.

The result is in currency units and reflects the bond’s inflation-linked principal projection at the supplied settlement date.

Return type:

Decimal

Parameters:
  • bond (TipsBond)

  • settlement_date (Date)

  • fixing_source (object | None)

present_value_from_real_yield(bond, real_yield, settlement_date, *, fixing_source=None)

Return the dirty price in percent of par from a real yield.

The yield is interpreted as a real yield under the bond’s configured compounding rules.

Return type:

Decimal

Parameters:
  • bond (TipsBond)

  • real_yield (Yield)

  • settlement_date (Date)

  • fixing_source (object | None)

dirty_price_from_real_yield(bond, real_yield, settlement_date, *, fixing_source=None)

Return the dirty price implied by real_yield.

The returned price is a currency-valued Price.

Return type:

Price

Parameters:
  • bond (TipsBond)

  • real_yield (Yield)

  • settlement_date (Date)

  • fixing_source (object | None)

clean_price_from_real_yield(bond, real_yield, settlement_date, *, fixing_source=None)

Return the clean price implied by real_yield.

Accrued interest is removed from the dirty price on the bond’s settlement date.

Return type:

Price

Parameters:
  • bond (TipsBond)

  • real_yield (Yield)

  • settlement_date (Date)

  • fixing_source (object | None)

price_from_real_yield(bond, real_yield, settlement_date, *, fixing_source=None)

Return clean and dirty prices from a real yield.

The result includes currency-valued clean and dirty prices plus accrued interest in currency units.

Return type:

PriceResult

Parameters:
  • bond (TipsBond)

  • real_yield (Yield)

  • settlement_date (Date)

  • fixing_source (object | None)

real_yield_from_clean_price(bond, clean_price, settlement_date, *, fixing_source=None)

Return the real yield implied by a clean price.

clean_price must use the bond’s currency. The returned yield is wrapped as a Yield using the bond’s compounding convention.

Return type:

YieldResult

Parameters:
  • bond (TipsBond)

  • clean_price (Price)

  • settlement_date (Date)

  • fixing_source (object | None)

risk_metrics_from_real_yield(bond, real_yield, settlement_date, *, fixing_source=None, bump=0.0001)

Return duration, convexity, and DV01/PV01 with respect to real yield.

The finite-difference bump is interpreted as a raw decimal yield shift; the returned DV01/PV01 is signed positive when price rises as yield falls.

Parameters:
  • bond (TipsBond)

  • real_yield (Yield)

  • settlement_date (Date)

  • fixing_source (object | None)

  • bump (float)

class fuggers_py.bonds.ValidationFailure(field, expected, actual, tolerance)

Bloomberg validation mismatch for a single field.

Parameters:
  • field (str)

  • expected (Decimal)

  • actual (Decimal)

  • tolerance (Decimal)

class fuggers_py.bonds.VaRMethod(value)
class fuggers_py.bonds.VaRResult(value, confidence, method)
Parameters:
  • value (Decimal)

  • confidence (Decimal)

  • method (VaRMethod)

class fuggers_py.bonds.YASCalculator(curve, government_curve=None, benchmark=None)

Build a complete YAS analysis for a bond.

Parameters:
  • curve (DiscountingCurve) – Curve used for z-spread calculation.

  • government_curve (GovernmentCurve | None) – Optional government curve used for g-spread calculation.

  • benchmark (BenchmarkSpec | None) – Optional benchmark selection for the g-spread view.

calculate(bond, clean_price, settlement_date)

Return YAS display fields, risk metrics, and settlement invoice.

Return type:

YasAnalysis

Parameters:
  • bond (Bond)

  • clean_price (Price | Decimal)

  • settlement_date (Date)

validate_bloomberg(bond, clean_price, settlement_date, reference=None, *, tolerance=Decimal('1.0'))

Compare the calculated YAS output against a reference snapshot.

Returns:

Field-level mismatches against the supplied reference values.

Return type:

list[ValidationFailure]

Parameters:
  • bond (Bond)

  • clean_price (Price | Decimal)

  • settlement_date (Date)

  • reference (BloombergReference | None)

  • tolerance (Decimal)

fuggers_py.bonds.YASResult

alias of YasAnalysis

class fuggers_py.bonds.YasAnalysis(ytm, street_yield, true_yield, current_yield, simple_yield, money_market_yield, g_spread_bps, z_spread_bps, benchmark_spread_bps, benchmark_tenor, risk, invoice)

Display-oriented YAS output bundle.

Yields are quoted percentages. Spread fields are in basis points. The attached invoice separates clean-price inputs from currency cash amounts.

Parameters:
  • ytm (Decimal)

  • street_yield (Decimal)

  • true_yield (Decimal)

  • current_yield (Decimal)

  • simple_yield (Decimal)

  • money_market_yield (Decimal | None)

  • g_spread_bps (Decimal | None)

  • z_spread_bps (Decimal | None)

  • benchmark_spread_bps (Decimal | None)

  • benchmark_tenor (Tenor | None)

  • risk (BondRiskMetrics)

  • invoice (SettlementInvoice)

modified_duration()

Return the modified duration from the attached risk bundle.

Return type:

Decimal

convexity()

Return the convexity from the attached risk bundle.

Return type:

Decimal

dv01()

Return the DV01 from the attached risk bundle.

Return type:

Decimal

class fuggers_py.bonds.YasAnalysisBuilder(ytm=None, street_yield=None, true_yield=None, current_yield=None, simple_yield=None, money_market_yield=None, g_spread_bps=None, z_spread_bps=None, benchmark_spread_bps=None, benchmark_tenor=None, risk=None, invoice=None)

Builder for YasAnalysis instances.

Parameters:
  • ytm (Decimal | None)

  • street_yield (Decimal | None)

  • true_yield (Decimal | None)

  • current_yield (Decimal | None)

  • simple_yield (Decimal | None)

  • money_market_yield (Decimal | None)

  • g_spread_bps (Decimal | None)

  • z_spread_bps (Decimal | None)

  • benchmark_spread_bps (Decimal | None)

  • benchmark_tenor (Tenor | None)

  • risk (BondRiskMetrics | None)

  • invoice (SettlementInvoice | None)

build()

Validate required fields and build a YasAnalysis.

Return type:

YasAnalysis

exception fuggers_py.bonds.YieldConvergenceFailed(iterations, residual)

Raised when a yield solver fails to converge.

Parameters:
  • iterations (int)

  • residual (float)

Return type:

None

class fuggers_py.bonds.YieldEngine(*args, **kwargs)

Protocol for yield engine implementations used by analytics wrappers.

class fuggers_py.bonds.YieldEngineResult(yield_rate, iterations, converged, residual, method, convention)

Result of a yield-solver iteration.

The solver reports the converged yield, iteration count, residual, and the convention used to interpret the yield.

Parameters:
  • yield_rate (float)

  • iterations (int)

  • converged (bool)

  • residual (float)

  • method (str)

  • convention (YieldConvention)

class fuggers_py.bonds.YieldResult(ytm, engine)

Bond yield result together with the lower-level engine output.

ytm is returned in the bond’s configured compounding convention. The nested engine result preserves the raw solver diagnostics used to reach the yield.

Parameters:
class fuggers_py.bonds.YieldSolver(tolerance=1e-10, max_iterations=100)

Yield solver with analytics error translation.

The solver delegates to the bond-layer implementation and converts bond-layer pricing errors into analytics-layer exceptions.

Parameters:
  • tolerance (float)

  • max_iterations (int)

solve(*, dirty_price, cashflows, times, frequency, convention=YieldConvention.STREET_CONVENTION, initial_guess=None)

Solve for yield using the parent bond solver and normalize errors.

Returns:

Solved yield and convergence metadata.

Return type:

YieldResult

Parameters:
  • dirty_price (float)

  • cashflows (list[float])

  • times (list[float])

  • frequency (int)

  • convention (YieldConvention)

  • initial_guess (float | None)

exception fuggers_py.bonds.YieldSolverError(reason)
Parameters:

reason (str)

Return type:

None

class fuggers_py.bonds.ZeroCouponBond(_issue_date, _maturity_date, _currency=Currency.<bound method Currency.name of <Currency.USD: 'USD'>>, _notional=Decimal('100'), _identifiers=<factory>, _rules=<factory>, instrument_id=None)

Bond that pays principal only at maturity.

Parameters:
  • _issue_date (Date) – Bond issue and maturity dates.

  • _maturity_date (Date) – Bond issue and maturity dates.

  • _currency (Currency) – Bond currency.

  • _notional (Decimal) – Face amount repaid at maturity.

  • _identifiers (BondIdentifiers) – Optional identifier set.

  • _rules (YieldCalculationRules) – Yield and accrual rules.

  • instrument_id (InstrumentId | None) – Optional stable instrument identifier.

identifiers()

Return the bond’s identifier set, such as ISIN or CUSIP.

Return type:

BondIdentifiers

currency()

Return the bond currency.

Return type:

Currency

notional()

Return the bond notional used to scale cash flows.

Return type:

Decimal

issue_date()

Return the issue/effective date.

Return type:

Date

maturity_date()

Return the contractual maturity date.

Return type:

Date

frequency()

Return the coupon frequency used to build the schedule.

Return type:

Frequency

rules()

Return the yield and accrual rules used by the bond.

Return type:

YieldCalculationRules

cash_flows(from_date=None)

Return future cash flows sorted by date.

Parameters:

from_date (Date | None) – Optional cutoff date. When supplied, only flows strictly after this date are returned.

Return type:

list[BondCashFlow]

accrued_interest(settlement_date)

Zero-coupon bonds do not accrue interest between issuance and maturity.

Return type:

Decimal

Parameters:

settlement_date (Date)

fuggers_py.bonds.adjusted_term_rate(*, simple_rate, year_fraction, convexity_adjustment=Decimal('0'))

Return the adjusted term rate as a raw decimal.

Return type:

Decimal

Parameters:
  • simple_rate (object)

  • year_fraction (object)

  • convexity_adjustment (object)

fuggers_py.bonds.apply_balance_sheet_overlays(*, base_spread, adjustments=())

Apply spread adjustments to a base spread.

Return type:

SpreadAdjustmentSummary

Parameters:
fuggers_py.bonds.apply_funding_spread_overlays(*, base_funding_spread, adjustments=(), credit_spread=None)

Apply spread adjustments to a funding spread and optional credit spread.

Return type:

FundingSpreadOverlayResult

Parameters:
  • base_funding_spread (object)

  • adjustments (tuple[SpreadAdjustment, ...])

  • credit_spread (object | None)

fuggers_py.bonds.bond_equivalent_yield(face_value, price, days_to_maturity)

Return a bond-equivalent yield quoted as percentage points.

Return type:

Decimal

Parameters:
  • face_value (object)

  • price (object)

  • days_to_maturity (object)

fuggers_py.bonds.bond_equivalent_yield_simple(face_value, price, days_to_maturity)

Return bond-equivalent yield as a float quoted percentage.

Return type:

float

Parameters:
  • face_value (float)

  • price (float)

  • days_to_maturity (float)

fuggers_py.bonds.calculate_accrued_amount(face_value, accrued_interest)

Convert accrued interest from percent-of-par into currency units.

Return type:

Decimal

Parameters:
  • face_value (object)

  • accrued_interest (object)

fuggers_py.bonds.calculate_proceeds(principal_amount, accrued_amount)

Return the settlement cash amount from principal and accrued cash.

Return type:

Decimal

Parameters:
  • principal_amount (object)

  • accrued_amount (object)

fuggers_py.bonds.calculate_settlement_date(trade_date, rules)

Return the settlement date using the supplied settlement rules.

Return type:

Date

Parameters:
  • trade_date (Date)

  • rules (SettlementRules)

fuggers_py.bonds.capital_adjustment_breakdown(*, exposure, risk_weight, capital_ratio, hurdle_rate, pass_through=Decimal('1'), name='capital')

Return the capital spread adjustment breakdown as raw decimals.

Return type:

CapitalAdjustmentBreakdown

Parameters:
  • exposure (object)

  • risk_weight (object)

  • capital_ratio (object)

  • hurdle_rate (object)

  • pass_through (object)

  • name (str)

fuggers_py.bonds.capital_spread_adjustment(*, exposure, risk_weight, capital_ratio, hurdle_rate, pass_through=Decimal('1'))

Return the capital spread adjustment as a raw decimal.

Return type:

Decimal

Parameters:
  • exposure (object)

  • risk_weight (object)

  • capital_ratio (object)

  • hurdle_rate (object)

  • pass_through (object)

fuggers_py.bonds.cd_equivalent_yield(face_value, price, days_to_maturity)

Return a CD-equivalent yield quoted as percentage points.

Return type:

Decimal

Parameters:
  • face_value (object)

  • price (object)

  • days_to_maturity (object)

fuggers_py.bonds.compose_spread_adjustments(*, base_spread=Decimal('0'), adjustments=())

Compose raw decimal spread adjustments onto a base spread.

Return type:

SpreadAdjustmentSummary

Parameters:
fuggers_py.bonds.compounding_convexity_breakdown(*, simple_rate, year_fraction, convexity_adjustment=Decimal('0'))

Return the compounding and convexity adjustment breakdown.

Return type:

CompoundingConvexityBreakdown

Parameters:
  • simple_rate (object)

  • year_fraction (object)

  • convexity_adjustment (object)

fuggers_py.bonds.current_yield(coupon_rate, clean_price)

Return current yield as a raw decimal.

Parameters:
  • coupon_rate (object) – Annual coupon rate as a raw decimal or Decimal-like value.

  • clean_price (object) – Clean price in percent of par.

Returns:

Current yield as a raw decimal rate.

Return type:

Decimal

fuggers_py.bonds.current_yield_from_amount(coupon_amount, clean_price)

Return current yield as a raw decimal.

Parameters:
  • coupon_amount (object) – Annual coupon payment in currency units per 100 face.

  • clean_price (object) – Clean price in percent of par.

Returns:

Current yield as a raw decimal rate.

Return type:

Decimal

fuggers_py.bonds.current_yield_from_amount_pct(coupon_amount, clean_price)

Return current yield as quoted percentage points.

Return type:

Decimal

Parameters:
  • coupon_amount (object)

  • clean_price (object)

fuggers_py.bonds.current_yield_from_bond(bond, clean_price)

Return raw-decimal current yield from a bond-like object.

The bond must expose coupon_rate either as a method or attribute. The result is always normalized to coupon-per-100-face.

Return type:

Decimal

Parameters:
  • bond (object)

  • clean_price (object)

fuggers_py.bonds.current_yield_from_bond_pct(bond, clean_price)

Return quoted current yield from a bond-like object.

Return type:

Decimal

Parameters:
  • bond (object)

  • clean_price (object)

fuggers_py.bonds.current_yield_pct(coupon_rate, clean_price)

Return current yield as quoted percentage points.

Return type:

Decimal

Parameters:
  • coupon_rate (object)

  • clean_price (object)

fuggers_py.bonds.current_yield_simple(coupon_rate, clean_price)

Return current yield as a raw decimal using float arithmetic.

Return type:

float

Parameters:
  • coupon_rate (float)

  • clean_price (float)

fuggers_py.bonds.current_yield_simple_pct(coupon_rate, clean_price)

Return current yield as quoted percentage points using float arithmetic.

Return type:

float

Parameters:
  • coupon_rate (float)

  • clean_price (float)

fuggers_py.bonds.deliverable_bpv_regressor(bpv, *, deliverable)

Return the standard deliverability regressor encoding.

This keeps BondQuote.regressors['deliverable_bpv'] in one simple quote-level form: bpv when the bond is deliverable, otherwise 0.0.

Return type:

float

Parameters:
  • bpv (object)

  • deliverable (bool)

fuggers_py.bonds.discount_yield(face_value, price, days_to_maturity)

Return a discount yield quoted as percentage points.

Return type:

Decimal

Parameters:
  • face_value (object)

  • price (object)

  • days_to_maturity (object)

fuggers_py.bonds.discount_yield_simple(face_value, price, days_to_maturity)

Return discount yield as a float quoted percentage.

Return type:

float

Parameters:
  • face_value (float)

  • price (float)

  • days_to_maturity (float)

fuggers_py.bonds.g_spread(bond_yield, benchmark_yield)

Return the g-spread as a raw decimal.

Positive values mean the bond yield is above the benchmark yield.

Return type:

Decimal

Parameters:
  • bond_yield (object)

  • benchmark_yield (object)

fuggers_py.bonds.g_spread_bps(bond_yield, benchmark_yield)

Return the g-spread in basis points.

Return type:

Decimal

Parameters:
  • bond_yield (object)

  • benchmark_yield (object)

fuggers_py.bonds.g_spread_with_benchmark(bond_yield, curve, maturity, *, benchmark=None)

Return the g-spread as a raw decimal against a curve benchmark.

Return type:

Decimal

Parameters:
fuggers_py.bonds.g_spread_with_benchmark_bps(bond_yield, curve, maturity, *, benchmark=None)

Return the g-spread in basis points against a curve benchmark.

Return type:

Decimal

Parameters:
fuggers_py.bonds.haircut_adjustment_breakdown(*, collateral_value, haircut, repo_rate, haircut_funding_rate, year_fraction=Decimal('1'), financing_base=None, name='haircut')

Return the haircut spread adjustment breakdown as raw decimals.

Return type:

HaircutAdjustmentBreakdown

Parameters:
  • collateral_value (object)

  • haircut (object)

  • repo_rate (object)

  • haircut_funding_rate (object)

  • year_fraction (object)

  • financing_base (object | None)

  • name (str)

fuggers_py.bonds.haircut_spread_adjustment(*, collateral_value, haircut, repo_rate, haircut_funding_rate, year_fraction=Decimal('1'), financing_base=None)

Return the haircut spread adjustment as a raw decimal.

Return type:

Decimal

Parameters:
  • collateral_value (object)

  • haircut (object)

  • repo_rate (object)

  • haircut_funding_rate (object)

  • year_fraction (object)

  • financing_base (object | None)

fuggers_py.bonds.i_spread(bond_yield, swap_rate)

Return the I-spread as a raw decimal.

Positive values mean the bond yield is above the swap rate.

Return type:

Decimal

Parameters:
  • bond_yield (object)

  • swap_rate (object)

fuggers_py.bonds.i_spread_bps(bond_yield, swap_rate)

Return the I-spread in basis points.

Return type:

Decimal

Parameters:
  • bond_yield (object)

  • swap_rate (object)

fuggers_py.bonds.money_market_yield(face_value, price, days_to_maturity)

Return the default money-market yield as quoted percentage points.

The analytics layer currently maps the generic money-market convention to the bond-equivalent yield path.

Return type:

Decimal

Parameters:
  • face_value (object)

  • price (object)

  • days_to_maturity (object)

fuggers_py.bonds.money_market_yield_with_horizon(face_value, price, days_to_maturity, horizon_days)

Return the money-market yield for a holding-period wrapper.

The current implementation preserves the base money-market yield and does not alter the convention based on the horizon input.

Return type:

Decimal

Parameters:
  • face_value (object)

  • price (object)

  • days_to_maturity (object)

  • horizon_days (object)

fuggers_py.bonds.reference_rate_decomposition(*, repo_rate, general_collateral_rate, unsecured_overnight_rate, term_rate, year_fraction=None, convexity_adjustment=Decimal('0'))

Decompose the ladder from repo to term unsecured funding.

Return type:

ReferenceRateBreakdown

Parameters:
  • repo_rate (object)

  • general_collateral_rate (object)

  • unsecured_overnight_rate (object)

  • term_rate (object)

  • year_fraction (object | None)

  • convexity_adjustment (object)

fuggers_py.bonds.secured_unsecured_overnight_basis(*, loss_given_default, default_probability, discount_factor, model=None)

Return the secured-versus-unsecured overnight basis as a raw decimal.

Return type:

Decimal

Parameters:
fuggers_py.bonds.settlement_adjustment(value=None)

Return a settlement adjustment term.

The adjustment defaults to zero unless supplied by the caller.

Return type:

Decimal

Parameters:

value (object | None)

fuggers_py.bonds.shadow_cost_adjustment_breakdown(*, shadow_cost_rate, utilization=None, usage=None, capacity=None, pass_through=Decimal('1'), name='shadow_cost')

Return the shadow-cost spread adjustment breakdown.

Return type:

ShadowCostAdjustmentBreakdown

Parameters:
  • shadow_cost_rate (object)

  • utilization (object | None)

  • usage (object | None)

  • capacity (object | None)

  • pass_through (object)

  • name (str)

fuggers_py.bonds.shadow_cost_spread_adjustment(*, shadow_cost_rate, utilization=None, usage=None, capacity=None, pass_through=Decimal('1'))

Return the shadow-cost spread adjustment as a raw decimal.

Return type:

Decimal

Parameters:
  • shadow_cost_rate (object)

  • utilization (object | None)

  • usage (object | None)

  • capacity (object | None)

  • pass_through (object)

fuggers_py.bonds.simple_margin(dirty_price, next_coupon, reference_rate, days_to_reset)

Approximate the discount margin from dirty price and next reset.

The approximation is a short-reset, dirty-price formulation using the next coupon, reference rate, and days to reset.

Return type:

Decimal

Parameters:
  • dirty_price (object)

  • next_coupon (object)

  • reference_rate (object)

  • days_to_reset (int | object)

fuggers_py.bonds.simple_to_compounded_equivalent_rate(simple_rate, year_fraction)

Convert a simple rate into its compounded-equivalent raw decimal rate.

Parameters:
  • simple_rate (object) – Simple rate in raw decimal form.

  • year_fraction (object) – Accrual fraction used for the conversion.

Return type:

Decimal

fuggers_py.bonds.simple_yield(coupon_amount, clean_price, par, years)

Return simple yield as a quoted percentage.

Parameters:
  • coupon_amount (object) – Annual coupon payment in currency units per 100 face.

  • clean_price (object) – Clean price in percent of par.

  • par (object) – Par value, typically 100.

  • years (object) – Time to maturity in years.

Returns:

Simple yield quoted as a percentage.

Return type:

Decimal

fuggers_py.bonds.simple_yield_f64(coupon_amount, clean_price, par, years)

Return simple yield as a float quoted percentage.

Return type:

float

Parameters:
  • coupon_amount (float)

  • clean_price (float)

  • par (float)

  • years (float)

fuggers_py.bonds.street_convention_yield(dirty_price, cashflows, times, *, frequency, initial_guess=None)

Return the street-convention yield as a raw decimal rate.

The result follows the bond solver’s raw-decimal convention rather than a quoted percentage display format.

Return type:

float

Parameters:
  • dirty_price (float)

  • cashflows (list[float])

  • times (list[float])

  • frequency (int)

  • initial_guess (float | None)

fuggers_py.bonds.true_yield(street_yield, settlement_adjustment_value)

Return true yield as a raw decimal rate.

True yield is modeled as street yield plus the supplied settlement adjustment.

Return type:

Decimal

Parameters:
  • street_yield (object)

  • settlement_adjustment_value (object)

fuggers_py.bonds.utilization_ratio(*, usage, capacity)

Return utilization as usage divided by capacity.

Return type:

Decimal

Parameters:
  • usage (object)

  • capacity (object)

fuggers_py.bonds.z_discount_margin(frn, dirty_price, settlement_date, *, forward_curve, discount_curve)

Solve the discount margin using the curve-backed calculator.

Return type:

Decimal

Parameters:
  • frn (FloatingRateNote)

  • dirty_price (object)

  • settlement_date (Date)

  • forward_curve (object)

  • discount_curve (object)

fuggers_py.bonds.z_spread(bond, price, curve, settlement_date)

Solve the Z-spread in raw decimal form using a clean bond price.

The supplied clean price is converted to dirty price by adding accrued interest before the root solve.

Return type:

Decimal

Parameters:
  • bond (Bond)

  • price (Price)

  • curve (DiscountingCurve)

  • settlement_date (Date)

fuggers_py.bonds.z_spread_from_curve(cashflows, *, dirty_price, curve, settlement_date)

Solve the Z-spread in raw decimal form from dirty price and cash flows.

Return type:

Decimal

Parameters:
  • cashflows (list[BondCashFlow])

  • dirty_price (object)

  • curve (DiscountingCurve)

  • settlement_date (Date)