Create saccr
Object and Compute Regulatory Values for Multiple Asset Classes with Netting Set
This example shows how to create a saccr
object for trades from multiple asset classes with a netting set. The trades are:
Tr001
— Asset class (IR
), 10 Year Interest Rate Swap in EURTr002
— Asset class (FX
), EUR/GBP Forward FX Swap (Trade Decomposition "1b")Tr003
— Asset class (CR_SN
), Single name CDS on Spain (Short Protection)Tr004
— Asset class (CR_IX
), CDS iTraxx Europe Crossover Index Receiver OptionTr005
— Asset class (EQ_SN
), Long Call Option on AAPLTr006
— Asset class (EQ_IX
), Long Put Option on S&P500 IndexTr007_SOpt
— Asset class (CO
), Long Put Option on CORN (sold option with premium paid)
These trades are in Portfolio 5. They use the Standardized Approach for Counterparty Credit Risk (SA-CCR) framework and have one netting set (N001
), no collateral sets, and no collateral positions.
Define Data
Define the foreign exchange (FX) spot currency exchange rate table.
format("default"); Base = ["EUR";"GBP";"GBP"]; Quote = ["USD";"USD";"EUR"]; SpotRate = [1.0543;1.2195;1.1567]; FXSpotTable = table(Base,Quote,SpotRate)
FXSpotTable=3×3 table
Base Quote SpotRate
_____ _____ ________
"EUR" "USD" 1.0543
"GBP" "USD" 1.2195
"GBP" "EUR" 1.1567
Define the SA-CCR CRIF file.
SACCRCRIF = "SACCR_CRIF_Port_5.csv";
Create saccr
Object
Construct the saccr
object from SACCRCRIF
.
mySACCR = saccr(SACCRCRIF, DomesticCurrency="USD", FXSpot=FXSpotTable)
mySACCR = saccr with properties: CRIF: [15x19 table] NumPortfolios: 1 PortfolioIDs: "Port_005" CounterpartyIDs: "" Portfolios: [1x1 saccr.Portfolio] Regulation: "Basel_CRE52" DomesticCurrency: "USD" Alpha: 1.4000 FXSpotRates: [3x3 table] TradeDecompositions: [5x2 table] CollateralHaircuts: [200x6 table] SupervisoryParameters: [19x7 table] MaturityBusinessDaysFloor: 10 NumBusinessDaysYear: 250
Display the contents of the SA-CCR CRIF file.
mySACCR.CRIF
ans=15×19 table
PortfolioID TradeID CounterpartyName CounterpartyID NettingSetNumber RiskType Category Qualifier Bucket Label1 Label2 Amount AmountCurrency AmountUSD Regulation Model ValuationDate EndDate Label3
___________ ____________ ________________ ______________ ________________ ________ _________ _____________________________ ______________ _________ _________ __________ ______________ __________ ________________ ________ _____________ _______ ______
"Port_005" "Tr001" <missing> <missing> "N001" "IR" "EUR" "EUR" <missing> "0" "10" 3.1478e+07 "EUR" 3.3187e+07 "Basel (CRE 52)" "SA-CCR" 2023-10-16 10 1
"Port_005" "Tr001" <missing> <missing> "N001" "PV" <missing> <missing> <missing> <missing> <missing> -5650.7 "EUR" -5957.5 "Basel (CRE 52)" "SA-CCR" 2023-10-16 NaN NaN
"Port_005" "Tr002_01" <missing> <missing> "N001" "FX" "EURGBP" "EURGBP" <missing> "0.5" "0.5" 1e+06 "EUR" 1.0543e+06 "Basel (CRE 52)" "SA-CCR" 2023-10-16 0.5 -1
"Port_005" "Tr002_02" <missing> <missing> "N001" "FX" "EURGBP" "EURGBP" <missing> "0.5" "1" 1e+06 "EUR" 1.0543e+06 "Basel (CRE 52)" "SA-CCR" 2023-10-16 1 1
"Port_005" "Tr002" <missing> <missing> "N001" "PV" <missing> <missing> <missing> <missing> <missing> 1702.2 "GBP" 2075.9 "Basel (CRE 52)" "SA-CCR" 2023-10-16 NaN NaN
"Port_005" "Tr003" <missing> <missing> "N001" "CR_SN" "CREDIT" "SPAIN" "A" "0" "5" 2.212e+07 "EUR" 2.3321e+07 "Basel (CRE 52)" "SA-CCR" 2023-10-16 5 -1
"Port_005" "Tr003" <missing> <missing> "N001" "PV" <missing> <missing> <missing> <missing> <missing> -62783 "EUR" -66192 "Basel (CRE 52)" "SA-CCR" 2023-10-16 NaN NaN
"Port_005" "Tr004" <missing> <missing> "N001" "CR_IX" "CREDIT" "CDS iTraxx Europe Crossover" "SG" "0.5" "4.5" 3.5359e+07 "EUR" 3.7279e+07 "Basel (CRE 52)" "SA-CCR" 2023-10-16 4.5 -0.4
"Port_005" "Tr004" <missing> <missing> "N001" "PV" <missing> <missing> <missing> <missing> <missing> 5.2464e+05 "EUR" 5.5313e+05 "Basel (CRE 52)" "SA-CCR" 2023-10-16 NaN NaN
"Port_005" "Tr005" <missing> <missing> "N001" "EQ_SN" "EQUITY" "AAPL" <missing> "0" "2.5" 1e+07 "USD" 1e+07 "Basel (CRE 52)" "SA-CCR" 2023-10-16 2.5 0.23
"Port_005" "Tr005" <missing> <missing> "N001" "PV" <missing> <missing> <missing> <missing> <missing> 34350 "USD" 34350 "Basel (CRE 52)" "SA-CCR" 2023-10-16 NaN NaN
"Port_005" "Tr006" <missing> <missing> "N001" "EQ_IX" "EQUITY" "S&P500" <missing> "0" "3" 1e+07 "USD" 1e+07 "Basel (CRE 52)" "SA-CCR" 2023-10-16 3 -0.27
"Port_005" "Tr006" <missing> <missing> "N001" "PV" <missing> <missing> <missing> <missing> <missing> 1.8203e+05 "USD" 1.8203e+05 "Basel (CRE 52)" "SA-CCR" 2023-10-16 NaN NaN
"Port_005" "Tr007_SOpt" <missing> <missing> "N001" "CO" "AGRI" "CORN" "AGRICULTURAL" "0" "0.5" 1.0435e+05 "USD" 1.0435e+05 "Basel (CRE 52)" "SA-CCR" 2023-10-16 0.5 -0.36
"Port_005" "Tr007_SOpt" <missing> <missing> "N001" "PV" <missing> <missing> <missing> <missing> <missing> -9721.5 "USD" -9721.5 "Basel (CRE 52)" "SA-CCR" 2023-10-16 NaN NaN
Display Portfolio
Display the Portfolios
object for Port_005
.
mySACCR.Portfolios
ans = Portfolio with properties: ID: "Port_005" CounterpartyID: "" Trades: [7x1 saccr.Trade] NettingSets: [1x1 saccr.NettingSet] AssetClasses: [7x1 string]
Display Netting Set
The NettingSet
object for all trades is N001
. Display details for this netting set.
mySACCR.Portfolios(1).NettingSets
ans = NettingSet with properties: ID: "N001" CollateralSets: [0x1 saccr.CollateralSet]
Display Trades
Display the Trade
objects for Tr001
, Tr004
, and Tr007_SOpt
.
mySACCR.Portfolios.Trades(1)
ans = Trade with properties: ID: "Tr001" NettingSetID: "N001" CollateralSetID: "" AssetClass: "IR" SubClass: <missing> HedgingSet: "EUR" Qualifier: "EUR" AdjustedNotional: 3.1478e+07 AdjustedNotionalCurrency: "EUR" AdjustedNotionalUSD: 3.3187e+07 PV: -5.6507e+03 PVCurrency: "EUR" PVUSD: -5.9575e+03 StartTime: 0 EndTime: 10 MaturityTime: 10 SupervisoryDelta: 1 InputVariant: "1a" SoldOption: 0 MaturityFactorUncollateralized: 1 MaturityFactorCollateralized: 1 MaturityBucket: "B3: > 5Y"
mySACCR.Portfolios.Trades(4)
ans = Trade with properties: ID: "Tr004" NettingSetID: "N001" CollateralSetID: "" AssetClass: "CR_IX" SubClass: "SG" HedgingSet: "CREDIT" Qualifier: "CDS iTraxx Europe Crossover" AdjustedNotional: 3.5359e+07 AdjustedNotionalCurrency: "EUR" AdjustedNotionalUSD: 3.7279e+07 PV: 5.2464e+05 PVCurrency: "EUR" PVUSD: 5.5313e+05 StartTime: 0.5000 EndTime: 4.5000 MaturityTime: 4.5000 SupervisoryDelta: -0.4000 InputVariant: "1a" SoldOption: 0 MaturityFactorUncollateralized: 1 MaturityFactorCollateralized: 1 MaturityBucket: [0x1 string]
mySACCR.Portfolios.Trades(7)
ans = Trade with properties: ID: "Tr007_SOpt" NettingSetID: "N001" CollateralSetID: "" AssetClass: "CO" SubClass: "AGRICULTURAL" HedgingSet: "AGRI" Qualifier: "CORN" AdjustedNotional: 1.0435e+05 AdjustedNotionalCurrency: "USD" AdjustedNotionalUSD: 1.0435e+05 PV: -9.7215e+03 PVCurrency: "USD" PVUSD: -9.7215e+03 StartTime: 0 EndTime: 0.5000 MaturityTime: 0.5000 SupervisoryDelta: -0.3600 InputVariant: "1a" SoldOption: 1 MaturityFactorUncollateralized: 0.7071 MaturityFactorCollateralized: 0.7071 MaturityBucket: [0x1 string]
Compute Replacement Cost
Compute replacement cost (RC) component results using rc
.
RCResults = rc(mySACCR)
RCResults = RCResults with properties: NumPortfolios: 1 PortfolioIDs: "Port_005" CounterpartyIDs: "" Regulation: "Basel_CRE52" DomesticCurrency: "USD" RCUncollateralized: 6.8972e+05 RCCollateralized: NaN
Compute Add-On Component
Compute add-On component results using addOn
.
AddOnResults = addOn(mySACCR)
AddOnResults = AddOnResults with properties: NumPortfolios: 1 PortfolioIDs: "Port_005" CounterpartyIDs: "" Regulation: "Basel_CRE52" DomesticCurrency: "USD" AddOnAggregateUncollateralized: 1.1177e+06 AddOnAggregateCollateralized: NaN AddOnAssetClassesUncollateralized: [1x1 saccr.AddOnAssetClassResults] AddOnAssetClassesCollateralized: [1x1 saccr.AddOnAssetClassResults]
Compute PFE
Compute potential future exposure (PFE) component results using pfe
.
PFEResults = pfe(mySACCR)
PFEResults = PFEResults with properties: NumPortfolios: 1 PortfolioIDs: "Port_005" CounterpartyIDs: "" Regulation: "Basel_CRE52" DomesticCurrency: "USD" PFEUncollateralized: 1.1177e+06 PFECollateralized: NaN MultiplierUncollateralized: 1 MultiplierCollateralized: NaN AddOnResults: [1x1 saccr.AddOnResults]
Compute EAD and Display Results
Compute exposure at default (EAD) results using ead
and show the results table.
EADResults = ead(mySACCR)
EADResults = EADResults with properties: NumPortfolios: 1 PortfolioIDs: "Port_005" CounterpartyIDs: "" Regulation: "Basel_CRE52" DomesticCurrency: "USD" EAD: 2.5303e+06 Alpha: 1.4000 RC: 6.8972e+05 PFE: 1.1177e+06 Multiplier: 1 AddOnAggregate: 1.1177e+06 RCResults: [1x1 saccr.RCResults] PFEResults: [1x1 saccr.PFEResults] ResultsTable: [1x17 table]
EADResults.ResultsTable
ans=1×17 table
PortfolioIDs CounterpartyIDs Regulation DomesticCurrency EAD Alpha RC PFE Multiplier AddOnAggregate AddOnIR AddOnFX AddOnCR AddOnEQ AddOnCO Collateralized UsedCollateral
____________ _______________ _____________ ________________ __________ _____ __________ __________ __________ ______________ __________ _______ __________ __________ _______ ______________ ______________
"Port_005" "" "Basel_CRE52" "USD" 2.5303e+06 1.4 6.8972e+05 1.1177e+06 1 1.1177e+06 1.6593e+05 12352 2.1671e+05 7.1787e+05 4781.3 false false
See Also
rc
| addOn
| pfe
| ead
| addOnChart
| eadChart
| pfeChart
| rcChart
| frtbsa
Related Examples
- Framework for Standardized Approach to Calculating Counterparty Credit Risk: Introduction
- Create saccr Object and Compute Regulatory Values for Interest-Rate Swap
- Create saccr Object and Compute Regulatory Values for Forward FX Swap
- Create saccr Object and Compute Regulatory Values for Two CDS Trades
- Create saccr Object and Compute Regulatory Values for Multiple Asset Classes
- Create saccr Object and Compute Regulatory Values for Multiple Asset Classes with Netting Set and Collateral Set
- Create saccr Object and Compute Regulatory Values for Multiple Asset Classes with Netting Set, Collateral Set, and Collateral Positions
- Create saccr Object and Compute Regulatory Values for Multiple Portfolios Containing Multiple Asset Classes