Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
creditdefaultswapoption.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2020 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/creditdefaultswapoption.hpp
20 \brief credit default swap option trade data model and serialization
21 \ingroup tradedata
22 */
23
24#pragma once
25
28#include <boost/optional/optional.hpp>
29
30/*! Serializable Credit Default Swap Option
31 \ingroup tradedata
32*/
33namespace ore {
34namespace data {
35
37public:
38 /*! Hold information on a default that has occurred and for which an auction has been held.
39
40 If the CDS option has knockout set to false, a default payment will be made on expiry of the option in the
41 event of a default. Also, if knockout is set to true, we would still need to know this amount between the
42 auction date and the auction settlement date, typically 3 business days, to assign a value to the option
43 trade. Between the default date and the auction date, the recovery rate still trades so there should be enough
44 information in the market data to price the trade using the CDS option engine.
45 */
47 public:
48 //! Default constructor
50
51 //! Detailed constructor
53 QuantLib::Real& auctionFinalPrice);
54
55 //! \name Inspectors
56 //@{
57 const QuantLib::Date& auctionSettlementDate() const;
58 QuantLib::Real auctionFinalPrice() const;
59 //@}
60
61 //! \name Serialisation
62 //@{
63 void fromXML(XMLNode* node) override;
64 XMLNode* toXML(XMLDocument& doc) const override;
65 //@}
66
67 private:
68 QuantLib::Date auctionSettlementDate_;
69 QuantLib::Real auctionFinalPrice_;
70 };
71
72 //! Default constructor
74
75 //! Constructor
77 const OptionData& option,
79 QuantLib::Real strike = QuantLib::Null<QuantLib::Real>(),
80 const std::string& strikeType = "Spread",
81 bool knockOut = true,
82 const std::string& term = "",
83 const boost::optional<AuctionSettlementInformation>& asi = boost::none);
84
85 //! \name Trade interface
86 //@{
87 void build(const QuantLib::ext::shared_ptr<EngineFactory>& ef) override;
88 //@}
89
90 //! \name Inspectors
91 //@{
92 const OptionData& option() const;
93 const CreditDefaultSwapData& swap() const;
94 QuantLib::Real strike() const;
95 const std::string& strikeType() const;
96 bool knockOut() const;
97 const std::string& term() const;
98 const boost::optional<AuctionSettlementInformation>& auctionSettlementInformation() const;
99 //@}
100
101 //! \name Serialisation
102 //@{
103 void fromXML(XMLNode* node) override;
104 XMLNode* toXML(XMLDocument& doc) const override;
105 //@}
106
107private:
110 QuantLib::Real strike_;
111 std::string strikeType_;
113 std::string term_;
114 boost::optional<AuctionSettlementInformation> asi_;
115
116 //! Build CDS option given that no default
117 void buildNoDefault(const QuantLib::ext::shared_ptr<EngineFactory>& ef);
118
119 //! Build instrument given that default has occurred
120 void buildDefaulted(const QuantLib::ext::shared_ptr<EngineFactory>& ef);
121
122 //! Add the premium payment
123 Date addPremium(const QuantLib::ext::shared_ptr<EngineFactory>& ef, const QuantLib::Currency& tradeCurrency,
124 const std::string& marketConfig,
125 std::vector<QuantLib::ext::shared_ptr<QuantLib::Instrument>>& additionalInstruments,
126 std::vector<QuantLib::Real>& additionalMultipliers);
127};
128
129}
130}
AuctionSettlementInformation(const QuantLib::Date &auctionSettlementDate, QuantLib::Real &auctionFinalPrice)
Detailed constructor.
void buildDefaulted(const QuantLib::ext::shared_ptr< EngineFactory > &ef)
Build instrument given that default has occurred.
void build(const QuantLib::ext::shared_ptr< EngineFactory > &ef) override
const CreditDefaultSwapData & swap() const
XMLNode * toXML(XMLDocument &doc) const override
const boost::optional< AuctionSettlementInformation > & auctionSettlementInformation() const
boost::optional< AuctionSettlementInformation > asi_
Date addPremium(const QuantLib::ext::shared_ptr< EngineFactory > &ef, const QuantLib::Currency &tradeCurrency, const std::string &marketConfig, std::vector< QuantLib::ext::shared_ptr< QuantLib::Instrument > > &additionalInstruments, std::vector< QuantLib::Real > &additionalMultipliers)
Add the premium payment.
CreditDefaultSwapOption(const Envelope &env, const OptionData &option, const CreditDefaultSwapData &swap, QuantLib::Real strike=QuantLib::Null< QuantLib::Real >(), const std::string &strikeType="Spread", bool knockOut=true, const std::string &term="", const boost::optional< AuctionSettlementInformation > &asi=boost::none)
Constructor.
void buildNoDefault(const QuantLib::ext::shared_ptr< EngineFactory > &ef)
Build CDS option given that no default.
Serializable object holding generic trade data, reporting dimensions.
Definition: envelope.hpp:51
Serializable object holding option data.
Definition: optiondata.hpp:42
Trade base class.
Definition: trade.hpp:55
Small XML Document wrapper class.
Definition: xmlutils.hpp:65
Base class for all serializable classes.
Definition: xmlutils.hpp:101
Ibor cap, floor or collar trade data model and serialization.
@ data
Definition: log.hpp:77
Serializable Credit Default Swap.
Definition: namespaces.docs:23
trade option data model and serialization