Title: | SA Counterparty Credit Risk under CRR2 |
---|---|
Description: | Computes the Exposure-At-Default based on the standardized approach of CRR2 (SA-CCR). The simplified version of SA-CCR has been included, as well as the OEM methodology. Multiple trade types of all the five major asset classes are being supported including the 'Other' Exposure and, given the inheritance- based structure of the application, the addition of further trade types is straightforward. The application returns a list of trees per Counterparty and CSA after automatically separating the trades based on the Counterparty, the CSAs, the hedging sets, the netting sets and the risk factors. The basis and volatility transactions are also identified and treated in specific hedging sets whereby the corresponding penalty factors are applied. All the examples appearing on the regulatory papers (both for the margined and the un-margined workflow) have been implemented including the latest CRR2 developments. |
Authors: | Tasos Grivas |
Maintainer: | Tasos Grivas <[email protected]> |
License: | GPL-3 |
Version: | 3.2 |
Built: | 2024-10-20 18:20:19 UTC |
Source: | https://github.com/cranhaven/cranhaven.r-universe.dev |
Calculates the amount of the addon for each heding/nettting set
CalcAddon(trades_tree, MF, simplified = FALSE, OEM = FALSE)
CalcAddon(trades_tree, MF, simplified = FALSE, OEM = FALSE)
trades_tree |
A tree structure with the input trades |
MF |
(Optional) The Maturity Factor based on the collateral agreement |
simplified |
(optional) When TRUE, the add-ons will be calculated as per the simplified SA-CCR |
OEM |
(optional) When TRUE, the add-ons will be calculated as per the Original Exposure Method |
The aggregate amount of the addon summed up for all the asset classes
Tasos Grivas <[email protected]>
Regulation (EU) 2019/876 of the European Parliament and of the Council of 20 May 2019 http://data.europa.eu/eli/reg/2019/876/oj
Calculates the Exposure at Default
CalcEAD(RC, PFE)
CalcEAD(RC, PFE)
RC |
the replacement cost |
PFE |
the projected future exposure |
The Exposure-at-Default
Tasos Grivas <[email protected]>
Regulation (EU) 2019/876 of the European Parliament and of the Council of 20 May 2019 http://data.europa.eu/eli/reg/2019/876/oj
#returns 1.4*(60+500) = 784 EAD <- CalcEAD(60,500)
#returns 1.4*(60+500) = 784 EAD <- CalcEAD(60,500)
Calculates the Projected Future Exposure (PFE) after applying the relevant multiplier. The purpose of this multiplier is to lessen the risk stemming from the addons in case of excess collateral
CalcPFE(V_C, V = 0,Addon_Aggregate, simplified)
CalcPFE(V_C, V = 0,Addon_Aggregate, simplified)
V_C |
the difference between the sum of the MtMs and the collateral |
V |
the sum of MVs of the trades |
Addon_Aggregate |
the aggregate amount of the Addon |
simplified |
(optional) When TRUE, the multiplier will be set to 1 as per the simplified & OEM approach |
The Projected Future Exposure (PFE)
Tasos Grivas <[email protected]>
Regulation (EU) 2019/876 of the European Parliament and of the Council of 20 May 2019 http://data.europa.eu/eli/reg/2019/876/oj
Calculates the Replacement Cost(RC) and the sum of the MtMs for all the trades
CalcRC(trades, csa, collaterals, simplified, ignore_margin = FALSE)
CalcRC(trades, csa, collaterals, simplified, ignore_margin = FALSE)
trades |
The full list of the Trade Objects |
csa |
(Optional) The CSA objects |
collaterals |
(Optional) The collaterals Objects |
simplified |
(optional) When TRUE, collaterals will be ignored as per the simplified & OEM approach |
ignore_margin |
(optional) if TRUE, the margin agreement workflow will be turned off |
The replacement Cost and the sum of the MtMs
Tasos Grivas <[email protected]>
Regulation (EU) 2019/876 of the European Parliament and of the Council of 20 May 2019 http://data.europa.eu/eli/reg/2019/876/oj
Creates a tree-like structure describing the various hedging sets / risk factors that that the input trades can be broken into
CreateTradeGraph(trades)
CreateTradeGraph(trades)
trades |
The full list of the Trade Objects |
A tree structure based on hedging/netting sets and basis/volatility transactions
Tasos Grivas <[email protected]>
Determines the CCR methodology that the institution is eligible to utilize. The regulator allows the institutions to select less complicated methodologies when the derivatives trading business is negligible
DetermineCCRMethodology(trades_filename, total_assets)
DetermineCCRMethodology(trades_filename, total_assets)
trades_filename |
the file holding the trades of the portfolio |
total_assets |
the total assets of the institution in mio EUR |
The CCR methodology that the institution is eligible to utilize
Tasos Grivas <[email protected]>
Regulation (EU) 2019/876 of the European Parliament and of the Council of 20 May 2019 http://data.europa.eu/eli/reg/2019/876/oj
Calculates the Exposure at Default for a trade set containing basis and volatility transactions
ExampleBasisVol(JSON = FALSE)
ExampleBasisVol(JSON = FALSE)
JSON |
(optional) if TRUE it returns a json string |
The exposure at default
Tasos Grivas <[email protected]>
Regulation (EU) 2019/876 of the European Parliament and of the Council of 20 May 2019 http://data.europa.eu/eli/reg/2019/876/oj
Calculates the Exposure at Default for the Commodities example as given in the Basel III regulatory paper
ExampleComm(JSON = FALSE)
ExampleComm(JSON = FALSE)
JSON |
(optional) if TRUE it returns a json string |
The exposure at default (expected value based on the Basel paper is 5406)
Tasos Grivas <[email protected]>
Basel Committee: The standardised approach for measuring counterparty credit risk exposures http://www.bis.org/publ/bcbs279.htm
Calculates the Exposure at Default for the Credit example as given in the Basel III regulatory paper
ExampleCredit(JSON = FALSE)
ExampleCredit(JSON = FALSE)
JSON |
(optional) if TRUE it returns a json string |
The exposure at default (expected value based on the Basel paper is 381)
Tasos Grivas <[email protected]>
Basel Committee: The standardised approach for measuring counterparty credit risk exposures http://www.bis.org/publ/bcbs279.htm
Calculates the Exposure at Default for the FX product type
ExampleFX(JSON = FALSE)
ExampleFX(JSON = FALSE)
JSON |
(optional) if TRUE it returns a json string |
The exposure at default
Tasos Grivas <[email protected]>
Basel Committee: The standardised approach for measuring counterparty credit risk exposures http://www.bis.org/publ/bcbs279.htm
Calculates the Exposure at Default for the IRD example as given in the Basel III regulatory paper
ExampleIRD(JSON = FALSE)
ExampleIRD(JSON = FALSE)
JSON |
(optional) if TRUE it returns a json string |
The exposure at default (expected value based on the Basel paper is 569)
Tasos Grivas <[email protected]>
Basel Committee: The standardised approach for measuring counterparty credit risk exposures http://www.bis.org/publ/bcbs279.htm
Calculates the Exposure at Default for the margined IRDs + Commodity example as given in the Basel III regulatory paper
ExampleIRDCommMargined(JSON = FALSE)
ExampleIRDCommMargined(JSON = FALSE)
JSON |
(optional) if TRUE it returns a json string |
The exposure at default (expected value based on the Basel paper is 1879)
Tasos Grivas <[email protected]>
Basel Committee: The standardised approach for measuring counterparty credit risk exposures http://www.bis.org/publ/bcbs279.htm
Calculates the Exposure at Default for the IRDs + Commodity example as given in the Basel III regulatory paper
ExampleIRDCredit(JSON = FALSE)
ExampleIRDCredit(JSON = FALSE)
JSON |
(optional) if TRUE it returns a json string |
The exposure at default (expected value based on the Basel paper is 936)
Tasos Grivas <[email protected]>
Basel Committee: The standardised approach for measuring counterparty credit risk exposures http://www.bis.org/publ/bcbs279.htm
Receives a list of trades and splits them according to being basis, volatility or 'normal' transactions
HandleBasisVol(trades)
HandleBasisVol(trades)
trades |
The full list of the Trade Objects |
A list depicting which trade IDs fall under each hedging set.
Tasos Grivas <[email protected]>
Regulation (EU) 2019/876 of the European Parliament and of the Council of 20 May 2019 http://data.europa.eu/eli/reg/2019/876/oj
Loads the supervisory data (factors, correlation and option volatility) for each Asset Class and SubClass
LoadSupervisoryData()
LoadSupervisoryData()
A data frame with the required data
Tasos Grivas <[email protected]>
Regulation (EU) 2019/876 of the European Parliament and of the Council of 20 May 2019 http://data.europa.eu/eli/reg/2019/876/oj
Returns a tree structure depicting the add-on calculations on different hedging/netting sets
SACCRCalculator( trades_filename, csa_filename, coll_filename, JSON = FALSE, simplified = FALSE, OEM = FALSE, export_results = FALSE, ignore_margin = FALSE )
SACCRCalculator( trades_filename, csa_filename, coll_filename, JSON = FALSE, simplified = FALSE, OEM = FALSE, export_results = FALSE, ignore_margin = FALSE )
trades_filename |
a .csv file containing the trades |
csa_filename |
a .csv file containing CSAs |
coll_filename |
a .csv file containing collaterals |
JSON |
(optional) if TRUE it returns a json string |
simplified |
(optional) if TRUE, the simplified SA-CCR is being calculated |
OEM |
(optional) if TRUE, the Original Exposure Method is being calculated |
export_results |
(optional) if TRUE, a csv with the exposure at the top level will be exported |
ignore_margin |
(optional) if TRUE, the margin agreement workflow will be turned off |
The relevant exposure trees
Tasos Grivas <[email protected]>
Regulation (EU) 2019/876 of the European Parliament and of the Council of 20 May 2019 http://data.europa.eu/eli/reg/2019/876/oj
Calculates the addon information (including Adj notional, superv delta etc) for each trade
SingleTradeAddon(trade, MF)
SingleTradeAddon(trade, MF)
trade |
A trade object |
MF |
(Optional) The Maturity Factor based on the collateral agreement |
A list of addon information
Tasos Grivas <[email protected]>
Regulation (EU) 2019/876 of the European Parliament and of the Council of 20 May 2019 http://data.europa.eu/eli/reg/2019/876/oj