Conventions¶
This page defines the shared public conventions used across fuggers-py.
Bond prices¶
Bond
clean_priceanddirty_pricestay in percent-of-par where the API already uses percent-of-par.Coupon-per-price helpers that take bond prices assume the same per-100-face convention.
Unsuffixed yields, rates, and spreads¶
Shared/public unsuffixed yields, rates, and spreads use raw decimal units.
Example:
0.05means 5%,0.0025means 25 bp.Shared calc outputs follow the same rule for fields such as
yield_to_maturity,current_yield,z_spread,g_spread,i_spread,discount_margin, andasset_swap_spread.
Display helpers¶
Use
_pcthelpers for quoted percentage display values.Use
_bpshelpers for basis-point display values.YAS is display-oriented, so YAS keeps quoted percentages and basis points in its output fields.
DV01, PV01, and BPV¶
Use
dv01for the main one-basis-point risk field in public bond, rates, portfolio, and runtime outputs.Some older or domain-specific paths still expose
pv01. Runtime output records backfillpv01fromdv01, ordv01frompv01, and reject the record if both are supplied with different values.The rates risk module defines
pv01()as the implementation function, then aliasesdv01 = pv01andbpv = pv01.Credit and inflation still use
pv01names where that is the normal product language, such as CDS risky PV01 and inflation-swap PV01.Positive DV01 means the value rises when rates, yields, or spreads fall by one basis point.
Methodology note¶
The code uses the same sign convention, but not every product computes the number the same way.
For bonds, the direct duration formula is:
dv01 = modified_duration * (dirty_price / 100) * face * Decimal("0.0001")
For bumped bond prices, the finite-difference formula is:
dv01 = (price_down - price_up) / Decimal(2)
price_down means the price after the yield, rate, or spread is moved down.
price_up means the price after it is moved up. If the instrument has normal
positive duration, price_down is larger than price_up, so DV01 is positive.
For rates products, the same finite-difference idea is applied to PV:
pv01 = (pv_with_rates_down - pv_with_rates_up) / Decimal(2)
dv01 = pv01
bpv = pv01
This is why the names stay aligned even though the calculation path differs by product.