NonFixedBullet.java

  1. package org.drip.sample.corporate;

  2. import org.drip.analytics.cashflow.*;
  3. import org.drip.analytics.date.*;
  4. import org.drip.numerical.common.FormatUtil;
  5. import org.drip.param.creator.MarketParamsBuilder;
  6. import org.drip.param.market.CurveSurfaceQuoteContainer;
  7. import org.drip.param.valuation.*;
  8. import org.drip.product.creator.BondBuilder;
  9. import org.drip.product.credit.BondComponent;
  10. import org.drip.product.definition.*;
  11. import org.drip.service.env.EnvManager;
  12. import org.drip.service.template.*;
  13. import org.drip.state.discount.MergedDiscountForwardCurve;
  14. import org.drip.state.govvie.GovvieCurve;

  15. /*
  16.  * -*- mode: java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  17.  */

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

  89. /**
  90.  * <i>NonFixedBullet</i> demonstrates Non-EOS Non-Fixed Coupon (Floater, Variable) Corporate Bond Pricing and
  91.  * Relative Value Measure Generation Functionality.
  92.  *  
  93.  * <br><br>
  94.  *  <ul>
  95.  *      <li><b>Module </b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/ProductCore.md">Product Core Module</a></li>
  96.  *      <li><b>Library</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/FixedIncomeAnalyticsLibrary.md">Fixed Income Analytics</a></li>
  97.  *      <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>
  98.  *      <li><b>Package</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/sample/corporate/README.md">Corporate Bond Relative Value Analytics</a></li>
  99.  *  </ul>
  100.  * <br><br>
  101.  *
  102.  * @author Lakshmi Krishnamurthy
  103.  */

  104. public class NonFixedBullet {

  105.     private static final MergedDiscountForwardCurve FundingCurve (
  106.         final JulianDate dtSpot,
  107.         final String strCurrency,
  108.         final double dblBump)
  109.         throws Exception
  110.     {
  111.         String[] astrDepositMaturityTenor = new String[] {
  112.             "2D"
  113.         };

  114.         double[] adblDepositQuote = new double[] {
  115.             0.0111956 + dblBump // 2D
  116.         };

  117.         double[] adblFuturesQuote = new double[] {
  118.             0.011375 + dblBump, // 98.8625
  119.             0.013350 + dblBump, // 98.6650
  120.             0.014800 + dblBump, // 98.5200
  121.             0.016450 + dblBump, // 98.3550
  122.             0.017850 + dblBump, // 98.2150
  123.             0.019300 + dblBump  // 98.0700
  124.         };

  125.         String[] astrFixFloatMaturityTenor = new String[] {
  126.             "02Y",
  127.             "03Y",
  128.             "04Y",
  129.             "05Y",
  130.             "06Y",
  131.             "07Y",
  132.             "08Y",
  133.             "09Y",
  134.             "10Y",
  135.             "11Y",
  136.             "12Y",
  137.             "15Y",
  138.             "20Y",
  139.             "25Y",
  140.             "30Y",
  141.             "40Y",
  142.             "50Y"
  143.         };

  144.         double[] adblFixFloatQuote = new double[] {
  145.             0.017029 + dblBump, //  2Y
  146.             0.019354 + dblBump, //  3Y
  147.             0.021044 + dblBump, //  4Y
  148.             0.022291 + dblBump, //  5Y
  149.             0.023240 + dblBump, //  6Y
  150.             0.024025 + dblBump, //  7Y
  151.             0.024683 + dblBump, //  8Y
  152.             0.025243 + dblBump, //  9Y
  153.             0.025720 + dblBump, // 10Y
  154.             0.026130 + dblBump, // 11Y
  155.             0.026495 + dblBump, // 12Y
  156.             0.027230 + dblBump, // 15Y
  157.             0.027855 + dblBump, // 20Y
  158.             0.028025 + dblBump, // 25Y
  159.             0.028028 + dblBump, // 30Y
  160.             0.027902 + dblBump, // 40Y
  161.             0.027655 + dblBump  // 50Y
  162.         };

  163.         MergedDiscountForwardCurve dcFunding = LatentMarketStateBuilder.SmoothFundingCurve (
  164.             dtSpot,
  165.             strCurrency,
  166.             astrDepositMaturityTenor,
  167.             adblDepositQuote,
  168.             "ForwardRate",
  169.             adblFuturesQuote,
  170.             "ForwardRate",
  171.             astrFixFloatMaturityTenor,
  172.             adblFixFloatQuote,
  173.             "SwapRate"
  174.         );

  175.         Component[] aDepositComp = OTCInstrumentBuilder.FundingDeposit (
  176.             dtSpot,
  177.             strCurrency,
  178.             astrDepositMaturityTenor
  179.         );

  180.         Component[] aFuturesComp = ExchangeInstrumentBuilder.ForwardRateFuturesPack (
  181.             dtSpot,
  182.             adblFuturesQuote.length,
  183.             strCurrency
  184.         );

  185.         Component[] aFixFloatComp = OTCInstrumentBuilder.FixFloatStandard (
  186.             dtSpot,
  187.             strCurrency,
  188.             "ALL",
  189.             astrFixFloatMaturityTenor,
  190.             "MAIN",
  191.             0.
  192.         );

  193.         ValuationParams valParams = new ValuationParams (
  194.             dtSpot,
  195.             dtSpot,
  196.             strCurrency
  197.         );

  198.         CurveSurfaceQuoteContainer csqc = MarketParamsBuilder.Create (
  199.             dcFunding,
  200.             null,
  201.             null,
  202.             null,
  203.             null,
  204.             null,
  205.             null
  206.         );

  207.         System.out.println();

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

  209.         System.out.println ("\t|        DEPOSIT INPUT vs. CALC       ||");

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

  211.         for (int i = 0; i < aDepositComp.length; ++i)
  212.             System.out.println ("\t| [" + aDepositComp[i].maturityDate() + "] =" +
  213.                 FormatUtil.FormatDouble (aDepositComp[i].measureValue (
  214.                     valParams,
  215.                     null,
  216.                     csqc,
  217.                     null,
  218.                     "ForwardRate"
  219.                 ), 1, 6, 1.) + " |" +
  220.                 FormatUtil.FormatDouble (adblDepositQuote[i], 1, 6, 1.) + " ||"
  221.             );

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

  223.         System.out.println();

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

  225.         System.out.println ("\t|        FUTURES INPUT vs. CALC       ||");

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

  227.         for (int i = 0; i < aFuturesComp.length; ++i)
  228.             System.out.println ("\t| [" + aFuturesComp[i].maturityDate() + "] =" +
  229.                 FormatUtil.FormatDouble (aFuturesComp[i].measureValue (
  230.                     valParams,
  231.                     null,
  232.                     csqc,
  233.                     null,
  234.                     "ForwardRate"
  235.                 ), 1, 6, 1.) + " |" +
  236.                 FormatUtil.FormatDouble (adblFuturesQuote[i], 1, 6, 1.) + " ||"
  237.             );

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

  239.         System.out.println();

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

  241.         System.out.println ("\t|          FIX-FLOAT INPUTS vs CALIB             ||");

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

  243.         for (int i = 0; i < aFixFloatComp.length; ++i)
  244.             System.out.println ("\t| [" + aFixFloatComp[i].maturityDate() + "] =" +
  245.                 FormatUtil.FormatDouble (aFixFloatComp[i].measureValue (
  246.                     valParams,
  247.                     null,
  248.                     csqc,
  249.                     null,
  250.                     "CalibSwapRate"
  251.                 ), 1, 6, 1.) + " |" +
  252.                 FormatUtil.FormatDouble (adblFixFloatQuote[i], 1, 6, 1.) + " |" +
  253.                 FormatUtil.FormatDouble (aFixFloatComp[i].measureValue (
  254.                     valParams,
  255.                     null,
  256.                     csqc,
  257.                     null,
  258.                     "FairPremium"
  259.                 ), 1, 6, 1.) + " ||"
  260.             );

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

  262.         System.out.println();

  263.         return dcFunding;
  264.     }

  265.     private static final GovvieCurve GovvieCurve (
  266.         final JulianDate dtSpot,
  267.         final String strCode,
  268.         final double[] adblCoupon,
  269.         final double[] adblYield)
  270.         throws Exception
  271.     {
  272.         JulianDate[] adtEffective = new JulianDate[] {
  273.             dtSpot,
  274.             dtSpot,
  275.             dtSpot,
  276.             dtSpot,
  277.             dtSpot,
  278.             dtSpot,
  279.             dtSpot,
  280.             dtSpot
  281.         };

  282.         JulianDate[] adtMaturity = new JulianDate[] {
  283.             dtSpot.addTenor ("1Y"),
  284.             dtSpot.addTenor ("2Y"),
  285.             dtSpot.addTenor ("3Y"),
  286.             dtSpot.addTenor ("5Y"),
  287.             dtSpot.addTenor ("7Y"),
  288.             dtSpot.addTenor ("10Y"),
  289.             dtSpot.addTenor ("20Y"),
  290.             dtSpot.addTenor ("30Y")
  291.         };

  292.         GovvieCurve gc = LatentMarketStateBuilder.GovvieCurve (
  293.             strCode,
  294.             dtSpot,
  295.             adtEffective,
  296.             adtMaturity,
  297.             adblCoupon,
  298.             adblYield,
  299.             "Yield",
  300.             LatentMarketStateBuilder.SHAPE_PRESERVING
  301.         );

  302.         BondComponent[] aComp = TreasuryBuilder.FromCode (
  303.             strCode,
  304.             adtEffective,
  305.             adtMaturity,
  306.             adblCoupon
  307.         );

  308.         ValuationParams valParams = ValuationParams.Spot (dtSpot.julian());

  309.         CurveSurfaceQuoteContainer csqc = new CurveSurfaceQuoteContainer();

  310.         csqc.setGovvieState (gc);

  311.         System.out.println();

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

  313.         System.out.println ("\t|       TREASURY INPUT vs CALIB YIELD       ||");

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

  315.         for (int i = 0; i < aComp.length; ++i)
  316.             System.out.println ("\t| " + aComp[i].name() + " | " +
  317.                 FormatUtil.FormatDouble (adblYield[i], 1, 3, 100.) + "% | " +
  318.                 FormatUtil.FormatDouble (aComp[i].yieldFromPrice (
  319.                     valParams,
  320.                     null,
  321.                     null,
  322.                     aComp[i].maturityDate().julian(),
  323.                     1.,
  324.                     aComp[i].priceFromYield (
  325.                         valParams,
  326.                         null,
  327.                         null,
  328.                         gc.yield (aComp[i].maturityDate().julian())
  329.                     )
  330.                 ), 1, 3, 100.) + "% ||"
  331.             );

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

  333.         return gc;
  334.     }

  335.     private static final BondComponent Corporate (
  336.         final String strCUSIP,
  337.         final String strRateIndex,
  338.         final JulianDate dtEffective,
  339.         final JulianDate dtMaturity,
  340.         final double dblFloatSpread)
  341.         throws Exception
  342.     {
  343.         return BondBuilder.CreateSimpleFloater (
  344.             strCUSIP,
  345.             "USD",
  346.             strRateIndex,
  347.             "",
  348.             dblFloatSpread,
  349.             4,
  350.             "Act/360",
  351.             dtEffective,
  352.             dtMaturity,
  353.             null,
  354.             null
  355.         );
  356.     }

  357.     private static final void RVMeasures (
  358.         final BondComponent[] aBond,
  359.         final JulianDate dtValue,
  360.         final MergedDiscountForwardCurve dcBase,
  361.         final MergedDiscountForwardCurve dcBump,
  362.         final GovvieCurve gc,
  363.         final double[] adblCleanPrice,
  364.         final double[] adblFullFirstCoupon)
  365.         throws Exception
  366.     {
  367.         JulianDate dtSettle = dtValue.addBusDays (
  368.             3,
  369.             aBond[0].currency()
  370.         );

  371.         ValuationParams valParams = new ValuationParams (
  372.             dtValue,
  373.             dtSettle,
  374.             aBond[0].currency()
  375.         );

  376.         System.out.println();

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

  378.         System.out.println ("\t| Trade Date       : " + dtValue + " ||");

  379.         System.out.println ("\t| Cash Settle Date : " + dtSettle + " ||");

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

  381.         System.out.println();

  382.         String strSecularMetrics = "";

  383.         for (int i = 0; i < aBond.length; ++i) {
  384.             CurveSurfaceQuoteContainer csqc = MarketParamsBuilder.Create (
  385.                 dcBase,
  386.                 gc,
  387.                 null,
  388.                 null,
  389.                 null,
  390.                 null,
  391.                 null
  392.             );

  393.             CurveSurfaceQuoteContainer csqcBump = MarketParamsBuilder.Create (
  394.                 dcBump,
  395.                 null,
  396.                 null,
  397.                 null,
  398.                 null,
  399.                 null,
  400.                 null
  401.             );

  402.             ComposableUnitPeriod cupFirst = aBond[i].stream().containingPeriod (dtValue.julian()).periods().get (0);

  403.             csqc.setFixing (
  404.                 ((ComposableUnitFloatingPeriod) cupFirst).referenceIndexPeriod().fixingDate(),
  405.                 aBond[i].floaterSetting().fri(),
  406.                 adblFullFirstCoupon[i] - aBond[i].floatSpread()
  407.             );

  408.             csqcBump.setFixing (
  409.                 ((ComposableUnitFloatingPeriod) cupFirst).referenceIndexPeriod().fixingDate(),
  410.                 aBond[i].floaterSetting().fri(),
  411.                 adblFullFirstCoupon[i] - aBond[i].floatSpread() + 0.0001
  412.             );

  413.             double dblAccrued = aBond[i].accrued (
  414.                 dtSettle.julian(),
  415.                 csqc
  416.             );

  417.             WorkoutInfo wi = aBond[i].exerciseYieldFromPrice (
  418.                 valParams,
  419.                 csqc,
  420.                 null,
  421.                 adblCleanPrice[i]
  422.             );

  423.             double dblYTM = aBond[i].yieldFromPrice (
  424.                 valParams,
  425.                 csqc,
  426.                 null,
  427.                 aBond[i].maturityDate().julian(),
  428.                 1.,
  429.                 adblCleanPrice[i]
  430.             );

  431.             double dblYTMBondEquivalent = aBond[i].yieldFromPrice (
  432.                 valParams,
  433.                 csqc,
  434.                 ValuationCustomizationParams.BondEquivalent (aBond[i].currency()),
  435.                 aBond[i].maturityDate().julian(),
  436.                 1.,
  437.                 adblCleanPrice[i]
  438.             );

  439.             double dblWALTW = aBond[i].weightedAverageLife (
  440.                 valParams,
  441.                 csqc,
  442.                 wi.date(),
  443.                 wi.factor()
  444.             );

  445.             double dblWALTM = aBond[i].weightedAverageLife (
  446.                 valParams,
  447.                 csqc,
  448.                 aBond[i].maturityDate().julian(),
  449.                 1.
  450.             );

  451.             double dblDiscountMargin = aBond[i].discountMarginFromYield (
  452.                 valParams,
  453.                 csqc,
  454.                 null,
  455.                 wi.date(),
  456.                 wi.factor(),
  457.                 wi.yield()
  458.             );

  459.             double dblOAS = aBond[i].oasFromYield (
  460.                 valParams,
  461.                 csqc,
  462.                 null,
  463.                 wi.date(),
  464.                 wi.factor(),
  465.                 wi.yield()
  466.             );

  467.             double dblBasePrice = aBond[i].priceFromFundingCurve (
  468.                 valParams,
  469.                 csqc,
  470.                 wi.date(),
  471.                 wi.factor(),
  472.                 0.
  473.             );

  474.             double dblBumpPrice = aBond[i].priceFromFundingCurve (
  475.                 valParams,
  476.                 csqcBump,
  477.                 wi.date(),
  478.                 wi.factor(),
  479.                 0.
  480.             );

  481.             strSecularMetrics +=
  482.                 aBond[i].name() + "," +
  483.                 aBond[i].effectiveDate() + "," +
  484.                 aBond[i].maturityDate() + "," +
  485.                 aBond[i].floaterSetting().fri().fullyQualifiedName() + "," +
  486.                 FormatUtil.FormatDouble (aBond[i].floatSpread(), 3, 1, 10000.) + "," +
  487.                 aBond[i].firstCouponDate() + "," +
  488.                 FormatUtil.FormatDouble (adblCleanPrice[i], 3, 3, 100.) + "," +
  489.                 FormatUtil.FormatDouble (dblAccrued, 1, 4, 100.) + "," +
  490.                 FormatUtil.FormatDouble (wi.yield(), 1, 3, 100.) + "%," +
  491.                 FormatUtil.FormatDouble (dblYTM, 1, 3, 100.) + "%," +
  492.                 FormatUtil.FormatDouble (dblYTMBondEquivalent, 1, 3, 100.) + "%," +
  493.                 FormatUtil.FormatDouble (dblWALTW, 1, 3, 1.) + "," +
  494.                 FormatUtil.FormatDouble (dblWALTM, 1, 3, 1.) + "," +
  495.                 FormatUtil.FormatDouble (dblBasePrice - dblBumpPrice, 1, 4, 10000.) + "," +
  496.                 FormatUtil.FormatDouble (dblDiscountMargin, 1, 3, 10000.) + "," +
  497.                 FormatUtil.FormatDouble (dblOAS, 1, 3, 10000.) + "\n";
  498.         }

  499.         System.out.println
  500.             ("Bond, Issue, Maturity, Floater Index, Spread, First Coupon, Clean Price, Accrued, Yield TW, Yield TM, Bond Equivalent Yield TM, WAL TW, WAL TM, Duration TW, Discount Margin TW, OAS TW");

  501.         System.out.print (strSecularMetrics);
  502.     }

  503.     public static final void main (
  504.         final String[] astrArgs)
  505.         throws Exception
  506.     {
  507.         EnvManager.InitEnv ("");

  508.         JulianDate dtSpot = DateUtil.CreateFromYMD (
  509.             2017,
  510.             DateUtil.MARCH,
  511.             10
  512.         );

  513.         String strCurrency = "USD";
  514.         String strTreasuryCode = "UST";

  515.         double[] adblTreasuryCoupon = new double[] {
  516.             0.0100,
  517.             0.0100,
  518.             0.0125,
  519.             0.0150,
  520.             0.0200,
  521.             0.0225,
  522.             0.0250,
  523.             0.0300
  524.         };

  525.         double[] adblTreasuryYield = new double[] {
  526.             0.0083, //  1Y
  527.             0.0122, //  2Y
  528.             0.0149, //  3Y
  529.             0.0193, //  5Y
  530.             0.0227, //  7Y
  531.             0.0248, // 10Y
  532.             0.0280, // 20Y
  533.             0.0308  // 30Y
  534.         };

  535.         BondComponent[] aCorporateBond = new BondComponent[] {
  536.             Corporate ("55608PAF1", "USD-3M", DateUtil.CreateFromYMD (2014,  3, 24), DateUtil.CreateFromYMD (2017,  3, 24), 0.00790),
  537.             Corporate ("233851BX1", "USD-3M", DateUtil.CreateFromYMD (2015,  8,  3), DateUtil.CreateFromYMD (2017,  8,  3), 0.00710),
  538.             Corporate ("00817YAR9", "USD-3M", DateUtil.CreateFromYMD (2016,  6,  9), DateUtil.CreateFromYMD (2017, 12,  8), 0.00650),
  539.             Corporate ("38141GVK7", "USD-3M", DateUtil.CreateFromYMD (2013,  4, 30), DateUtil.CreateFromYMD (2018,  4, 30), 0.01200),
  540.             Corporate ("865622CD4", "USD-3M", DateUtil.CreateFromYMD (2016, 10, 19), DateUtil.CreateFromYMD (2018, 10, 19), 0.00670),
  541.             Corporate ("63307A2B0", "USD-3M", DateUtil.CreateFromYMD (2015, 12, 14), DateUtil.CreateFromYMD (2018, 12, 14), 0.00840),
  542.             Corporate ("6325C0DE8", "USD-3M", DateUtil.CreateFromYMD (2016,  1, 14), DateUtil.CreateFromYMD (2019,  1, 14), 0.00780),
  543.             Corporate ("55608PAU8", "USD-3M", DateUtil.CreateFromYMD (2016,  1, 15), DateUtil.CreateFromYMD (2019,  1, 15), 0.01180),
  544.             Corporate ("61746BDY9", "USD-3M", DateUtil.CreateFromYMD (2016,  1, 27), DateUtil.CreateFromYMD (2019,  2,  1), 0.01375),
  545.             Corporate ("80283LAL7", "USD-3M", DateUtil.CreateFromYMD (2016,  3, 14), DateUtil.CreateFromYMD (2019,  3, 14), 0.01480),
  546.             Corporate ("961214CU5", "USD-3M", DateUtil.CreateFromYMD (2016,  5, 13), DateUtil.CreateFromYMD (2019,  5, 13), 0.00710),
  547.             Corporate ("94988J5E3", "USD-3M", DateUtil.CreateFromYMD (2016,  6,  2), DateUtil.CreateFromYMD (2019,  5, 24), 0.00600),
  548.             Corporate ("064159HU3", "USD-3M", DateUtil.CreateFromYMD (2016,  6, 14), DateUtil.CreateFromYMD (2019,  6, 14), 0.00660),
  549.             Corporate ("23636AAG6", "USD-3M", DateUtil.CreateFromYMD (2016,  9,  8), DateUtil.CreateFromYMD (2019,  9,  6), 0.00580),
  550.             Corporate ("65557CAU7", "USD-3M", DateUtil.CreateFromYMD (2016,  9, 30), DateUtil.CreateFromYMD (2019,  9, 30), 0.00620),
  551.             Corporate ("86563VAF6", "USD-3M", DateUtil.CreateFromYMD (2016, 10, 18), DateUtil.CreateFromYMD (2019, 10, 18), 0.00910),
  552.         };

  553.         double[] adblCleanPrice = new double[] {
  554.             1.0001950,  // (2017,  3, 24)
  555.             1.0024600,  // (2017,  8,  3)
  556.             1.0039670,  // (2017, 12,  8)
  557.             1.0097600,  // (2018,  4, 30)
  558.             1.0033100,  // (2018, 10, 19)
  559.             1.0058650,  // (2018, 12, 14)
  560.             1.0079700,  // (2019,  1, 14)
  561.             1.0114550,  // (2019,  1, 15)
  562.             1.0172800,  // (2019,  2,  1)
  563.             1.0164400,  // (2019,  3, 14)
  564.             1.0073900,  // (2019,  5, 13)
  565.             1.0055400,  // (2019,  5, 24)
  566.             1.0063760,  // (2019,  6, 14)
  567.             1.0032590,  // (2019,  9,  6)
  568.             1.0042840,  // (2019,  9, 30)
  569.             1.0052800,  // (2019, 10, 18)
  570.         };

  571.         double[] adblFullFirstCoupon = new double[] {
  572.             0.0178706,  // (2017,  3, 24)
  573.             0.0174456,  // (2017,  8,  3)
  574.             0.0175622,  // (2017, 12,  8)
  575.             0.0223900,  // (2018,  4, 30)
  576.             0.0168483,  // (2018, 10, 19)
  577.             0.0196122,  // (2018, 12, 14)
  578.             0.0180317,  // (2019,  1, 14)
  579.             0.0220317,  // (2019,  1, 15)
  580.             0.0240900,  // (2019,  2,  1)
  581.             0.0260122,  // (2019,  3, 14)
  582.             0.0174372,  // (2019,  5, 13)
  583.             0.0165400,  // (2019,  5, 24)
  584.             0.0178122,  // (2019,  6, 14)
  585.             0.0168000,  // (2019,  9,  6)
  586.             0.0161817,  // (2019,  9, 30)
  587.             0.0193372,  // (2019, 10, 18)
  588.         };

  589.         RVMeasures (
  590.             aCorporateBond,
  591.             dtSpot,
  592.             FundingCurve (
  593.                 dtSpot,
  594.                 strCurrency,
  595.                 0.
  596.             ),
  597.             FundingCurve (
  598.                 dtSpot,
  599.                 strCurrency,
  600.                 0.0001
  601.             ),
  602.             GovvieCurve (
  603.                 dtSpot,
  604.                 strTreasuryCode,
  605.                 adblTreasuryCoupon,
  606.                 adblTreasuryYield
  607.             ),
  608.             adblCleanPrice,
  609.             adblFullFirstCoupon
  610.         );

  611.         System.out.println();

  612.         EnvManager.TerminateEnv();
  613.     }
  614. }