25#include <ql/time/date.hpp>
34 const bool useRfrCurveInSimulationMarket,
35 const std::map<std::string, FallbackData>& fallbacks)
36 : enableIborFallbacks_(enableIborFallbacks), useRfrCurveInTodaysMarket_(useRfrCurveInTodaysMarket),
37 useRfrCurveInSimulationMarket_(useRfrCurveInSimulationMarket), fallbacks_(fallbacks) {}
58 return i !=
fallbacks_.end() && asof >= i->second.switchDate;
65 "No fallback data found for ibor index '"
67 <<
"', client code should check whether an index is replaced with IsIndexReplaced() before querying data.");
119 {{
"CHF-LIBOR-SN",
FallbackData{
"CHF-SARON", -0.000551, Date(1, Jan, 2022)}},
120 {
"CHF-LIBOR-1W",
FallbackData{
"CHF-SARON", -0.000705, Date(1, Jan, 2022)}},
121 {
"CHF-LIBOR-1M",
FallbackData{
"CHF-SARON", -0.000571, Date(1, Jan, 2022)}},
122 {
"CHF-LIBOR-2M",
FallbackData{
"CHF-SARON", -0.000231, Date(1, Jan, 2022)}},
123 {
"CHF-LIBOR-3M",
FallbackData{
"CHF-SARON", 0.000031, Date(1, Jan, 2022)}},
124 {
"CHF-LIBOR-6M",
FallbackData{
"CHF-SARON", 0.000741, Date(1, Jan, 2022)}},
125 {
"CHF-LIBOR-12M",
FallbackData{
"CHF-SARON", 0.002048, Date(1, Jan, 2022)}},
126 {
"EUR-EONIA",
FallbackData{
"EUR-ESTER", 0.00085, Date(1, Jan, 2022)}},
127 {
"EUR-EURIBOR-1W",
FallbackData{
"EUR-ESTER", 0.000577, Date(1, Jan, 2100)}},
128 {
"EUR-EURIBOR-1M",
FallbackData{
"EUR-ESTER", 0.000738, Date(1, Jan, 2100)}},
129 {
"EUR-EURIBOR-3M",
FallbackData{
"EUR-ESTER", 0.001244, Date(1, Jan, 2100)}},
130 {
"EUR-EURIBOR-6M",
FallbackData{
"EUR-ESTER", 0.001977, Date(1, Jan, 2100)}},
131 {
"EUR-EURIBOR-12M",
FallbackData{
"EUR-ESTER", 0.002048, Date(1, Jan, 2100)}},
132 {
"EUR-LIBOR-ON",
FallbackData{
"EUR-ESTER", 0.000017, Date(1, Jan, 2022)}},
133 {
"EUR-LIBOR-1W",
FallbackData{
"EUR-ESTER", 0.000243, Date(1, Jan, 2022)}},
134 {
"EUR-LIBOR-1M",
FallbackData{
"EUR-ESTER", 0.000456, Date(1, Jan, 2022)}},
135 {
"EUR-LIBOR-2M",
FallbackData{
"EUR-ESTER", 0.000753, Date(1, Jan, 2022)}},
136 {
"EUR-LIBOR-3M",
FallbackData{
"EUR-ESTER", 0.000962, Date(1, Jan, 2022)}},
137 {
"EUR-LIBOR-6M",
FallbackData{
"EUR-ESTER", 0.001537, Date(1, Jan, 2022)}},
138 {
"EUR-LIBOR-12M",
FallbackData{
"EUR-ESTER", 0.002993, Date(1, Jan, 2022)}},
139 {
"JPY-TIBOR-1W",
FallbackData{
"JPY-TONAR", 0.0005564, Date(1, Jan, 2025)}},
140 {
"JPY-TIBOR-1M",
FallbackData{
"JPY-TONAR", 0.0009608, Date(1, Jan, 2025)}},
141 {
"JPY-TIBOR-3M",
FallbackData{
"JPY-TONAR", 0.0010989, Date(1, Jan, 2025)}},
142 {
"JPY-TIBOR-6M",
FallbackData{
"JPY-TONAR", 0.0016413, Date(1, Jan, 2025)}},
143 {
"JPY-TIBOR-12M",
FallbackData{
"JPY-TONAR", 0.0018181, Date(1, Jan, 2025)}},
144 {
"JPY-EYTIBOR-1W",
FallbackData{
"JPY-TONAR", 0.0006506, Date(1, Jan, 2025)}},
145 {
"JPY-EYTIBOR-1M",
FallbackData{
"JPY-TONAR", 0.0013485, Date(1, Jan, 2025)}},
146 {
"JPY-EYTIBOR-3M",
FallbackData{
"JPY-TONAR", 0.0010252, Date(1, Jan, 2025)}},
147 {
"JPY-EYTIBOR-6M",
FallbackData{
"JPY-TONAR", 0.0014848, Date(1, Jan, 2025)}},
148 {
"JPY-EYTIBOR-12M",
FallbackData{
"JPY-TONAR", 0.0018567, Date(1, Jan, 2025)}},
149 {
"JPY-LIBOR-SN",
FallbackData{
"JPY-TONAR", -0.0001839, Date(1, Jan, 2022)}},
150 {
"JPY-LIBOR-1W",
FallbackData{
"JPY-TONAR", -0.0001981, Date(1, Jan, 2022)}},
151 {
"JPY-LIBOR-1M",
FallbackData{
"JPY-TONAR", -0.0002923, Date(1, Jan, 2022)}},
152 {
"JPY-LIBOR-2M",
FallbackData{
"JPY-TONAR", -0.0000449, Date(1, Jan, 2022)}},
153 {
"JPY-LIBOR-3M",
FallbackData{
"JPY-TONAR", 0.0000835, Date(1, Jan, 2022)}},
154 {
"JPY-LIBOR-6M",
FallbackData{
"JPY-TONAR", 0.0005809, Date(1, Jan, 2022)}},
155 {
"JPY-LIBOR-12M",
FallbackData{
"JPY-TONAR", 0.00166, Date(1, Jan, 2022)}},
156 {
"AUD-BBSW-1M",
FallbackData{
"AUD-AONIA", 0.001191, Date(1, Jan, 2100)}},
157 {
"AUD-BBSW-2M",
FallbackData{
"AUD-AONIA", 0.002132, Date(1, Jan, 2100)}},
158 {
"AUD-BBSW-3M",
FallbackData{
"AUD-AONIA", 0.002623, Date(1, Jan, 2100)}},
159 {
"AUD-BBSW-4M",
FallbackData{
"AUD-AONIA", 0.003313, Date(1, Jan, 2100)}},
160 {
"AUD-BBSW-5M",
FallbackData{
"AUD-AONIA", 0.004104, Date(1, Jan, 2100)}},
161 {
"AUD-BBSW-6M",
FallbackData{
"AUD-AONIA", 0.004845, Date(1, Jan, 2100)}},
162 {
"HKD-HIBOR-ON",
FallbackData{
"HKD-HONIA", 0.0003219, Date(1, Jan, 2100)}},
163 {
"HKD-HIBOR-1W",
FallbackData{
"HKD-HONIA", 0.001698, Date(1, Jan, 2100)}},
164 {
"HKD-HIBOR-2W",
FallbackData{
"HKD-HONIA", 0.002370, Date(1, Jan, 2100)}},
165 {
"HKD-HIBOR-1M",
FallbackData{
"HKD-HONIA", 0.0039396, Date(1, Jan, 2100)}},
166 {
"HKD-HIBOR-2M",
FallbackData{
"HKD-HONIA", 0.0056768, Date(1, Jan, 2100)}},
167 {
"HKD-HIBOR-3M",
FallbackData{
"HKD-HONIA", 0.0072642, Date(1, Jan, 2100)}},
168 {
"HKD-HIBOR-6M",
FallbackData{
"HKD-HONIA", 0.0093495, Date(1, Jan, 2100)}},
169 {
"HKD-HIBOR-12M",
FallbackData{
"HKD-HONIA", 0.0121231, Date(1, Jan, 2100)}},
170 {
"CAD-CDOR-1M",
FallbackData{
"CAD-CORRA", 0.0029547, Date(1, July, 2024)}},
171 {
"CAD-CDOR-2M",
FallbackData{
"CAD-CORRA", 0.0030190, Date(1, July, 2024)}},
172 {
"CAD-CDOR-3M",
FallbackData{
"CAD-CORRA", 0.0032138, Date(1, July, 2024)}},
173 {
"CAD-CDOR-6M",
FallbackData{
"CAD-CORRA", 0.0049375, Date(17, May, 2021)}},
174 {
"CAD-CDOR-12M",
FallbackData{
"CAD-CORRA", 0.005482, Date(17, May, 2021)}},
175 {
"GBP-LIBOR-ON",
FallbackData{
"GBP-SONIA", -0.000024, Date(1, Jan, 2022)}},
176 {
"GBP-LIBOR-1W",
FallbackData{
"GBP-SONIA", 0.000168, Date(1, Jan, 2022)}},
177 {
"GBP-LIBOR-1M",
FallbackData{
"GBP-SONIA", 0.000326, Date(1, Jan, 2022)}},
178 {
"GBP-LIBOR-2M",
FallbackData{
"GBP-SONIA", 0.000633, Date(1, Jan, 2022)}},
179 {
"GBP-LIBOR-3M",
FallbackData{
"GBP-SONIA", 0.001193, Date(1, Jan, 2022)}},
180 {
"GBP-LIBOR-6M",
FallbackData{
"GBP-SONIA", 0.002766, Date(1, Jan, 2022)}},
181 {
"GBP-LIBOR-12M",
FallbackData{
"GBP-SONIA", 0.004644, Date(1, Jan, 2022)}},
182 {
"USD-LIBOR-ON",
FallbackData{
"USD-SOFR", 0.0000644, Date(1, Jul, 2023)}},
183 {
"USD-LIBOR-1W",
FallbackData{
"USD-SOFR", 0.0003839, Date(1, Jan, 2023)}},
184 {
"USD-LIBOR-1M",
FallbackData{
"USD-SOFR", 0.0011448, Date(1, Jul, 2023)}},
185 {
"USD-LIBOR-2M",
FallbackData{
"USD-SOFR", 0.0018456, Date(1, Jan, 2023)}},
186 {
"USD-LIBOR-3M",
FallbackData{
"USD-SOFR", 0.0026161, Date(1, Jul, 2023)}},
187 {
"USD-LIBOR-6M",
FallbackData{
"USD-SOFR", 0.0042826, Date(1, Jul, 2023)}},
188 {
"USD-LIBOR-12M",
FallbackData{
"USD-SOFR", 0.0071513, Date(1, Jul, 2023)}},
189 {
"TRY-TRLIBOR-1M",
FallbackData{
"TRY-TLREF", 0.0100, Date(1, July, 2022)}},
190 {
"TRY-TRLIBOR-3M",
FallbackData{
"TRY-TLREF", 0.0093, Date(1, July, 2022)}},
191 {
"TRY-TRLIBOR-6M",
FallbackData{
"TRY-TLREF", 0.0058, Date(1, July, 2022)}}}};
196 for (std::map<std::string, FallbackData>::iterator f =
fallbacks_.begin(); f !=
fallbacks_.end(); f++) {
197 if ((f->first == indexName || indexName ==
"") &&
198 f->second.switchDate > targetSwitchDate) {
200 "Updating switch date from " +
to_string(f->second.switchDate) +
203 f->second.switchDate = targetSwitchDate;
210 DLOG(
"IBOR index " << f.first <<
" has fallback switch date " <<
to_string(f.second.switchDate));
void updateSwitchDate(QuantLib::Date targetSwitchDate, const std::string &indexName="")
bool useRfrCurveInSimulationMarket_
bool enableIborFallbacks() const
const FallbackData & fallbackData(const string &iborIndex) const
void fromXML(XMLNode *node) override
XMLNode * toXML(XMLDocument &doc) const override
bool useRfrCurveInTodaysMarket() const
bool enableIborFallbacks_
std::map< std::string, FallbackData > fallbacks_
bool useRfrCurveInSimulationMarket() const
static IborFallbackConfig defaultConfig()
bool useRfrCurveInTodaysMarket_
bool isIndexReplaced(const string &iborIndex, const QuantLib::Date &asof=QuantLib::Date::maxDate()) const
void addIndexFallbackRule(const string &iborIndex, const FallbackData &fallbackData)
void log() const
generate Boost log record to pass to corresponding sinks
Utility classes for Structured warnings, contains the configuration type and ID (NettingSetId,...
Small XML Document wrapper class.
XMLNode * allocNode(const string &nodeName)
util functions that wrap rapidxml
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 XMLNode * addChild(XMLDocument &doc, XMLNode *n, const string &name)
Date parseDate(const string &s)
Convert std::string to QuantLib::Date.
Real parseReal(const string &s)
Convert text to Real.
ibor fallback configuration
Classes and functions for log message handling.
#define DLOG(text)
Logging Macro (Level = Debug)
std::string to_string(const LocationInfo &l)
Serializable Credit Default Swap.
Map text representations to QuantLib/QuantExt types.
Class for structured configuration warnings.
string conversion utilities