Skip to main content
A collateral algorithm computes, for each credit support annex (CSA), time point, and scenario, the collateral balance that the CSA requires. The cube sums the balances of the CSAs of a master agreement and subtracts the sum from the master agreement mark-to-future (MtF) value to obtain the collateralized exposure. Netting Set Analytics provides two algorithms: Bilateral CSA and Unilateral (Bank) CSA. An application can add its own, as described in How to write your own collateral algorithm. Understanding exposure concepts (specifically the CSA parameters and the margin period of risk) is a prerequisite for this page.

Which parameters do the algorithms use?

Both algorithms read the parameters of the CSA from the CollateralAgreements table. The per-trade amounts of the IndependentAmounts table are not an input of the algorithms. See the data model for the field definitions. Both algorithms use the counterparty margin period of risk hh.

How is the collateral balance looked up in time?

For each reporting time point TT, the algorithm values the CSA at the date T−hT - h, one margin period of risk earlier. The value of the CSA is the sum of the MtF values of the trades that name the CSA:
  1. If T−hT - h is before the as-of date, the balance equals the initial collateral of the CSA, converted from the CSA parameter currency to the display currency with the FX rate at TT. The exposure formulas below are not applied.
  2. If T−hT - h is a date of the simulation grid, the algorithm uses the MtF value of the CSA at that date.
  3. If T−hT - h falls between two grid dates, the algorithm linearly interpolates the MtF value between the two nearest reporting dates.
The algorithms evaluate reporting time points only. A time point that exists only for collateral evaluation is read when the look-back date falls exactly on it. Interpolation uses the neighbouring reporting time points only. The balance of a CSA is null at every time point after the latest TradeMaturityDate of its trades, and from then on the CSA holds no collateral in its master agreement. A master agreement with a CSA has no collateralized exposure after the latest TradeMaturityDate of all its trades, so the collateralized exposure, its metrics, and the xVA EE/ENE PV are empty after that date. A trade without a TradeMaturityDate counts as maturing on the maximum date, so the balance of its CSA continues to the last time point.

How are currencies converted?

The CSA parameters are expressed in the CSA parameter currency. For each scenario ss, the algorithm divides the MtF value at T−hT - h by the FX rate at T−hT - h to express it in that currency, and multiplies the resulting collateral by the FX rate at TT to return to the display currency. The FX vectors are the ones that convert the MtF vectors, including the pivot through the default currency for a pair with no quote. FX rates for dates between two grid dates are linearly interpolated. The conversion reads the market data set selected in the query, the default market data set when none is selected. When the netting set’s CSA currency has no rate to the display currency, the collateral balance and the collateralized exposure are empty. In the formulas below, R(s)R(s) is the CSA MtF value at T−hT - h in the CSA parameter currency, and N(s)=max⁡(R(s),0)N(s) = \max(R(s), 0) is its positive part: R(s)=MtF(T−h,s)FX(T−h,s),N(s)=max⁡(R(s), 0)R(s) = \frac{\text{MtF}(T - h, s)}{\text{FX}(T - h, s)}, \qquad N(s) = \max\bigl(R(s),\, 0\bigr) The independent amounts AbA_b and AcA_c count as zero when R(s)=0R(s) = 0.

What is the total exposure under the Bilateral CSA algorithm?

The bilateral algorithm combines the counterparty-side and bank-side independent amount terms with the MtF value: Mc(s)=max⁡(kc⋅N(s)+Ac,  Fc)M_c(s) = \max\bigl(k_c \cdot N(s) + A_c,\; F_c\bigr) Mb(s)=min⁡(kb⋅min⁡(R(s),0)+Ab,  Fb)M_b(s) = \min\bigl(k_b \cdot \min(R(s), 0) + A_b,\; F_b\bigr) E(s)=R(s)+Mc(s)+Mb(s)E(s) = R(s) + M_c(s) + M_b(s)

What is the total exposure under the Unilateral (Bank) CSA algorithm?

The unilateral algorithm uses only the counterparty parameters and the positive part of the MtF value: Mc(s)=max⁡(max⁡(kc⋅N(s), 0)+Ac,  Fc)M_c(s) = \max\bigl(\max(k_c \cdot N(s),\, 0) + A_c,\; F_c\bigr) E(s)=N(s)+Mc(s)E(s) = N(s) + M_c(s)

How is the collateral call determined?

The collateral call C(s)C(s) turns the total exposure E(s)E(s) into a collateral amount, in the CSA parameter currency. A call is made only when the exposure exceeds the threshold by at least the minimum transfer amount. For the Bilateral CSA algorithm, the counterparty side is tested first, then the bank side: C(s)={E(s)−θcif E(s)>θc+mcE(s)−θbif E(s)<θb+mb0otherwiseC(s) = \begin{cases} E(s) - \theta_c & \text{if } E(s) > \theta_c + m_c \\ E(s) - \theta_b & \text{if } E(s) < \theta_b + m_b \\ 0 & \text{otherwise} \end{cases} For the Unilateral (Bank) CSA algorithm, only the counterparty threshold and minimum transfer amount apply: C(s)={E(s)−θcif E(s)>θc+mc0otherwiseC(s) = \begin{cases} E(s) - \theta_c & \text{if } E(s) > \theta_c + m_c \\ 0 & \text{otherwise} \end{cases} The collateral balance in the display currency is C(s)⋅FX(T,s)C(s) \cdot \text{FX}(T, s).

How is collateralized exposure computed?

An algorithm computes only the collateral balance of one CSA. The cube computes the exposure from the balances, per master agreement. A master agreement is the netting set: it holds any number of CSAs, plus trades that have no CSA. The Collateralized MtM measure is the gross MtM of the master agreement, less the collateral balances of its CSAs, without any floor. With Ckbase(T,s)C^{\text{base}}_k(T, s) the balance of CSA kk of the master agreement in the cube base currency: V(T,s)=∑tradesMtF(T,s)−∑kCkbase(T,s)V(T, s) = \sum_{\text{trades}} \text{MtF}(T, s) - \sum_{k} C^{\text{base}}_k(T, s) The measure is null at a time point that the selected algorithm of any CSA of the master agreement skips. A CSA that has no balance at a time point, such as the default CSA N/A, subtracts nothing. The bank and counterparty collateralized exposure measures then depend on the Netted field of the master agreement:
  • Master agreement that nets (Netted is true): the bank side takes the positive part of V(T,s)V(T, s) and the counterparty side takes the negative part.
Ebankcoll(T,s)=max⁡(V(T,s),  0)Ecptycoll(T,s)=min⁡(V(T,s),  0)E^{\text{coll}}_{\text{bank}}(T, s) = \max\bigl(V(T, s),\; 0\bigr) \qquad E^{\text{coll}}_{\text{cpty}}(T, s) = \min\bigl(V(T, s),\; 0\bigr)
  • Master agreement that does not net (Netted is false, or no master agreement row): each trade is floored on its own, then the collateral balances of the CSAs are subtracted from each side, and each side is floored again.
Ebankcoll(T,s)=max⁡(∑tradesmax⁡(MtF(T,s),0)−∑kCkbase(T,s),  0)E^{\text{coll}}_{\text{bank}}(T, s) = \max\Bigl(\sum_{\text{trades}} \max\bigl(\text{MtF}(T, s), 0\bigr) - \sum_{k} C^{\text{base}}_k(T, s),\; 0\Bigr) Ecptycoll(T,s)=min⁡(∑tradesmin⁡(MtF(T,s),0)−∑kCkbase(T,s),  0)E^{\text{coll}}_{\text{cpty}}(T, s) = \min\Bigl(\sum_{\text{trades}} \min\bigl(\text{MtF}(T, s), 0\bigr) - \sum_{k} C^{\text{base}}_k(T, s),\; 0\Bigr) Collateral that the bank holds lowers the bank side, which is the loss if the counterparty defaults, and adds to the counterparty side, which the bank owes back if it defaults itself. Collateral that the bank posted does the reverse. The final floor keeps the bank side at zero or above when the bank holds more collateral than its trades are worth to it, and the counterparty side at zero or below in the reverse case.

How is an algorithm selected?

Algorithms are the members of the Collateral Algorithm hierarchy. The hierarchy belongs to the dimension of the same name. It is a slicing hierarchy with one level, also named Collateral Algorithm. Its members are Bilateral CSA, Unilateral (Bank) CSA, and every algorithm that the application adds. Both built-in algorithms are available in the PFE and xVA cubes. The cube has one set of collateralized measures, in the Collateralized Exposures folder. No measure name contains an algorithm name. The measures are evaluated with the algorithm that the query selects:
  • A query that does not select a member uses the default member.
  • A query that selects a member evaluates every collateralized measure with that algorithm.
  • A query that puts the hierarchy on an axis shows one result per algorithm, which compares the algorithms side by side.
The downstream measures follow the selected member: the exposure metrics, the inframarginal and incremental contribution measures, and the measures built on the collateralized exposure by the consuming cube. The following MDX query evaluates a measure with the Unilateral (Bank) CSA algorithm. A slicing hierarchy has no [ALL].[AllMember] segment in its member path.
The following query compares all algorithms:

Which algorithm is the default?

The atoti.solution.model.cubes.<cube>.collateral.default-evaluator property names the default member of the Collateral Algorithm hierarchy. It defaults to Bilateral CSA. Queries that do not select a member use this algorithm. The default must be a built-in algorithm or one that the application adds. Otherwise the application fails at startup with an error that names the cube. The cube-specific properties are listed in Configuration.

How does the cube read the selected algorithm?

The hidden measure Collateral Algorithm returns the selected member. It is available as collateralAlgorithm() on ITechCollateralMeasures. The collateral data points, the collateral balance, and the Collateralized MtM measures read it for every cell and evaluate the algorithm of that name. An application can redefine this measure to choose the algorithm by another rule, for example per CSA. See How to choose the algorithm per CSA.

How is an algorithm added or replaced?

The application declares one ICollateralConfigurer bean. The configurer adds evaluators by name to the cubes it names. An evaluator whose name equals a built-in name replaces that built-in algorithm. The evaluator contract and a complete example are in How to write your own collateral algorithm.