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

A class to calculate SIMM given a set of aggregated CRIF results for one or more portfolios. More...

#include <orea/simm/simmcalculator.hpp>

Public Types

typedef SimmConfiguration::SimmSide SimmSide
 

Public Member Functions

 SimmCalculator (const ore::analytics::Crif &crif, const QuantLib::ext::shared_ptr< SimmConfiguration > &simmConfiguration, const std::string &calculationCcyCall="USD", const std::string &calculationCcyPost="USD", const std::string &resultCcy="", const QuantLib::ext::shared_ptr< ore::data::Market > market=nullptr, const bool determineWinningRegulations=true, const bool enforceIMRegulations=false, const bool quiet=false, const std::map< SimmSide, std::set< NettingSetDetails >> &hasSEC=std::map< SimmSide, std::set< NettingSetDetails >>(), const std::map< SimmSide, std::set< NettingSetDetails >> &hasCFTC=std::map< SimmSide, std::set< NettingSetDetails >>())
 
const void calculateRegulationSimm (const ore::analytics::Crif &crif, const ore::data::NettingSetDetails &nsd, const string &regulation, const SimmSide &side)
 Calculates SIMM for a given regulation under a given netting set.
 
const std::string & winningRegulations (const SimmSide &side, const ore::data::NettingSetDetails &nettingSetDetails) const
 Return the winning regulation for each netting set.
 
const std::map< ore::data::NettingSetDetails, string > & winningRegulations (const SimmSide &side) const
 
const std::map< SimmSide, std::map< ore::data::NettingSetDetails, string > > & winningRegulations () const
 
const SimmResultssimmResults (const SimmSide &side, const ore::data::NettingSetDetails &nettingSetDetails, const std::string &regulation) const
 Give back the SIMM results container for the given portfolioId and SIMM side.
 
const std::map< std::string, SimmResults > & simmResults (const SimmSide &side, const ore::data::NettingSetDetails &nettingSetDetails) const
 
const std::map< ore::data::NettingSetDetails, std::map< std::string, SimmResults > > & simmResults (const SimmSide &side) const
 
const std::map< SimmSide, std::map< ore::data::NettingSetDetails, std::map< std::string, SimmResults > > > & simmResults () const
 
const std::pair< std::string, SimmResults > & finalSimmResults (const SimmSide &side, const ore::data::NettingSetDetails &nettingSetDetails) const
 Give back the SIMM results container for the given netting set and SIMM side.
 
const std::map< ore::data::NettingSetDetails, std::pair< std::string, SimmResults > > & finalSimmResults (const SimmSide &side) const
 
const std::map< SimmSide, std::map< ore::data::NettingSetDetails, std::pair< std::string, SimmResults > > > & finalSimmResults () const
 
const std::map< SimmSide, std::set< std::string > > & finalTradeIds () const
 
const CrifsimmParameters () const
 
const std::string & calculationCurrency (const SimmSide &side) const
 Return the calculator's calculation currency.
 
const std::string & resultCurrency () const
 Return the calculator's result currency.
 
void populateFinalResults (const std::map< SimmSide, std::map< ore::data::NettingSetDetails, std::string >> &winningRegulations)
 

Detailed Description

A class to calculate SIMM given a set of aggregated CRIF results for one or more portfolios.

Constructor & Destructor Documentation

◆ SimmCalculator()

SimmCalculator ( const ore::analytics::Crif crif,
const QuantLib::ext::shared_ptr< SimmConfiguration > &  simmConfiguration,
const std::string &  calculationCcyCall = "USD",
const std::string &  calculationCcyPost = "USD",
const std::string &  resultCcy = "",
const QuantLib::ext::shared_ptr< ore::data::Market market = nullptr,
const bool  determineWinningRegulations = true,
const bool  enforceIMRegulations = false,
const bool  quiet = false,
const std::map< SimmSide, std::set< NettingSetDetails >> &  hasSEC = std::map< SimmSide, std::set< NettingSetDetails >>(),
const std::map< SimmSide, std::set< NettingSetDetails >> &  hasCFTC = std::map< SimmSide, std::set< NettingSetDetails >>() 
)

Construct the SimmCalculator from a container of netted CRIF records and a SIMM configuration. The SIMM number is initially calculated in USD using the AmountUSD column. It can optionally be converted to a calculation currency other than USD by using the calculationCcy parameter. If the calculationCcy is not USD then the usdSpot parameter must be used to give the FX spot rate between USD and the calculationCcy. This spot rate is interpreted as the number of USD per unit of calculationCcy.

Member Function Documentation

◆ simmResults()

const std::map<ore::data::NettingSetDetails, std::map<std::string, SimmResults> >& simmResults ( const SimmSide side) const

Give back a map containing the SIMM results containers for every portfolio for the given SIMM side. The key is the portfolio ID and the value is the SIMM results container for that portfolio.

◆ finalSimmResults()

const std::map<ore::data::NettingSetDetails, std::pair<std::string, SimmResults> >& finalSimmResults ( const SimmSide side) const

Give back a map containing the SIMM results containers for every portfolio for the given SIMM side. The key is the portfolio ID and the value is a map, with regulation as the key, and the value is the SIMM results container for that portfolioId-regulation combination.

◆ populateFinalResults()

void populateFinalResults ( const std::map< SimmSide, std::map< ore::data::NettingSetDetails, std::string >> &  winningRegulations)

Populate the finalSimmResults_ and finalAddMargins_ containers using the provided map of winning call/post regulations.