Skip to content

Commit 20d2e68

Browse files
rolandlichtersjenkins
authored andcommitted
QPR-12561 add inverted fx spot as required quote
1 parent 1cfd62d commit 20d2e68

8 files changed

Lines changed: 21 additions & 3 deletions

OREData/ored/configuration/curveconfigurations.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,8 @@ std::set<string> CurveConfigurations::quotes(const QuantLib::ext::shared_ptr<Tod
235235
if (spec->baseType() == CurveSpec::CurveType::FX) {
236236
QuantLib::ext::shared_ptr<FXSpotSpec> fxss = QuantLib::ext::dynamic_pointer_cast<FXSpotSpec>(spec);
237237
QL_REQUIRE(fxss, "Expected an FXSpotSpec but did not get one");
238-
string strQuote = "FX/RATE/" + fxss->unitCcy() + "/" + fxss->ccy();
239-
quotes.insert(strQuote);
238+
quotes.insert("FX/RATE/" + fxss->unitCcy() + "/" + fxss->ccy());
239+
quotes.insert("FX/RATE/" + fxss->ccy() + "/" + fxss->unitCcy());
240240
}
241241
}
242242
}

OREData/ored/configuration/yieldcurveconfig.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,15 @@ const vector<string>& YieldCurveConfig::quotes() {
235235
// Check if the segment is a CrossCcyYieldCurveSegment and add the FX spot rate to the
236236
// set of quotes needed for the YieldCurveConfig if it has not already been added.
237237
if (auto xccySegment = QuantLib::ext::dynamic_pointer_cast<CrossCcyYieldCurveSegment>(c)) {
238-
if (!addedFxSpot)
238+
if (!addedFxSpot) {
239239
quotes_.push_back(xccySegment->spotRateID());
240+
// we add the inverted pair as well, because the original pair might get removed from the market
241+
// data loader if both are present in the input market data
242+
if (auto md = boost::dynamic_pointer_cast<FXSpotQuote>(
243+
parseMarketDatum(Date(), xccySegment->spotRateID(), 1.0))) {
244+
quotes_.push_back("FX/RATE/" + md->ccy() + "/" + md->unitCcy());
245+
}
246+
}
240247
}
241248
}
242249
}

OREData/test/input/curveconfig/expected_quotes_all.csv

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ IR_SWAP/RATE/EUR/2D/6M/10Y
2525
FXFWD/RATE/EUR/USD/3M
2626
FXFWD/RATE/EUR/USD/6M
2727
FX/RATE/EUR/USD
28+
FX/RATE/USD/EUR
2829
CC_BASIS_SWAP/BASIS_SPREAD/USD/3M/EUR/3M/5Y
2930
CC_BASIS_SWAP/BASIS_SPREAD/USD/3M/EUR/3M/10Y
3031
MM/RATE/GBP/0D/1D
@@ -41,6 +42,7 @@ BASIS_SWAP/BASIS_SPREAD/3M/6M/GBP/5Y
4142
BASIS_SWAP/BASIS_SPREAD/3M/6M/GBP/10Y
4243
FXFWD/RATE/GBP/USD/6M
4344
FX/RATE/GBP/USD
45+
FX/RATE/USD/GBP
4446
CC_BASIS_SWAP/BASIS_SPREAD/USD/3M/GBP/3M/2Y
4547
CC_BASIS_SWAP/BASIS_SPREAD/USD/3M/GBP/3M/5Y
4648
CC_BASIS_SWAP/BASIS_SPREAD/USD/3M/GBP/3M/10Y

OREData/test/input/curveconfig/expected_quotes_only_ir.csv

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ IR_SWAP/RATE/EUR/2D/6M/10Y
2525
FXFWD/RATE/EUR/USD/3M
2626
FXFWD/RATE/EUR/USD/6M
2727
FX/RATE/EUR/USD
28+
FX/RATE/USD/EUR
2829
CC_BASIS_SWAP/BASIS_SPREAD/USD/3M/EUR/3M/5Y
2930
CC_BASIS_SWAP/BASIS_SPREAD/USD/3M/EUR/3M/10Y
3031
MM/RATE/GBP/0D/1D
@@ -41,6 +42,7 @@ BASIS_SWAP/BASIS_SPREAD/3M/6M/GBP/5Y
4142
BASIS_SWAP/BASIS_SPREAD/3M/6M/GBP/10Y
4243
FXFWD/RATE/GBP/USD/6M
4344
FX/RATE/GBP/USD
45+
FX/RATE/USD/GBP
4446
CC_BASIS_SWAP/BASIS_SPREAD/USD/3M/GBP/3M/2Y
4547
CC_BASIS_SWAP/BASIS_SPREAD/USD/3M/GBP/3M/5Y
4648
CC_BASIS_SWAP/BASIS_SPREAD/USD/3M/GBP/3M/10Y

OREData/test/input/curveconfig/expected_quotes_tmp_multiple.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,4 @@ FXFWD/RATE/EUR/USD/6M
2727
CC_BASIS_SWAP/BASIS_SPREAD/USD/3M/EUR/3M/5Y
2828
CC_BASIS_SWAP/BASIS_SPREAD/USD/3M/EUR/3M/10Y
2929
FX/RATE/EUR/USD
30+
FX/RATE/USD/EUR

OREData/test/input/curveconfig/expected_quotes_with_fx_vol_atm.csv

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ IR_SWAP/RATE/EUR/2D/6M/10Y
2525
FXFWD/RATE/EUR/USD/3M
2626
FXFWD/RATE/EUR/USD/6M
2727
FX/RATE/EUR/USD
28+
FX/RATE/USD/EUR
2829
CC_BASIS_SWAP/BASIS_SPREAD/USD/3M/EUR/3M/5Y
2930
CC_BASIS_SWAP/BASIS_SPREAD/USD/3M/EUR/3M/10Y
3031
MM/RATE/GBP/0D/1D
@@ -41,6 +42,7 @@ BASIS_SWAP/BASIS_SPREAD/3M/6M/GBP/5Y
4142
BASIS_SWAP/BASIS_SPREAD/3M/6M/GBP/10Y
4243
FXFWD/RATE/GBP/USD/6M
4344
FX/RATE/GBP/USD
45+
FX/RATE/USD/GBP
4446
CC_BASIS_SWAP/BASIS_SPREAD/USD/3M/GBP/3M/2Y
4547
CC_BASIS_SWAP/BASIS_SPREAD/USD/3M/GBP/3M/5Y
4648
CC_BASIS_SWAP/BASIS_SPREAD/USD/3M/GBP/3M/10Y

OREData/test/input/curveconfig/expected_quotes_with_fx_vol_smile.csv

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ IR_SWAP/RATE/EUR/2D/6M/10Y
2525
FXFWD/RATE/EUR/USD/3M
2626
FXFWD/RATE/EUR/USD/6M
2727
FX/RATE/EUR/USD
28+
FX/RATE/USD/EUR
2829
CC_BASIS_SWAP/BASIS_SPREAD/USD/3M/EUR/3M/5Y
2930
CC_BASIS_SWAP/BASIS_SPREAD/USD/3M/EUR/3M/10Y
3031
MM/RATE/GBP/0D/1D
@@ -41,6 +42,7 @@ BASIS_SWAP/BASIS_SPREAD/3M/6M/GBP/5Y
4142
BASIS_SWAP/BASIS_SPREAD/3M/6M/GBP/10Y
4243
FXFWD/RATE/GBP/USD/6M
4344
FX/RATE/GBP/USD
45+
FX/RATE/USD/GBP
4446
CC_BASIS_SWAP/BASIS_SPREAD/USD/3M/GBP/3M/2Y
4547
CC_BASIS_SWAP/BASIS_SPREAD/USD/3M/GBP/3M/5Y
4648
CC_BASIS_SWAP/BASIS_SPREAD/USD/3M/GBP/3M/10Y

OREData/test/input/curveconfig/expected_quotes_with_fx_vol_smile_delta.csv

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ IR_SWAP/RATE/EUR/2D/6M/10Y
2525
FXFWD/RATE/EUR/USD/3M
2626
FXFWD/RATE/EUR/USD/6M
2727
FX/RATE/EUR/USD
28+
FX/RATE/USD/EUR
2829
CC_BASIS_SWAP/BASIS_SPREAD/USD/3M/EUR/3M/5Y
2930
CC_BASIS_SWAP/BASIS_SPREAD/USD/3M/EUR/3M/10Y
3031
MM/RATE/GBP/0D/1D
@@ -41,6 +42,7 @@ BASIS_SWAP/BASIS_SPREAD/3M/6M/GBP/5Y
4142
BASIS_SWAP/BASIS_SPREAD/3M/6M/GBP/10Y
4243
FXFWD/RATE/GBP/USD/6M
4344
FX/RATE/GBP/USD
45+
FX/RATE/USD/GBP
4446
CC_BASIS_SWAP/BASIS_SPREAD/USD/3M/GBP/3M/2Y
4547
CC_BASIS_SWAP/BASIS_SPREAD/USD/3M/GBP/3M/5Y
4648
CC_BASIS_SWAP/BASIS_SPREAD/USD/3M/GBP/3M/10Y

0 commit comments

Comments
 (0)