TreasuryFuturesOptionContainer.java

  1. package org.drip.market.exchange;

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

  78. /**
  79.  * <i>TreasuryFuturesOptionContainer</i> holds the Details of the Treasury Futures Options Contracts.
  80.  *
  81.  *  <br><br>
  82.  *  <ul>
  83.  *      <li><b>Module </b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/ProductCore.md">Product Core Module</a></li>
  84.  *      <li><b>Library</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/FixedIncomeAnalyticsLibrary.md">Fixed Income Analytics Library</a></li>
  85.  *      <li><b>Project</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/market">Static Market Fields - the Definitions, the OTC/Exchange Traded Products, and Treasury Settings</a></li>
  86.  *      <li><b>Package</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/market/exchange">Deliverable Swap, STIR, Treasury Futures</a></li>
  87.  *  </ul>
  88.  *
  89.  * @author Lakshmi Krishnamurthy
  90.  */

  91. public class TreasuryFuturesOptionContainer {
  92.     private static java.util.Map<java.lang.String, org.drip.market.exchange.TreasuryFuturesOptionConvention>
  93.         _mapFuturesOptions = null;

  94.     /**
  95.      * Initialize the Treasury Futures Options Convention Container with the Conventions
  96.      *
  97.      * @return TRUE - The Treasury Futures Options Convention Container successfully initialized
  98.      */

  99.     public static final boolean Init()
  100.     {
  101.         if (null != _mapFuturesOptions) return true;

  102.         _mapFuturesOptions = new java.util.TreeMap<java.lang.String,
  103.             org.drip.market.exchange.TreasuryFuturesOptionConvention>();

  104.         try {
  105.             org.drip.product.params.LastTradingDateSetting[] aLTDS = new
  106.                 org.drip.product.params.LastTradingDateSetting[] {new
  107.                     org.drip.product.params.LastTradingDateSetting
  108.                         (org.drip.product.params.LastTradingDateSetting.MID_CURVE_OPTION, "2D",
  109.                             java.lang.Integer.MIN_VALUE), new org.drip.product.params.LastTradingDateSetting
  110.                                 (org.drip.product.params.LastTradingDateSetting.MID_CURVE_OPTION_QUARTERLY,
  111.                                     "", java.lang.Integer.MIN_VALUE)};

  112.             _mapFuturesOptions.put ("USD-TREASURY-BOND-ULTRA", new
  113.                 org.drip.market.exchange.TreasuryFuturesOptionConvention (new java.lang.String[] {"OUB",
  114.                     "OUL"}, "USD-TREASURY-BOND-ULTRA", 100000., true, aLTDS));

  115.             _mapFuturesOptions.put ("USD-TREASURY-BOND-30Y", new
  116.                 org.drip.market.exchange.TreasuryFuturesOptionConvention (new java.lang.String[] {"OZB",
  117.                     "CG-PG"}, "USD-TREASURY-BOND-30Y", 100000., true, aLTDS));

  118.             _mapFuturesOptions.put ("USD-TREASURY-NOTE-10Y", new
  119.                 org.drip.market.exchange.TreasuryFuturesOptionConvention (new java.lang.String[] {"OZN",
  120.                     "TC-TP"}, "USD-TREASURY-NOTE-10Y", 100000., true, aLTDS));

  121.             _mapFuturesOptions.put ("USD-TREASURY-NOTE-5Y", new
  122.                 org.drip.market.exchange.TreasuryFuturesOptionConvention (new java.lang.String[] {"OZF",
  123.                     "FL-FP"}, "USD-TREASURY-NOTE-5Y", 100000., true, aLTDS));

  124.             _mapFuturesOptions.put ("USD-TREASURY-NOTE-2Y", new
  125.                 org.drip.market.exchange.TreasuryFuturesOptionConvention (new java.lang.String[] {"OZT",
  126.                     "TUC-TUP"}, "USD-TREASURY-NOTE-2Y", 200000., true, aLTDS));

  127.             _mapFuturesOptions.put ("EUR-EURO-BUXL-30Y", new
  128.                 org.drip.market.exchange.TreasuryFuturesOptionConvention (new java.lang.String[] {"BUXL"},
  129.                     "EUR-EURO-BUXL-30Y", 100000., false, aLTDS));

  130.             _mapFuturesOptions.put ("EUR-EURO-BUND-10Y", new
  131.                 org.drip.market.exchange.TreasuryFuturesOptionConvention (new java.lang.String[] {"BUND"},
  132.                     "EUR-EURO-BUND-10Y", 100000., false, aLTDS));

  133.             _mapFuturesOptions.put ("EUR-EURO-BOBL-5Y", new
  134.                 org.drip.market.exchange.TreasuryFuturesOptionConvention (new java.lang.String[] {"BOBL"},
  135.                     "EUR-EURO-BOBL-10Y", 100000., false, aLTDS));

  136.             _mapFuturesOptions.put ("EUR-EURO-SCHATZ-2Y", new
  137.                 org.drip.market.exchange.TreasuryFuturesOptionConvention (new java.lang.String[] {"SCHATZ"},
  138.                     "EUR-EURO-SCHATZ-10Y", 100000., false, aLTDS));

  139.             _mapFuturesOptions.put ("EUR-TREASURY-BONO-10Y", new
  140.                 org.drip.market.exchange.TreasuryFuturesOptionConvention (new java.lang.String[] {"BONO"},
  141.                     "EUR-TREASURY-BONO-10Y", 100000., false, aLTDS));

  142.             return true;
  143.         } catch (java.lang.Exception e) {
  144.             e.printStackTrace();
  145.         }

  146.         return false;
  147.     }

  148.     /**
  149.      * Retrieve the Treasury Futures Option Convention from the Contract Name
  150.      *
  151.      * @param strContractName The Options Contract Name
  152.      *
  153.      * @return The Treasury Futures Option Convention
  154.      */

  155.     public static final org.drip.market.exchange.TreasuryFuturesOptionConvention FromContract (
  156.         final java.lang.String strContractName)
  157.     {
  158.         return null == strContractName || strContractName.isEmpty() || !_mapFuturesOptions.containsKey
  159.             (strContractName) ? null : _mapFuturesOptions.get (strContractName);
  160.     }
  161. }