CsaTerms

class quantsupport.risk.CsaTerms(collateral_index: MarketIndex | str | Mapping[str, Any], collateral_currency: Currency | str, credit_spread: Any, recovery: Any, funding_spread: float = ..., credit_index: MarketIndex | str | Mapping[str, Any] | None = ..., funding_spread_curve: Any | None = ..., funding_index: Any | None = ..., variation_margin: bool = ..., counterparty_threshold: float = ..., own_threshold: float = ..., minimum_transfer_amount: float = ...)

Per-client collateral, credit, and funding assumptions for XVA.

Parameters:
  • collateral_index (MarketIndex or str) – Required collateral remuneration index, as a typed index or native serialized name. Other-currency trades use collateral-adjusted discount curves.

  • collateral_currency (Currency or str) – Required currency of collateral balances, as an enum or ISO alphabetic code.

  • credit_spread (float) – Required flat counterparty credit spread in decimal annual rate units; 0.01 is 100 basis points. Used for CVA only when credit_index is absent.

  • recovery (float) – Required counterparty recovery fraction; 0.4 represents 40 percent.

  • funding_spread (float, optional) – Flat FVA funding spread in decimal annual rate units. Defaults to 0.0. Ignored if funding_spread_curve or funding_index is supplied.

  • credit_index (MarketIndex or str, optional) – Counterparty credit-curve index, default None. When present, CVA uses its survival probabilities instead of credit_spread. The aggregator tracks independent survival-pillar derivatives, not original CDS-spread risk; the credit bootstrap Jacobian is not replayed along this path. A data-carrying index may be supplied as a typed MarketIndex or native tagged mapping, for example {"Credit": "CLIENT-A"}, not its display string.

  • funding_spread_curve (ZeroRateTermStructure or mapping, optional) – Reusable decimal funding-spread term structure, default None. The binding also accepts a TenorBasedZeroRateTermStructure. A native mapping carries its reference date, dates, rates, and rate/interpolation conventions. Replaces the flat spread; with funding_index it is an additive spread overlay on the curve-implied basis rather than a replacement discount curve.

  • funding_index (MarketIndex or str, optional) – Bootstrapped funding discount-curve index, default None. FVA uses forward spreads of this curve over the engine system/base curve at simulation dates, plus any funding_spread_curve overlay. Replaces funding_spread. Aggregator risk tracks independent derived spread pillars, not original funding-curve quote risk; this path does not replay funding calibration.

  • variation_margin (bool, optional) – Defaults to False for uncollateralized exposure. True enables margin calls at each simulation date using the thresholds and minimum transfer amount.

  • counterparty_threshold (float, optional) – Finite non-negative unsecured positive exposure allowed before the counterparty posts collateral, in collateral currency units. Defaults to 0.0.

  • own_threshold (float, optional) – Finite non-negative unsecured negative-exposure allowance before this party posts collateral, in collateral currency units. Defaults to 0.0.

  • minimum_transfer_amount (float, optional) – Finite non-negative minimum absolute change in collateral balance triggering a transfer, in collateral currency units. Equality triggers a transfer. Defaults to 0.0. Thresholds and this amount are validated even with margin off.

Raises:

QuantSupportError – If an index, currency, or curve cannot be converted, or a margin threshold or transfer minimum is negative or non-finite.

Source declaration

Methods

static from_dict(obj: Mapping[str, Any]) → CsaTerms

Deserialize and validate one client’s CSA terms.

Parameters:

obj (mapping) – Native CSA fields. collateral_index, collateral_currency, credit_spread, and recovery are required. Funding spread, thresholds, and minimum transfer default to 0.0; variation_margin defaults to False; credit_index, funding_index, and funding_spread_curve default to None. Financial units and funding precedence match the class constructor. Native tagged index representations are required for data-carrying variants, for example {"Credit": "CLIENT-A"}; typed enums and curves are normalized.

Returns:

CSA terms with finite non-negative margin thresholds and transfer minimum.

Return type:

CsaTerms

Raises:

QuantSupportError – If decoding fails or margin parameter validation fails.

Properties

property collateral_currency: Any

Read-only currency of collateral balances and margin thresholds.

property collateral_index: Any

Read-only market index of the collateral remuneration curve.

property counterparty_threshold: Any

Read-only unsecured exposure allowed to the counterparty, in collateral currency units.

property credit_index: Any

Read-only counterparty credit-curve index, or None when not configured.

property credit_spread: Any

Read-only flat counterparty credit spread in decimal rate units.

property funding_index: Any

Read-only funding-curve market index, or None when not configured.

property funding_spread: Any

Read-only flat funding spread in decimal rate units; 0.01 is 100 basis points.

property funding_spread_curve: Any

The reusable zero-rate spread curve, or None when absent.

property minimum_transfer_amount: Any

Read-only minimum margin transfer size, in collateral currency units.

property own_threshold: Any

Read-only unsecured exposure allowed to this party, in collateral currency units.

property recovery: Any

Read-only counterparty recovery fraction; 0.4 represents 40 percent.

property variation_margin: Any

Read-only flag enabling variation margin with the configured thresholds and transfer minimum.