Logo
Reference manual - version orea_version
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
CrifRecord Struct Reference

#include <orea/simm/crifrecord.hpp>

Public Types

enum class  RecordType { SIMM , FRTB , Generic }
 
enum class  RiskType {
  Empty , Commodity , CommodityVol , CreditNonQ ,
  CreditQ , CreditVol , CreditVolNonQ , Equity ,
  EquityVol , FX , FXVol , Inflation ,
  IRCurve , IRVol , InflationVol , BaseCorr ,
  XCcyBasis , ProductClassMultiplier , AddOnNotionalFactor , Notional ,
  AddOnFixedAmount , PV , GIRR_DELTA , GIRR_VEGA ,
  GIRR_CURV , CSR_NS_DELTA , CSR_NS_VEGA , CSR_NS_CURV ,
  CSR_SNC_DELTA , CSR_SNC_VEGA , CSR_SNC_CURV , CSR_SC_DELTA ,
  CSR_SC_VEGA , CSR_SC_CURV , EQ_DELTA , EQ_VEGA ,
  EQ_CURV , COMM_DELTA , COMM_VEGA , COMM_CURV ,
  FX_DELTA , FX_VEGA , FX_CURV , DRC_NS ,
  DRC_SNC , DRC_SC , RRAO_1_PERCENT , RRAO_01_PERCENT ,
  All
}
 
enum class  ProductClass {
  RatesFX , Rates , FX , Credit ,
  Equity , Commodity , Empty , Other ,
  AddOnNotionalFactor , AddOnFixedAmount , All
}
 
enum class  CurvatureScenario { Empty , Up , Down }
 There are two entries for curvature risk in frtb, a up and down shift.
 
typedef std::tuple< std::string, NettingSetDetails, ProductClass, RiskType, std::string, std::string, std::string, std::string, std::string, std::string > SimmAmountCcyKey
 

Public Member Functions

 CrifRecord (std::string tradeId, std::string tradeType, NettingSetDetails nettingSetDetails, ProductClass productClass, RiskType riskType, std::string qualifier, std::string bucket, std::string label1, std::string label2, std::string amountCurrency, QuantLib::Real amount, QuantLib::Real amountUsd, std::string imModel="", std::string collectRegulations="", std::string postRegulations="", std::string endDate="", std::map< std::string, std::string > extraFields={})
 
RecordType type () const
 
bool hasAmountCcy () const
 
bool hasAmount () const
 
bool hasAmountUsd () const
 
bool hasResultCcy () const
 
bool hasAmountResultCcy () const
 
bool requiresAmountUsd () const
 
bool isSimmParameter () const
 
bool isEmpty () const
 
bool isFrtbCurvatureRisk () const
 
CurvatureScenario frtbCurveatureScenario () const
 
std::string getAdditionalFieldAsStr (const std::string &fieldName) const
 
double getAdditionalFieldAsDouble (const std::string &fieldName) const
 
bool getAdditionalFieldAsBool (const std::string &fieldName) const
 
const SimmAmountCcyKey getSimmAmountCcyKey () const
 
bool operator< (const CrifRecord &cr) const
 Define how CRIF records are compared.
 
bool operator== (const CrifRecord &cr) const
 

Static Public Member Functions

static bool amountCcyLTCompare (const CrifRecord &cr1, const CrifRecord &cr2)
 
static bool amountCcyEQCompare (const CrifRecord &cr1, const CrifRecord &cr2)
 

Public Attributes

std::string tradeId
 
std::string portfolioId
 
ProductClass productClass = ProductClass::Empty
 
RiskType riskType = RiskType::Notional
 
std::string qualifier
 
std::string bucket
 
std::string label1
 
std::string label2
 
std::string amountCurrency
 
QuantLib::Real amount = QuantLib::Null<QuantLib::Real>()
 
QuantLib::Real amountUsd = QuantLib::Null<QuantLib::Real>()
 
std::string resultCurrency
 
QuantLib::Real amountResultCcy = QuantLib::Null<QuantLib::Real>()
 
std::string tradeType
 
std::string agreementType
 
std::string callType
 
std::string initialMarginType
 
std::string legalEntityId
 
NettingSetDetails nettingSetDetails
 
std::string imModel
 
std::string collectRegulations
 
std::string postRegulations
 
std::string endDate
 
std::string label3
 
std::string creditQuality
 
std::string longShortInd
 
std::string coveredBondInd
 
std::string trancheThickness
 
std::string bb_rw
 
std::map< std::string, std::variant< std::string, double, bool > > additionalFields
 

Static Public Attributes

static std::vector< std::set< std::string > > additionalHeaders
 

Detailed Description

A container for holding single CRIF records or aggregated CRIF records. A CRIF record is a row of the CRIF file outlined in the document: ISDA SIMM Methodology, Risk Data Standards. Version 1.36: 1 February 2017. or an updated version thereof.

Member Enumeration Documentation

◆ RiskType

enum RiskType
strong

Risk types plus an All type for convenience Internal methods rely on the last element being 'All' Note that the risk type inflation has to be treated as an additional, single tenor bucket in IRCurve

◆ ProductClass

enum ProductClass
strong

Product class types in SIMM plus an All type for convenience Internal methods rely on the last element being 'All'