Configuring Cross-Currency Swaps - is it USDCAD or CADUSD?#

A Cross-Currency Swap (XCS) is composed of two Legs. Each leg is a different currency and in some cases it does not matter which currency in the pair one assigns to which Leg.

However, for some kinds of XCS and for some features it does matter.

Mark-to-Market Swaps#

MTM-XCSs are the default interbank XCS instrument. These Instruments have a single Leg whose notional is variable and is defined by future FX fixings. In rateslib only Leg2 can be defined as a MTM Leg. So whichever currency has the variable notional, and in general it is the dominant currency, e.g. USD or EUR where USD is not present, must be assigned to Leg2.

Thus, irrespective of how one refers to a USDCAD or CADUSD XCS, if the variable notional leg is USD this instrument should be constructed as a CADUSD instrument in rateslib.

Defining leg2_notional#

leg2_notional cannot be specified directly for a XCS, instead it is implicitly calculated from notional (on leg1) and fx_fixings. For mid-market pricing, if fx_fixings is not initially given, these will be calculated dynamically from an FXForwards object (as well as future FX fixings for MTM legs).

If you were to trade a USDCAD MTM-XCS in US$100mm with an initial FX fixing of USDCAD 1.35 implying a CA$ 135mm notional, this should not be entered as specified here. Instead it should be entered as a CADUSD MTM-XCS (with MTM Leg in USD) specified by a notional of 135mm and an initial fx_fixings of 0.74074 (=1/1.35).

In [1]: xcs = XCS(
   ...:     effective=dt(2000,1,1),
   ...:     termination="1y",
   ...:     frequency="q",
   ...:     notional=135e6,
   ...:     fx_fixings=0.7407407407407407,
   ...:     currency="cad",
   ...:     leg2_currency="usd",
   ...:  )
   ...: 

To see the cashflows of a XCS curves and fx are always required. Here we just use place holders to get a feel for the structure of this Instrument.

In [2]: xcs.cashflows(
   ...:     curves=Curve({dt(2000, 1, 1): 1.0, dt(2002, 1, 1): 1.0}),
   ...:     fx=1.0, # this value is not used an raises a UserWarning
   ...: )
   ...: 
Out[2]: 
               Type    Period  Ccy    Payment      Notional   DF  Rate      Cashflow           NPV  FX Rate       NPV Ccy Collateral  Acc Start    Acc End Convention  DCF  Spread
leg1 0     Cashflow  Exchange  CAD 2000-01-01 -135000000.00 1.00   NaN  135000000.00  135000000.00     1.00  135000000.00       None        NaT        NaT        NaN  NaN     NaN
     1  FloatPeriod   Regular  CAD 2000-04-03  135000000.00 1.00  0.00         -0.00         -0.00     1.00         -0.00       None 2000-01-01 2000-04-01    ACT365F 0.25    0.00
     2  FloatPeriod   Regular  CAD 2000-07-03  135000000.00 1.00  0.00         -0.00         -0.00     1.00         -0.00       None 2000-04-01 2000-07-01    ACT365F 0.25    0.00
     3  FloatPeriod   Regular  CAD 2000-10-03  135000000.00 1.00  0.00         -0.00         -0.00     1.00         -0.00       None 2000-07-01 2000-10-01    ACT365F 0.25    0.00
     4  FloatPeriod   Regular  CAD 2001-01-03  135000000.00 1.00  0.00         -0.00         -0.00     1.00         -0.00       None 2000-10-01 2001-01-01    ACT365F 0.25    0.00
     5     Cashflow  Exchange  CAD 2001-01-01  135000000.00 1.00   NaN -135000000.00 -135000000.00     1.00 -135000000.00       None        NaT        NaT        NaN  NaN     NaN
leg2 0     Cashflow  Exchange  USD 2000-01-01  100000000.00 1.00  0.74 -100000000.00 -100000000.00     1.00 -100000000.00       None        NaT        NaT        NaN  NaN     NaN
     1  FloatPeriod   Regular  USD 2000-04-03 -100000000.00 1.00  0.00          0.00          0.00     1.00          0.00       None 2000-01-01 2000-04-01    ACT365F 0.25    0.00
     2     Cashflow       Mtm  USD 2000-04-01          0.00 1.00  0.74         -0.00         -0.00     1.00         -0.00       None        NaT        NaT        NaN  NaN     NaN
     3  FloatPeriod   Regular  USD 2000-07-03 -100000000.00 1.00  0.00          0.00          0.00     1.00          0.00       None 2000-04-01 2000-07-01    ACT365F 0.25    0.00
     4     Cashflow       Mtm  USD 2000-07-01          0.00 1.00  0.74         -0.00         -0.00     1.00         -0.00       None        NaT        NaT        NaN  NaN     NaN
     5  FloatPeriod   Regular  USD 2000-10-03 -100000000.00 1.00  0.00          0.00          0.00     1.00          0.00       None 2000-07-01 2000-10-01    ACT365F 0.25    0.00
     6     Cashflow       Mtm  USD 2000-10-01          0.00 1.00  0.74         -0.00         -0.00     1.00         -0.00       None        NaT        NaT        NaN  NaN     NaN
     7  FloatPeriod   Regular  USD 2001-01-03 -100000000.00 1.00  0.00          0.00          0.00     1.00          0.00       None 2000-10-01 2001-01-01    ACT365F 0.25    0.00
     8     Cashflow  Exchange  USD 2001-01-01 -100000000.00 1.00  0.74  100000000.00  100000000.00     1.00  100000000.00       None        NaT        NaT        NaN  NaN     NaN

Calculating the rate#

The XCS.rate method can calculate the implied rate for any kind of XCS, whether it is parameterised as Float/Float, Fixed/Float, Float/Fixed, Fixed/Fixed and MTM or non-MTM. By default it will calculate the spread on Leg1 which is traditionally where the basis-point spread is assigned (to the non-MTM Leg). For a CADUSD XCS this would align with market standard quotations.