Struct CrossCurrencyAssetSwap
pub struct CrossCurrencyAssetSwap {
pub package: AssetSwap,
pub float_currency: Currency,
pub fx_rate: f64,
pub float_discount: CollateralSpec,
pub bond_discount: CollateralSpec,
}Expand description
A cross-currency asset swap: a bond in one currency packaged with a
floating leg in another at a contract FX rate. Par-par, the buyer pays par
in the floating currency, N_Y = N·fx_rate, against the bond’s dirty
proceeds converted at the same rate; on proceeds the floating leg runs on
the converted proceeds, N_Y = P_dirty·N·fx_rate, so the exchanges at the
start cancel and the proceeds come back at the end. Either way the buyer
pays the bond’s flows away in its own currency and receives floating plus
the spread on N_Y. To the buyer, in the floating currency,
s·A_Y + I_Y − S·PV_bond + P_dirty·N·fx_rate·DF_Y(start)A_Y and I_Y are AssetSwap’s floating leg on N_Y and the floating
currency’s curves, PV_bond the bond’s flows on its own currency’s curve
under the floating currency’s CSA, and S spot, floating units per bond
unit. In one currency at a rate of one it is the asset swap.
Fields§
§package: AssetSwapThe package: the bond, the floating schedule on the floating index, the bond’s face as notional, the traded dirty price and the spread.
float_currency: CurrencyThe floating leg’s currency.
fx_rate: f64The contract rate, floating units per bond unit.
float_discount: CollateralSpecThe floating currency’s own discount key.
bond_discount: CollateralSpecThe bond’s currency under the floating currency’s CSA.
Implementations§
§impl CrossCurrencyAssetSwap
impl CrossCurrencyAssetSwap
pub fn new(
package: AssetSwap,
float_currency: Currency,
fx_rate: f64,
) -> Result<Self, CrossCurrencyAssetSwapError>
pub fn new( package: AssetSwap, float_currency: Currency, fx_rate: f64, ) -> Result<Self, CrossCurrencyAssetSwapError>
package with its floating leg in float_currency, struck at
fx_rate floating units per bond unit.
§Errors
CrossCurrencyAssetSwapError for a bond in the floating currency,
or an FX rate that is not positive and finite.
pub fn float_notional(&self) -> f64
pub fn float_notional(&self) -> f64
The floating notional: the package’s convention notional at the
contract rate, N·fx_rate par-par, P_dirty·N·fx_rate on proceeds.
§impl CrossCurrencyAssetSwap
impl CrossCurrencyAssetSwap
fn unspread<R: Scalar>(
&self,
view: &PricingView<'_, R>,
) -> Result<(R, R), PricingError>
fn unspread<R: Scalar>( &self, view: &PricingView<'_, R>, ) -> Result<(R, R), PricingError>
Everything but the spread leg, to the buyer in the floating currency,
I_Y − S·PV_bond + P_dirty·N·fx_rate·DF_Y(start), with the annuity on
N_Y the spread multiplies.
Trait Implementations§
§impl Clone for CrossCurrencyAssetSwap
impl Clone for CrossCurrencyAssetSwap
§fn clone(&self) -> CrossCurrencyAssetSwap
fn clone(&self) -> CrossCurrencyAssetSwap
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 CrossCurrencyAssetSwap
impl Debug for CrossCurrencyAssetSwap
§impl PartialEq for CrossCurrencyAssetSwap
impl PartialEq for CrossCurrencyAssetSwap
§fn eq(&self, other: &CrossCurrencyAssetSwap) -> bool
fn eq(&self, other: &CrossCurrencyAssetSwap) -> bool
self and other values to be equal, and is used by ==.§impl<R: Scalar> Priceable<R> for CrossCurrencyAssetSwap
impl<R: Scalar> Priceable<R> for CrossCurrencyAssetSwap
§fn npv(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>
fn npv(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>
To the buyer, s·A_Y + I_Y − S·PV_bond + P_dirty·N·fx_rate·DF_Y(start);
negated for the seller.
§fn par_spread(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>
fn par_spread(&self, view: &PricingView<'_, R>) -> Result<R, PricingError>
The spread that zeroes the package, in closed form.
§fn par_rate(&self, _view: &PricingView<'_, R>) -> Result<R, PricingError>
fn par_rate(&self, _view: &PricingView<'_, R>) -> Result<R, PricingError>
§impl PricingRiskFactors for CrossCurrencyAssetSwap
impl PricingRiskFactors for CrossCurrencyAssetSwap
§fn risk_factors(&self) -> Result<RiskFactors<'_>, PricingError>
fn risk_factors(&self) -> Result<RiskFactors<'_>, PricingError>
The floating currency’s curve and index, and the bond’s currency under the floating currency’s CSA.
§impl Product for CrossCurrencyAssetSwap
impl Product for CrossCurrencyAssetSwap
§fn currency(&self) -> Currency
fn currency(&self) -> Currency
§fn contract_dates(&self) -> Vec<(&'static str, NaiveDate)>
fn contract_dates(&self) -> Vec<(&'static str, NaiveDate)>
(name, date) pairs —
exactly the dates its stated constructor takes, so a product built
through a derived form can be read back and rebuilt through the stated
one. Empty for a product with no stated form. No default: every
product states which it is — see AnyInstrument::contract_dates.§fn legs(&self) -> Option<Vec<&Leg>>
fn legs(&self) -> Option<Vec<&Leg>>
None
for a product that holds none — see AnyInstrument::legs. No
default: every product states which it is.§fn final_payment_date(&self) -> Option<NaiveDate>
fn final_payment_date(&self) -> Option<NaiveDate>
None for a product no ladder is built from.§fn restruck_at_rate(&self, _rate: f64) -> Option<AnyInstrument>
fn restruck_at_rate(&self, _rate: f64) -> Option<AnyInstrument>
rate — the scalar a par
calibration rung on it is quoted in — or None for a product that
carries no such scalar. What a quote scenario moves a rung to.§fn restruck_at_spread(&self, _spread: f64) -> Option<AnyInstrument>
fn restruck_at_spread(&self, _spread: f64) -> Option<AnyInstrument>
spread on its spread
leg, or None for a product that quotes none.