49 const QuantLib::ext::shared_ptr<SimmConfiguration>& simmConfiguration,
50 const std::string& calculationCcyCall =
"USD",
51 const std::string& calculationCcyPost =
"USD",
52 const std::string& resultCcy =
"",
53 const QuantLib::ext::shared_ptr<ore::data::Market> market =
nullptr,
54 const bool determineWinningRegulations =
true,
const bool enforceIMRegulations =
false,
55 const bool quiet =
false,
56 const std::map<
SimmSide, std::set<NettingSetDetails>>& hasSEC =
57 std::map<
SimmSide, std::set<NettingSetDetails>>(),
58 const std::map<
SimmSide, std::set<NettingSetDetails>>& hasCFTC =
59 std::map<
SimmSide, std::set<NettingSetDetails>>());
63 const string& regulation,
const SimmSide& side);
69 const std::map<SimmSide, std::map<ore::data::NettingSetDetails, string>>&
winningRegulations()
const;
73 const std::string& regulation)
const;
80 const std::map<ore::data::NettingSetDetails, std::map<std::string, SimmResults>>&
simmResults(
const SimmSide& side)
const;
81 const std::map<SimmSide, std::map<ore::data::NettingSetDetails, std::map<std::string, SimmResults>>>&
simmResults()
const;
90 const std::map<ore::data::NettingSetDetails, std::pair<std::string, SimmResults>>&
finalSimmResults(
const SimmSide& side)
const;
91 const std::map<SimmSide, std::map<ore::data::NettingSetDetails, std::pair<std::string, SimmResults>>>&
finalSimmResults()
const;
115 std::map<SimmSide, std::map<ore::data::NettingSetDetails, std::map<std::string, Crif>>>
regSensitivities_;
130 QuantLib::ext::shared_ptr<ore::data::Market>
market_;
151 std::map<SimmSide, std::map<ore::data::NettingSetDetails, std::map<std::string, SimmResults>>>
simmResults_;
157 std::map<SimmSide, std::map<ore::data::NettingSetDetails, std::pair<std::string, SimmResults>>>
finalSimmResults_;
161 std::map<SimmSide, std::map<ore::data::NettingSetDetails, std::map<std::string, set<string>>>>
tradeIds_;
166 std::pair<std::map<std::string, QuantLib::Real>,
bool>
171 std::pair<std::map<std::string, QuantLib::Real>,
bool>
176 std::pair<std::map<std::string, QuantLib::Real>,
bool>
193 std::pair<std::map<std::string, QuantLib::Real>,
bool>
196 bool rfLabels =
true)
const;
220 const bool overwrite =
true);
225 const bool overwrite =
true);
231 QuantLib::Real
lambda(QuantLib::Real theta)
const;
235 const std::vector<CrifRecord::RiskType>& riskTypes)
const;
A class to calculate SIMM given a set of aggregated CRIF results for one or more portfolios.
const std::map< SimmSide, std::map< ore::data::NettingSetDetails, std::map< std::string, SimmResults > > > & simmResults() const
void populateFinalResults()
const Crif & simmParameters() const
std::pair< std::map< std::string, QuantLib::Real >, bool > margin(const ore::data::NettingSetDetails &nettingSetDetails, const CrifRecord::ProductClass &pc, const CrifRecord::RiskType &rt, const ore::analytics::Crif &netRecords, const SimmSide &side) const
std::set< std::string > getQualifiers(const Crif &crif, const ore::data::NettingSetDetails &nettingSetDetails, const CrifRecord::ProductClass &pc, const std::vector< CrifRecord::RiskType > &riskTypes) const
void add(const ore::data::NettingSetDetails &nettingSetDetails, const string ®ulation, const CrifRecord::ProductClass &pc, const SimmConfiguration::RiskClass &rc, const SimmConfiguration::MarginType &mt, const std::map< std::string, QuantLib::Real > &margins, SimmSide side, const bool overwrite=true)
std::map< SimmSide, std::set< NettingSetDetails > > hasCFTC_
std::map< SimmSide, std::set< NettingSetDetails > > hasSEC_
std::pair< std::map< std::string, QuantLib::Real >, bool > irDeltaMargin(const ore::data::NettingSetDetails &nettingSetDetails, const CrifRecord::ProductClass &pc, const ore::analytics::Crif &netRecords, const SimmSide &side) const
Calculate the Interest Rate delta margin component for the given portfolio and product class.
std::string calculationCcyCall_
The SIMM exposure calculation currency i.e. the currency for which FX delta risk is ignored.
QuantLib::Real lambda(QuantLib::Real theta) const
Give the used in the curvature margin calculation.
std::pair< std::map< std::string, QuantLib::Real >, bool > irVegaMargin(const ore::data::NettingSetDetails &nettingSetDetails, const CrifRecord::ProductClass &pc, const ore::analytics::Crif &netRecords, const SimmSide &side) const
Calculate the Interest Rate vega margin component for the given portfolio and product class.
void calcAddMargin(const SimmSide &side, const ore::data::NettingSetDetails &nsd, const string ®ulation, const ore::analytics::Crif &netRecords)
Calculate the additional initial margin for the portfolio ID and regulation.
std::map< SimmSide, std::map< ore::data::NettingSetDetails, std::string > > winningRegulations_
Regulation with highest initial margin for each given netting set.
std::pair< std::map< std::string, QuantLib::Real >, bool > irCurvatureMargin(const ore::data::NettingSetDetails &nettingSetDetails, const CrifRecord::ProductClass &pc, const SimmSide &side, const ore::analytics::Crif &crif) const
Calculate the Interest Rate curvature margin component for the given portfolio and product class.
std::map< ore::data::NettingSetDetails, bool > collectRegsIsEmpty_
For each netting set, whether all CRIF records' collect regulations are empty.
std::map< SimmSide, std::map< ore::data::NettingSetDetails, std::map< std::string, SimmResults > > > simmResults_
std::map< ore::data::NettingSetDetails, bool > postRegsIsEmpty_
For each netting set, whether all CRIF records' post regulations are empty.
const std::map< SimmSide, std::map< ore::data::NettingSetDetails, string > > & winningRegulations() const
QuantLib::ext::shared_ptr< SimmConfiguration > simmConfiguration_
The SIMM configuration governing the calculation.
ore::analytics::Crif simmParameters_
Record of SIMM parameters that were used in the calculation.
std::pair< std::map< std::string, QuantLib::Real >, bool > curvatureMargin(const ore::data::NettingSetDetails &nettingSetDetails, const CrifRecord::ProductClass &pc, const CrifRecord::RiskType &rt, const SimmSide &side, const ore::analytics::Crif &netRecords, bool rfLabels=true) const
const std::map< SimmSide, std::map< ore::data::NettingSetDetails, std::pair< std::string, SimmResults > > > & finalSimmResults() const
const std::string & resultCurrency() const
Return the calculator's result currency.
QuantLib::ext::shared_ptr< ore::data::Market > market_
Market data for FX rates to use for converting amounts to USD.
bool quiet_
If true, no logging is written out.
std::map< SimmSide, std::map< ore::data::NettingSetDetails, std::pair< std::string, SimmResults > > > finalSimmResults_
void populateFinalResults(const std::map< SimmSide, std::map< ore::data::NettingSetDetails, std::string > > &winningRegulations)
std::map< SimmSide, std::map< ore::data::NettingSetDetails, std::map< std::string, Crif > > > regSensitivities_
Net sentivities at the regulation level within each netting set.
void add(const ore::data::NettingSetDetails &nettingSetDetails, const string ®ulation, const CrifRecord::ProductClass &pc, const SimmConfiguration::RiskClass &rc, const SimmConfiguration::MarginType &mt, const std::string &b, QuantLib::Real margin, SimmSide side, const bool overwrite=true)
std::string calculationCcyPost_
ore::analytics::Crif crif_
All the net sensitivities passed in for the calculation.
void populateResults(const SimmSide &side, const ore::data::NettingSetDetails &nsd, const string ®ulation)
const std::string & calculationCurrency(const SimmSide &side) const
Return the calculator's calculation currency.
std::map< SimmSide, set< string > > finalTradeIds_
void splitCrifByRegulationsAndPortfolios(const Crif &crif, const bool enforceIMRegulations)
Add CRIF record to the CRIF records container that correspondsd to the given regulation/s and portfol...
std::map< SimmSide, std::map< ore::data::NettingSetDetails, std::map< std::string, set< string > > > > tradeIds_
Container for keeping track of what trade IDs belong to each regulation.
const std::map< SimmSide, std::set< std::string > > & finalTradeIds() const
std::string resultCcy_
The SIMM result currency i.e. the currency in which the main SIMM results are denominated.
const void calculateRegulationSimm(const ore::analytics::Crif &crif, const ore::data::NettingSetDetails &nsd, const string ®ulation, const SimmSide &side)
Calculates SIMM for a given regulation under a given netting set.
SimmConfiguration::SimmSide SimmSide
SimmSide
Enum indicating the relevant side of the SIMM calculation.
Struct for holding CRIF records.
Class for loading CRIF records.
Class for holding SIMM results.