BalanceSheetFunding.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>BalanceSheetFunding</i> holds the Quantities used to compute the Stable FUnding Ratios in the BCBS
  76.  * Standards. 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 BalanceSheetFunding
  113. {
  114.     private java.lang.String _stressPeriod = "";
  115.     private double _stableFundingAmount = java.lang.Double.NaN;
  116.     private double _extendedStressFundingAmount = java.lang.Double.NaN;

  117.     /**
  118.      * Construct the Basel III Version of BalanceSheetFunding
  119.      *
  120.      * @param stableFundingAmount Stable Funding Amount
  121.      * @param extendedStressFundingAmount Funding Amount Required Over the Specified Period of Extended
  122.      *      Stress
  123.      *
  124.      * @return The Basel III Version of BalanceSheetFunding
  125.      */

  126.     public static final BalanceSheetFunding Basel_III (
  127.         final double stableFundingAmount,
  128.         final double extendedStressFundingAmount)
  129.     {
  130.         try
  131.         {
  132.             return new BalanceSheetFunding (
  133.                 stableFundingAmount,
  134.                 extendedStressFundingAmount,
  135.                 "1Y"
  136.             );
  137.         }
  138.         catch (java.lang.Exception e)
  139.         {
  140.             e.printStackTrace();
  141.         }

  142.         return null;
  143.     }

  144.     /**
  145.      * BalanceSheetFunding Constructor
  146.      *
  147.      * @param stableFundingAmount Stable Funding Amount
  148.      * @param extendedStressFundingAmount Funding Amount Required Over the Specified Period of Extended
  149.      *      Stress
  150.      * @param stressPeriod Stress Period
  151.      *
  152.      * @throws java.lang.Exception Thrown if the Inputs are Invalid
  153.      */

  154.     public BalanceSheetFunding (
  155.         final double stableFundingAmount,
  156.         final double extendedStressFundingAmount,
  157.         final java.lang.String stressPeriod)
  158.         throws java.lang.Exception
  159.     {
  160.         if (!org.drip.numerical.common.NumberUtil.IsValid (_stableFundingAmount = stableFundingAmount) ||
  161.                 0. > _stableFundingAmount ||
  162.             !org.drip.numerical.common.NumberUtil.IsValid (_extendedStressFundingAmount =
  163.                 extendedStressFundingAmount) || 0. > _extendedStressFundingAmount ||
  164.             null == (_stressPeriod = stressPeriod) || _stressPeriod.isEmpty())
  165.         {
  166.             throw new java.lang.Exception ("BalanceSheetFunding Constructor => Invalid Inputs");
  167.         }
  168.     }

  169.     /**
  170.      * Retrieve the Stable Funding Amount
  171.      *
  172.      * @return The Stable Funding Amount
  173.      */

  174.     public double stableFundingAmount()
  175.     {
  176.         return _stableFundingAmount;
  177.     }

  178.     /**
  179.      * Retrieve the Funding Amount Required Over the Specified Period of Extended Stress
  180.      *
  181.      * @return The Funding Amount Required Over the Specified Period of Extended Stress
  182.      */

  183.     public double extendedStressFundingAmount()
  184.     {
  185.         return _extendedStressFundingAmount;
  186.     }

  187.     /**
  188.      * Retrieve the Stress Period
  189.      *
  190.      * @return The Stress Period
  191.      */

  192.     public java.lang.String stressPeriod()
  193.     {
  194.         return _stressPeriod;
  195.     }

  196.     /**
  197.      * Retrieve the Net Stable Funding Ratio
  198.      *
  199.      * @return The Net Stable Funding Ratio
  200.      */

  201.     public double netStableFundingRatio()
  202.     {
  203.         return _stableFundingAmount / _extendedStressFundingAmount;
  204.     }
  205. }