Main Content

Create saccr Object and Compute Regulatory Values for Forward FX Swap

This example shows how to create a saccr object for a trade involving a EUR/GBP forward FX swap with trade decomposition 1b (multiple components). The forward FX swap trade, TR002 in Portfolio 2, 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 name.

SACCRCRIF = "SACCR_CRIF_FX.csv";

Create saccr Object

Construct the saccr object from SACCRCRIF.

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

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

    "Port_002"     "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_002"     "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_002"     "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  

Display Portfolio

Display the Portfolios object for Port_002.

mySACCR.Portfolios
ans = 
  Portfolio with properties:

                ID: "Port_002"
    CounterpartyID: ""
            Trades: [1x1 saccr.Trade]
       NettingSets: [0x1 saccr.NettingSet]
      AssetClasses: "FX"
       HedgingSets: "EURGBP"

Display Trades

Display the Trades object for Tr002.

mySACCR.Portfolios.Trades
ans = 
  Trade with properties:

                                ID: "Tr002"
                      NettingSetID: "Missing_NettingSet_Port_002_Tr002"
                   CollateralSetID: ""
                        AssetClass: "FX"
                          SubClass: <missing>
                        HedgingSet: [2x1 string]
                         Qualifier: [2x1 string]
                  AdjustedNotional: [2x1 double]
          AdjustedNotionalCurrency: [2x1 string]
               AdjustedNotionalUSD: [2x1 double]
                                PV: 1.7022e+03
                        PVCurrency: "GBP"
                             PVUSD: 2.0759e+03
                         StartTime: [2x1 double]
                           EndTime: [2x1 double]
                      MaturityTime: [2x1 double]
                  SupervisoryDelta: [2x1 double]
                      InputVariant: "1b"
                        SoldOption: 0
    MaturityFactorUncollateralized: [2x1 double]
      MaturityFactorCollateralized: [2x1 double]
                    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_002"
       CounterpartyIDs: ""
            Regulation: "Basel_CRE52"
      DomesticCurrency: "USD"
    RCUncollateralized: 2.0759e+03
      RCCollateralized: NaN

Compute Add-On Component

Compute add-on component results using addOn.

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

                        NumPortfolios: 1
                         PortfolioIDs: "Port_002"
                      CounterpartyIDs: ""
                           Regulation: "Basel_CRE52"
                     DomesticCurrency: "USD"
       AddOnAggregateUncollateralized: 7.1992e+04
         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_002"
               CounterpartyIDs: ""
                    Regulation: "Basel_CRE52"
              DomesticCurrency: "USD"
           PFEUncollateralized: 7.1992e+04
             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_002"
     CounterpartyIDs: ""
          Regulation: "Basel_CRE52"
    DomesticCurrency: "USD"
                 EAD: 1.0370e+05
               Alpha: 1.4000
                  RC: 2.0759e+03
                 PFE: 7.1992e+04
          Multiplier: 1
      AddOnAggregate: 7.1992e+04
           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_002"           ""           "Basel_CRE52"         "USD"          1.037e+05     1.4     2075.9    71992        1             71992            0        71992        0          0          0           false             false     

See Also

| | | | | | | |

Related Examples

More About