HighQualityLiquidAssetSettings.java

  1. package org.drip.capital.bcbs;

  2. /*
  3.  * -*- mode: java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  4.  */

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

  74. /**
  75.  * <i>HighQualityLiquidAssetSettings</i> holds the Risk-Weights and the Haircuts associated with Levels 1,
  76.  * 2A, and 2B. The References are:
  77.  *
  78.  * <br><br>
  79.  *  <ul>
  80.  *      <li>
  81.  *          Basel Committee on Banking Supervision (2017): Basel III Leverage Ratio Framework and Disclosure
  82.  *              Requirements https://www.bis.org/publ/bcbs270.pdf
  83.  *      </li>
  84.  *      <li>
  85.  *          Central Banking (2013): Fed and FDIC agree 6% Leverage Ratio for US SIFIs
  86.  *              https://www.centralbanking.com/central-banking/news/2280726/fed-and-fdic-agree-6-leverage-ratio-for-us-sifis
  87.  *      </li>
  88.  *      <li>
  89.  *          European Banking Agency (2013): Implementing Basel III in Europe: CRD IV Package
  90.  *              https://eba.europa.eu/regulation-and-policy/implementing-basel-iii-europe
  91.  *      </li>
  92.  *      <li>
  93.  *          Federal Reserve (2013): Liquidity Coverage Ratio – Liquidity Risk Measurements, Standards, and
  94.  *              Monitoring
  95.  *              https://web.archive.org/web/20131102074614/http:/www.federalreserve.gov/FR_notice_lcr_20131024.pdf
  96.  *      </li>
  97.  *      <li>
  98.  *          Wikipedia (2018): Basel III https://en.wikipedia.org/wiki/Basel_III
  99.  *      </li>
  100.  *  </ul>
  101.  *
  102.  *  <br><br>
  103.  *  <ul>
  104.  *      <li><b>Module </b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/PortfolioCore.md">Portfolio Core Module</a></li>
  105.  *      <li><b>Library</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/CapitalAnalyticsLibrary.md">Capital Analytics</a></li>
  106.  *      <li><b>Project</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/capital/README.md">Basel Market Risk and Operational Capital</a></li>
  107.  *      <li><b>Package</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/capital/bcbs/README.md">BCBS and Jurisdictional Capital Ratios</a></li>
  108.  *  </ul>
  109.  *
  110.  * @author Lakshmi Krishnamurthy
  111.  */

  112. public class HighQualityLiquidAssetSettings
  113. {
  114.     private double _level1Haircut = java.lang.Double.NaN;
  115.     private double _level2AHaircut = java.lang.Double.NaN;
  116.     private double _level2BHaircut = java.lang.Double.NaN;
  117.     private double _level1RiskWeight = java.lang.Double.NaN;
  118.     private double _level2ARiskWeight = java.lang.Double.NaN;
  119.     private double _level2BRiskWeight = java.lang.Double.NaN;

  120.     /**
  121.      * Retrieve the Federal Reserve Version of the HQLA Settings Standard
  122.      *
  123.      * @return The Federal Reserve Version of the HQLA Settings Standard
  124.      */

  125.     public static final HighQualityLiquidAssetSettings FederalReserveStandard()
  126.     {
  127.         try
  128.         {
  129.             return new HighQualityLiquidAssetSettings (
  130.                 0.00,
  131.                 0.00,
  132.                 0.15,
  133.                 0.20,
  134.                 0.50,
  135.                 0.50
  136.             );
  137.         }
  138.         catch (java.lang.Exception e)
  139.         {
  140.             e.printStackTrace();
  141.         }

  142.         return null;
  143.     }

  144.     /**
  145.      * HighQualityLiquidAssetSettings Constructor
  146.      *
  147.      * @param level1Haircut Level 1 HQLA Haircut
  148.      * @param level1RiskWeight Level 1 HQLA Risk-Weight
  149.      * @param level2AHaircut Level 2A HQLA Haircut
  150.      * @param level2ARiskWeight Level 2A HQLA Risk-Weight
  151.      * @param level2BHaircut Level 2B HQLA Haircut
  152.      * @param level2BRiskWeight Level 2B HQLA Risk-Weight
  153.      *
  154.      * @throws java.lang.Exception Thrown if the Inputs are Invalid
  155.      */

  156.     public HighQualityLiquidAssetSettings (
  157.         final double level1Haircut,
  158.         final double level1RiskWeight,
  159.         final double level2AHaircut,
  160.         final double level2ARiskWeight,
  161.         final double level2BHaircut,
  162.         final double level2BRiskWeight)
  163.         throws java.lang.Exception
  164.     {
  165.         if (!org.drip.numerical.common.NumberUtil.IsValid (_level1Haircut = level1Haircut) ||
  166.                 0. > _level1Haircut || 1. < _level1Haircut ||
  167.             !org.drip.numerical.common.NumberUtil.IsValid (_level1RiskWeight = level1RiskWeight) ||
  168.                 0. > _level1RiskWeight ||
  169.             !org.drip.numerical.common.NumberUtil.IsValid (_level2AHaircut = level2AHaircut) ||
  170.                 0. > _level2AHaircut || 1. < _level2AHaircut ||
  171.             !org.drip.numerical.common.NumberUtil.IsValid (_level2ARiskWeight = level2ARiskWeight) ||
  172.                 0. > _level2ARiskWeight ||
  173.             !org.drip.numerical.common.NumberUtil.IsValid (_level2BHaircut = level2BHaircut) ||
  174.                 0. > _level2BHaircut || 1. < _level2BHaircut ||
  175.             !org.drip.numerical.common.NumberUtil.IsValid (_level2BRiskWeight = level2BRiskWeight) ||
  176.                 0. > _level2BRiskWeight)
  177.         {
  178.             throw new java.lang.Exception ("HighQualityLiquidAssetSettings Constructor => Invalid Inputs");
  179.         }
  180.     }

  181.     /**
  182.      * Retrieve the Level 1 Risk Weight
  183.      *
  184.      * @return The Level 1 Risk Weight
  185.      */

  186.     public double level1RiskWeight()
  187.     {
  188.         return _level1RiskWeight;
  189.     }

  190.     /**
  191.      * Retrieve the Level 1 Haircut
  192.      *
  193.      * @return The Level 1 Haircut
  194.      */

  195.     public double level1Haircut()
  196.     {
  197.         return _level1Haircut;
  198.     }

  199.     /**
  200.      * Retrieve the Level 2A Risk Weight
  201.      *
  202.      * @return The Level 2A Risk Weight
  203.      */

  204.     public double level2ARiskWeight()
  205.     {
  206.         return _level2ARiskWeight;
  207.     }

  208.     /**
  209.      * Retrieve the Level 2A Haircut
  210.      *
  211.      * @return The Level 2A Haircut
  212.      */

  213.     public double level2AHaircut()
  214.     {
  215.         return _level2AHaircut;
  216.     }

  217.     /**
  218.      * Retrieve the Level 2B Risk Weight
  219.      *
  220.      * @return The Level 2B Risk Weight
  221.      */

  222.     public double level2BRiskWeight()
  223.     {
  224.         return _level2BRiskWeight;
  225.     }

  226.     /**
  227.      * Retrieve the Level 2B Haircut
  228.      *
  229.      * @return The Level 2B Haircut
  230.      */

  231.     public double level2BHaircut()
  232.     {
  233.         return _level2BHaircut;
  234.     }
  235. }