34 build(
const std::string& parentId,
const QuantLib::ext::shared_ptr<Trade>& underlying,
35 const std::vector<Date>& valuationDates,
const std::vector<Date>& paymentDates,
36 const std::string& fundingCurrency,
const QuantLib::ext::shared_ptr<EngineFactory>& engineFactory,
37 QuantLib::ext::shared_ptr<QuantLib::Index>& underlyingIndex, Real& underlyingMultiplier,
38 std::map<std::string, double>& indexQuantities, std::map<std::string, QuantLib::ext::shared_ptr<QuantExt::FxIndex>>& fxIndices,
39 Real& initialPrice, std::string& assetCurrency, std::string& creditRiskCurrency,
40 std::map<std::string, SimmCreditQualifierMapping>& creditQualifierMapping, Date&
maturity,
41 const std::function<QuantLib::ext::shared_ptr<QuantExt::FxIndex>(
42 const QuantLib::ext::shared_ptr<Market> market,
const std::string& configuration,
const std::string& domestic,
43 const std::string& foreign, std::map<std::string, QuantLib::ext::shared_ptr<QuantExt::FxIndex>>& fxIndices)>&
45 const std::string& underlyingDerivativeId,
RequiredFixings& fixings, std::vector<Leg>& returnLegs)
const = 0;
46 virtual void updateUnderlying(
const QuantLib::ext::shared_ptr<ReferenceDataManager>& refData,
47 QuantLib::ext::shared_ptr<Trade>& underlying,
const std::string& parentId)
const {}
51 :
public QuantLib::Singleton<TrsUnderlyingBuilderFactory, std::integral_constant<bool, true>> {
52 map<std::string, QuantLib::ext::shared_ptr<TrsUnderlyingBuilder>>
builders_;
56 std::map<std::string, QuantLib::ext::shared_ptr<TrsUnderlyingBuilder>>
getBuilders()
const {
57 boost::shared_lock<boost::shared_mutex> lock(
mutex_);
60 QuantLib::ext::shared_ptr<TrsUnderlyingBuilder>
getBuilder(
const std::string& tradeType)
const;
61 void addBuilder(
const std::string& tradeType,
const QuantLib::ext::shared_ptr<TrsUnderlyingBuilder>& builder,
62 const bool allowOverwrite =
false);
67 build(
const std::string& parentId,
const QuantLib::ext::shared_ptr<Trade>& underlying,
68 const std::vector<Date>& valuationDates,
const std::vector<Date>& paymentDates,
69 const std::string& fundingCurrency,
const QuantLib::ext::shared_ptr<EngineFactory>& engineFactory,
70 QuantLib::ext::shared_ptr<QuantLib::Index>& underlyingIndex, Real& underlyingMultiplier,
71 std::map<std::string, double>& indexQuantities,
72 std::map<std::string, QuantLib::ext::shared_ptr<QuantExt::FxIndex>>& fxIndices,
73 Real& initialPrice, std::string& assetCurrency, std::string& creditRiskCurrency,
74 std::map<std::string, SimmCreditQualifierMapping>& creditQualifierMapping, Date&
maturity,
75 const std::function<QuantLib::ext::shared_ptr<QuantExt::FxIndex>(
76 const QuantLib::ext::shared_ptr<Market> market,
const std::string& configuration,
const std::string& domestic,
77 const std::string& foreign, std::map<std::string, QuantLib::ext::shared_ptr<QuantExt::FxIndex>>& fxIndices)>&
79 const std::string& underlyingDerivativeId,
RequiredFixings& fixings, std::vector<Leg>& returnLegs)
const override;
84 build(
const std::string& parentId,
const QuantLib::ext::shared_ptr<Trade>& underlying,
85 const std::vector<Date>& valuationDates,
const std::vector<Date>& paymentDates,
86 const std::string& fundingCurrency,
const QuantLib::ext::shared_ptr<EngineFactory>& engineFactory,
87 QuantLib::ext::shared_ptr<QuantLib::Index>& underlyingIndex, Real& underlyingMultiplier,
88 std::map<std::string, double>& indexQuantities,
89 std::map<std::string, QuantLib::ext::shared_ptr<QuantExt::FxIndex>>& fxIndices,
90 Real& initialPrice, std::string& assetCurrency, std::string& creditRiskCurrency,
91 std::map<std::string, SimmCreditQualifierMapping>& creditQualifierMapping, Date&
maturity,
92 const std::function<QuantLib::ext::shared_ptr<QuantExt::FxIndex>(
93 const QuantLib::ext::shared_ptr<Market> market,
const std::string& configuration,
const std::string& domestic,
94 const std::string& foreign, std::map<std::string, QuantLib::ext::shared_ptr<QuantExt::FxIndex>>& fxIndices)>& getFxIndex,
95 const std::string& underlyingDerivativeId,
RequiredFixings& fixings, std::vector<Leg>& returnLegs)
const override;
101 build(
const std::string& parentId,
const QuantLib::ext::shared_ptr<Trade>& underlying,
102 const std::vector<Date>& valuationDates,
const std::vector<Date>& paymentDates,
103 const std::string& fundingCurrency,
const QuantLib::ext::shared_ptr<EngineFactory>& engineFactory,
104 QuantLib::ext::shared_ptr<QuantLib::Index>& underlyingIndex, Real& underlyingMultiplier,
105 std::map<std::string, double>& indexQuantities,
106 std::map<std::string, QuantLib::ext::shared_ptr<QuantExt::FxIndex>>& fxIndices,
107 Real& initialPrice, std::string& assetCurrency, std::string& creditRiskCurrency,
108 std::map<std::string, SimmCreditQualifierMapping>& creditQualifierMapping, Date&
maturity,
109 const std::function<QuantLib::ext::shared_ptr<QuantExt::FxIndex>(
110 const QuantLib::ext::shared_ptr<Market> market,
const std::string& configuration,
const std::string& domestic,
111 const std::string& foreign, std::map<std::string, QuantLib::ext::shared_ptr<QuantExt::FxIndex>>& fxIndices)>& getFxIndex,
112 const std::string& underlyingDerivativeId,
RequiredFixings& fixings, std::vector<Leg>& returnLegs)
const override;
114 void updateQuantities(std::map<std::string, double>& indexQuantities,
const std::string& indexName,
115 const double qty)
const;
126 build(
const std::string& parentId,
const QuantLib::ext::shared_ptr<Trade>& underlying,
127 const std::vector<Date>& valuationDates,
const std::vector<Date>& paymentDates,
128 const std::string& fundingCurrency,
const QuantLib::ext::shared_ptr<EngineFactory>& engineFactory,
129 QuantLib::ext::shared_ptr<QuantLib::Index>& underlyingIndex, Real& underlyingMultiplier,
130 std::map<std::string, double>& indexQuantities, std::map<std::string, QuantLib::ext::shared_ptr<QuantExt::FxIndex>>& fxIndices,
131 Real& initialPrice, std::string& assetCurrency, std::string& creditRiskCurrency,
132 std::map<std::string, SimmCreditQualifierMapping>& creditQualifierMapping, Date&
maturity,
133 const std::function<QuantLib::ext::shared_ptr<QuantExt::FxIndex>(
134 const QuantLib::ext::shared_ptr<Market> market,
const std::string& configuration,
const std::string& domestic,
135 const std::string& foreign, std::map<std::string, QuantLib::ext::shared_ptr<QuantExt::FxIndex>>& fxIndices)>& getFxIndex,
136 const std::string& underlyingDerivativeId,
RequiredFixings& fixings, std::vector<Leg>& returnLegs)
const override;
142 build(
const std::string& parentId,
const QuantLib::ext::shared_ptr<Trade>& underlying,
143 const std::vector<Date>& valuationDates,
const std::vector<Date>& paymentDates,
144 const std::string& fundingCurrency,
const QuantLib::ext::shared_ptr<EngineFactory>& engineFactory,
145 QuantLib::ext::shared_ptr<QuantLib::Index>& underlyingIndex, Real& underlyingMultiplier,
146 std::map<std::string, double>& indexQuantities, std::map<std::string, QuantLib::ext::shared_ptr<QuantExt::FxIndex>>& fxIndices,
147 Real& initialPrice, std::string& assetCurrency, std::string& creditRiskCurrency,
148 std::map<std::string, SimmCreditQualifierMapping>& creditQualifierMapping, Date&
maturity,
149 const std::function<QuantLib::ext::shared_ptr<QuantExt::FxIndex>(
150 const QuantLib::ext::shared_ptr<Market> market,
const std::string& configuration,
const std::string& domestic,
151 const std::string& foreign, std::map<std::string, QuantLib::ext::shared_ptr<QuantExt::FxIndex>>& fxIndices)>& getFxIndex,
152 const std::string& underlyingDerivativeId,
RequiredFixings& fixings, std::vector<Leg>& returnLegs)
const override;
157 build(
const std::string& parentId,
const QuantLib::ext::shared_ptr<Trade>& underlying,
158 const std::vector<Date>& valuationDates,
const std::vector<Date>& paymentDates,
159 const std::string& fundingCurrency,
const QuantLib::ext::shared_ptr<EngineFactory>& engineFactory,
160 QuantLib::ext::shared_ptr<QuantLib::Index>& underlyingIndex, Real& underlyingMultiplier,
161 std::map<std::string, double>& indexQuantities, std::map<std::string, QuantLib::ext::shared_ptr<QuantExt::FxIndex>>& fxIndices,
162 Real& initialPrice, std::string& assetCurrency, std::string& creditRiskCurrency,
163 std::map<std::string, SimmCreditQualifierMapping>& creditQualifierMapping, Date&
maturity,
164 const std::function<QuantLib::ext::shared_ptr<QuantExt::FxIndex>(
165 const QuantLib::ext::shared_ptr<Market> market,
const std::string& configuration,
const std::string& domestic,
166 const std::string& foreign, std::map<std::string, QuantLib::ext::shared_ptr<QuantExt::FxIndex>>& fxIndices)>& getFxIndex,
167 const std::string& underlyingDerivativeId,
RequiredFixings& fixings, std::vector<Leg>& returnLegs)
const override;
172Leg
makeBondTRSLeg(
const std::vector<Date>& valuationDates,
const std::vector<Date>& paymentDates,
174 QuantLib::Real initialPrice = QuantLib::Null<QuantLib::Real>(),
175 QuantLib::ext::shared_ptr<QuantExt::FxIndex> fxIndex =
nullptr);
Interface for building a bond index.
std::map< std::string, QuantLib::ext::shared_ptr< TrsUnderlyingBuilder > > getBuilders() const
map< std::string, QuantLib::ext::shared_ptr< TrsUnderlyingBuilder > > builders_
void addBuilder(const std::string &tradeType, const QuantLib::ext::shared_ptr< TrsUnderlyingBuilder > &builder, const bool allowOverwrite=false)
boost::shared_mutex mutex_
QuantLib::ext::shared_ptr< TrsUnderlyingBuilder > getBuilder(const std::string &tradeType) const
Commodity Position trade data model and serialization.
Equity Position trade data model and serialization.
AssetPositionTrsUnderlyingBuilder< ore::data::CommodityPosition > CommodityPositionTrsUnderlyingBuilder
void modifyBondTRSLeg(QuantLib::Leg &leg, QuantLib::Date issueDate)
AssetPositionTrsUnderlyingBuilder< ore::data::EquityPosition > EquityPositionTrsUnderlyingBuilder
Leg makeBondTRSLeg(const std::vector< Date > &valuationDates, const std::vector< Date > &paymentDates, const BondIndexBuilder &bondIndexBuilder, Real initialPrice, QuantLib::ext::shared_ptr< QuantExt::FxIndex > fxIndex)
Serializable Credit Default Swap.
mapping of SIMM credit qualifiers
void updateQuantities(std::map< std::string, double > &indexQuantities, const std::string &indexName, const double qty) const
void build(const std::string &parentId, const QuantLib::ext::shared_ptr< Trade > &underlying, const std::vector< Date > &valuationDates, const std::vector< Date > &paymentDates, const std::string &fundingCurrency, const QuantLib::ext::shared_ptr< EngineFactory > &engineFactory, QuantLib::ext::shared_ptr< QuantLib::Index > &underlyingIndex, Real &underlyingMultiplier, std::map< std::string, double > &indexQuantities, std::map< std::string, QuantLib::ext::shared_ptr< QuantExt::FxIndex > > &fxIndices, Real &initialPrice, std::string &assetCurrency, std::string &creditRiskCurrency, std::map< std::string, SimmCreditQualifierMapping > &creditQualifierMapping, Date &maturity, const std::function< QuantLib::ext::shared_ptr< QuantExt::FxIndex >(const QuantLib::ext::shared_ptr< Market > market, const std::string &configuration, const std::string &domestic, const std::string &foreign, std::map< std::string, QuantLib::ext::shared_ptr< QuantExt::FxIndex > > &fxIndices)> &getFxIndex, const std::string &underlyingDerivativeId, RequiredFixings &fixings, std::vector< Leg > &returnLegs) const override
std::string getIndexCurrencyFromPosition(QuantLib::ext::shared_ptr< T > position, size_t i) const
void build(const std::string &parentId, const QuantLib::ext::shared_ptr< Trade > &underlying, const std::vector< Date > &valuationDates, const std::vector< Date > &paymentDates, const std::string &fundingCurrency, const QuantLib::ext::shared_ptr< EngineFactory > &engineFactory, QuantLib::ext::shared_ptr< QuantLib::Index > &underlyingIndex, Real &underlyingMultiplier, std::map< std::string, double > &indexQuantities, std::map< std::string, QuantLib::ext::shared_ptr< QuantExt::FxIndex > > &fxIndices, Real &initialPrice, std::string &assetCurrency, std::string &creditRiskCurrency, std::map< std::string, SimmCreditQualifierMapping > &creditQualifierMapping, Date &maturity, const std::function< QuantLib::ext::shared_ptr< QuantExt::FxIndex >(const QuantLib::ext::shared_ptr< Market > market, const std::string &configuration, const std::string &domestic, const std::string &foreign, std::map< std::string, QuantLib::ext::shared_ptr< QuantExt::FxIndex > > &fxIndices)> &getFxIndex, const std::string &underlyingDerivativeId, RequiredFixings &fixings, std::vector< Leg > &returnLegs) const override
void build(const std::string &parentId, const QuantLib::ext::shared_ptr< Trade > &underlying, const std::vector< Date > &valuationDates, const std::vector< Date > &paymentDates, const std::string &fundingCurrency, const QuantLib::ext::shared_ptr< EngineFactory > &engineFactory, QuantLib::ext::shared_ptr< QuantLib::Index > &underlyingIndex, Real &underlyingMultiplier, std::map< std::string, double > &indexQuantities, std::map< std::string, QuantLib::ext::shared_ptr< QuantExt::FxIndex > > &fxIndices, Real &initialPrice, std::string &assetCurrency, std::string &creditRiskCurrency, std::map< std::string, SimmCreditQualifierMapping > &creditQualifierMapping, Date &maturity, const std::function< QuantLib::ext::shared_ptr< QuantExt::FxIndex >(const QuantLib::ext::shared_ptr< Market > market, const std::string &configuration, const std::string &domestic, const std::string &foreign, std::map< std::string, QuantLib::ext::shared_ptr< QuantExt::FxIndex > > &fxIndices)> &getFxIndex, const std::string &underlyingDerivativeId, RequiredFixings &fixings, std::vector< Leg > &returnLegs) const override
void build(const std::string &parentId, const QuantLib::ext::shared_ptr< Trade > &underlying, const std::vector< Date > &valuationDates, const std::vector< Date > &paymentDates, const std::string &fundingCurrency, const QuantLib::ext::shared_ptr< EngineFactory > &engineFactory, QuantLib::ext::shared_ptr< QuantLib::Index > &underlyingIndex, Real &underlyingMultiplier, std::map< std::string, double > &indexQuantities, std::map< std::string, QuantLib::ext::shared_ptr< QuantExt::FxIndex > > &fxIndices, Real &initialPrice, std::string &assetCurrency, std::string &creditRiskCurrency, std::map< std::string, SimmCreditQualifierMapping > &creditQualifierMapping, Date &maturity, const std::function< QuantLib::ext::shared_ptr< QuantExt::FxIndex >(const QuantLib::ext::shared_ptr< Market > market, const std::string &configuration, const std::string &domestic, const std::string &foreign, std::map< std::string, QuantLib::ext::shared_ptr< QuantExt::FxIndex > > &fxIndices)> &getFxIndex, const std::string &underlyingDerivativeId, RequiredFixings &fixings, std::vector< Leg > &returnLegs) const override
void build(const std::string &parentId, const QuantLib::ext::shared_ptr< Trade > &underlying, const std::vector< Date > &valuationDates, const std::vector< Date > &paymentDates, const std::string &fundingCurrency, const QuantLib::ext::shared_ptr< EngineFactory > &engineFactory, QuantLib::ext::shared_ptr< QuantLib::Index > &underlyingIndex, Real &underlyingMultiplier, std::map< std::string, double > &indexQuantities, std::map< std::string, QuantLib::ext::shared_ptr< QuantExt::FxIndex > > &fxIndices, Real &initialPrice, std::string &assetCurrency, std::string &creditRiskCurrency, std::map< std::string, SimmCreditQualifierMapping > &creditQualifierMapping, Date &maturity, const std::function< QuantLib::ext::shared_ptr< QuantExt::FxIndex >(const QuantLib::ext::shared_ptr< Market > market, const std::string &configuration, const std::string &domestic, const std::string &foreign, std::map< std::string, QuantLib::ext::shared_ptr< QuantExt::FxIndex > > &fxIndices)> &getFxIndex, const std::string &underlyingDerivativeId, RequiredFixings &fixings, std::vector< Leg > &returnLegs) const override
void build(const std::string &parentId, const QuantLib::ext::shared_ptr< Trade > &underlying, const std::vector< Date > &valuationDates, const std::vector< Date > &paymentDates, const std::string &fundingCurrency, const QuantLib::ext::shared_ptr< EngineFactory > &engineFactory, QuantLib::ext::shared_ptr< QuantLib::Index > &underlyingIndex, Real &underlyingMultiplier, std::map< std::string, double > &indexQuantities, std::map< std::string, QuantLib::ext::shared_ptr< QuantExt::FxIndex > > &fxIndices, Real &initialPrice, std::string &assetCurrency, std::string &creditRiskCurrency, std::map< std::string, SimmCreditQualifierMapping > &creditQualifierMapping, Date &maturity, const std::function< QuantLib::ext::shared_ptr< QuantExt::FxIndex >(const QuantLib::ext::shared_ptr< Market > market, const std::string &configuration, const std::string &domestic, const std::string &foreign, std::map< std::string, QuantLib::ext::shared_ptr< QuantExt::FxIndex > > &fxIndices)> &getFxIndex, const std::string &underlyingDerivativeId, RequiredFixings &fixings, std::vector< Leg > &returnLegs) const override
virtual void updateUnderlying(const QuantLib::ext::shared_ptr< ReferenceDataManager > &refData, QuantLib::ext::shared_ptr< Trade > &underlying, const std::string &parentId) const
virtual void build(const std::string &parentId, const QuantLib::ext::shared_ptr< Trade > &underlying, const std::vector< Date > &valuationDates, const std::vector< Date > &paymentDates, const std::string &fundingCurrency, const QuantLib::ext::shared_ptr< EngineFactory > &engineFactory, QuantLib::ext::shared_ptr< QuantLib::Index > &underlyingIndex, Real &underlyingMultiplier, std::map< std::string, double > &indexQuantities, std::map< std::string, QuantLib::ext::shared_ptr< QuantExt::FxIndex > > &fxIndices, Real &initialPrice, std::string &assetCurrency, std::string &creditRiskCurrency, std::map< std::string, SimmCreditQualifierMapping > &creditQualifierMapping, Date &maturity, const std::function< QuantLib::ext::shared_ptr< QuantExt::FxIndex >(const QuantLib::ext::shared_ptr< Market > market, const std::string &configuration, const std::string &domestic, const std::string &foreign, std::map< std::string, QuantLib::ext::shared_ptr< QuantExt::FxIndex > > &fxIndices)> &getFxIndex, const std::string &underlyingDerivativeId, RequiredFixings &fixings, std::vector< Leg > &returnLegs) const =0
virtual ~TrsUnderlyingBuilder()