31#include <ql/cashflows/cashflows.hpp>
32#include <ql/cashflows/fixedratecoupon.hpp>
34#include <boost/assign/list_of.hpp>
35#include <boost/bimap.hpp>
36#include <boost/optional.hpp>
37#include <boost/range/adaptor/map.hpp>
43 const QuantLib::ext::shared_ptr<QuantExt::FxIndex>& ind =
nullptr) {
44 QL_REQUIRE(returnLegs.size() > 0,
"TrsUnderlyingBuilder: No returnLeg built");
45 auto fdg = QuantLib::ext::make_shared<FixingDateGetter>(fixings);
46 fdg->setAdditionalFxIndex(ind);
47 for (
const auto& rl : returnLegs)
80 if (!observationLag_.empty())
82 if (!observationConvention_.empty())
84 if (!observationCalendar_.empty())
86 if (!paymentLag_.empty())
88 if (!paymentConvention_.empty())
90 if (!paymentCalendar_.empty())
92 if (!paymentDates_.empty())
94 if (initialPrice_ != Null<Real>())
96 if (!initialPriceCurrency_.empty())
98 if (payUnderlyingCashFlowsImmediately_)
99 XMLUtils::addChild(doc, n,
"PayUnderlyingCashFlowsImmediately", *payUnderlyingCashFlowsImmediately_);
100 if (!fxTerms_.empty())
108 for (
auto const n : nodes) {
111 legData_.push_back(ld);
114 for (
auto const n : nodes2) {
122 for (
auto& l : legData_) {
125 for (
auto const t : notionalType_) {
128 if(fundingResetGracePeriod_ > 0) {
129 XMLUtils::addChild(doc, n,
"FundingResetGracePeriod", std::to_string(fundingResetGracePeriod_));
138 legData_.fromXML(tmp);
145 if (legData_.concreteLegData())
150std::map<AssetClass, std::set<std::string>>
152 std::map<AssetClass, std::set<std::string>> result;
154 QL_REQUIRE(
underlying_[i],
"TRS::underlyingIndices(): underlying trade is null");
157 for (
auto const& b : TrsUnderlyingBuilderFactory::instance().getBuilders()) {
158 b.second->updateUnderlying(referenceDataManager,
underlying_[i],
id());
162 result[tmp.first].insert(tmp.second.begin(), tmp.second.end());
175 QL_REQUIRE(dataNode,
tradeType_ +
"Data node required");
179 QL_REQUIRE(underlyingDataNode,
"UnderlyingData node required");
182 QL_REQUIRE(!underlyingTradeNodes.empty() || !underlyingTradeNodes2.empty(),
183 "at least one 'Trade' or 'Derivative' node required");
184 Size underlyingCounter = 0;
187 for (
auto const n : underlyingTradeNodes) {
189 QuantLib::ext::shared_ptr<Trade> u;
191 u = TradeFactory::instance().build(
tradeType);
192 }
catch (
const std::exception& e) {
193 QL_FAIL(
"Failed for build TRS underlying trade # " << underlyingCounter + 1 <<
": " << e.what());
195 u->id() = this->
id() +
"_underlying" +
196 (underlyingTradeNodes.size() > 1 ?
"_" + std::to_string(underlyingCounter++) :
"");
201 for (
auto const n : underlyingTradeNodes2) {
204 QL_REQUIRE(t !=
nullptr,
"expected 'Trade' node under 'Derivative' node");
206 auto u = TradeFactory::instance().build(
tradeType);
207 QL_REQUIRE(u,
"No trade builder found for TRS derivative trade type '"
208 <<
tradeType <<
"' when processing underlying trade #" << (underlyingCounter + 1));
209 u->id() = this->
id() +
"_underlying" +
210 (underlyingTradeNodes.size() > 1 ?
"_" + std::to_string(underlyingCounter++) :
"");
228 if (additionalCashflowDataNode)
261QuantLib::ext::shared_ptr<QuantExt::FxIndex>
262TRS::getFxIndex(
const QuantLib::ext::shared_ptr<Market> market,
const std::string& configuration,
const std::string& domestic,
263 const std::string& foreign, std::map<std::string, QuantLib::ext::shared_ptr<QuantExt::FxIndex>>& fxIndices,
264 std::set<std::string>& missingFxIndexPairs)
const {
265 if (domestic == foreign)
267 std::set<std::string> requiredCcys = {domestic, foreign};
270 std::set<std::string> indexCcys = {fx->sourceCurrency().code(), fx->targetCurrency().code()};
271 if (requiredCcys == indexCcys) {
272 auto h = fxIndices.find(f);
273 if (h != fxIndices.end())
275 DLOG(
"setting up fx index for domestic=" << domestic <<
" foreign=" << foreign);
276 auto fx =
buildFxIndex(f, domestic, foreign, market, configuration,
false);
285 std::string f(
"FX-GENERIC-" + domestic +
"-" + foreign);
286 auto fx =
buildFxIndex(f, domestic, foreign, market, configuration,
false);
288 missingFxIndexPairs.insert(domestic + foreign);
292void TRS::build(
const QuantLib::ext::shared_ptr<EngineFactory>& engineFactory) {
294 DLOG(
"TRS::build() called for id = " <<
id());
306 std::set<bool> fundingLegPayers;
307 std::set<std::string> fundingCurrencies;
313 fundingLegPayer = l.isPayer();
314 fundingCurrency = l.currency();
315 fundingLegPayers.insert(fundingLegPayer);
316 fundingCurrencies.insert(fundingCurrency);
319 QL_REQUIRE(fundingLegPayers.size() <= 1,
"funding leg payer flags must match");
320 QL_REQUIRE(fundingCurrencies.size() <= 1,
"funding leg currencies must match");
326 for (
auto const& b : TrsUnderlyingBuilderFactory::instance().getBuilders()) {
327 b.second->updateUnderlying(engineFactory->referenceData(),
underlying_[i],
id());
357 DLOG(
"build valuation and payment dates vectors");
359 std::vector<Date> valuationDates, paymentDates;
362 QL_REQUIRE(schedule.dates().size() >= 2,
"at least two dates required in return schedule");
377 for (
auto const& d : schedule.dates()) {
378 valuationDates.push_back(observationCalendar.advance(d, -observationLag, observationConvention));
379 if (d != schedule.dates().front())
380 paymentDates.push_back(paymentCalendar.advance(d, plPeriod, paymentConvention));
384 paymentDates.clear();
387 << valuationDates.size() <<
") minus 1");
392 DLOG(
"valuation schedule:");
393 for (
auto const& d : valuationDates)
396 DLOG(
"payment schedule:");
397 for (
auto const& d : paymentDates)
402 std::map<std::string, double> indexNamesAndQty;
403 std::map<std::string, QuantLib::ext::shared_ptr<QuantExt::FxIndex>> initialFxIndices, fxIndices, fxIndicesDummy;
407 std::set<std::string> missingFxIndexPairs;
411 auto fxIndexAdditionalCashflows =
416 missingFxIndexPairs);
420 std::vector<QuantLib::ext::shared_ptr<QuantLib::Index>> underlyingIndex(
underlying_.size(),
nullptr);
421 std::vector<Real> underlyingMultiplier(
underlying_.size(), Null<Real>());
422 std::vector<std::string> assetCurrency(
underlying_.size(), fundingCurrency);
423 std::vector<QuantLib::ext::shared_ptr<QuantExt::FxIndex>> fxIndexAsset(
underlying_.size(),
nullptr);
429 DLOG(
"build underlying index for underlying #" << (i + 1));
431 std::string localCreditRiskCurrency;
433 std::map<std::string, double> localIndexNamesAndQuantities;
434 std::map<std::string, QuantLib::ext::shared_ptr<QuantExt::FxIndex>> localFxIndices = initialFxIndices;
435 Real dummyInitialPrice = 1.0;
437 std::vector<Leg> returnLegs;
438 auto builder = TrsUnderlyingBuilderFactory::instance().getBuilder(
440 builder->build(
id(),
underlying_[i], valuationDates, paymentDates, fundingCurrency, engineFactory,
441 underlyingIndex[i], underlyingMultiplier[i], localIndexNamesAndQuantities, localFxIndices,
442 underlying_.size() == 1 ? initialPrice : dummyInitialPrice, assetCurrency[i],
444 std::bind(&
TRS::getFxIndex,
this, std::placeholders::_1, std::placeholders::_2,
445 std::placeholders::_3, std::placeholders::_4, std::placeholders::_5,
446 std::ref(missingFxIndexPairs)),
455 }
else if (!localCreditRiskCurrency.empty() &&
creditRiskCurrency_ != localCreditRiskCurrency) {
458 localCreditRiskCurrency +
"' in addition.")
468 DLOG(
"underlying #" << (i + 1) <<
" has asset ccy " << assetCurrency[i] <<
", funding ccy is "
472 assetCurrency[i], fundingCurrency, localFxIndices, missingFxIndexPairs);
473 DLOG(
"underlying #" << (i + 1) <<
" index (" << underlyingIndex[i]->
name() <<
") built.");
474 DLOG(
"underlying #" << (i + 1) <<
" multiplier is " << underlyingMultiplier[i]);
478 for (
const auto& [indexName, qty] : localIndexNamesAndQuantities) {
482 fxIndices.insert(localFxIndices.begin(), localFxIndices.end());
486 bool assetClassIsUnique =
true;
487 std::string assetClass;
489 auto it = u->additionalData().find(
"isdaAssetClass");
490 if (it != u->additionalData().end()) {
491 std::string ac = boost::any_cast<std::string>(it->second);
492 if (assetClass ==
"")
494 else if (ac != assetClass)
495 assetClassIsUnique =
false;
504 if (assetClass ==
"") {
505 ALOG(
"ISDA asset class not found for TRS " <<
id() <<
", ISDA taxonomy undefined");
508 if (!assetClassIsUnique) {
509 WLOG(
"ISDA asset class not unique in TRS " <<
id() <<
" using first hit: " << assetClass);
512 if (assetClass ==
"Equity") {
514 additionalData_[
"isdaBaseProduct"] = string(
"Contract For Difference");
517 additionalData_[
"isdaSubProduct"] = string(
"Price Return Basic Performance");
518 }
else if (assetClass ==
"Credit") {
522 WLOG(
"ISDA asset class " << assetClass <<
" not explicitly covered for TRS trade " <<
id()
523 <<
" using default BaseProduct 'Total Retuen Swap' and leaving sub-product blank");
529 QL_REQUIRE(missingFxIndexPairs.empty(),
"TRS::build(): missing FXTerms for the following pairs: "
530 << boost::algorithm::join(missingFxIndexPairs,
", "));
534 QL_REQUIRE(!assetCurrency.empty(),
"TRS::build(): no underlying given.");
536 std::string initialPriceCurrency =
540 for (
auto const& ccy : assetCurrency) {
541 QL_REQUIRE(ccy == initialPriceCurrency,
"TRS::build(): can not determine unique initial price currency "
542 "from asset currencies for initial price ("
544 <<
"), please add the initial price currency to the trade xml");
550 if (initialPrice != Null<Real>()) {
551 DLOG(
"initial price is given as " << initialPrice <<
" " << initialPriceCurrency);
553 DLOG(
"initial price after conversion to major ccy " << initialPrice);
555 DLOG(
"no initial price is given");
558 DLOG(
"fundingCurrency is " << fundingCurrency);
560 for (Size i = 0; i < assetCurrency.size(); ++i)
561 DLOG(
"assetCurrency #" << i <<
" is " << assetCurrency[i]);
570 <<
" LegData nodes. These two must match. The NotionalType can also be omitted entirely.");
572 std::vector<Leg> fundingLegs;
573 std::vector<TRS::FundingData::NotionalType> fundingNotionalTypes;
577 QL_REQUIRE(ld.legType() ==
"Fixed" || ld.legType() ==
"Floating" || ld.legType() ==
"CMS" ||
578 ld.legType() ==
"CMB",
579 "TRS::build(): funding leg type: only fixed, floating, CMS, CMB are supported");
585 "TRS::build(): if notional is given in funding leg data, the notional type must be fixed, got "
586 << notionalType <<
" for funding leg #" << (i + 1));
588 struct TempNotionalSetter {
589 TempNotionalSetter(
LegData& ld) : ld_(ld) {
591 ld.
notionals() = std::vector<Real>(1, 1.0);
593 restoreEmptyLegDataNotionals_ =
true;
595 restoreEmptyLegDataNotionals_ =
false;
598 ~TempNotionalSetter() {
599 if (restoreEmptyLegDataNotionals_)
600 ld_.notionals().clear();
603 bool restoreEmptyLegDataNotionals_;
606 TempNotionalSetter tmpSetter(ld);
608 auto legBuilder = engineFactory->legBuilder(ld.legType());
609 fundingLegs.push_back(legBuilder->buildLeg(ld, engineFactory,
requiredFixings_,
611 fundingNotionalTypes.push_back(notionalType);
614 if (ld.legType() ==
"CMB") {
615 auto cmbData = QuantLib::ext::dynamic_pointer_cast<ore::data::CMBLegData>(ld.concreteLegData());
616 QL_REQUIRE(cmbData,
"TRS::build(): internal error, could to cast to CMBLegData.");
619 auto [source, target] =
628 DLOG(
"add required fixings for fundings legs with daily resets (if any)");
630 for (Size i = 0; i < fundingLegs.size(); ++i) {
632 for (
auto const& c : fundingLegs[i]) {
633 if (
auto cpn = QuantLib::ext::dynamic_pointer_cast<QuantLib::Coupon>(c)) {
634 QL_REQUIRE(QuantLib::ext::dynamic_pointer_cast<QuantLib::FixedRateCoupon>(c) ||
635 QuantLib::ext::dynamic_pointer_cast<QuantLib::IborCoupon>(c) ||
636 QuantLib::ext::dynamic_pointer_cast<QuantExt::OvernightIndexedCoupon>(c) ||
637 QuantLib::ext::dynamic_pointer_cast<QuantExt::AverageONIndexedCoupon>(c),
638 "daily reset funding legs support fixed rate, ibor and overnight indexed coupons only");
639 for (QuantLib::Date d = cpn->accrualStartDate(); d < cpn->accrualEndDate(); ++d) {
641 Date
fixingDate = underlyingIndex[j]->fixingCalendar().adjust(d, Preceding);
642 for (
auto const& [n, _] : indexNamesAndQty)
644 for (
auto const& n : fxIndices) {
646 n.first, cpn->date(),
false,
false);
653 for (
auto const& c : fundingLegs[i]) {
654 if (
auto cpn = QuantLib::ext::dynamic_pointer_cast<QuantLib::Coupon>(c)) {
656 Date fundingStartDate = cpn->accrualStartDate();
657 Size currentIdx = std::distance(valuationDates.begin(),
658 std::upper_bound(valuationDates.begin(),
659 valuationDates.end(),
664 for (
auto const& [n, _] : indexNamesAndQty)
666 for (
auto const& n : fxIndices) {
668 n.first, cpn->date(),
false,
false);
678 Date startDate = Date::maxDate();
679 for (
auto const& l : fundingLegs) {
680 for (
auto const& cf : l) {
681 QuantLib::ext::shared_ptr<Coupon> coupon = QuantLib::ext::dynamic_pointer_cast<Coupon>(cf);
683 startDate = std::min(startDate, coupon->accrualStartDate());
688 for (
const auto& [
name, qty] : indexNamesAndQty) {
694 DLOG(
"build additional cashflow leg");
696 Leg additionalCashflowLeg;
697 bool additionalCashflowLegPayer =
false;
698 std::string additionalCashflowLegCurrency = fundingCurrency;
701 "TRS::build(): additional cashflow data leg must have type 'Cashflow'");
711 std::vector<QuantLib::Currency> parsedAssetCurrencies;
712 for (
auto const& c : assetCurrency) {
718 DLOG(
"build instrument and set trade member");
720 bool includeUnderlyingCashflowsInReturn;
724 includeUnderlyingCashflowsInReturn =
tradeType_ !=
"ContractForDifference";
727 auto wrapper = QuantLib::ext::make_shared<TRSWrapper>(
728 underlying_, underlyingIndex, underlyingMultiplier, includeUnderlyingCashflowsInReturn, initialPrice,
730 valuationDates, paymentDates, fundingLegs, fundingNotionalTypes,
parseCurrency(fundingCurrency),
732 additionalCashflowLegPayer,
parseCurrency(additionalCashflowLegCurrency), fxIndexAsset, fxIndexReturn,
733 fxIndexAdditionalCashflows, fxIndices);
734 wrapper->setPricingEngine(QuantLib::ext::make_shared<TRSWrapperAccrualEngine>());
735 instrument_ = QuantLib::ext::make_shared<VanillaInstrument>(wrapper);
739 if (Date today = Settings::instance().evaluationDate(); !valuationDates.empty() && valuationDates.front() > today) {
740 std::set<QuantLib::ext::shared_ptr<QuantExt::FxIndex>> tmp;
741 auto fxIndicesVal = fxIndices | boost::adaptors::map_values;
742 tmp.insert(fxIndicesVal.begin(), fxIndicesVal.end());
743 tmp.insert(fxIndexAsset.begin(), fxIndexAsset.end());
744 tmp.insert(fxIndexReturn);
745 tmp.insert(fxIndexAdditionalCashflows);
746 for (
auto const& fx : tmp) {
749 IndexNameTranslator::instance().oreName(fx->name()));
762 maturity_ = std::max(valuationDates.back(), paymentDates.back());
763 for (
auto const& l : fundingLegs) {
772 return instrument_->qlInstrument()->result<Real>(
"currentNotional");
773 }
catch (
const std::exception& e) {
774 if (strcmp(e.what(),
"currentNotional not provided"))
775 ALOG(
"error when retrieving notional: " << e.what());
782boost::bimap<std::string, TRS::FundingData::NotionalType>
783 types = boost::assign::list_of<boost::bimap<std::string, TRS::FundingData::NotionalType>::relation>
790 auto it =
types.left.find(s);
791 QL_REQUIRE(it !=
types.left.end(),
792 "parseTrsFundingNotionalType '" << s <<
"' failed, expected PeriodReset, DailyReset, Fixed");
797 auto it =
types.right.find(t);
798 QL_REQUIRE(it !=
types.right.end(),
"operator<<(" <<
static_cast<int>(t) <<
") failed, this is an internal error.");
void log() const
generate Boost log record to pass to corresponding sinks
Serializable object holding leg data.
const string & currency() const
virtual void fromXML(XMLNode *node) override
const string & legType() const
const vector< string > & notionalDates() const
QuantLib::ext::shared_ptr< LegAdditionalData > concreteLegData() const
const vector< double > & notionals() const
void addData(const RequiredFixings &requiredFixings)
void addFixingDate(const QuantLib::Date &fixingDate, const std::string &indexName, const QuantLib::Date &payDate=Date::maxDate(), const bool alwaysAddIfPaysOnSettlement=false, const bool mandatoryFixing=true)
virtual void fromXML(XMLNode *node) override
Utility class for Structured Trade errors, contains the Trade ID and Type.
void fromXML(XMLNode *node) override
XMLNode * toXML(XMLDocument &doc) const override
const LegData & legData() const
const std::vector< NotionalType > & notionalType() const
void fromXML(XMLNode *node) override
XMLNode * toXML(XMLDocument &doc) const override
const std::vector< LegData > & legData() const
QuantLib::Size fundingResetGracePeriod() const
boost::optional< bool > payUnderlyingCashFlowsImmediately_
std::string observationConvention_
const std::string & observationConvention() const
std::vector< std::string > fxTerms_
const std::vector< std::string > & paymentDates() const
const std::string & currency() const
const std::vector< std::string > & fxTerms() const
const ScheduleData & scheduleData() const
const std::string & initialPriceCurrency() const
std::vector< std::string > paymentDates_
boost::optional< bool > payUnderlyingCashFlowsImmediately() const
const std::string & observationCalendar() const
void fromXML(XMLNode *node) override
XMLNode * toXML(XMLDocument &doc) const override
const std::string & paymentCalendar() const
std::string initialPriceCurrency_
const std::string & observationLag() const
std::string observationLag_
ScheduleData scheduleData_
std::string paymentCalendar_
const std::string & paymentLag() const
std::string observationCalendar_
const std::string & paymentConvention() const
Real initialPrice() const
std::string paymentConvention_
std::map< std::string, SimmCreditQualifierMapping > creditQualifierMapping_
QuantLib::ext::shared_ptr< QuantExt::FxIndex > getFxIndex(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, std::set< std::string > &missingFxIndexPairs) const
AdditionalCashflowData additionalCashflowData_
std::map< AssetClass, std::set< std::string > > underlyingIndices(const QuantLib::ext::shared_ptr< ReferenceDataManager > &referenceDataManager=nullptr) const override
Interface.
std::vector< QuantLib::ext::shared_ptr< Trade > > underlying_
std::vector< std::string > underlyingDerivativeId_
QuantLib::Real notional() const override
Return the current notional in npvCurrency. See individual sub-classes for the precise definition.
void fromXML(XMLNode *node) override
XMLNode * toXML(XMLDocument &doc) const override
void build(const QuantLib::ext::shared_ptr< EngineFactory > &) override
std::string creditRiskCurrency_
const std::string & sensitivityTemplate() const
string sensitivityTemplate_
const RequiredFixings & requiredFixings() const
virtual void fromXML(XMLNode *node) override
void setSensitivityTemplate(const EngineBuilder &builder)
virtual XMLNode * toXML(XMLDocument &doc) const override
string & id()
Set the trade id.
virtual const std::map< std::string, boost::any > & additionalData() const
returns all additional data returned by the trade once built
RequiredFixings requiredFixings_
QuantLib::ext::shared_ptr< InstrumentWrapper > instrument_
void reset()
Reset trade, clear all base class data. This does not reset accumulated timings for this trade.
const string & tradeType() const
std::map< std::string, boost::any > additionalData_
Small XML Document wrapper class.
XMLNode * allocNode(const string &nodeName)
util functions that wrap rapidxml
static void addChildren(XMLDocument &doc, XMLNode *n, const string &names, const string &name, const vector< T > &values)
static string getAttribute(XMLNode *node, const string &attrName)
static void checkNode(XMLNode *n, const string &expectedName)
static vector< XMLNode * > getChildrenNodes(XMLNode *node, const string &name)
Returns all the children with a given name.
static string getChildValue(XMLNode *node, const string &name, bool mandatory=false, const string &defaultValue=string())
static bool getChildValueAsBool(XMLNode *node, const string &name, bool mandatory=false, bool defaultValue=true)
static XMLNode * getChildNode(XMLNode *n, const string &name="")
static string getNodeValue(XMLNode *node)
Get a node's value.
static int getChildValueAsInt(XMLNode *node, const string &name, bool mandatory=false, int defaultValue=0)
static vector< string > getChildrenValues(XMLNode *node, const string &names, const string &name, bool mandatory=false)
static XMLNode * addChild(XMLDocument &doc, XMLNode *n, const string &name)
static void appendNode(XMLNode *parent, XMLNode *child)
SafeStack< ValueType > value
Calendar parseCalendar(const string &s)
Convert text to QuantLib::Calendar.
QuantLib::ext::shared_ptr< FxIndex > parseFxIndex(const string &s, const Handle< Quote > &fxSpot, const Handle< YieldTermStructure > &sourceYts, const Handle< YieldTermStructure > &targetYts, const bool useConventions)
Convert std::string to QuantExt::FxIndex.
Currency parseCurrencyWithMinors(const string &s)
Convert text to QuantLib::Currency.
Date parseDate(const string &s)
Convert std::string to QuantLib::Date.
QuantLib::Real convertMinorToMajorCurrency(const std::string &s, QuantLib::Real value)
Convert a value from a minor ccy to major.
Currency parseCurrency(const string &s)
Convert text to QuantLib::Currency.
BusinessDayConvention parseBusinessDayConvention(const string &s)
Convert text to QuantLib::BusinessDayConvention.
Period parsePeriod(const string &s)
Convert text to QuantLib::Period.
bool parseBool(const string &s)
Convert text to bool.
PaymentLag parsePaymentLag(const string &s)
Convert text to PaymentLag.
Real parseReal(const string &s)
Convert text to Real.
translates between QuantLib::Index::name() and ORE names
#define DLOG(text)
Logging Macro (Level = Debug)
#define ALOG(text)
Logging Macro (Level = Alert)
#define WLOG(text)
Logging Macro (Level = Warning)
market data related utilties
QuantLib::Date fixingDate(const QuantLib::Date &d, const QuantLib::Period obsLag, const QuantLib::Frequency freq, bool interpolated)
std::ostream & operator<<(std::ostream &out, EquityReturnType t)
std::string creditCurveNameFromSecuritySpecificCreditCurveName(const std::string &name)
std::pair< std::string, SimmCreditQualifierMapping > getCmbLegCreditQualifierMapping(const CMBLegData &ld, const QuantLib::ext::shared_ptr< ReferenceDataManager > &refData, const std::string &tradeId, const std::string &tradeType)
void addToRequiredFixings(const QuantLib::Leg &leg, const QuantLib::ext::shared_ptr< FixingDateGetter > &fixingDateGetter)
Size size(const ValueType &v)
TRS::FundingData::NotionalType parseTrsFundingNotionalType(const std::string &s)
std::string to_string(const LocationInfo &l)
boost::bimap< std::string, TRS::FundingData::NotionalType > types
void addTRSRequiredFixings(RequiredFixings &fixings, const std::vector< Leg > &returnLegs, const QuantLib::ext::shared_ptr< QuantExt::FxIndex > &ind=nullptr)
std::string getCmbLegCreditRiskCurrency(const CMBLegData &ld, const QuantLib::ext::shared_ptr< ReferenceDataManager > &refData)
boost::variant< QuantLib::Period, QuantLib::Natural > PaymentLag
QuantLib::ext::shared_ptr< QuantExt::FxIndex > buildFxIndex(const string &fxIndex, const string &domestic, const string &foreign, const QuantLib::ext::shared_ptr< Market > &market, const string &configuration, bool useXbsCurves)
Schedule makeSchedule(const ScheduleDates &data)
Serializable Credit Default Swap.
Structured Trade Error class.
string conversion utilities
generic wrapper for trs (bond, convertible bond, equity, ...)