Record Class SaCcrTrade
java.lang.Object
java.lang.Record
com.quantfinlib.risk.SaCcrTrade
- Record Components:
assetClass- the SA-CCR asset classhedgingSet- currency (rates), currency pair (FX), entity name (credit, equity) or commodity type (commodity)creditGrade- rating bucket for credit trades, else nullindex- true for index credit or equity tradescommoditySet- commodity hedging set, else nullnotional- trade notional (rates, credit) or adjusted notional (FX foreign leg, equity, commodity)startYears- S_i, start of the referenced period (rates, credit), else 0endYears- E_i, end of the referenced period (rates, credit), else 0maturityYears- M_i, remaining maturity of the contractdelta- supervisory delta (|delta| ≤ 15, the CDO-tranche maximum)marketValue- current market value of the tradehedgingSetType- ordinary, basis or volatility hedging set (BCBS 279 paras 162-163); seeasBasis()andasVolatility()
public record SaCcrTrade(SaCcr.AssetClass assetClass, String hedgingSet, SaCcr.CreditGrade creditGrade, boolean index, SaCcr.CommoditySet commoditySet, double notional, double startYears, double endYears, double maturityYears, double delta, double marketValue, SaCcr.HedgingSetType hedgingSetType)
extends Record
One derivative as the SA-CCR sees it (BCBS 279, March 2014, Annex 4):
the asset class, the hedging-set key, the inputs to the trade-level
adjusted notional and the supervisory delta. Build trades with the
per-asset-class factories; each fills the fields its class does not
use with neutral values.
Units: notionals and market values in the reporting (domestic)
currency; times in years from the reference date. delta is
the supervisory delta of BCBS 279 paragraph 159: +1 long and -1 short
in the primary risk factor, or the option and CDO-tranche formulas in
SaCcr.optionDelta(boolean, boolean, double, double, double, double) and SaCcr.cdoTrancheDelta(double, double, boolean).
-
Constructor Summary
ConstructorsConstructorDescriptionSaCcrTrade(SaCcr.AssetClass assetClass, String hedgingSet, SaCcr.CreditGrade creditGrade, boolean index, SaCcr.CommoditySet commoditySet, double notional, double startYears, double endYears, double maturityYears, double delta, double marketValue) The 2.1 constructor: an ordinary (non-basis, non-volatility) trade.SaCcrTrade(SaCcr.AssetClass assetClass, String hedgingSet, SaCcr.CreditGrade creditGrade, boolean index, SaCcr.CommoditySet commoditySet, double notional, double startYears, double endYears, double maturityYears, double delta, double marketValue, SaCcr.HedgingSetType hedgingSetType) Validates every field. -
Method Summary
Modifier and TypeMethodDescriptionasBasis()This trade as a basis transaction (para 162): a non-FX trade whose two floating legs reference risk factors of the same asset class in the same currency, such as 3m LIBOR against OIS.Returns the value of theassetClassrecord component.This trade as a volatility transaction (para 163): the reference is a volatility or variance of a risk factor, such as a variance swap.static SaCcrTradecommodity(SaCcr.CommoditySet set, String commodityType, double adjustedNotional, double maturityYears, double delta, double marketValue) Commodity derivative.Returns the value of thecommoditySetrecord component.static SaCcrTradecredit(String entity, SaCcr.CreditGrade grade, double notional, double startYears, double endYears, double maturityYears, double delta, double marketValue) Credit derivative on a single name or an index.Returns the value of thecreditGraderecord component.doubledelta()Returns the value of thedeltarecord component.doubleendYears()Returns the value of theendYearsrecord component.final booleanIndicates whether some other object is "equal to" this one.static SaCcrTradeequity(String entity, boolean index, double adjustedNotional, double maturityYears, double delta, double marketValue) Equity derivative on a single name or an index.static SaCcrTradefx(String currencyPair, double foreignLegNotional, double maturityYears, double delta, double marketValue) FX derivative.final inthashCode()Returns a hash code value for this object.Returns the value of thehedgingSetrecord component.Returns the value of thehedgingSetTyperecord component.booleanindex()Returns the value of theindexrecord component.static SaCcrTradeinterestRate(String currency, double notional, double startYears, double endYears, double maturityYears, double delta, double marketValue) Interest-rate derivative.doubleReturns the value of themarketValuerecord component.doubleReturns the value of thematurityYearsrecord component.doublenotional()Returns the value of thenotionalrecord component.doubleReturns the value of thestartYearsrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
SaCcrTrade
public SaCcrTrade(SaCcr.AssetClass assetClass, String hedgingSet, SaCcr.CreditGrade creditGrade, boolean index, SaCcr.CommoditySet commoditySet, double notional, double startYears, double endYears, double maturityYears, double delta, double marketValue) The 2.1 constructor: an ordinary (non-basis, non-volatility) trade.- Parameters:
assetClass- the SA-CCR asset classhedgingSet- hedging-set keycreditGrade- rating bucket for credit trades, else nullindex- true for index credit or equity tradescommoditySet- commodity hedging set, else nullnotional- notional or adjusted notionalstartYears- S_iendYears- E_imaturityYears- M_idelta- supervisory deltamarketValue- current market value
-
SaCcrTrade
public SaCcrTrade(SaCcr.AssetClass assetClass, String hedgingSet, SaCcr.CreditGrade creditGrade, boolean index, SaCcr.CommoditySet commoditySet, double notional, double startYears, double endYears, double maturityYears, double delta, double marketValue, SaCcr.HedgingSetType hedgingSetType) Validates every field.
-
-
Method Details
-
interestRate
public static SaCcrTrade interestRate(String currency, double notional, double startYears, double endYears, double maturityYears, double delta, double marketValue) Interest-rate derivative. The hedging set is the currency; the maturity bucket comes fromendYears(under 1y, 1y to 5y, over 5y).- Parameters:
currency- hedging-set currency, e.g. "USD"notional- trade notionalstartYears- S_i (0 when the period has started)endYears- E_imaturityYears- M_i (for a physically settled swaption, the end of the underlying swap)delta- supervisory deltamarketValue- current market value- Returns:
- the trade
-
fx
public static SaCcrTrade fx(String currencyPair, double foreignLegNotional, double maturityYears, double delta, double marketValue) FX derivative. The hedging set is the currency pair; the adjusted notional is the foreign leg converted to the domestic currency.- Parameters:
currencyPair- hedging set, e.g. "EURUSD"foreignLegNotional- foreign leg in domestic currencymaturityYears- M_idelta- supervisory deltamarketValue- current market value- Returns:
- the trade
-
credit
public static SaCcrTrade credit(String entity, SaCcr.CreditGrade grade, double notional, double startYears, double endYears, double maturityYears, double delta, double marketValue) Credit derivative on a single name or an index. Trades on the same entity name aggregate into one entity-level effective notional.- Parameters:
entity- reference entity or index namegrade- rating bucket, or one of the two index gradesnotional- trade notionalstartYears- S_iendYears- E_imaturityYears- M_idelta- supervisory delta (+1 protection buyer)marketValue- current market value- Returns:
- the trade
-
equity
public static SaCcrTrade equity(String entity, boolean index, double adjustedNotional, double maturityYears, double delta, double marketValue) Equity derivative on a single name or an index.- Parameters:
entity- stock or index nameindex- true for an indexadjustedNotional- price of one unit times number of unitsmaturityYears- M_idelta- supervisory deltamarketValue- current market value- Returns:
- the trade
-
commodity
public static SaCcrTrade commodity(SaCcr.CommoditySet set, String commodityType, double adjustedNotional, double maturityYears, double delta, double marketValue) Commodity derivative. The commodity type "Electricity" (any case) takes the 40% factor; every other type takes 18%.- Parameters:
set- commodity hedging setcommodityType- type inside the set, e.g. "Crude Oil"adjustedNotional- price of one unit times number of unitsmaturityYears- M_idelta- supervisory deltamarketValue- current market value- Returns:
- the trade
-
asBasis
This trade as a basis transaction (para 162): a non-FX trade whose two floating legs reference risk factors of the same asset class in the same currency, such as 3m LIBOR against OIS. Basis trades on the same pair of risk factors form their own hedging set, keyed byhedgingSet()(name it after the pair, e.g. "USD 3M/OIS"), and take half the supervisory factor.- Returns:
- a copy marked basis
-
asVolatility
This trade as a volatility transaction (para 163): the reference is a volatility or variance of a risk factor, such as a variance swap. Volatility trades form their own hedging sets and take five times the supervisory factor.- Returns:
- a copy marked volatility
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
assetClass
Returns the value of theassetClassrecord component.- Returns:
- the value of the
assetClassrecord component
-
hedgingSet
Returns the value of thehedgingSetrecord component.- Returns:
- the value of the
hedgingSetrecord component
-
creditGrade
Returns the value of thecreditGraderecord component.- Returns:
- the value of the
creditGraderecord component
-
index
-
commoditySet
Returns the value of thecommoditySetrecord component.- Returns:
- the value of the
commoditySetrecord component
-
notional
-
startYears
public double startYears()Returns the value of thestartYearsrecord component.- Returns:
- the value of the
startYearsrecord component
-
endYears
-
maturityYears
public double maturityYears()Returns the value of thematurityYearsrecord component.- Returns:
- the value of the
maturityYearsrecord component
-
delta
-
marketValue
public double marketValue()Returns the value of themarketValuerecord component.- Returns:
- the value of the
marketValuerecord component
-
hedgingSetType
Returns the value of thehedgingSetTyperecord component.- Returns:
- the value of the
hedgingSetTyperecord component
-