Skip to main content

calibrate_cross_currency

Function calibrate_cross_currency 

pub fn calibrate_cross_currency(
    reference: NaiveDate,
    pay_discount: &Curve,
    pay_projection: &Curve,
    recv_projection: Option<&Curve>,
    rungs: &[Rung],
    fixings: &FixingStore,
    fx: &FxRates,
    tolerance: Tolerance,
    scheme: Interpolation,
) -> Result<Calibrated, CalibrationError>
Expand description

Calibrates the discount curve of a cross-currency swap’s receive leg under its collateral — EUR under a USD CSA, from EUR/USD basis swaps — against a pay-leg discount curve and both legs’ projection curves already known.

The same sequential solve as calibrate, sweeps included, with every rate role of the view fixed and passive and the curve under solve in the receive leg’s discount slot. Which curve is solved is therefore a property of how the rung was built: a template swap receives its quoted-spread leg, so for a basis quoted on EUR the receive leg is EUR and this solves EUR under the template’s CSA. To solve the other side, build the rung reversed.

A rung is a Rung::spread at the quoted basis: the swap’s value is exactly affine in its spread, so the fair basis is what the quote is verified against. The FX spot comes from fx, as it does for pricing. A rung projecting two different indices is what a cross-currency swap is, and is accepted in this form.

The result is the same Calibrated a rate ladder returns — the curve, its solves and sweeps, and provenance with the par-quote Jacobian — because nothing about a solved discount curve is cross-currency once it is solved.

§Errors

As calibrate; a missing FX pair fails through the swap’s own error, naming the pair.