Skip to content
TotalFinance

Fixed income · @insiderfinance/totalfinance

@insiderfinance/totalfinance/fixed-income/cross-currency

import { … } from '@insiderfinance/totalfinance/fixed-income/cross-currency'
stable-by-law (pre-1.0; not a 1.0 stability guarantee)iface 4fn 2JSON ↗
iface

CrossCurrencyBasisInput

#

Public declaration. Read the signature and member contracts below; no additional behaviour is inferred.

Signature
import type { CrossCurrencyBasisInput } from '@insiderfinance/totalfinance/fixed-income/cross-currency';

export interface CrossCurrencyBasisInput {
    /** FX spot: domestic units per 1 foreign unit. */
    spot: number;
    /** Domestic collateral (OIS) discount curve. */
    domestic: YieldCurve;
    /** Foreign index/OIS discount curve (pre-basis). */
    foreign: YieldCurve;
    /**
     * Cross-currency basis term structure added to the foreign curve (its zero rates ARE the basis
     * spreads). Omit for the pure covered-interest-parity case (no basis): `fxForward` is then
     * `spot · D_for(t)/D_dom(t)` and the collateralized curve is the foreign curve itself.
     */
    basis?: YieldCurve;
}
Fields, parameters and returned members (85)

Loading 85 members…

Stability: stable-by-law (pre-1.0; not a 1.0 stability guarantee). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.

iface

CrossCurrencyBasisResult

#

Public declaration. Read the signature and member contracts below; no additional behaviour is inferred.

Signature
import type { CrossCurrencyBasisResult } from '@insiderfinance/totalfinance/fixed-income/cross-currency';

export interface CrossCurrencyBasisResult {
    /** Applied conventions, echoed (Law 2 report grammar). */
    assumptions: {
        conventionsVersion: string;
        [k: string]: unknown;
    };
    /** Structured warnings; always present (possibly empty). */
    diagnostics: {
        warnings: QuantWarning[];
    };
    /** The domestic-collateralized foreign discount curve (`foreign + basis`). Discount foreign cash flows on THIS. */
    collateralizedCurve: YieldCurve;
    /** Market FX forward at `at`, from the collateralized curve: `spot · D_for^dom(at) / D_dom(at)`. */
    fxForward(at: string | number): number;
}
Fields, parameters and returned members (34)

Loading 34 members…

Stability: stable-by-law (pre-1.0; not a 1.0 stability guarantee). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.

iface

ImpliedCrossCurrencyBasisInput

#

Public declaration. Read the signature and member contracts below; no additional behaviour is inferred.

Signature
import type { ImpliedCrossCurrencyBasisInput } from '@insiderfinance/totalfinance/fixed-income/cross-currency';

export interface ImpliedCrossCurrencyBasisInput {
    /** FX spot: domestic units per 1 foreign unit. */
    spot: number;
    /** Domestic collateral (OIS) discount curve. */
    domestic: YieldCurve;
    /** Foreign index/OIS discount curve (pre-basis). */
    foreign: YieldCurve;
    /** Observed market FX forwards `[date, forward]` (domestic per foreign). */
    forwards: [
        string,
        number
    ][];
}
Fields, parameters and returned members (58)

Loading 58 members…

Stability: stable-by-law (pre-1.0; not a 1.0 stability guarantee). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.

iface

ImpliedCrossCurrencyBasisResult

#

Public declaration. Read the signature and member contracts below; no additional behaviour is inferred.

Signature
import type { ImpliedCrossCurrencyBasisResult } from '@insiderfinance/totalfinance/fixed-income/cross-currency';

export interface ImpliedCrossCurrencyBasisResult {
    /** Applied conventions, echoed (Law 2 report grammar). */
    assumptions: {
        conventionsVersion: string;
        [k: string]: unknown;
    };
    /** Structured warnings; always present (possibly empty). */
    diagnostics: {
        warnings: QuantWarning[];
    };
    /** Implied continuous cross-currency basis spread at each forward date (collateralized zero − foreign zero). */
    basis: {
        date: string;
        spread: number;
    }[];
}
Fields, parameters and returned members (5)
Name · typeMeaning · unitRequired · default
assumptions{ [k: string]: unknown; conventionsVersion: string; }

Applied conventions, echoed (Law 2 report grammar).

unitless by name
RequiredNo @default declared
assumptions.conventionsVersionstring—unitless by nameRequiredNo @default declared
basis{ date: string; spread: number; }[]

Implied continuous cross-currency basis spread at each forward date (collateralized zero − foreign zero).

unitless by name
RequiredNo @default declared
diagnostics{ warnings: QuantWarning[]; }

Structured warnings; always present (possibly empty).

unitless by name
RequiredNo @default declared
diagnostics.warningsQuantWarning[]—unitless by nameRequiredNo @default declared

Stability: stable-by-law (pre-1.0; not a 1.0 stability guarantee). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.

fn

crossCurrencyBasisCurve

#

Build the domestic-collateralized foreign discount curve (spec §14.5): the foreign OIS curve plus the cross-currency basis, D_for^dom = foreign.addSpread(basis). This is the curve on which to discount foreign cash flows collateralized in the domestic currency, and it reprices the FX forwards the xccy basis market quotes: F(0,t) = spot · D_for^dom(t) / D_dom(t).

Signature
import { crossCurrencyBasisCurve } from '@insiderfinance/totalfinance/fixed-income/cross-currency';

export declare function crossCurrencyBasisCurve(input: CrossCurrencyBasisInput): CrossCurrencyBasisResult;
Fields, parameters and returned members (11)
Name · typeMeaning · unitRequired · default
(input)CrossCurrencyBasisInput—unitless by nameRequiredNo @default declared
(input).basisYieldCurve

Cross-currency basis term structure added to the foreign curve (its zero rates ARE the basis spreads). Omit for the pure covered-interest-parity case (no basis): fxForward is then spot · D_for(t)/D_dom(t) and the collateralized curve is the foreign curve itself.

unitless by name
OptionalNo @default declared
(input).domesticYieldCurve

Domestic collateral (OIS) discount curve.

unitless by name
RequiredNo @default declared
(input).foreignYieldCurve

Foreign index/OIS discount curve (pre-basis).

unitless by name
RequiredNo @default declared
(input).spotnumber

FX spot: domestic units per 1 foreign unit.

unitless by name
RequiredNo @default declared
return.assumptions{ [k: string]: unknown; conventionsVersion: string; }

Applied conventions, echoed (Law 2 report grammar).

unitless by name
RequiredNo @default declared
return.assumptions.conventionsVersionstring—unitless by nameRequiredNo @default declared
return.collateralizedCurveYieldCurve

The domestic-collateralized foreign discount curve (foreign + basis). Discount foreign cash flows on THIS.

unitless by name
RequiredNo @default declared
return.diagnostics{ warnings: QuantWarning[]; }

Structured warnings; always present (possibly empty).

unitless by name
RequiredNo @default declared
return.diagnostics.warningsQuantWarning[]—unitless by nameRequiredNo @default declared
return.fxForward(at: string | number) => number

Market FX forward at at, from the collateralized curve: spot · D_for^dom(at) / D_dom(at).

unitless by name
RequiredNo @default declared

Stability: stable-by-law (pre-1.0; not a 1.0 stability guarantee). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.

fn

impliedCrossCurrencyBasis

#

Invert market FX forwards to the cross-currency basis (spec §14.5) — the inverse of crossCurrencyBasisCurve. From F(0,t) = spot · D_for^dom(t)/D_dom(t), the collateralized foreign discount factor is D_for^dom(t) = F(0,t)·D_dom(t)/spot, and the implied basis is its continuous zero minus the foreign curve's own zero.

Signature
import { impliedCrossCurrencyBasis } from '@insiderfinance/totalfinance/fixed-income/cross-currency';

export declare function impliedCrossCurrencyBasis(input: ImpliedCrossCurrencyBasisInput): ImpliedCrossCurrencyBasisResult;
Fields, parameters and returned members (10)
Name · typeMeaning · unitRequired · default
(input)ImpliedCrossCurrencyBasisInput—unitless by nameRequiredNo @default declared
(input).domesticYieldCurve

Domestic collateral (OIS) discount curve.

unitless by name
RequiredNo @default declared
(input).foreignYieldCurve

Foreign index/OIS discount curve (pre-basis).

unitless by name
RequiredNo @default declared
(input).forwards[string, number][]

Observed market FX forwards [date, forward] (domestic per foreign).

unitless by name
RequiredNo @default declared
(input).spotnumber

FX spot: domestic units per 1 foreign unit.

unitless by name
RequiredNo @default declared
return.assumptions{ [k: string]: unknown; conventionsVersion: string; }

Applied conventions, echoed (Law 2 report grammar).

unitless by name
RequiredNo @default declared
return.assumptions.conventionsVersionstring—unitless by nameRequiredNo @default declared
return.basis{ date: string; spread: number; }[]

Implied continuous cross-currency basis spread at each forward date (collateralized zero − foreign zero).

unitless by name
RequiredNo @default declared
return.diagnostics{ warnings: QuantWarning[]; }

Structured warnings; always present (possibly empty).

unitless by name
RequiredNo @default declared
return.diagnostics.warningsQuantWarning[]—unitless by nameRequiredNo @default declared

Stability: stable-by-law (pre-1.0; not a 1.0 stability guarantee). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.