Skip to main content

Module records

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 ForwardPayoff row at settlement: amount is F_dirty·N/100 − strike_amount in the contract’s long terms, direction carries the side, and pv is the forward’s value. No row once settlement has passed, as npv reads it.
bond_trs_records 🔒
A bond total return swap’s flows, in two legs: a Return row 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 a Return row of its own), then a Funding row per funding coupon. pv carries 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 Premium row per coupon the valuation reads, with its coupon details and its pv survival-weighted to the day before payment; a Protection row per premium period from protection start, the notional it protects, rate the loss given default and pv that period’s expected protection on the pricer’s own integration grid; and AccrualOnDefault, Upfront and Rebate rows where the contract has them. pv sums to npv. factor scales 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; None for a deliverable leg.
fee_records 🔒
A fee’s one payment as a Fee row, amount unsigned and direction carrying the side; no row once it has paid.
fra_records 🔒
A FRA’s settlement as one Settlement row, paid on the accrual start, its pv the FRA’s value; no row once the start has passed, as npv reads it. amount is the settlement in the contract’s own terms (long the rate), so its sign is the rate against the strike and direction carries the side.
instrument_cashflow_records
One instrument’s cashflows as records, against view.
linker_records 🔒
A linker’s indexed flows as records: an Indexed row per remaining real coupon, its rate the real coupon rate times the index ratio observed for its period, and a Redemption row indexed on the last period’s ratio — or the par amount, unmultiplied, where the redemption floor binds — exactly as the pricer values them, so the pv column sums to the bond’s value.
refuses_a_cashflow_table
Why this instrument can have no cashflow table, or None where 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 Exchange row for the initial notional out, the step N(i−1) − N(i) at each later reset and the final notional back. pv is signed for side and not yet converted.
trs_funding_rows 🔒
A bond total return swap’s Funding rows, one per remaining funding coupon on the curve its value reads, pv signed against the return.
xccy_records 🔒
A deliverable cross-currency swap’s flows: the pay leg’s rows (leg 0), then the receive leg’s (leg 1), each discounted and projected on its own side’s curves with its amounts in its own currency. Every pv is converted into the swap’s valuation currency at spot, as npv converts, and settlement_currency names it, so the column sums to npv.
zc_inflation_swap_records 🔒
A zero-coupon inflation swap’s two payments at maturity: the Fixed side, N · (growth − 1) at the fixed rate, then the Indexed side, N · (ratio − 1) on the index ratio npv reads. rate is the fixed rate and the index’s growth over the life; the two pvs sum to the swap’s value. No rows once maturity has passed.