Skip to content

Commit bd62bed

Browse files
damienbarkerjenkins
authored andcommitted
Merge remote-tracking branch 'origin/master' into QPR-12242
2 parents 7b12e60 + e9e7a78 commit bd62bed

24 files changed

Lines changed: 657 additions & 178 deletions

Docker/.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ DEBIAN_TAG=11.7
33
# it's recommended to include CMAKE_BUILD_TYPE and BOOST_VARIANT in QL_TAG, ORE_TAG, BOOST_TAG
44
# to distinguish a release build from a debug build
55

6-
QL_TAG=1.31.1_ddda9430
6+
QL_TAG=1.31.1_f8955cf0
77
ORE_TAG=latest
88

99
# debug or release

Docs/UserGuide/tradecomponents/legdatanotionals.tex

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ \subsubsection{Leg Data and Notionals}
5252

5353
Allowable values: See Table \ref{tab:currency} \lstinline!Currency!. When \lstinline!LegType! is \emph{Equity}, Minor Currencies in Table \ref{tab:currency} are also allowable.
5454

55-
\item PaymentCalendar [Optional]: The payment calendar of the leg coupons. The \lstinline!PaymentCalendar! is used in conjunction with the \lstinline!PaymentConvention! and the \lstinline!PaymentLag! to determine the payments dates, unless the \lstinline!PaymentDates! node is used which defines the payment dates explicitly.
55+
\item PaymentCalendar [Optional]: The payment calendar of the leg coupons. The \lstinline!PaymentCalendar! is used in conjunction with the \lstinline!PaymentConvention!, \lstinline!PaymentLag! and \lstinline!NotionalPaymentLag! to determine the payments dates, unless the \lstinline!PaymentDates! node is used which defines the payment dates explicitly.
5656

5757
Allowable values: See Table \ref{tab:calendar} \lstinline!Calendar!. If left blank or omitted, defaults to the calendar in the \lstinline!ScheduleData! node, unless \lstinline!LegType! is \emph{Floating} and \lstinline!Index! is OIS, in which case this defaults to the index calendar.
5858

@@ -62,12 +62,16 @@ \subsubsection{Leg Data and Notionals}
6262

6363
Allowable values: See Table \ref{tab:convention}.
6464

65-
\item PaymentLag [optional]: The payment lag applies to Fixed legs, Equity legs, and Floating legs with Ibor and OIS indices (but not to BMA/SIFMA indices), as well as CMS legs, CMSSpread legs, CPI legs and Zero Coupon Fixed legs. \\
65+
\item PaymentLag [optional]: The payment lag applies to the coupons on Fixed legs, Equity legs, and Floating legs with Ibor and OIS indices (but not to BMA/SIFMA indices), as well as CMS legs, CMSSpread legs, CPI legs and Zero Coupon Fixed legs. \\
6666
PaymentLag is also not supported for CapFloor Floating legs that have Ibor coupons with sub periods (HasSubPeriods = \emph{true}), nor for CapFloor Floating legs with averaged ON coupons (IsAveraged = \emph{true}).
6767

6868
Allowable values: Any valid period, i.e. a non-negative whole number, optionally followed by \emph{D} (days), \emph{W} (weeks), \emph{M} (months),
6969
\emph{Y} (years). Defaults to \emph{0D} if left blank or omitted. If a whole number is given and no letter, it is assumed that it is a number of \emph{D} (days).
7070

71+
\item NotionalPaymentLag [optional]: The notional payment lag (in days) applied to any notional exchanges.
72+
73+
Allowable values: Any non-negative integer. Defaults to zero if left blank or omitted.
74+
7175
\item DayCounter: The day count convention of the leg coupons. Note that \lstinline!DayCounter! is mandatory for all leg types except \emph{Equity}.
7276

7377
Allowable values: See \lstinline!DayCount Convention! in Table \ref{tab:daycount}. For \emph{Equity} legs, if left blank or omitted, it defaults to \emph{ACT/365}.

Docs/UserGuide/tradedata/compositetrade.tex

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,19 @@ \subsubsection{Composite Trade}
2323
\label{lst:compositetrade_data}
2424
\end{listing}
2525
26+
\begin{listing}[H]
27+
%\hrule\medskip
28+
\begin{minted}[fontsize=\footnotesize]{xml}
29+
<CompositeTradeData>
30+
<Currency>USD</Currency>
31+
<NotionalCalculation>Sum</NotionalCalculation>
32+
<PortfolioBasket>true</PortfolioBasket>
33+
<BasketName>NAME</BasketName>
34+
</CompositeTradeData>
35+
\end{minted}
36+
\caption{Composite trade data with Reference Data}
37+
\end{listing}
38+
2639
The meanings and allowable values of the elements in the \lstinline!CompositeTradeData! node follow below.
2740
2841
\begin{itemize}
@@ -43,4 +56,8 @@ \subsubsection{Composite Trade}
4356
Allowable values: Any non-negative real number.
4457
\item Components: The portfolio of trades that make up the composite trade. \\
4558
Allowable values: These trades should be valid xmls that could otherwise be entered into the portfolio, with the exception that they can have empty ids.
59+
\item PortfolioBasket [Optional]: Indicate if the Component represent a portfolio basket. \\
60+
Allowable values: Boolean true or false.
61+
\item BasketName [Optional]: The portfolio Id. \\
62+
Allowable values: Any string. Note that if PortfolioBasket is True then there must be a BasketName. We look up the Basket within the reference data.
4663
\end{itemize}
Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
\subsubsection{CPI Swap}
22

3-
A CPI swap can be set up as a swap with trade type \emph{Swap}, with one leg of type {\tt CPI}. Listing \ref{lst:cpiswap}
4-
shows an example. The CPI leg contains an additional {\tt CPILegData} block. See \ref{ss:cpilegdata} for details on the
5-
CPI leg specification.
3+
A CPI inflation swap can be set up using the \emph{InflationSwap} trade type, with one leg of type {\tt CPI}. and the other leg(s) can be of any leg type. Listing \ref{lst:cpiinflationswap} shows an example. The CPI leg contains an additional {\tt CPILegData} block. See \ref{ss:cpilegdata} for details on the
4+
CPI leg specification.
5+
6+
Note that Cross Currency Inflation Swaps are supported, as the currencies on the legs of an \emph{InflationSwap} do not need to be the same.
7+
68

79
\begin{listing}[H]
810
%\hrule\medskip
911
\begin{minted}[fontsize=\footnotesize]{xml}
10-
<SwapData>
12+
<InflationSwapData>
1113
<LegData>
1214
<LegType>Floating</LegType>
1315
<Payer>true</Payer>
@@ -21,18 +23,19 @@ \subsubsection{CPI Swap}
2123
...
2224
</CPILegData>
2325
</LegData>
24-
</SwapData>
26+
</InflationSwapData>
2527
\end{minted}
26-
\caption{CPI Swap Data (using \emph{Swap} trade type)}
27-
\label{lst:cpiswap}
28+
\caption{CPI Swap Data (using \emph{InflationSwap} trade type)}
29+
\label{lst:cpiinflationswap}
2830
\end{listing}
2931

30-
Alternatively, a CPI swap can be set up using the \emph{InflationSwap} trade type, see Listing \ref{lst:cpiinflationswap}. The structure of the {\tt InflationSwapData} container is the same as for {\tt SwapData} above.
32+
33+
Alternatively, a CPI swap can be set up as a swap with trade type \emph{Swap}, with one leg of type {\tt CPI}, see listing \ref{lst:cpiswap}.
3134

3235
\begin{listing}[H]
3336
%\hrule\medskip
3437
\begin{minted}[fontsize=\footnotesize]{xml}
35-
<InflationSwapData>
38+
<SwapData>
3639
<LegData>
3740
<LegType>Floating</LegType>
3841
<Payer>true</Payer>
@@ -46,8 +49,9 @@ \subsubsection{CPI Swap}
4649
...
4750
</CPILegData>
4851
</LegData>
49-
</InflationSwapData>
52+
</SwapData>
5053
\end{minted}
51-
\caption{CPI Swap Data (using \emph{InflationSwap} trade type)}
52-
\label{lst:cpiinflationswap}
53-
\end{listing}
54+
\caption{CPI Swap Data (using \emph{Swap} trade type)}
55+
\label{lst:cpiswap}
56+
\end{listing}
57+
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#TradeId,TradeType,Maturity,MaturityTime,NPV,NpvCurrency,NPV(Base),BaseCurrency,Notional,NotionalCurrency,Notional(Base),NettingSet,CounterParty
22
Cap_USD_SOFR,Swap,2025-03-21,1.003324,0.000931,USD,0.000931,USD,100000000.00,USD,100000000.00,DUMMY_NS,DUMMY_CP
3-
Swaption_USD_SOFR,Swaption,2046-01-12,21.817022,250911.447892,USD,250911.447892,USD,100000000.00,USD,100000000.00,DUMMY_NS,DUMMY_CP
3+
Swaption_USD_SOFR,Swaption,2046-01-12,21.817022,250911.447904,USD,250911.447904,USD,100000000.00,USD,100000000.00,DUMMY_NS,DUMMY_CP

OREAnalytics/orea/simm/simmbucketmapperbase.cpp

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -47,19 +47,7 @@ const map<RiskType, RiskType> nonVolRiskTypeMap = {{RiskType::IRVol, RiskType::I
4747
{RiskType::CreditVol, RiskType::CreditQ},
4848
{RiskType::CreditVolNonQ, RiskType::CreditNonQ},
4949
{RiskType::EquityVol, RiskType::Equity},
50-
{RiskType::CommodityVol, RiskType::Commodity},
51-
{RiskType::CSR_NS_VEGA, RiskType::CSR_NS_DELTA},
52-
{RiskType::CSR_SC_VEGA, RiskType::CSR_SC_DELTA},
53-
{RiskType::CSR_SNC_VEGA, RiskType::CSR_SNC_DELTA},
54-
{RiskType::EQ_VEGA, RiskType::EQ_DELTA},
55-
{RiskType::COMM_VEGA, RiskType::COMM_DELTA},
56-
{RiskType::GIRR_CURV, RiskType::GIRR_DELTA},
57-
{RiskType::CSR_NS_CURV, RiskType::CSR_NS_DELTA},
58-
{RiskType::CSR_SC_CURV, RiskType::CSR_SC_VEGA},
59-
{RiskType::CSR_SNC_CURV, RiskType::CSR_SNC_DELTA},
60-
{RiskType::EQ_CURV, RiskType::EQ_DELTA},
61-
{RiskType::COMM_CURV, RiskType::COMM_DELTA},
62-
{RiskType::FX_CURV, RiskType::FX_DELTA}};
50+
{RiskType::CommodityVol, RiskType::Commodity}};
6351

6452
SimmBucketMapperBase::SimmBucketMapperBase(
6553
const QuantLib::ext::shared_ptr<ore::data::ReferenceDataManager>& refDataManager,
@@ -69,12 +57,7 @@ SimmBucketMapperBase::SimmBucketMapperBase(
6957
// Fill the set of risk types that have buckets
7058
rtWithBuckets_ = {RiskType::IRCurve, RiskType::CreditQ, RiskType::CreditNonQ, RiskType::Equity,
7159
RiskType::Commodity, RiskType::IRVol, RiskType::InflationVol, RiskType::CreditVol,
72-
RiskType::CreditVolNonQ, RiskType::EquityVol, RiskType::CommodityVol, RiskType::GIRR_DELTA,
73-
RiskType::GIRR_CURV, RiskType::CSR_NS_DELTA, RiskType::CSR_NS_VEGA, RiskType::CSR_NS_CURV,
74-
RiskType::COMM_DELTA, RiskType::COMM_VEGA, RiskType::COMM_CURV, RiskType::CSR_SC_CURV,
75-
RiskType::CSR_SC_DELTA, RiskType::CSR_SC_VEGA, RiskType::CSR_SNC_CURV, RiskType::CSR_SNC_DELTA,
76-
RiskType::CSR_SNC_VEGA, RiskType::CSR_SNC_CURV, RiskType::EQ_CURV, RiskType::EQ_DELTA,
77-
RiskType::EQ_VEGA, RiskType::FX_CURV, RiskType::FX_DELTA};
60+
RiskType::CreditVolNonQ, RiskType::EquityVol, RiskType::CommodityVol};
7861
}
7962

8063
std::string BucketMapping::name() const {
@@ -216,7 +199,7 @@ bool SimmBucketMapperBase::has(const RiskType& riskType, const string& qualifier
216199
lookupRiskType = nv->second;
217200
}
218201

219-
if (lookupRiskType == RiskType::IRCurve)
202+
if (lookupRiskType == RiskType::IRCurve || lookupRiskType == RiskType::GIRR_DELTA)
220203
return true;
221204

222205
auto bm = bucketMapping_.find(lookupRiskType);

OREData/ored/portfolio/commodityapo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ Leg CommodityAveragePriceOption::buildLeg(const QuantLib::ext::shared_ptr<Engine
239239
vector<string> paymentDates = paymentDate_.empty() ? vector<string>() : vector<string>(1, paymentDate_);
240240
LegData legData(commLegData, true, currency_, scheduleData, "", vector<Real>(), vector<string>(),
241241
paymentConvention_, false, false, false, true, "", 0, "", vector<AmortizationData>(),
242-
paymentLag_, paymentCalendar_, paymentDates);
242+
paymentLag_, "", paymentCalendar_, paymentDates);
243243

244244
// Get the leg builder, set the allAveraging_ flag and build the leg
245245
auto legBuilder = engineFactory->legBuilder(legData.legType());

0 commit comments

Comments
 (0)