Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
riskparticipationagreement.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2019 Quaternion Risk Management Ltd
3 All rights reserved.
4
5 This file is part of ORE, a free-software/open-source library
6 for transparent pricing and risk analysis - http://opensourcerisk.org
7
8 ORE is free software: you can redistribute it and/or modify it
9 under the terms of the Modified BSD License. You should have received a
10 copy of the license along with this program.
11 The license is also available online at <http://opensourcerisk.org>
12
13 This program is distributed on the basis that it will form a useful
14 contribution to risk analytics and model standardisation, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 FITNESS FOR A PARTICULAR PURPOSE. See the license for more details.
17*/
18
19/*! \file ored/portfolio/builders/riskparticipationagreement.hpp
20 \brief
21 \ingroup builders
22*/
23
24#pragma once
25
27
30
31#include <boost/make_shared.hpp>
32
33namespace ore {
34namespace data {
35
36//! RPA base engine builder
38 : public CachingPricingEngineBuilder<string, const std::string&, RiskParticipationAgreement*> {
39public:
40 RiskParticipationAgreementEngineBuilderBase(const std::string& model, const std::string& engine,
41 const std::set<std::string>& tradeTypes)
43
44protected:
45 virtual std::string keyImpl(const std::string& id, RiskParticipationAgreement* rpa) override { return id; }
46 std::map<std::string, Handle<YieldTermStructure>> getDiscountCurves(RiskParticipationAgreement* rpa);
47 std::map<std::string, Handle<Quote>> getFxSpots(RiskParticipationAgreement* rpa);
48};
49
50//! RPA Black engine builder
52public:
54 : RiskParticipationAgreementEngineBuilderBase("Black", "Analytic", {"RiskParticipationAgreement_Vanilla"}) {}
55
56protected:
57 QuantLib::ext::shared_ptr<QuantLib::PricingEngine> engineImpl(const std::string& id,
58 RiskParticipationAgreement* rpa) override;
59};
60
61//! RPA XCcy Black engine builder
63public:
66 {"RiskParticipationAgreement_Vanilla_XCcy"}) {}
67
68protected:
69 QuantLib::ext::shared_ptr<QuantLib::PricingEngine> engineImpl(const std::string& id,
70 RiskParticipationAgreement* rpa) override;
71};
72
73//! RPA Numeric LGM base builder
75public:
76 explicit RiskParticipationAgreementLGMGridEngineBuilder(const std::set<std::string>& tradeTypes)
78
79protected:
80 QuantLib::ext::shared_ptr<QuantExt::LGM> model(const string& id, const string& key, const std::vector<Date>& expiries,
81 const Date& maturity, const std::vector<Real>& strikes);
82};
83
84//! RPA Numeric LGM engine builder for swap underlyings
86public:
89 {"RiskParticipationAgreement_Vanilla", "RiskParticipationAgreement_Structured"}) {}
90
91protected:
92 QuantLib::ext::shared_ptr<QuantLib::PricingEngine> engineImpl(const std::string& id,
93 RiskParticipationAgreement* rpa) override;
94};
95
96//! RPA Numeric LGM engine builder for tlock underlyings
98public:
100 : RiskParticipationAgreementLGMGridEngineBuilder({"RiskParticipationAgreement_TLock"}) {}
101
102protected:
103 QuantLib::ext::shared_ptr<QuantLib::PricingEngine> engineImpl(const std::string& id,
104 RiskParticipationAgreement* rpa) override;
105};
106
107} // namespace data
108} // namespace ore
Abstract template engine builder class.
Abstract template EngineBuilder class that can cache engines and coupon pricers.
const string & engine() const
Return the engine name.
const set< string > & tradeTypes() const
Return the possible trade types.
const string & model() const
Return the model name.
QuantLib::ext::shared_ptr< QuantLib::PricingEngine > engineImpl(const std::string &id, RiskParticipationAgreement *rpa) override
std::map< std::string, Handle< Quote > > getFxSpots(RiskParticipationAgreement *rpa)
virtual std::string keyImpl(const std::string &id, RiskParticipationAgreement *rpa) override
std::map< std::string, Handle< YieldTermStructure > > getDiscountCurves(RiskParticipationAgreement *rpa)
RiskParticipationAgreementEngineBuilderBase(const std::string &model, const std::string &engine, const std::set< std::string > &tradeTypes)
RiskParticipationAgreementLGMGridEngineBuilder(const std::set< std::string > &tradeTypes)
RPA Numeric LGM engine builder for swap underlyings.
QuantLib::ext::shared_ptr< QuantLib::PricingEngine > engineImpl(const std::string &id, RiskParticipationAgreement *rpa) override
RPA Numeric LGM engine builder for tlock underlyings.
QuantLib::ext::shared_ptr< QuantLib::PricingEngine > engineImpl(const std::string &id, RiskParticipationAgreement *rpa) override
QuantLib::ext::shared_ptr< QuantLib::PricingEngine > engineImpl(const std::string &id, RiskParticipationAgreement *rpa) override
Pricing Engine Factory.
@ data
Definition: log.hpp:77
Time maturity
Definition: utilities.cpp:66
Serializable Credit Default Swap.
Definition: namespaces.docs:23
risk participation agreement data model and serialization