Main Content

Create saccr Object and Compute Regulatory Values for Interest-Rate Swap

This example shows how to create a saccr object involving a trade for a 10-year interest-rate swap in Euros that is valued in US dollars. Trade, TR001 in Portfolio 1, uses the Standardized Approach for Counterparty Credit Risk (SA-CCR) framework and has 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_IR.csv";

Create saccr Object

Construct the saccr object from SACCRCRIF.

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

                         CRIF: [2x19 table]
                NumPortfolios: 1
                 PortfolioIDs: "Port_001"
              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=2×19 table
    PortfolioID    TradeID    CounterpartyName    CounterpartyID    NettingSetNumber    RiskType    Category     Qualifier     Bucket       Label1       Label2        Amount      AmountCurrency    AmountUSD        Regulation        Model      ValuationDate    EndDate    Label3
    ___________    _______    ________________    ______________    ________________    ________    _________    _________    _________    _________    _________    __________    ______________    __________    ________________    ________    _____________    _______    ______

    "Port_001"     "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_001"     "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  

Display Porfolio

Display the Portfolio object (Port_001).

mySACCR.Portfolios
ans = 
  Portfolio with properties:

                ID: "Port_001"
    CounterpartyID: ""
            Trades: [1x1 saccr.Trade]
       NettingSets: [0x1 saccr.NettingSet]
      AssetClasses: "IR"
       HedgingSets: "EUR"

Display the trades.

mySACCR.Portfolios.Trades
ans = 
  Trade with properties:

                                ID: "Tr001"
                      NettingSetID: "Missing_NettingSet_Port_001_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"

Compute Replacement Cost

Compute replacement cost (RC) component results using rc.

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

         NumPortfolios: 1
          PortfolioIDs: "Port_001"
       CounterpartyIDs: ""
            Regulation: "Basel_CRE52"
      DomesticCurrency: "USD"
    RCUncollateralized: 0
      RCCollateralized: NaN

Compute Add-On Component

Compute add-on component results using addOn.

AddOnResults = addOn(mySACCR)
AddOnResults = 
  AddOnResults with properties:

                        NumPortfolios: 1
                         PortfolioIDs: "Port_001"
                      CounterpartyIDs: ""
                           Regulation: "Basel_CRE52"
                     DomesticCurrency: "USD"
       AddOnAggregateUncollateralized: 1.6593e+05
         AddOnAggregateCollateralized: NaN
    AddOnAssetClassesUncollateralized: [1x1 saccr.AddOnAssetClassResults]
      AddOnAssetClassesCollateralized: [1x1 saccr.AddOnAssetClassResults]

Compute PFE Component

Compute potential future exposure (PFE) component results using pfe.

PFEResults = pfe(mySACCR)
PFEResults = 
  PFEResults with properties:

                 NumPortfolios: 1
                  PortfolioIDs: "Port_001"
               CounterpartyIDs: ""
                    Regulation: "Basel_CRE52"
              DomesticCurrency: "USD"
           PFEUncollateralized: 1.6298e+05
             PFECollateralized: NaN
    MultiplierUncollateralized: 0.9822
      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_001"
     CounterpartyIDs: ""
          Regulation: "Basel_CRE52"
    DomesticCurrency: "USD"
                 EAD: 2.2818e+05
               Alpha: 1.4000
                  RC: 0
                 PFE: 1.6298e+05
          Multiplier: 0.9822
      AddOnAggregate: 1.6593e+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_001"           ""           "Basel_CRE52"         "USD"          2.2818e+05     1.4     0     1.6298e+05     0.98222        1.6593e+05      1.6593e+05       0          0          0          0           false             false     

See Also

| | | | | | | |

Related Examples

More About