Module records
Expand description
An instrument’s cashflow table, resolved against a market.
cashflows::records knows legs and coupons and
nothing about markets; this is the half that knows both. It pairs the keys a
product declares with the curves the market resolved under them, so
each coupon is projected off the curve it names rather than off one curve
chosen for the whole table.
The pairing is built here and not carried on the view. Valuation needs
no key-directed lookup — every product’s own npv arm already knows which
leg reads which curve — and resolve runs once per trade in a book
valuation. Making PricingView remember the keys it resolved from would
put either an allocation or a lifetime bound on that path to serve a
reporting one. A table is asked for rarely; a book is valued constantly.
Constants§
- ENTRY_
POINT 🔒 - The entry point’s name in every refusal below, so a caller reads one name whichever way the table is unavailable.
Functions§
- a_
table_ 🔒cannot_ describe - Whether a product’s own declared risk factors rule a cashflow table out: a foreign discount on legs that do not convert, or a credit entity.
- bond_
forward_ 🔒records - A bond forward’s payoff as one
ForwardPayoffrow at settlement:amountisF_dirty·N/100 − strike_amountin the contract’s long terms,directioncarries the side, andpvis the forward’s value. No row once settlement has passed, asnpvreads it. - bond_
trs_ 🔒records - A bond total return swap’s flows, in two legs: a
Returnrow per remaining reset period, the basket’s clean-price return carried on the repo curve plus the bond flows its window holds (a flow paid immediately gets aReturnrow of its own), then aFundingrow per funding coupon.pvcarries the side, so the column sums to the swap’s value. - cds_
protection_ 🔒by_ period - A CDS’s expected protection per premium period: the pricer’s integration grid, each interval’s expected loss credited to the period its midpoint falls in.
- cds_
records 🔒 - A CDS’s flows: a
Premiumrow per coupon the valuation reads, with its coupon details and itspvsurvival-weighted to the day before payment; aProtectionrow per premium period from protection start, the notional it protects,ratethe loss given default andpvthat period’s expected protection on the pricer’s own integration grid; andAccrualOnDefault,UpfrontandRebaterows where the contract has them.pvsums tonpv.factorscales every row’s notional, amount and value: one for a single-name contract, an index’s remaining fraction for an index CDS. - cds_row 🔒
- One CDS row with the contract’s identity filled and every number empty.
- cds_
settlement_ 🔒rows - A CDS’s accrual on default and its settlements, each a row where the contract has it, signed as the pricer signs it.
- conversion_
of 🔒 - A non-deliverable leg’s conversion, read off the view exactly as the
valuation reads it;
Nonefor a deliverable leg. - fee_
records 🔒 - A fee’s one payment as a
Feerow,amountunsigned anddirectioncarrying the side; no row once it has paid. - fra_
records 🔒 - A FRA’s settlement as one
Settlementrow, paid on the accrual start, itspvthe FRA’s value; no row once the start has passed, asnpvreads it.amountis the settlement in the contract’s own terms (long the rate), so its sign is the rate against the strike anddirectioncarries the side. - instrument_
cashflow_ records - One instrument’s cashflows as records, against
view. - linker_
records 🔒 - A linker’s indexed flows as records: an
Indexedrow per remaining real coupon, its rate the real coupon rate times the index ratio observed for its period, and aRedemptionrow indexed on the last period’s ratio — or the par amount, unmultiplied, where the redemption floor binds — exactly as the pricer values them, so thepvcolumn sums to the bond’s value. - refuses_
a_ cashflow_ table - Why this instrument can have no cashflow table, or
Nonewhere it can. - repo_
coupon_ 🔒rows - A repo’s informational coupon rows: each coupon the lender is entitled to, manufactured (classic) or netted at the far date (buy/sell-back), still ahead of the valuation date.
- repo_
records 🔒 - A repo’s flows as records, on the repo curve its value reads:
- resetting_
leg_ 🔒records - A resetting leg’s rows in its own currency, as its value reads them: each
coupon on the notional set at its period’s start, then an
Exchangerow for the initial notional out, the stepN(i−1) − N(i)at each later reset and the final notional back.pvis signed forsideand not yet converted. - trs_
funding_ 🔒rows - A bond total return swap’s
Fundingrows, one per remaining funding coupon on the curve its value reads,pvsigned against the return. - xccy_
records 🔒 - A deliverable cross-currency swap’s flows: the pay leg’s rows (
leg0), then the receive leg’s (leg1), each discounted and projected on its own side’s curves with its amounts in its own currency. Everypvis converted into the swap’s valuation currency at spot, asnpvconverts, andsettlement_currencynames it, so the column sums tonpv. - zc_
inflation_ 🔒swap_ records - A zero-coupon inflation swap’s two payments at maturity: the
Fixedside,N · (growth − 1)at the fixed rate, then theIndexedside,N · (ratio − 1)on the index rationpvreads.rateis the fixed rate and the index’s growth over the life; the twopvs sum to the swap’s value. No rows once maturity has passed.