Logo
Reference manual - version orea_version
CrifRecord Struct Reference

#include <orea/simm/crifrecord.hpp>

Public Types

enum class  RecordType { SIMM , FRTB , SACCR , Generic }
enum class  CapitalModel : unsigned char { Empty , SACCR , SACVA , FRTB }
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 ,
  CO , COLL , CR_IX , CR_SN ,
  EQ_IX , EQ_SN , IR , All
}
enum class  ProductClass {
  RatesFX , Rates , FX , Credit ,
  Equity , Commodity , Empty , Other ,
  AddOnNotionalFactor , AddOnFixedAmount , All
}
enum class  IMModel {
  Schedule , SIMM , SIMM_R , SIMM_P ,
  Empty
}
enum class  Regulation {
  APRA , CFTC , ESA , FINMA ,
  KFSC , HKMA , JFSA , MAS ,
  OSFI , RBI , SEC , SEC_unseg ,
  USPR , NONREG , BACEN , SANT ,
  SFC , UK , AMFQ , BANX ,
  OJK , Included , Unspecified , Excluded ,
  Invalid
}
 SIMM regulators.
enum class  SaccrRegulation : unsigned char { Basel , CRR2 , Unspecified , Invalid }
enum class  CurvatureScenario { Empty , Up , Down }
 There are two entries for curvature risk in frtb, a up and down shift.

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, IMModel imModel=IMModel::Empty, std::set< Regulation > collectRegulations={}, std::set< Regulation > postRegulations={}, std::string endDate="", std::map< std::string, std::string > extraFields={})
 CrifRecord (const std::string &tradeId, const std::string &tradeType, const NettingSetDetails &nettingSetDetails, const std::string &counterpartyId, const CapitalModel &capitalModel, const SaccrRegulation &regulation, const QuantLib::Date &valuationDate)
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
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 tradeType
NettingSetDetails nettingSetDetails
ProductClass productClass = ProductClass::Empty
RiskType riskType = RiskType::Empty
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>()
IMModel imModel = IMModel::Empty
CapitalModel capitalModel = CapitalModel::Empty
std::set< RegulationcollectRegulations
std::set< RegulationpostRegulations
std::string endDate
std::string label3
std::string creditQuality
std::string longShortInd
std::string coveredBondInd
std::string trancheThickness
std::string bb_rw
std::string counterpartyName
std::string counterpartyId
std::string nettingSetNumber
std::string hedgingSet
std::string hedgingSubset
QuantLib::Date valuationDate
SaccrRegulation regulation = SaccrRegulation::Unspecified
boost::variant< QuantLib::Real, std::string, QuantLib::Size > saccrLabel1 = ""
boost::variant< QuantLib::Real, std::string > saccrLabel2 = ""
QuantLib::Real saccrLabel3 = QuantLib::Null<QuantLib::Real>()
QuantLib::Real saccrEndDate = QuantLib::Null<QuantLib::Real>()
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 class 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 class ProductClass
strong

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