Struct CrossCurrencyLeg
pub struct CrossCurrencyLeg {
pub coupons: Leg,
pub currency: Currency,
pub collateral: CollateralSpec,
pub index: Option<String>,
pub notional: f64,
pub spread: f64,
}Expand description
One side of a cross-currency swap: a receive-oriented compiled leg and the identifiers naming what it is priced against.
Receive-oriented so that the leg’s own annuity is positive and one valuation serves both sides; the swap subtracts the pay side.
The leg carries its principal exchanges as cashflows: the notional paid
out on its first accrual start and taken back on its last accrual end, so
the valuation, legs(), the records and a non-deliverable conversion all
read one list. A resetting leg’s principal is instead the schedule its
resets set, so marking a leg resetting takes its exchanges out.
Fields§
§coupons: LegThe coupons, built with Direction::Receive.
currency: CurrencyThe leg’s currency.
collateral: CollateralSpecThe discount curve key — the leg’s currency collateralised under the swap’s CSA.
index: Option<String>The projection index a floating leg’s coupons reset against, by
registry code; None for a fixed leg, whose rate lives on its coupons
and is read through fixed_rate.
notional: f64The notional exchanged at start and end (and the base for a resetting counterpart).
spread: f64The spread carried on a floating leg’s coupons, as a decimal; zero on a fixed leg, which quotes a rate instead.
Implementations§
§impl CrossCurrencyLeg
impl CrossCurrencyLeg
pub fn new(
coupons: Leg,
currency: Currency,
collateral: CollateralSpec,
index: Option<String>,
notional: f64,
spread: f64,
) -> Self
pub fn new( coupons: Leg, currency: Currency, collateral: CollateralSpec, index: Option<String>, notional: f64, spread: f64, ) -> Self
A leg from a receive-oriented compiled leg: floating on index, or
fixed where index is None, exchanging notional at its first
accrual start and its last accrual end — unless coupons already
carries its exchanges or settles non-deliverably.
pub fn without_initial_exchange(self) -> Self
pub fn without_initial_exchange(self) -> Self
This leg exchanging its notional at the end alone: its initial exchange, if any, taken out.
pub fn fixed_rate(&self) -> Option<f64>
pub fn fixed_rate(&self) -> Option<f64>
The fixed rate a fixed leg’s coupons carry; None for a floating leg.
Trait Implementations§
§impl Clone for CrossCurrencyLeg
impl Clone for CrossCurrencyLeg
§fn clone(&self) -> CrossCurrencyLeg
fn clone(&self) -> CrossCurrencyLeg
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for CrossCurrencyLeg
impl Debug for CrossCurrencyLeg
§impl PartialEq for CrossCurrencyLeg
impl PartialEq for CrossCurrencyLeg
§fn eq(&self, other: &CrossCurrencyLeg) -> bool
fn eq(&self, other: &CrossCurrencyLeg) -> bool
self and other values to be equal, and is used by ==.