Module fx
Expand description
FX forwards and swaps: two cashflows in two currencies, and a pair of them.
An outright forward exchanges base_amount of the base currency against
quote_amount of the quote currency on a value date. Every field is passive
contract data — amounts, dates, the settlement kind, the two collateral keys
its legs discount under — and the instrument carries no scalar type. The
rate is derived (quote = −base·rate), which is what makes a swap’s far leg
a plain negation of the near and keeps “buy base, sell quote” unambiguous.
A cash-settled forward (the NDF arm) nets both amounts at a published fixing and pays one cashflow in the settlement currency. The fixing date is a contract term — it is written on the confirm — so it is stored here rather than derived at pricing time from an index convention; the index name says which fixing series to read.
Re-exports§
pub use crate::marketdata::fixings::FixingSource;pub use crate::marketdata::fixings::FixingSourceError;
Structs§
- FxForward
- An outright FX forward.
- FxOption
- A European FX vanilla: a call or put on the base currency against the quote currency, premium in the quote currency. Every field is passive.
- FxOption
Diagnostics - What an FX option resolved to when it was priced, passively.
- FxSwap
- An FX swap: a near forward and a far forward on the same pair in opposite directions.
Enums§
- FxError
- An FX instrument that cannot be built as specified.
- Settlement
- How a forward settles.
- Strike
- How an FX option’s strike is stated.
Functions§
- checked_
cash 🔒 - A cash settlement on the
base/quotepair, checked:settleone of the pair, and a cross fixing the pair’s quote per base in its base. - offshore_
collateral 🔒 - The collateral keys of a pair settled in
settle,(base, quote): the settlement leg on its own curve, the leg never paid on its offshore curve{CCY}-CSA-USD— the dollar-collateralised curve NDF outrights mark, which is where the forward of a currency that cannot be delivered lives, whatever the settlement currency. A dollar leg is its own curve.