CustomFixFloatSwap.java

  1. package org.drip.sample.fixfloat;

  2. import java.util.*;

  3. import org.drip.analytics.date.*;
  4. import org.drip.analytics.daycount.*;
  5. import org.drip.analytics.support.*;
  6. import org.drip.function.r1tor1.QuadraticRationalShapeControl;
  7. import org.drip.numerical.common.FormatUtil;
  8. import org.drip.param.creator.*;
  9. import org.drip.param.market.CurveSurfaceQuoteContainer;
  10. import org.drip.param.period.*;
  11. import org.drip.param.valuation.*;
  12. import org.drip.product.creator.*;
  13. import org.drip.product.rates.*;
  14. import org.drip.service.env.EnvManager;
  15. import org.drip.spline.basis.PolynomialFunctionSetParams;
  16. import org.drip.spline.params.*;
  17. import org.drip.spline.stretch.*;
  18. import org.drip.state.creator.ScenarioDiscountCurveBuilder;
  19. import org.drip.state.discount.*;
  20. import org.drip.state.estimator.LatentStateStretchBuilder;
  21. import org.drip.state.identifier.*;
  22. import org.drip.state.inference.*;

  23. /*
  24.  * -*- mode: java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  25.  */

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

  88. /**
  89.  * <i>CustomFixFloatSwap</i> demonstrates the Construction and Valuation of a Custom Fix-Float Swap.
  90.  *  
  91.  * <br><br>
  92.  *  <ul>
  93.  *      <li><b>Module </b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/AnalyticsCore.md">Analytics Core Module</a></li>
  94.  *      <li><b>Library</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/FixedIncomeAnalyticsLibrary.md">Fixed Income Analytics Library</a></li>
  95.  *      <li><b>Project</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/sample/README.md">Sample</a></li>
  96.  *      <li><b>Package</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/sample/fixfloat/README.md">Fix Float Swap Analytics</a></li>
  97.  *  </ul>
  98.  * <br><br>
  99.  *
  100.  * @author Lakshmi Krishnamurthy
  101.  */

  102. public class CustomFixFloatSwap {

  103.     /*
  104.      * Construct the Array of Deposit Instruments from the given set of parameters
  105.      *
  106.      *      USE WITH CARE: This sample ignores errors and does not handle exceptions.
  107.      */

  108.     private static final SingleStreamComponent[] DepositInstrumentsFromMaturityDays (
  109.         final JulianDate dtEffective,
  110.         final String strCurrency,
  111.         final String strFloaterTenor,
  112.         final int[] aiDay)
  113.         throws Exception
  114.     {
  115.         SingleStreamComponent[] aDeposit = new SingleStreamComponent[aiDay.length];

  116.         ComposableFloatingUnitSetting cfus = new ComposableFloatingUnitSetting (
  117.             strFloaterTenor,
  118.             CompositePeriodBuilder.EDGE_DATE_SEQUENCE_SINGLE,
  119.             null,
  120.             ForwardLabel.Create (
  121.                 strCurrency,
  122.                 strFloaterTenor
  123.             ),
  124.             CompositePeriodBuilder.REFERENCE_PERIOD_IN_ADVANCE,
  125.             0.
  126.         );

  127.         CompositePeriodSetting cps = new CompositePeriodSetting (
  128.             Helper.TenorToFreq (strFloaterTenor),
  129.             strFloaterTenor,
  130.             strCurrency,
  131.             null,
  132.             1.,
  133.             null,
  134.             null,
  135.             null,
  136.             null
  137.         );

  138.         CashSettleParams csp = new CashSettleParams (
  139.             0,
  140.             strCurrency,
  141.             0
  142.         );

  143.         for (int i = 0; i < aiDay.length; ++i) {
  144.             aDeposit[i] = new SingleStreamComponent (
  145.                 "DEPOSIT_" + aiDay[i],
  146.                 new Stream (
  147.                     CompositePeriodBuilder.FloatingCompositeUnit (
  148.                         CompositePeriodBuilder.EdgePair (
  149.                             dtEffective,
  150.                             dtEffective.addBusDays (
  151.                                 aiDay[i],
  152.                                 strCurrency
  153.                             )
  154.                         ),
  155.                         cps,
  156.                         cfus
  157.                     )
  158.                 ),
  159.                 csp
  160.             );

  161.             aDeposit[i].setPrimaryCode (aiDay[i] + "D");
  162.         }

  163.         return aDeposit;
  164.     }
  165.    
  166.     private static final FixFloatComponent CustomIRS (
  167.         final JulianDate dtEffective,
  168.         final String strCurrency,
  169.         final JulianDate dtMaturity,
  170.         final String strFixedDayCount,
  171.         final double dblFixedCoupon,
  172.         final String strFixedTenor,
  173.         final String strFloaterComposableTenor,
  174.         final String strFloaterCompositeTenor,
  175.         final double dblNotional)
  176.         throws Exception
  177.     {
  178.         List<Integer> lsFixedStreamEdgeDate = CompositePeriodBuilder.BackwardEdgeDates (
  179.             dtEffective,
  180.             dtMaturity,
  181.             strFixedTenor,
  182.             new DateAdjustParams (
  183.                 Convention.DATE_ROLL_FOLLOWING,
  184.                 0,
  185.                 strCurrency
  186.             ),
  187.             CompositePeriodBuilder.SHORT_STUB
  188.         );

  189.         List<Integer> lsFloatingStreamEdgeDate = CompositePeriodBuilder.BackwardEdgeDates (
  190.             dtEffective,
  191.             dtMaturity,
  192.             strFloaterCompositeTenor,
  193.             new DateAdjustParams (
  194.                 Convention.DATE_ROLL_FOLLOWING,
  195.                 0,
  196.                 strCurrency
  197.             ),
  198.             CompositePeriodBuilder.SHORT_STUB
  199.         );

  200.         return CustomIRS (
  201.             dtEffective,
  202.             strCurrency,
  203.             lsFixedStreamEdgeDate,
  204.             lsFloatingStreamEdgeDate,
  205.             strFixedDayCount,
  206.             dblFixedCoupon,
  207.             strFixedTenor,
  208.             strFloaterComposableTenor,
  209.             strFloaterCompositeTenor,
  210.             dblNotional
  211.         );      
  212.     }
  213.    
  214.     private static final FixFloatComponent CustomIRS (
  215.         final JulianDate dtEffective,
  216.         final String strCurrency,
  217.         final String strMaturityTenor,
  218.         final String strFixedDayCount,
  219.         final double dblFixedCoupon,
  220.         final String strFixedTenor,
  221.         final String strFloaterComposableTenor,
  222.         final String strFloaterCompositeTenor,
  223.         final double dblNotional)
  224.         throws Exception
  225.     {
  226.         List<Integer> lsFixedStreamEdgeDate = CompositePeriodBuilder.RegularEdgeDates (
  227.             dtEffective,
  228.             strFixedTenor,
  229.             strMaturityTenor,
  230.             null
  231.         );

  232.         List<Integer> lsFloatingStreamEdgeDate = CompositePeriodBuilder.RegularEdgeDates (
  233.             dtEffective,
  234.             strFloaterComposableTenor,
  235.             strMaturityTenor,
  236.             null
  237.         );

  238.         return CustomIRS (
  239.             dtEffective,
  240.             strCurrency,
  241.             lsFixedStreamEdgeDate,
  242.             lsFloatingStreamEdgeDate,
  243.             strFixedDayCount,
  244.             dblFixedCoupon,
  245.             strFixedTenor,
  246.             strFloaterComposableTenor,
  247.             strFloaterCompositeTenor,
  248.             dblNotional
  249.         );      
  250.     }

  251.     /*
  252.      * Construct the Custom Fix-Float Instrument from the given set of parameters
  253.      *
  254.      *      USE WITH CARE: This sample ignores errors and does not handle exceptions.
  255.      */

  256.     private static final FixFloatComponent CustomIRS (
  257.         final JulianDate dtEffective,
  258.         final String strCurrency,
  259.         List<Integer> lsFixedStreamEdgeDate,
  260.         List<Integer> lsFloatingStreamEdgeDate,
  261.         final String strFixedDayCount,
  262.         final double dblFixedCoupon,
  263.         final String strFixedTenor,
  264.         final String strFloaterComposableTenor,
  265.         final String strFloaterCompositeTenor,
  266.         final double dblNotional)
  267.         throws Exception
  268.     {
  269.         int iFixedFreq = Helper.TenorToFreq (strFixedTenor);

  270.         UnitCouponAccrualSetting ucasFixed = new UnitCouponAccrualSetting (
  271.             iFixedFreq,
  272.             strFixedDayCount,
  273.             false,
  274.             strFixedDayCount,
  275.             false,
  276.             strCurrency,
  277.             false,
  278.             CompositePeriodBuilder.ACCRUAL_COMPOUNDING_RULE_GEOMETRIC
  279.         );

  280.         ComposableFloatingUnitSetting cfusFloating = new ComposableFloatingUnitSetting (
  281.             strFloaterComposableTenor,
  282.             CompositePeriodBuilder.EDGE_DATE_SEQUENCE_REGULAR,
  283.             new DateAdjustParams (
  284.                 Convention.DATE_ROLL_FOLLOWING,
  285.                 0,
  286.                 strCurrency
  287.             ),
  288.             ForwardLabel.Create (
  289.                 strCurrency,
  290.                 strFloaterComposableTenor
  291.             ),
  292.             CompositePeriodBuilder.REFERENCE_PERIOD_IN_ADVANCE,
  293.             0.
  294.         );

  295.         ComposableFixedUnitSetting cfusFixed = new ComposableFixedUnitSetting (
  296.             strFixedTenor,
  297.             CompositePeriodBuilder.EDGE_DATE_SEQUENCE_REGULAR,
  298.             new DateAdjustParams (
  299.                 Convention.DATE_ROLL_FOLLOWING,
  300.                 0,
  301.                 strCurrency
  302.             ),
  303.             dblFixedCoupon,
  304.             0.,
  305.             strCurrency
  306.         );

  307.         int iFloaterFreq = Helper.TenorToFreq (strFloaterCompositeTenor);

  308.         CompositePeriodSetting cpsFloating = new CompositePeriodSetting (
  309.             iFloaterFreq,
  310.             strFloaterCompositeTenor,
  311.             strCurrency,
  312.             null,
  313.             -1. * dblNotional,
  314.             null,
  315.             null,
  316.             null,
  317.             null
  318.         );

  319.         CompositePeriodSetting cpsFixed = new CompositePeriodSetting (
  320.             iFixedFreq,
  321.             strFixedTenor,
  322.             strCurrency,
  323.             null,
  324.             1. * dblNotional,
  325.             null,
  326.             null,
  327.             null,
  328.             null
  329.         );

  330.         Stream floatingStream = new Stream (
  331.             CompositePeriodBuilder.FloatingCompositeUnit (
  332.                 lsFloatingStreamEdgeDate,
  333.                 cpsFloating,
  334.                 cfusFloating
  335.             )
  336.         );

  337.         Stream fixedStream = new Stream (
  338.             CompositePeriodBuilder.FixedCompositeUnit (
  339.                 lsFixedStreamEdgeDate,
  340.                 cpsFixed,
  341.                 ucasFixed,
  342.                 cfusFixed
  343.             )
  344.         );

  345.         FixFloatComponent irs = new FixFloatComponent (
  346.             fixedStream,
  347.             floatingStream,
  348.             null
  349.         );

  350.         return irs;
  351.     }

  352.     /*
  353.      * Construct the Array of Swap Instruments from the given set of parameters
  354.      *
  355.      *      USE WITH CARE: This sample ignores errors and does not handle exceptions.
  356.      */

  357.     private static final FixFloatComponent[] SwapInstrumentsFromMaturityTenor (
  358.         final JulianDate dtEffective,
  359.         final String strCurrency,
  360.         final String strFixedDayCount,
  361.         final double dblFixedCoupon,
  362.         final String strFixedTenor,
  363.         final String strFloaterComposableTenor,
  364.         final String strFloaterCompositeTenor,
  365.         final String[] astrMaturityTenor)
  366.         throws Exception
  367.     {
  368.         FixFloatComponent[] aIRS = new FixFloatComponent[astrMaturityTenor.length];

  369.         for (int i = 0; i < astrMaturityTenor.length; ++i) {
  370.             FixFloatComponent irs = CustomIRS(
  371.                     dtEffective,
  372.                     strCurrency,
  373.                     astrMaturityTenor[i],
  374.                     strFixedDayCount,
  375.                     dblFixedCoupon,
  376.                     strFixedTenor,
  377.                     strFloaterComposableTenor,
  378.                     strFloaterCompositeTenor,
  379.                     1.
  380.                     );      
  381.             irs.setPrimaryCode ("IRS." + astrMaturityTenor[i] + "." + strCurrency);

  382.             aIRS[i] = irs;
  383.         }
  384.        
  385.         return aIRS;
  386.     }

  387.     /*
  388.      * This sample demonstrates discount curve calibration and input instrument calibration quote recovery.
  389.      *  It shows the following:
  390.      *  - Construct the Array of Cash/Swap Instruments and their Quotes from the given set of parameters.
  391.      *  - Construct the Cash/Swap Instrument Set Stretch Builder.
  392.      *  - Set up the Linear Curve Calibrator using the following parameters:
  393.      *      - Cubic Exponential Mixture Basis Spline Set
  394.      *      - Ck = 2, Segment Curvature Penalty = 2
  395.      *      - Quadratic Rational Shape Controller
  396.      *      - Natural Boundary Setting
  397.      *  - Construct the Shape Preserving Discount Curve by applying the linear curve calibrator to the array
  398.      *      of Cash and Swap Stretches.
  399.      *  - Cross-Comparison of the Cash/Swap Calibration Instrument "Rate" metric across the different curve
  400.      *      construction methodologies.
  401.      *
  402.      *      USE WITH CARE: This sample ignores errors and does not handle exceptions.
  403.      */

  404.     private static final void CustomDiscountCurveBuilderSample (
  405.         final JulianDate dtSpot,
  406.         final String strCurrency)
  407.         throws Exception
  408.     {
  409.         /*
  410.          * Construct the Array of Deposit Instruments and their Quotes from the given set of parameters
  411.          */

  412.         String strFloaterTenor = "3M";

  413.         SingleStreamComponent[] aDepositComp = DepositInstrumentsFromMaturityDays (
  414.             dtSpot,
  415.             strCurrency,
  416.             strFloaterTenor,
  417.             new int[] {
  418.                 1, 2, 7, 14, 30, 60
  419.             }
  420.         );

  421.         double[] adblDepositQuote = new double[] {
  422.             0.0013, 0.0017, 0.0017, 0.0018, 0.0020, 0.0023
  423.         };

  424.         /*
  425.          * Construct the Deposit Instrument Set Stretch Builder
  426.          */

  427.         LatentStateStretchSpec depositStretch = LatentStateStretchBuilder.ForwardFundingStretchSpec (
  428.             "DEPOSIT",
  429.             aDepositComp,
  430.             "ForwardRate",
  431.             adblDepositQuote
  432.         );

  433.         /*
  434.          * Construct the Array of EDF Instruments and their Quotes from the given set of parameters
  435.          */

  436.         SingleStreamComponent[] aEDFComp = SingleStreamComponentBuilder.ForwardRateFuturesPack (
  437.             dtSpot,
  438.             8,
  439.             strCurrency
  440.         );

  441.         double[] adblEDFQuote = new double[] {
  442.             0.0027, 0.0032, 0.0041, 0.0054, 0.0077, 0.0104, 0.0134, 0.0160
  443.         };

  444.         /*
  445.          * Construct the EDF Instrument Set Stretch Builder
  446.          */

  447.         LatentStateStretchSpec edfStretch = LatentStateStretchBuilder.ForwardFundingStretchSpec (
  448.             "EDF",
  449.             aEDFComp,
  450.             "ForwardRate",
  451.             adblEDFQuote
  452.         );

  453.         /*
  454.          * Construct the Array of Swap Instruments and their Quotes from the given set of parameters
  455.          */

  456.         String strFixedDayCount = "Act/360";
  457.         double dblFixedCoupon = 0.01;
  458.         String strFixedTenor = "6M";
  459.         String strFloaterComposableTenor = "6M";
  460.         String strFloaterCompositeTenor = "6M";

  461.         FixFloatComponent[] aSwapInAdvance = SwapInstrumentsFromMaturityTenor (
  462.             dtSpot,
  463.             strCurrency,
  464.             strFixedDayCount,
  465.             dblFixedCoupon,
  466.             strFixedTenor,
  467.             strFloaterComposableTenor,
  468.             strFloaterCompositeTenor,
  469.             new java.lang.String[] {
  470.                 "4Y", "5Y", "6Y", "7Y", "8Y", "9Y", "10Y", "11Y", "12Y", "15Y", "20Y", "25Y", "30Y", "40Y", "50Y"
  471.             }
  472.         );

  473.         double[] adblSwapQuote = new double[] {
  474.             0.0166, 0.0206, 0.0241, 0.0269, 0.0292, 0.0311, 0.0326, 0.0340, 0.0351, 0.0375, 0.0393, 0.0402, 0.0407, 0.0409, 0.0409
  475.         };

  476.         /*
  477.          * Construct the Swap Instrument Set Stretch Builder
  478.          */

  479.         LatentStateStretchSpec swapStretch = LatentStateStretchBuilder.ForwardFundingStretchSpec (
  480.             "SWAP",
  481.             aSwapInAdvance,
  482.             "SwapRate",
  483.             adblSwapQuote
  484.         );

  485.         LatentStateStretchSpec[] aStretchSpec = new LatentStateStretchSpec[] {
  486.             depositStretch,
  487.             edfStretch,
  488.             swapStretch
  489.         };

  490.         /*
  491.          * Set up the Linear Curve Calibrator using the following parameters:
  492.          *  - Cubic Exponential Mixture Basis Spline Set
  493.          *  - Ck = 2, Segment Curvature Penalty = 2
  494.          *  - Quadratic Rational Shape Controller
  495.          *  - Natural Boundary Setting
  496.          */

  497.         LinearLatentStateCalibrator lcc = new LinearLatentStateCalibrator (
  498.             new SegmentCustomBuilderControl (
  499.                 MultiSegmentSequenceBuilder.BASIS_SPLINE_POLYNOMIAL,
  500.                 new PolynomialFunctionSetParams (4),
  501.                 SegmentInelasticDesignControl.Create (
  502.                     2,
  503.                     2
  504.                 ),
  505.                 new ResponseScalingShapeControl (
  506.                     true,
  507.                     new QuadraticRationalShapeControl (0.)
  508.                 ),
  509.                 null
  510.             ),
  511.             BoundarySettings.NaturalStandard(),
  512.             MultiSegmentSequence.CALIBRATE,
  513.             null,
  514.             null
  515.         );

  516.         ValuationParams valParams = new ValuationParams (
  517.             dtSpot,
  518.             dtSpot,
  519.             strCurrency
  520.         );

  521.         /*
  522.          * Construct the Shape Preserving Discount Curve by applying the linear curve calibrator to the array
  523.          *  of Deposit, Futures, and Swap Stretches.
  524.          */

  525.         MergedDiscountForwardCurve dc = ScenarioDiscountCurveBuilder.ShapePreservingDFBuild (
  526.             strCurrency,
  527.             lcc,
  528.             aStretchSpec,
  529.             valParams,
  530.             null,
  531.             null,
  532.             null,
  533.             1.
  534.         );

  535.         CurveSurfaceQuoteContainer csqs = MarketParamsBuilder.Create (
  536.             dc,
  537.             null,
  538.             null,
  539.             null,
  540.             null,
  541.             null,
  542.             null
  543.         );

  544.         System.out.println ("\n\t-------------------------------------------------------------------------------\n");

  545.         JulianDate dtCustomEffective = dtSpot.addTenor ("1Y");

  546.         JulianDate dtCustomMaturity = dtSpot.addTenor ("11Y");

  547.         String strCustomFixedDayCount = "Act/360";
  548.         double dblCustomFixedCoupon = 0.01;
  549.         String strCustomFixedTenor = "6M";
  550.         String strCustomFloaterComposableTenor = "6M";
  551.         String strCustomFloaterCompositeTenor = "6M";
  552.         double dblCustomNotional = 1.0e6;

  553.         FixFloatComponent ffcSwap = CustomIRS (
  554.             dtCustomEffective,
  555.             strCurrency,
  556.             dtCustomMaturity,
  557.             strCustomFixedDayCount,
  558.             dblCustomFixedCoupon,
  559.             strCustomFixedTenor,
  560.             strCustomFloaterComposableTenor,
  561.             strCustomFloaterCompositeTenor,
  562.             dblCustomNotional
  563.         );

  564.         Map<String, Double> mapSwap = ffcSwap.value (
  565.             new ValuationParams (
  566.                 dtSpot,
  567.                 dtSpot,
  568.                 strCurrency
  569.             ),
  570.             null,
  571.             csqs,
  572.             null
  573.         );

  574.         for (Map.Entry<String, Double> me : mapSwap.entrySet())
  575.             System.out.println ("\t" + me.getKey() + " => " + FormatUtil.FormatDouble (me.getValue(), 1, 8, 1.) + " |");

  576.         System.out.println ("\t-------------------------------------------------------------------------------");
  577.     }

  578.     public static final void main (
  579.         final String[] astrArgs)
  580.         throws Exception
  581.     {
  582.         /*
  583.          * Initialize the Credit Analytics Library
  584.          */

  585.         EnvManager.InitEnv ("");

  586.         JulianDate dtToday = DateUtil.Today().addTenor ("0D");

  587.         String strCurrency = "USD";

  588.         CustomDiscountCurveBuilderSample (
  589.             dtToday,
  590.             strCurrency
  591.         );

  592.         EnvManager.TerminateEnv();
  593.     }
  594. }