Basel32019Compliance.java

  1. package org.drip.sample.bcbs;

  2. import org.drip.capital.bcbs.BalanceSheet;
  3. import org.drip.capital.bcbs.BalanceSheetCapital;
  4. import org.drip.capital.bcbs.BalanceSheetFunding;
  5. import org.drip.capital.bcbs.BalanceSheetLiquidity;
  6. import org.drip.capital.bcbs.CapitalMetricsStandard;
  7. import org.drip.capital.bcbs.HighQualityLiquidAsset;
  8. import org.drip.capital.bcbs.HighQualityLiquidAssetSettings;
  9. import org.drip.capital.bcbs.LiquidityMetrics;
  10. import org.drip.numerical.common.FormatUtil;
  11. import org.drip.service.env.EnvManager;

  12. /*
  13.  * -*- mode: java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  14.  */

  15. /*!
  16.  * Copyright (C) 2020 Lakshmi Krishnamurthy
  17.  * Copyright (C) 2019 Lakshmi Krishnamurthy
  18.  *
  19.  *  This file is part of DROP, an open-source library targeting analytics/risk, transaction cost analytics,
  20.  *      asset liability management analytics, capital, exposure, and margin analytics, valuation adjustment
  21.  *      analytics, and portfolio construction analytics within and across fixed income, credit, commodity,
  22.  *      equity, FX, and structured products. It also includes auxiliary libraries for algorithm support,
  23.  *      numerical analysis, numerical optimization, spline builder, model validation, statistical learning,
  24.  *      and computational support.
  25.  *  
  26.  *      https://lakshmidrip.github.io/DROP/
  27.  *  
  28.  *  DROP is composed of three modules:
  29.  *  
  30.  *  - DROP Product Core - https://lakshmidrip.github.io/DROP-Product-Core/
  31.  *  - DROP Portfolio Core - https://lakshmidrip.github.io/DROP-Portfolio-Core/
  32.  *  - DROP Computational Core - https://lakshmidrip.github.io/DROP-Computational-Core/
  33.  *
  34.  *  DROP Product Core implements libraries for the following:
  35.  *  - Fixed Income Analytics
  36.  *  - Loan Analytics
  37.  *  - Transaction Cost Analytics
  38.  *
  39.  *  DROP Portfolio Core implements libraries for the following:
  40.  *  - Asset Allocation Analytics
  41.  *  - Asset Liability Management Analytics
  42.  *  - Capital Estimation Analytics
  43.  *  - Exposure Analytics
  44.  *  - Margin Analytics
  45.  *  - XVA Analytics
  46.  *
  47.  *  DROP Computational Core implements libraries for the following:
  48.  *  - Algorithm Support
  49.  *  - Computation Support
  50.  *  - Function Analysis
  51.  *  - Model Validation
  52.  *  - Numerical Analysis
  53.  *  - Numerical Optimizer
  54.  *  - Spline Builder
  55.  *  - Statistical Learning
  56.  *
  57.  *  Documentation for DROP is Spread Over:
  58.  *
  59.  *  - Main                     => https://lakshmidrip.github.io/DROP/
  60.  *  - Wiki                     => https://github.com/lakshmiDRIP/DROP/wiki
  61.  *  - GitHub                   => https://github.com/lakshmiDRIP/DROP
  62.  *  - Repo Layout Taxonomy     => https://github.com/lakshmiDRIP/DROP/blob/master/Taxonomy.md
  63.  *  - Javadoc                  => https://lakshmidrip.github.io/DROP/Javadoc/index.html
  64.  *  - Technical Specifications => https://github.com/lakshmiDRIP/DROP/tree/master/Docs/Internal
  65.  *  - Release Versions         => https://lakshmidrip.github.io/DROP/version.html
  66.  *  - Community Credits        => https://lakshmidrip.github.io/DROP/credits.html
  67.  *  - Issues Catalog           => https://github.com/lakshmiDRIP/DROP/issues
  68.  *  - JUnit                    => https://lakshmidrip.github.io/DROP/junit/index.html
  69.  *  - Jacoco                   => https://lakshmidrip.github.io/DROP/jacoco/index.html
  70.  *
  71.  *  Licensed under the Apache License, Version 2.0 (the "License");
  72.  *      you may not use this file except in compliance with the License.
  73.  *  
  74.  *  You may obtain a copy of the License at
  75.  *      http://www.apache.org/licenses/LICENSE-2.0
  76.  *  
  77.  *  Unless required by applicable law or agreed to in writing, software
  78.  *      distributed under the License is distributed on an "AS IS" BASIS,
  79.  *      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  80.  *  
  81.  *  See the License for the specific language governing permissions and
  82.  *      limitations under the License.
  83.  */

  84. /**
  85.  * <i>Basel32019Compliance</i> illustrates the Basel III 2019 Capital Metrics Compliance Checks along with
  86.  * Liquidity Compliance Checks for several Liquidity Metrics Standards. Liquidity Criteria correspond to
  87.  * Large BHC's. The References are:
  88.  *
  89.  * <br><br>
  90.  *  <ul>
  91.  *      <li>
  92.  *          Basel Committee on Banking Supervision (2017): Basel III Leverage Ratio Framework and Disclosure
  93.  *              Requirements https://www.bis.org/publ/bcbs270.pdf
  94.  *      </li>
  95.  *      <li>
  96.  *          Central Banking (2013): Fed and FDIC agree 6% Leverage Ratio for US SIFIs
  97.  *              https://www.centralbanking.com/central-banking/news/2280726/fed-and-fdic-agree-6-leverage-ratio-for-us-sifis
  98.  *      </li>
  99.  *      <li>
  100.  *          European Banking Agency (2013): Implementing Basel III in Europe: CRD IV Package
  101.  *              https://eba.europa.eu/regulation-and-policy/implementing-basel-iii-europe
  102.  *      </li>
  103.  *      <li>
  104.  *          Federal Reserve (2013): Liquidity Coverage Ratio – Liquidity Risk Measurements, Standards, and
  105.  *              Monitoring
  106.  *              https://web.archive.org/web/20131102074614/http:/www.federalreserve.gov/FR_notice_lcr_20131024.pdf
  107.  *      </li>
  108.  *      <li>
  109.  *          Wikipedia (2018): Basel III https://en.wikipedia.org/wiki/Basel_III
  110.  *      </li>
  111.  *  </ul>
  112.  *
  113.  *  <br><br>
  114.  *  <ul>
  115.  *      <li><b>Module </b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/PortfolioCore.md">Portfolio Core Module</a></li>
  116.  *      <li><b>Library</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/CapitalAnalyticsLibrary.md">Capital Analytics</a></li>
  117.  *      <li><b>Project</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/sample/README.md">DROP API Construction and Usage</a></li>
  118.  *      <li><b>Package</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/sample/bcbs/README.md">BCBS/Jurisdictional Capital/Leverage Compliance Checks</a></li>
  119.  *  </ul>
  120.  *
  121.  * @author Lakshmi Krishnamurthy
  122.  */

  123. public class Basel32019Compliance
  124. {

  125.     public static final void main (
  126.         final String[] argumentArray)
  127.         throws Exception
  128.     {
  129.         EnvManager.InitEnv ("");

  130.         HighQualityLiquidAssetSettings hqlaSettings =
  131.             HighQualityLiquidAssetSettings.FederalReserveStandard();

  132.         /*
  133.          * Capital Parameters
  134.          */

  135.         double cet1 = 450.;
  136.         double at1 = 150.;
  137.         double additionalCapital = 200.;
  138.         double rwa = 5000.;
  139.         double totalExposure = 4000.;

  140.         /*
  141.          * HQLA Parameters
  142.          */

  143.         double level1 = 60.;
  144.         double level2A = 25.;
  145.         double level2B = 15.;

  146.         /*
  147.          * Liquidity Parameters
  148.          */

  149.         double netCashOutflowAmount = 75.;

  150.         /*
  151.          * Stable Funding Parameters
  152.          */

  153.         double stableFundingAmount = 500.;
  154.         double extendedStressFundingAmount = 400.;

  155.         CapitalMetricsStandard capitalMetricsStandard = CapitalMetricsStandard.Basel_III_2019();

  156.         BalanceSheet balanceSheet = new BalanceSheet (
  157.             new BalanceSheetCapital (
  158.                 cet1,
  159.                 at1,
  160.                 additionalCapital,
  161.                 rwa,
  162.                 totalExposure
  163.             ),
  164.             BalanceSheetLiquidity.LargeBHC (
  165.                 new HighQualityLiquidAsset (
  166.                     level1,
  167.                     level2A,
  168.                     level2B
  169.                 ),
  170.                 netCashOutflowAmount
  171.             ),
  172.             new BalanceSheetFunding (
  173.                 stableFundingAmount,
  174.                 extendedStressFundingAmount,
  175.                 "1Y"
  176.             )
  177.         );

  178.         System.out.println ("\t|-------------------------------------------------------------------||");

  179.         System.out.println ("\t|           Basel III 2019 Liquidity Standards Compliance           ||");

  180.         System.out.println ("\t|-------------------------------------------------------------------||");

  181.         System.out.println (
  182.             "\t| CET1 Ratio (vs. Standard)                  => " +
  183.             FormatUtil.FormatDouble (balanceSheet.cet1Ratio(), 3, 2, 100.) + "% | " +
  184.             FormatUtil.FormatDouble (capitalMetricsStandard.commonEquityRatio(), 3, 2, 100.) + "%"
  185.         );

  186.         System.out.println (
  187.             "\t| Tier 1 Ratio (vs. Standard)                => " +
  188.             FormatUtil.FormatDouble (balanceSheet.tier1Ratio(), 3, 2, 100.) + "% | " +
  189.             FormatUtil.FormatDouble (capitalMetricsStandard.tier1Ratio(), 3, 2, 100.) + "%"
  190.         );

  191.         System.out.println (
  192.             "\t| Total Capital Ratio (vs. Standard)         => " +
  193.             FormatUtil.FormatDouble (balanceSheet.totalCapitalRatio(), 3, 2, 100.) + "% | " +
  194.             FormatUtil.FormatDouble (capitalMetricsStandard.totalRatio(), 3, 2, 100.) + "%"
  195.         );

  196.         System.out.println (
  197.             "\t| Leverage Ratio                             => " +
  198.             FormatUtil.FormatDouble (balanceSheet.leverageRatio(), 3, 2, 100.) + "% | " +
  199.             FormatUtil.FormatDouble (capitalMetricsStandard.leverageRatio(), 3, 2, 100.) + "%"
  200.         );

  201.         System.out.println (
  202.             "\t| Liquidity Coverage Ratio                   => " +
  203.             FormatUtil.FormatDouble (balanceSheet.liquidityCoverageRatio (hqlaSettings), 3, 2, 100.) + "%"
  204.         );

  205.         System.out.println (
  206.             "\t| Net Stable Funding Ratio                   => " +
  207.             FormatUtil.FormatDouble (balanceSheet.netStableFundingRatio(), 3, 2, 100.) + "%"
  208.         );

  209.         System.out.println (
  210.             "\t| Capital Metrics Compliance                 =>  " +
  211.             balanceSheet.capitalMetrics().isCompliant (capitalMetricsStandard)
  212.         );

  213.         System.out.println ("\t|-------------------------------------------------------------------||");

  214.         System.out.println();

  215.         System.out.println ("\t|-------------------------------------------------------------------||");

  216.         System.out.println ("\t|                 Cross Vintage Liquidity Standard                  ||");

  217.         System.out.println ("\t|-------------------------------------------------------------------||");

  218.         System.out.println ("\t|             Year             =>  2015 | 2016 | 2017 | 2018 | 2019 ||");

  219.         System.out.println ("\t|-------------------------------------------------------------------||");

  220.         String liquidityMetricsCompliance = "\t| Liquidity Metrics Compliance =>  ";

  221.         liquidityMetricsCompliance = liquidityMetricsCompliance +
  222.             balanceSheet.liquidityMetrics (hqlaSettings).isCompliant (LiquidityMetrics.Basel_III_2015()) + " | ";

  223.         liquidityMetricsCompliance = liquidityMetricsCompliance +
  224.             balanceSheet.liquidityMetrics (hqlaSettings).isCompliant (LiquidityMetrics.Basel_III_2016()) + " | ";

  225.         liquidityMetricsCompliance = liquidityMetricsCompliance +
  226.             balanceSheet.liquidityMetrics (hqlaSettings).isCompliant (LiquidityMetrics.Basel_III_2017()) + " | ";

  227.         liquidityMetricsCompliance = liquidityMetricsCompliance +
  228.             balanceSheet.liquidityMetrics (hqlaSettings).isCompliant (LiquidityMetrics.Basel_III_2018()) + " | ";

  229.         liquidityMetricsCompliance = liquidityMetricsCompliance +
  230.             balanceSheet.liquidityMetrics (hqlaSettings).isCompliant (LiquidityMetrics.Basel_III_2019()) + " ||";

  231.         System.out.println (liquidityMetricsCompliance);

  232.         System.out.println ("\t|-------------------------------------------------------------------||");

  233.         System.out.println();

  234.         EnvManager.TerminateEnv();
  235.     }
  236. }