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/riskparticipationagreement.hpp
20 \brief risk participation agreement data model and serialization
21 \ingroup tradedata
22*/
23
24#pragma once
25
30
31#include <ql/instruments/bond.hpp>
32
33namespace ore {
34namespace data {
35
36using namespace QuantLib;
37
38//! Serializable risk participation agreement
39/*!
40 \ingroup tradedata
41*/
43public:
44 RiskParticipationAgreement() : Trade("RiskParticipationAgreement") {}
45 //! Leg-based constructur, i.e. with Swap underyling
46 RiskParticipationAgreement(const ore::data::Envelope& env, const std::vector<ore::data::LegData>& underlying,
47 const std::vector<ore::data::LegData>& protectionFee, const Real participationRate,
48 const Date& protectionStart, const Date& protectionEnd, const std::string& creditCurveId,
49 const std::string& issuerId = "", const bool settlesAccrual = true,
50 const Real fixedRecoveryRate = Null<Real>(),
51 const boost::optional<ore::data::OptionData>& optionData = boost::none)
52 : Trade("RiskParticipationAgreement", env), underlying_(underlying), tlockData_(ore::data::TreasuryLockData()),
56 // Constructor with T-Lock underlying
58 const std::vector<ore::data::LegData>& protectionFee, const Real participationRate,
59 const Date& protectionStart, const Date& protectionEnd, const std::string& creditCurveId,
60 const std::string& issuerId = "", const bool settlesAccrual = true,
61 const Real fixedRecoveryRate = Null<Real>())
62 : Trade("RiskParticipationAgreement", env), tlockData_(tlockData), protectionFee_(protectionFee),
66
67 //! \name Inspectors
68 //@{
69 const std::vector<ore::data::LegData>& underlying() const { return underlying_; }
70 const boost::optional<ore::data::OptionData>& optionData() const { return optionData_; }
72 const std::vector<ore::data::LegData>& protectionFee() const { return protectionFee_; }
73 Real participationRate() const { return participationRate_; }
74 const Date& protectionStart() const { return protectionStart_; }
75 const Date& protectionEnd() const { return protectionEnd_; }
76 const std::string& creditCurveId() const { return creditCurveId_; }
77 const std::string& issuerId() const { return issuerId_; }
78 bool settlesAccrual() const { return settlesAccrual_; }
79 Real fixedRecoveryRate() const { return fixedRecoveryRate_; }
80 //@}
81
82 void build(const QuantLib::ext::shared_ptr<ore::data::EngineFactory>&) override;
83 virtual void fromXML(ore::data::XMLNode* node) override;
84 virtual ore::data::XMLNode* toXML(ore::data::XMLDocument& doc) const override;
85
86private:
87 void buildWithSwapUnderlying(const QuantLib::ext::shared_ptr<ore::data::EngineFactory>& engineFactory);
88 void buildWithTlockUnderlying(const QuantLib::ext::shared_ptr<ore::data::EngineFactory>& engineFactory);
89
90 std::vector<ore::data::LegData> underlying_;
92 std::vector<ore::data::LegData> protectionFee_;
98 boost::optional<ore::data::OptionData> optionData_;
100};
101
102} // namespace data
103} // namespace ore
const std::vector< Leg > & underlying() const
const std::vector< Leg > underlying_
const std::vector< Leg > protectionFee_
const std::vector< Leg > & protectionFee() const
const Date & protectionEnd() const
const Date & protectionStart() const
Serializable object holding generic trade data, reporting dimensions.
Definition: envelope.hpp:51
const boost::optional< ore::data::OptionData > & optionData() const
std::vector< ore::data::LegData > underlying_
std::vector< ore::data::LegData > protectionFee_
boost::optional< ore::data::OptionData > optionData_
const std::vector< ore::data::LegData > & protectionFee() const
const std::vector< ore::data::LegData > & underlying() const
const ore::data::TreasuryLockData & tlockData() const
RiskParticipationAgreement(const ore::data::Envelope &env, const ore::data::TreasuryLockData &tlockData, const std::vector< ore::data::LegData > &protectionFee, const Real participationRate, const Date &protectionStart, const Date &protectionEnd, const std::string &creditCurveId, const std::string &issuerId="", const bool settlesAccrual=true, const Real fixedRecoveryRate=Null< Real >())
RiskParticipationAgreement(const ore::data::Envelope &env, const std::vector< ore::data::LegData > &underlying, const std::vector< ore::data::LegData > &protectionFee, const Real participationRate, const Date &protectionStart, const Date &protectionEnd, const std::string &creditCurveId, const std::string &issuerId="", const bool settlesAccrual=true, const Real fixedRecoveryRate=Null< Real >(), const boost::optional< ore::data::OptionData > &optionData=boost::none)
Leg-based constructur, i.e. with Swap underyling.
Trade base class.
Definition: trade.hpp:55
Small XML Document wrapper class.
Definition: xmlutils.hpp:65
leg data model and serialization
@ data
Definition: log.hpp:77
Serializable Credit Default Swap.
Definition: namespaces.docs:23
trade option data model and serialization
A class to hold Treasury-Lock data.
base trade data model and serialization