Create saccr
Object and Compute Regulatory Values for Multiple Asset Classes
This example shows how to create a saccr
object for trades representing multiple asset classes. 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 4. They use the Standardized Approach for Counterparty Credit Risk (SA-CCR) framework and have no netting sets, no collateral sets, or 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_4.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_004" 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_004" "Tr001" <missing> <missing> <missing> "IR" "EUR" "EUR" <missing> "0" "10" 3.1478e+07 "EUR" 3.3187e+07 "Basel (CRE 52)" "SA-CCR" 2023-10-16 10 1
"Port_004" "Tr001" <missing> <missing> <missing> "PV" <missing> <missing> <missing> <missing> <missing> -5650.7 "EUR" -5957.5 "Basel (CRE 52)" "SA-CCR" 2023-10-16 NaN NaN
"Port_004" "Tr002_01" <missing> <missing> <missing> "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_004" "Tr002_02" <missing> <missing> <missing> "FX" "EURGBP" "EURGBP" <missing> "0.5" "1" 1e+06 "EUR" 1.0543e+06 "Basel (CRE 52)" "SA-CCR" 2023-10-16 1 1
"Port_004" "Tr002" <missing> <missing> <missing> "PV" <missing> <missing> <missing> <missing> <missing> 1702.2 "GBP" 2075.9 "Basel (CRE 52)" "SA-CCR" 2023-10-16 NaN NaN
"Port_004" "Tr003" <missing> <missing> <missing> "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_004" "Tr003" <missing> <missing> <missing> "PV" <missing> <missing> <missing> <missing> <missing> -62783 "EUR" -66192 "Basel (CRE 52)" "SA-CCR" 2023-10-16 NaN NaN
"Port_004" "Tr004" <missing> <missing> <missing> "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_004" "Tr004" <missing> <missing> <missing> "PV" <missing> <missing> <missing> <missing> <missing> 5.2464e+05 "EUR" 5.5313e+05 "Basel (CRE 52)" "SA-CCR" 2023-10-16 NaN NaN
"Port_004" "Tr005" <missing> <missing> <missing> "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_004" "Tr005" <missing> <missing> <missing> "PV" <missing> <missing> <missing> <missing> <missing> 34350 "USD" 34350 "Basel (CRE 52)" "SA-CCR" 2023-10-16 NaN NaN
"Port_004" "Tr006" <missing> <missing> <missing> "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_004" "Tr006" <missing> <missing> <missing> "PV" <missing> <missing> <missing> <missing> <missing> 1.8203e+05 "USD" 1.8203e+05 "Basel (CRE 52)" "SA-CCR" 2023-10-16 NaN NaN
"Port_004" "Tr007_SOpt" <missing> <missing> <missing> "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_004" "Tr007_SOpt" <missing> <missing> <missing> "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_004
.
mySACCR.Portfolios
ans = Portfolio with properties: ID: "Port_004" CounterpartyID: "" Trades: [7x1 saccr.Trade] NettingSets: [0x1 saccr.NettingSet] AssetClasses: [7x1 string]
Display Trades
Display some of the Trades
objects (Tr001
, Tr004
, Tr007
).
.
mySACCR.Portfolios.Trades(1)
ans = Trade with properties: ID: "Tr001" NettingSetID: "Missing_NettingSet_Port_004_Tr001" 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: "Missing_NettingSet_Port_004_Tr004" 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: "Missing_NettingSet_Port_004_Tr007_SOpt" 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_004" CounterpartyIDs: "" Regulation: "Basel_CRE52" DomesticCurrency: "USD" RCUncollateralized: 7.7159e+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_004" CounterpartyIDs: "" Regulation: "Basel_CRE52" DomesticCurrency: "USD" AddOnAggregateUncollateralized: 1.7699e+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_004" CounterpartyIDs: "" Regulation: "Basel_CRE52" DomesticCurrency: "USD" PFEUncollateralized: 1.7699e+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_004" CounterpartyIDs: "" Regulation: "Basel_CRE52" DomesticCurrency: "USD" EAD: 3.5581e+06 Alpha: 1.4000 RC: 7.7159e+05 PFE: 1.7699e+06 Multiplier: 1 AddOnAggregate: 1.7699e+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_004" "" "Basel_CRE52" "USD" 3.5581e+06 1.4 7.7159e+05 1.7699e+06 1 1.7699e+06 1.6593e+05 71992 2.5601e+05 1.276e+06 0 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 with Netting Set
- 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