Logo
Reference manual - version orea_version
Public Types | Static Public Member Functions | List of all members
CollateralExposureHelper Class Reference

Collateral Exposure Helper. More...

#include <orea/aggregation/collatexposurehelper.hpp>

Public Types

enum  CalculationType { Symmetric , AsymmetricCVA , AsymmetricDVA , NoLag }
 

Static Public Member Functions

static Real marginRequirementCalc (const QuantLib::ext::shared_ptr< CollateralAccount > &collat, const Real &uncollatValue, const Date &simulationDate)
 
template<class T >
static Real estimateUncollatValue (const Date &simulationDate, const Real &npv_t0, const Date &date_t0, const vector< vector< T >> &scenPvProfiles, const unsigned &scenIndex, const vector< Date > &dateGrid)
 
static void updateMarginCall (const QuantLib::ext::shared_ptr< CollateralAccount > &collat, const Real &uncollatValue, const Date &simulationDate, const Real &accrualFactor, const CalculationType &calcType=Symmetric, const bool &eligMarginReqDateUs=true, const bool &eligMarginReqDateCtp=true)
 
static Real creditSupportAmount (const QuantLib::ext::shared_ptr< ore::data::NettingSetDefinition > &nettingSet, const Real &uncollatValueCsaCur)
 
static QuantLib::ext::shared_ptr< vector< QuantLib::ext::shared_ptr< CollateralAccount > > > collateralBalancePaths (const QuantLib::ext::shared_ptr< NettingSetDefinition > &csaDef, const Real &nettingSetPv, const Date &date_t0, const vector< vector< Real >> &nettingSetValues, const Date &nettingSet_maturity, const vector< Date > &dateGrid, const Real &csaFxTodayRate, const vector< vector< Real >> &csaFxScenarioRates, const Real &csaTodayCollatCurve, const vector< vector< Real >> &csaScenCollatCurves, const CalculationType &calcType=Symmetric, const QuantLib::ext::shared_ptr< CollateralBalance > &balance=QuantLib::ext::shared_ptr< CollateralBalance >())
 

Detailed Description

Collateral Exposure Helper.

This class contains helper functions to aid in the calculation of collateralised exposures.

It can be used to calculate margin requirements in the presence of e.g. thresholds and minimum transfer amounts, update collateral account details with e.g. new margin call info, and return collateralised exposures to the user/invoker.

For further information refer to the detailed ORE documentation.

Member Enumeration Documentation

◆ CalculationType

Enumeration 'CalculationType' specifies how the collateralised exposures should be calculated (please refer to Sungard white-paper titled "Closing In On the CloseOut"):

  • 'Symmetric' => margin calls only settled after margin period of risk
  • 'AsymmetricCVA' => margin requested from ctp only settles after margin period of risk – (our margin postings settle instantaneously)
  • 'AsymmetricDVA' => margin postings to ctp only settle after margin period of risk – (margin calls to receive collateral from counterparty settle instantaneously)
  • 'NoLag' => margin calls/postings settled without margin period of risk delay

Member Function Documentation

◆ marginRequirementCalc()

static Real marginRequirementCalc ( const QuantLib::ext::shared_ptr< CollateralAccount > &  collat,
const Real &  uncollatValue,
const Date &  simulationDate 
)
static

Calculates CSA margin requirement, taking the following into account

  • uncollateralised value
  • collateral value
  • threshold
  • minimum transfer amount
  • independent amount

◆ estimateUncollatValue()

static Real estimateUncollatValue ( const Date &  simulationDate,
const Real &  npv_t0,
const Date &  date_t0,
const vector< vector< T >> &  scenPvProfiles,
const unsigned &  scenIndex,
const vector< Date > &  dateGrid 
)
static

Performs linear interpolation between dates to estimate the value as of simulationDate. Flat extrapolation at far end.

◆ updateMarginCall()

static void updateMarginCall ( const QuantLib::ext::shared_ptr< CollateralAccount > &  collat,
const Real &  uncollatValue,
const Date &  simulationDate,
const Real &  accrualFactor,
const CalculationType calcType = Symmetric,
const bool &  eligMarginReqDateUs = true,
const bool &  eligMarginReqDateCtp = true 
)
static

Checks if margin call is in need of update, and updates if necessary

◆ creditSupportAmount()

static Real creditSupportAmount ( const QuantLib::ext::shared_ptr< ore::data::NettingSetDefinition > &  nettingSet,
const Real &  uncollatValueCsaCur 
)
static

Computes the Credit Support Amount for the portfolio, given an unsecured exposure as input All calculations done in CSA currency

◆ collateralBalancePaths()

static QuantLib::ext::shared_ptr<vector<QuantLib::ext::shared_ptr<CollateralAccount> > > collateralBalancePaths ( const QuantLib::ext::shared_ptr< NettingSetDefinition > &  csaDef,
const Real &  nettingSetPv,
const Date &  date_t0,
const vector< vector< Real >> &  nettingSetValues,
const Date &  nettingSet_maturity,
const vector< Date > &  dateGrid,
const Real &  csaFxTodayRate,
const vector< vector< Real >> &  csaFxScenarioRates,
const Real &  csaTodayCollatCurve,
const vector< vector< Real >> &  csaScenCollatCurves,
const CalculationType calcType = Symmetric,
const QuantLib::ext::shared_ptr< CollateralBalance > &  balance = QuantLib::ext::shared_ptr< CollateralBalance >() 
)
static

Takes a netting set (and scenario exposures) as input and returns collateral balance paths per scenario