Struct XccySwapTemplate
pub struct XccySwapTemplate {
pub name: String,
pub leg1: XccyLegTemplate,
pub leg2: XccyLegTemplate,
pub spot_lag: Period,
pub notional_exchange: NotionalExchange,
pub coupon_mode: CouponMode,
pub deliverability: Deliverability,
pub fx_index: Option<FxIndexSpec>,
pub collateral: CsaSpec,
pub quoted_spread_leg: XccyLegSide,
}Expand description
Per-leg conventions for a cross-currency swap: two legs plus swap-level fields.
leg1/leg2 are neutral names; pay/receive direction is a trade-time concern.
Derives Clone + Debug? — NotionalExchange::Mtm holds a Vec, so this is
Clone only (no Eq/Hash).
Fields§
§name: StringTemplate name (doubles as registry code).
leg1: XccyLegTemplateFirst leg.
leg2: XccyLegTemplateSecond leg.
spot_lag: PeriodSpot lag (settlement convention).
notional_exchange: NotionalExchangeNotional-exchange shape.
coupon_mode: CouponModeCoupon-payment shape (standard vs zero-coupon at maturity).
deliverability: DeliverabilityDeliverable vs non-deliverable.
fx_index: Option<FxIndexSpec>FX-index metadata. Some iff notional_exchange is Mtm.
collateral: CsaSpecCollateral (CSA) specification. Mandatory — no implicit default.
quoted_spread_leg: XccyLegSideWhich leg carries the quoted spread / rate.
Implementations§
§impl XccySwapTemplate
impl XccySwapTemplate
pub fn custom(
name: impl Into<String>,
leg1: XccyLegTemplate,
leg2: XccyLegTemplate,
collateral: CsaSpec,
) -> Result<Self, XccyTemplateError>
pub fn custom( name: impl Into<String>, leg1: XccyLegTemplate, leg2: XccyLegTemplate, collateral: CsaSpec, ) -> Result<Self, XccyTemplateError>
A cross-currency template of the caller’s own: leg1 against leg2,
collateralised under collateral, the spread quoted on leg1, both
notionals exchanged at start and end, spot two days out.
It never enters the registry, which states market conventions; it
carries name so a refusal or a report can say which it is. Override
the quoted leg, the resetting leg, the collateral or the spot lag
with the builders.
§Errors
XccyTemplateError::OneCurrency if both legs are in one currency.
pub fn leg(&self, side: XccyLegSide) -> &XccyLegTemplate
pub fn leg(&self, side: XccyLegSide) -> &XccyLegTemplate
The leg on side.
pub fn side_in(&self, currency: &str) -> Option<XccyLegSide>
pub fn side_in(&self, currency: &str) -> Option<XccyLegSide>
The side whose leg is in currency, if either is.
pub fn with_leg(
self,
side: XccyLegSide,
leg: XccyLegTemplate,
) -> Result<Self, XccyTemplateError>
pub fn with_leg( self, side: XccyLegSide, leg: XccyLegTemplate, ) -> Result<Self, XccyTemplateError>
This template with leg on side.
A resetting template keeps resetting the leg on the side it did, so a replaced leg in another currency moves the variable notional with it.
§Errors
XccyTemplateError::OneCurrency if the new leg is in the other
leg’s currency.
pub fn with_quoted_spread_leg(self, side: XccyLegSide) -> Self
pub fn with_quoted_spread_leg(self, side: XccyLegSide) -> Self
This template quoting its spread on side.
pub fn with_spot_lag_days(self, days_after: i32) -> Self
pub fn with_spot_lag_days(self, days_after: i32) -> Self
This template settling days business days after the trade.
pub fn resetting_leg(&self) -> Option<XccyLegSide>
pub fn resetting_leg(&self) -> Option<XccyLegSide>
The side whose notional resets, if one does.
pub fn with_settlement_currency(
self,
code: &str,
) -> Result<Self, XccyTemplateError>
pub fn with_settlement_currency( self, code: &str, ) -> Result<Self, XccyTemplateError>
This non-deliverable template settling in code: a leg in code
pays deliverably, and every other leg must carry an FX source, a
source settling in USD crossing through USD into code.
§Errors
XccyTemplateError::Deliverable on a deliverable template.
pub fn with_leg_fx(self, side: XccyLegSide, fx: Option<LegFx>) -> Self
pub fn with_leg_fx(self, side: XccyLegSide, fx: Option<LegFx>) -> Self
This template with the leg on side sourcing its FX fixing from fx,
or from none — the per-leg terms a custom non-deliverable template
states.
pub fn with_initial_exchange(
self,
initial: bool,
) -> Result<Self, XccyTemplateError>
pub fn with_initial_exchange( self, initial: bool, ) -> Result<Self, XccyTemplateError>
This template exchanging its notional at the start as well as the
end, or, with false, at the end alone. An opted-in initial exchange
on a non-deliverable template converts at the trade’s FX rate — the
deal rate.
§Errors
XccyTemplateError::InitialExchangeOnResetting on a resetting
template.
pub fn with_resetting_leg(self, side: Option<XccyLegSide>) -> Self
pub fn with_resetting_leg(self, side: Option<XccyLegSide>) -> Self
This template resetting the notional on side to the forward FX rate
at every period, or, with None, exchanging a constant notional — at
start and end coming off a resetting template, as it was otherwise.
An FX index already on the template keeps its pair, reset lag and calendar; a new one takes the pair from the two currencies, a two-day lag and the resetting leg’s calendar. Pricing reads which leg resets; the lag and calendar are carried as the contract’s shape.
§impl XccySwapTemplate
impl XccySwapTemplate
pub fn with_spot_lag(self, days: i32) -> Self
pub fn with_spot_lag(self, days: i32) -> Self
Overrides the spot lag (business days) — builder-style, as
OisTemplate::with_spot_lag
does. The cross-currency constructor takes a template value, so the
override reaches the instrument.
Trait Implementations§
§impl Clone for XccySwapTemplate
impl Clone for XccySwapTemplate
§fn clone(&self) -> XccySwapTemplate
fn clone(&self) -> XccySwapTemplate
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more