Main Content

Create saccr Object and Compute Regulatory Values for Two CDS Trades

This example shows how to create a saccr object for trades involving a single name CDS on Spain (Short Protection) and a CDS iTraxx Europe Crossover Index Receiver Option. These trades, TR003 and Tr004 in Portfolio 3, 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_CR.csv";

Create saccr Object

Construct the saccr object from SACCRCRIF.

mySACCR = saccr(SACCRCRIF, DomesticCurrency="USD", FXSpot=FXSpotTable)
mySACCR = 
  saccr with properties:

                         CRIF: [4x19 table]
                NumPortfolios: 1
                 PortfolioIDs: "Port_003"
              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 contents of the SA-CCR CRIF file.

mySACCR.CRIF
ans=4×19 table
    PortfolioID    TradeID    CounterpartyName    CounterpartyID    NettingSetNumber    RiskType    Category               Qualifier               Bucket       Label1       Label2        Amount      AmountCurrency    AmountUSD        Regulation        Model      ValuationDate    EndDate    Label3
    ___________    _______    ________________    ______________    ________________    ________    _________    _____________________________    _________    _________    _________    __________    ______________    __________    ________________    ________    _____________    _______    ______

    "Port_003"     "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_003"     "Tr003"       <missing>          <missing>          <missing>        "PV"        <missing>    <missing>                        <missing>    <missing>    <missing>        -62783        "EUR"             -66192    "Basel (CRE 52)"    "SA-CCR"     2023-10-16        NaN        NaN 
    "Port_003"     "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_003"     "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 

Display Portfolio

Display the Portfolio object for Port_003.

mySACCR.Portfolios
ans = 
  Portfolio with properties:

                ID: "Port_003"
    CounterpartyID: ""
            Trades: [2x1 saccr.Trade]
       NettingSets: [0x1 saccr.NettingSet]
      AssetClasses: [2x1 string]
       HedgingSets: "CREDIT"

Display Trades

Display the Trade objects for trades Tr003 and Tr004.

mySACCR.Portfolios.Trades(1)
ans = 
  Trade with properties:

                                ID: "Tr003"
                      NettingSetID: "Missing_NettingSet_Port_003_Tr003"
                   CollateralSetID: ""
                        AssetClass: "CR_SN"
                          SubClass: "A"
                        HedgingSet: "CREDIT"
                         Qualifier: "SPAIN"
                  AdjustedNotional: 2.2120e+07
          AdjustedNotionalCurrency: "EUR"
               AdjustedNotionalUSD: 2.3321e+07
                                PV: -62783
                        PVCurrency: "EUR"
                             PVUSD: -6.6192e+04
                         StartTime: 0
                           EndTime: 5
                      MaturityTime: 5
                  SupervisoryDelta: -1
                      InputVariant: "1a"
                        SoldOption: 0
    MaturityFactorUncollateralized: 1
      MaturityFactorCollateralized: 1
                    MaturityBucket: [0x1 string]

mySACCR.Portfolios.Trades(2)
ans = 
  Trade with properties:

                                ID: "Tr004"
                      NettingSetID: "Missing_NettingSet_Port_003_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]

Compute Replacement Cost

Compute replacement cost (RC) component results using rc.

RCResults = rc(mySACCR)
RCResults = 
  RCResults with properties:

         NumPortfolios: 1
          PortfolioIDs: "Port_003"
       CounterpartyIDs: ""
            Regulation: "Basel_CRE52"
      DomesticCurrency: "USD"
    RCUncollateralized: 5.5313e+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_003"
                      CounterpartyIDs: ""
                           Regulation: "Basel_CRE52"
                     DomesticCurrency: "USD"
       AddOnAggregateUncollateralized: 2.5601e+05
         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_003"
               CounterpartyIDs: ""
                    Regulation: "Basel_CRE52"
              DomesticCurrency: "USD"
           PFEUncollateralized: 2.5601e+05
             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_003"
     CounterpartyIDs: ""
          Regulation: "Basel_CRE52"
    DomesticCurrency: "USD"
                 EAD: 1.1328e+06
               Alpha: 1.4000
                  RC: 5.5313e+05
                 PFE: 2.5601e+05
          Multiplier: 1
      AddOnAggregate: 2.5601e+05
           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_003"           ""           "Basel_CRE52"         "USD"          1.1328e+06     1.4     5.5313e+05    2.5601e+05        1           2.5601e+05         0          0       2.5601e+05       0          0           false             false     

See Also

| | | | | | | |

Related Examples

More About