Module instruments
Expand description
Instrument types: what a trade is, with no opinion on how it is valued.
Every field is passive contract data, and no type here takes a scalar type parameter — an instrument is the same value whatever mode it will later be priced in. What a trade holds is its legs (themselves compiled and passive), its currency, its collateral, and the identifiers naming the market data it is priced against.
The pricers live one layer up, with the seam they are written against, because pricing needs the resolved market view, and the view is the seam’s business. An instrument that knew how to fetch its own curves would be a layering inversion wearing a convenience.
Re-exports§
pub use bonds::CallableBond;
Modules§
- asset_
swap - The asset swap: a reference bond packaged with a floating leg, quoted as a spread over the risk-free curve.
- bond_
derivatives - Bond derivatives: the European option on a cash bond, and the bond future’s deliverable basket.
- bonds
- Fixed-rate bonds, and the yield-space analytics a street quote is read in.
- cap_
floor - An interest-rate cap or floor: a strip of options on a term index’s coupons.
- cpi_
cap_ floor - A zero-coupon inflation cap or floor: one option on a price index’s growth over the trade’s life.
- credit
- Credit instruments.
- credit_
linked - A credit-linked swap: ordinary legs, each tagged with how it depends on one reference entity’s default, with legs in several currencies.
- curve_
pin - A calibration target on a curve’s own reading.
- equity
- Equity options: a European call or put on a quoted equity, valued as Black-Scholes on the dividend-free forward.
- fee
- A standalone fee: one known amount paid or received on a date — the way an upfront is attached to a structure.
- financing
- Financing trades: the bond forward and the bond total return swap.
- fx
- FX forwards and swaps: two cashflows in two currencies, and a pair of them.
- loan
- A loan: the principal drawn at the start, interest on each period and the principal repaid at the end, booked from the lender’s side.
- pik
- The accretion seam and the fixed-rate payment-in-kind bond.
- rates
- Single-currency interest-rate products: the two swaps, the forward-rate agreement, the money-market deposit, the STIR future, the zero-coupon swap and the tenor basis swap.
- repack
- The single-asset repack note: what a limited-recourse SPV holds and owes.
- repo
- A repo: cash against a bond, returned at a far date for cash plus interest.
- straddle
- A two-option strategy booked as one product — a straddle, or a strangle when the strikes differ: its value is the options’ sum and its quote is the one flat vol that reprices them, the way a straddle is quoted.
- structured
- A structured note: a leg of composed coupons and the face it redeems.
- swaptions
- Swaptions: the European option on a swap, and the Bermudan.
- yoy_
cap_ floor - A year-on-year inflation cap or floor: a strip of options on a price index’s annual growth.
Macros§
- dispatch 🔒
dispatch!(on, x => body):bodyevaluated withxbound to the product insideon, whichever it is — the forwarding match, written once for every per-product method.- products 🔒
- Declares the built-in products once. From one list it derives the enum, the
runtime name
AnyInstrument::product_namereturns, theAnyInstrument::PRODUCT_NAMESa caller resolves against, anddispatch!, which writes the forwarding match every per-product method delegates through.
Structs§
- NotThe
Product - A product-specific reading asked of another product: the verb, the
product it takes and the product it was given. A caller’s input, raised as
ValueErrorin Python, carrying this text.
Enums§
- AnyInstrument
- The closed instrument set.
Traits§
- Product
- What every built-in product states about itself, beside how it is priced.
Functions§
- last_
payment 🔒 - The last payment date across
legs’ coupons — a swap’s final payment.