Module linker
Expand description
Street quote conventions for inflation-linked bonds.
A linker is priced by scaling its real flows by the index at a plainly lagged date. It is quoted by a rule its market publishes, and the two are not the same rule โ the same split a nominal bond already has between curve-space and yield-space. Nothing here changes what a linker is worth; it changes what number the market puts on it.
Most of that number is arithmetic this crate already has. TIPS, Canadian
RRBs and UK gilts at the three-month lag all quote a real yield on the
real flows, and InflationLinkedBond::real is exactly that bond โ so
their quotes are dirty_price on the real twin at a
street basis, and no second implementation of the price/yield relationship
appears here. What those three markets genuinely need is the two pieces
below: a reference-index observation and a rounding chain.
Three markets are more than that, and each says so: UK gilts at the
eight-month lag leave real space for money space, Brazilian NTN-Bs discount
on BUS/252 against a VNA, and Australian capital-indexed bonds carry a
quarterly Kt recursion.
Structsยง
- Anbima
Parcel - One discounted parcel of an ANBIMA quotation.
- Anbima
Quote - An ANBIMA quotation: its parcels, the quotation, and the unit price.
- Australian
Snapshot ๐ - The yield-independent AOFM inputs.
- Linker
Invoice - What a linker actually settles at, per 100 nominal face.
- Rounding
Chain - What a market does to its reference index and to the ratio built from it.
- UkDmo
Snapshot ๐ - The yield-independent inputs to the DMO case formula.
Enumsยง
- Linker
Quote Error - A street quote asked of a market that does not serve it, or that could not be produced.
- Month
Observation - How a market reads the index inside the lagged month.
- Rounding
Step - One rounding step in a marketโs published chain.
Constantsยง
- DMO_
ASSUMED_ INFLATION - The DMOโs standing inflation assumption for eight-month-lag money/real arithmetic.
- REAL_
YIELD_ ๐FAMILY - The markets whose street quote is a real yield on the real flows.
Functionsยง
- anbima_
nominal_ value - The official VNA at
date:1000 ยท I(date)/I_base, truncated to six decimals. - anbima_
price - The ANBIMA quotation at a real yield (
tir, per annum as a decimal). - anbima_
price_ ๐from_ snapshot - The unit price over a snapshot, applying the same truncation chain
anbima_pricedoes without materialising parcels. - anbima_
snapshot ๐ - The yield-independent ANBIMA flow snapshot: per remaining flow its date, business-day count, amount, and truncated exponent.
- anbima_
yield_ from_ price - The real yield implied by an ANBIMA unit price, by bisection over the exact truncation chain.
- australian_
coupon_ factor - The AOFM
pfor the payment atnext_coupon: half the percentage CPI movement over the two quarters ending two quarters before that paymentโs quarter,p = roundโ(50ยท(CPIโ/CPIโโโ โ 1)). - australian_
indexation_ factor - The
Ktatdatein ratio form:roundโ(100 ยท I(lagged(date))/I_base). - australian_
kt_ step - One exact step of the AOFM
Ktchain:Kt = roundโ(Ktโโ ยท (1 + p/100)). - australian_
price_ from_ real_ yield - The AOFM price per 100 face at a quarterly-compounded real yield.
- australian_
price_ ๐from_ snapshot - The AOFM price formula at a trial quarterly-compounded real yield:
- australian_
real_ yield_ from_ price - The quarterly-compounded real yield implied by an AOFM price.
- australian_
snapshot ๐ - days_
in_ ๐month - Days in
dateโs own month โ the denominator of the daily interpolation. - invoice
- The settlement invoice for a real-yield-quoting linker at a real clean quote.
- lagged_
month_ ๐start - The first of the month
lagmonths beforedate. - month_
point ๐ - One monthly index point: a published fixing where there is one, the curve otherwise.
- months_
between ๐ - Whole months from
fromโs month totoโs month. - period_
containing ๐ - The coupon period containing
settlement, as(start, end). - periods_
as_ ๐f64 - A whole-period count as a float. A bond has few periods, so the conversion cannot lose anything; written out rather than cast so the pedantic lints stay on.
- quotes_
real_ yield - Whether
conventionquotes a real yield, given the bondโs lag. - real_
clean_ ๐price_ of - The real clean price per 100: the real dirty price less the real twinโs accrued. Accrued is in real terms too, so nothing indexes here.
- real_
dirty_ ๐price_ of - The real dirty price per 100 at a street real yield.
- real_
price - The real price at
real_yieldon the requested basis โ one door for a caller holding a parsedPriceBasisrather than a branch over two signatures. - real_
yield - The street real yield implied by a real clean quote โ the inverse of
real_priceat the clean basis. - real_
yield_ basis - The street basis a real yield is quoted on: semiannual for every market in this family.
- reference_
index - The street reference index at
date. - require_
anbima ๐ - require_
australian ๐ - require_
bullet ๐ - The sovereign street kernels quote a bullet; an amortising real twin is refused by name rather than read as one.
- require_
real_ ๐yield - require_
uk ๐ - round_
dp - Round
xto the nearest value atdpdecimal places. - street_
index_ ratio - The street index ratio at
date, by the bondโs own market convention. - street_
rule - The observation and rounding chain a marketโs street quote reads by.
- trunc_
dp - Truncate
xtoward zero atdpdecimal places. - uk_
anchor ๐ - The DMO projection anchor
a = (RPI_L/RPI_B)ยทu^{2k/12}: the latest published RPI deflated backkmonths to the next dividendโs defining month, withu = (1+ฯ)^{โ1/2}. - uk_
dmo_ ๐snapshot - uk_
latest_ ๐rpi - The latest published monthly index print strictly before
settlementโs month, scanning back up to eighteen months of fixings and falling back to the curve at the previous month start. - uk_
money_ accrued - The money accrued per 100 at
settlement. - uk_
money_ ๐dirty_ from_ snapshot - The DMO case formula at a trial real yield:
- uk_
money_ price - The money dirty price per 100 at a semiannual real yield.
- uk_
money_ yield - The DMO money yield implied by a real yield under assumed annual inflation
pi:(1 + y/2) = (1 + ฯ/2)ยท(1 + ฯ)^{1/2}. - uk_
real_ yield_ from_ money - The real yield implied by a DMO money yield โ the inverse of
uk_money_yield. - uk_
real_ yield_ from_ money_ dirty - The semiannual real yield implied by a money dirty price โ the inverse
of
uk_money_price, by bisection over the case formula.