Пример #1
0
        public virtual void test_simpleMeasures()
        {
            DsfTradeCalculationFunction <DsfTrade> function = DsfTradeCalculationFunction.TRADE;
            ScenarioMarketData        md                 = marketData();
            RatesProvider             provider           = RATES_LOOKUP.ratesProvider(md.scenario(0));
            DiscountingDsfTradePricer pricer             = DiscountingDsfTradePricer.DEFAULT;
            double              expectedPrice            = pricer.price(RTRADE, provider);
            CurrencyAmount      expectedPv               = pricer.presentValue(RTRADE, provider, REF_PRICE);
            MultiCurrencyAmount expectedCurrencyExposure = pricer.currencyExposure(RTRADE, provider, REF_PRICE);

            ISet <Measure> measures = ImmutableSet.of(Measures.UNIT_PRICE, Measures.PRESENT_VALUE, Measures.CURRENCY_EXPOSURE, Measures.RESOLVED_TARGET);

            assertThat(function.calculate(TRADE, measures, PARAMS, md, REF_DATA)).containsEntry(Measures.UNIT_PRICE, Result.success(DoubleScenarioArray.of(ImmutableList.of(expectedPrice)))).containsEntry(Measures.PRESENT_VALUE, Result.success(CurrencyScenarioArray.of(ImmutableList.of(expectedPv)))).containsEntry(Measures.CURRENCY_EXPOSURE, Result.success(MultiCurrencyScenarioArray.of(ImmutableList.of(expectedCurrencyExposure)))).containsEntry(Measures.RESOLVED_TARGET, Result.success(RTRADE));
        }
Пример #2
0
        public virtual void test_simpleMeasures()
        {
            FxVanillaOptionTradeCalculationFunction function = new FxVanillaOptionTradeCalculationFunction();
            ScenarioMarketData md                               = marketData();
            RatesProvider      provider                         = RATES_LOOKUP.ratesProvider(md.scenario(0));
            BlackFxVanillaOptionTradePricer pricer              = BlackFxVanillaOptionTradePricer.DEFAULT;
            MultiCurrencyAmount             expectedPv          = pricer.presentValue(RTRADE, provider, VOLS);
            MultiCurrencyAmount             expectedCurrencyExp = pricer.currencyExposure(RTRADE, provider, VOLS);
            CurrencyAmount expectedCash                         = pricer.currentCash(RTRADE, VAL_DATE);

            ISet <Measure> measures = ImmutableSet.of(Measures.PRESENT_VALUE, Measures.PAR_SPREAD, Measures.CURRENCY_EXPOSURE, Measures.CURRENT_CASH, Measures.RESOLVED_TARGET);

            assertThat(function.calculate(TRADE, measures, PARAMS, md, REF_DATA)).containsEntry(Measures.PRESENT_VALUE, Result.success(MultiCurrencyScenarioArray.of(ImmutableList.of(expectedPv)))).containsEntry(Measures.CURRENCY_EXPOSURE, Result.success(MultiCurrencyScenarioArray.of(ImmutableList.of(expectedCurrencyExp)))).containsEntry(Measures.CURRENT_CASH, Result.success(CurrencyScenarioArray.of(ImmutableList.of(expectedCash)))).containsEntry(Measures.RESOLVED_TARGET, Result.success(RTRADE));
        }
        public virtual void test_simpleMeasures()
        {
            BulletPaymentTradeCalculationFunction function = new BulletPaymentTradeCalculationFunction();
            ScenarioMarketData       md       = marketData();
            RatesProvider            provider = RATES_LOOKUP.ratesProvider(md.scenario(0));
            DiscountingPaymentPricer pricer   = DiscountingPaymentPricer.DEFAULT;
            Payment        payment            = RTRADE.Product.Payment;
            CurrencyAmount expectedPv         = pricer.presentValue(payment, provider);
            CashFlows      expectedCashFlows  = pricer.cashFlows(payment, provider);

            ISet <Measure> measures = ImmutableSet.of(Measures.PRESENT_VALUE, Measures.CASH_FLOWS, Measures.RESOLVED_TARGET);

            assertThat(function.calculate(TRADE, measures, PARAMS, md, REF_DATA)).containsEntry(Measures.PRESENT_VALUE, Result.success(CurrencyScenarioArray.of(ImmutableList.of(expectedPv)))).containsEntry(Measures.CASH_FLOWS, Result.success(ScenarioArray.of(ImmutableList.of(expectedCashFlows)))).containsEntry(Measures.RESOLVED_TARGET, Result.success(RTRADE));
        }
        public virtual void test_simpleMeasures()
        {
            TermDepositTradeCalculationFunction function = new TermDepositTradeCalculationFunction();
            ScenarioMarketData md       = marketData();
            RatesProvider      provider = RATES_LOOKUP.ratesProvider(md.scenario(0));
            DiscountingTermDepositTradePricer pricer     = DiscountingTermDepositTradePricer.DEFAULT;
            CurrencyAmount      expectedPv               = pricer.presentValue(RTRADE, provider);
            double              expectedParRate          = pricer.parRate(RTRADE, provider);
            double              expectedParSpread        = pricer.parSpread(RTRADE, provider);
            MultiCurrencyAmount expectedCurrencyExposure = pricer.currencyExposure(RTRADE, provider);
            CurrencyAmount      expectedCurrentCash      = pricer.currentCash(RTRADE, provider);

            ISet <Measure> measures = ImmutableSet.of(Measures.PRESENT_VALUE, Measures.PAR_RATE, Measures.PAR_SPREAD, Measures.CURRENCY_EXPOSURE, Measures.CURRENT_CASH, Measures.RESOLVED_TARGET);

            assertThat(function.calculate(TRADE, measures, PARAMS, md, REF_DATA)).containsEntry(Measures.PRESENT_VALUE, Result.success(CurrencyScenarioArray.of(ImmutableList.of(expectedPv)))).containsEntry(Measures.PAR_RATE, Result.success(DoubleScenarioArray.of(ImmutableList.of(expectedParRate)))).containsEntry(Measures.PAR_SPREAD, Result.success(DoubleScenarioArray.of(ImmutableList.of(expectedParSpread)))).containsEntry(Measures.CURRENCY_EXPOSURE, Result.success(MultiCurrencyScenarioArray.of(ImmutableList.of(expectedCurrencyExposure)))).containsEntry(Measures.CURRENT_CASH, Result.success(CurrencyScenarioArray.of(ImmutableList.of(expectedCurrentCash)))).containsEntry(Measures.RESOLVED_TARGET, Result.success(RTRADE));
        }
Пример #5
0
        public virtual void test_simpleMeasures()
        {
            OvernightFutureTradeCalculationFunction <OvernightFutureTrade> function = OvernightFutureTradeCalculationFunction.TRADE;
            ScenarioMarketData md                = marketData(FORWARD_CURVE_ID.CurveName);
            RatesProvider      provider          = RATES_LOOKUP.ratesProvider(md.scenario(0));
            double             expectedPrice     = TRADE_PRICER.price(RESOLVED_TRADE, provider);
            CurrencyAmount     expectedPv        = TRADE_PRICER.presentValue(RESOLVED_TRADE, provider, MARKET_PRICE / 100d);
            double             expectedParSpread = TRADE_PRICER.parSpread(RESOLVED_TRADE, provider, MARKET_PRICE / 100d);

            ISet <Measure> measures = ImmutableSet.of(Measures.UNIT_PRICE, Measures.PRESENT_VALUE, Measures.PAR_SPREAD, Measures.RESOLVED_TARGET);

            assertThat(function.calculate(TRADE, measures, PARAMS, md, REF_DATA)).containsEntry(Measures.UNIT_PRICE, Result.success(DoubleScenarioArray.of(ImmutableList.of(expectedPrice)))).containsEntry(Measures.PRESENT_VALUE, Result.success(CurrencyScenarioArray.of(ImmutableList.of(expectedPv)))).containsEntry(Measures.PAR_SPREAD, Result.success(DoubleScenarioArray.of(ImmutableList.of(expectedParSpread)))).containsEntry(Measures.RESOLVED_TARGET, Result.success(RESOLVED_TRADE));
        }
Пример #6
0
        public virtual void test_simpleMeasures()
        {
            CmsTradeCalculationFunction function = new CmsTradeCalculationFunction();
            ScenarioMarketData          md       = marketData();
            RatesProvider provider = RATES_LOOKUP.ratesProvider(md.scenario(0));
            SabrExtrapolationReplicationCmsTradePricer pricer = new SabrExtrapolationReplicationCmsTradePricer(new SabrExtrapolationReplicationCmsProductPricer(new SabrExtrapolationReplicationCmsLegPricer(SabrExtrapolationReplicationCmsPeriodPricer.of(CUT_OFF_STRIKE, MU))));
            ResolvedCmsTrade    resolved   = TRADE.resolve(REF_DATA);
            MultiCurrencyAmount expectedPv = pricer.presentValue(resolved, provider, VOLS);

            ISet <Measure> measures = ImmutableSet.of(Measures.PRESENT_VALUE, Measures.RESOLVED_TARGET);

            assertThat(function.calculate(TRADE, measures, PARAMS, md, REF_DATA)).containsEntry(Measures.PRESENT_VALUE, Result.success(MultiCurrencyScenarioArray.of(ImmutableList.of(expectedPv)))).containsEntry(Measures.RESOLVED_TARGET, Result.success(TRADE.resolve(REF_DATA)));
        }
Пример #7
0
        public virtual void test_simpleMeasures()
        {
            SwaptionTradeCalculationFunction function = new SwaptionTradeCalculationFunction();
            ScenarioMarketData        md         = marketData();
            RatesProvider             provider   = RATES_LOOKUP.ratesProvider(md.scenario(0));
            NormalSwaptionTradePricer pricer     = NormalSwaptionTradePricer.DEFAULT;
            ResolvedSwaptionTrade     resolved   = TRADE.resolve(REF_DATA);
            CurrencyAmount            expectedPv = pricer.presentValue(resolved, provider, NORMAL_VOL_SWAPTION_PROVIDER_USD);

            ISet <Measure> measures = ImmutableSet.of(Measures.PRESENT_VALUE, Measures.RESOLVED_TARGET);

            assertThat(function.calculate(TRADE, measures, PARAMS, md, REF_DATA)).containsEntry(Measures.PRESENT_VALUE, Result.success(CurrencyScenarioArray.of(ImmutableList.of(expectedPv)))).containsEntry(Measures.RESOLVED_TARGET, Result.success(RTRADE));
        }
        public virtual void test_simpleMeasures()
        {
            IborFutureOptionTradeCalculationFunction <IborFutureOptionTrade> function = IborFutureOptionTradeCalculationFunction.TRADE;
            ScenarioMarketData md       = marketData();
            RatesProvider      provider = RATES_LOOKUP.ratesProvider(md.scenario(0));
            NormalIborFutureOptionMarginedTradePricer pricer   = NormalIborFutureOptionMarginedTradePricer.DEFAULT;
            ResolvedIborFutureOptionTrade             resolved = TRADE.resolve(REF_DATA);
            CurrencyAmount expectedPv = pricer.presentValue(resolved, provider, VOL_SIMPLE_MONEY_PRICE, SETTLEMENT_PRICE);

            ISet <Measure> measures = ImmutableSet.of(Measures.PRESENT_VALUE, Measures.RESOLVED_TARGET);

            assertThat(function.calculate(TRADE, measures, PARAMS, md, REF_DATA)).containsEntry(Measures.PRESENT_VALUE, Result.success(CurrencyScenarioArray.of(ImmutableList.of(expectedPv)))).containsEntry(Measures.RESOLVED_TARGET, Result.success(resolved));
        }
        public virtual void test_simpleMeasures()
        {
            IborCapFloorTradeCalculationFunction function = new IborCapFloorTradeCalculationFunction();
            ScenarioMarketData            md         = marketData();
            RatesProvider                 provider   = RATES_LOOKUP.ratesProvider(md.scenario(0));
            NormalIborCapFloorTradePricer pricer     = NormalIborCapFloorTradePricer.DEFAULT;
            MultiCurrencyAmount           expectedPv = pricer.presentValue(RTRADE, provider, VOLS);
            MultiCurrencyAmount           expectedCurrencyExposure = pricer.currencyExposure(RTRADE, provider, VOLS);
            MultiCurrencyAmount           expectedCurrentCash      = pricer.currentCash(RTRADE, provider, VOLS);

            ISet <Measure> measures = ImmutableSet.of(Measures.PRESENT_VALUE, Measures.CURRENCY_EXPOSURE, Measures.CURRENT_CASH);

            assertThat(function.calculate(TRADE, measures, PARAMS, md, REF_DATA)).containsEntry(Measures.PRESENT_VALUE, Result.success(MultiCurrencyScenarioArray.of(ImmutableList.of(expectedPv)))).containsEntry(Measures.CURRENCY_EXPOSURE, Result.success(MultiCurrencyScenarioArray.of(ImmutableList.of(expectedCurrencyExposure)))).containsEntry(Measures.CURRENT_CASH, Result.success(MultiCurrencyScenarioArray.of(ImmutableList.of(expectedCurrentCash))));
        }
        public virtual void test_ratesProvider()
        {
            ImmutableMap <Currency, CurveId> discounts = ImmutableMap.of(USD, CURVE_ID_DSC);
            ImmutableMap <Index, CurveId>    forwards  = ImmutableMap.of(USD_FED_FUND, CURVE_ID_DSC, USD_LIBOR_3M, CURVE_ID_FWD, US_CPI_U, CURVE_ID_FWD);
            RatesMarketDataLookup            test      = RatesMarketDataLookup.of(discounts, forwards);
            LocalDate     valDate       = date(2015, 6, 30);
            Curve         dscCurve      = ConstantCurve.of(Curves.discountFactors(CURVE_ID_DSC.CurveName, ACT_360), 1d);
            Curve         fwdCurve      = ConstantCurve.of(Curves.discountFactors(CURVE_ID_FWD.CurveName, ACT_360), 2d);
            MarketData    md            = ImmutableMarketData.of(valDate, ImmutableMap.of(CURVE_ID_DSC, dscCurve, CURVE_ID_FWD, fwdCurve));
            RatesProvider ratesProvider = test.ratesProvider(md);

            assertEquals(ratesProvider.ValuationDate, valDate);
            assertEquals(ratesProvider.findData(CURVE_ID_DSC.CurveName), dscCurve);
            assertEquals(ratesProvider.findData(CURVE_ID_FWD.CurveName), fwdCurve);
            assertEquals(ratesProvider.findData(CurveName.of("Rubbish")), null);
            assertEquals(ratesProvider.IborIndices, ImmutableSet.of(USD_LIBOR_3M));
            assertEquals(ratesProvider.OvernightIndices, ImmutableSet.of(USD_FED_FUND));
            assertEquals(ratesProvider.PriceIndices, ImmutableSet.of(US_CPI_U));
            assertEquals(ratesProvider.TimeSeriesIndices, ImmutableSet.of());
            // check discount factors
            SimpleDiscountFactors df = (SimpleDiscountFactors)ratesProvider.discountFactors(USD);

            assertEquals(df.Curve.Name, dscCurve.Name);
            assertThrowsIllegalArg(() => ratesProvider.discountFactors(GBP));
            // check Ibor
            DiscountIborIndexRates ibor   = (DiscountIborIndexRates)ratesProvider.iborIndexRates(USD_LIBOR_3M);
            SimpleDiscountFactors  iborDf = (SimpleDiscountFactors)ibor.DiscountFactors;

            assertEquals(iborDf.Curve.Name, fwdCurve.Name);
            assertThrowsIllegalArg(() => ratesProvider.iborIndexRates(GBP_LIBOR_3M));
            // check Overnight
            DiscountOvernightIndexRates on   = (DiscountOvernightIndexRates)ratesProvider.overnightIndexRates(USD_FED_FUND);
            SimpleDiscountFactors       onDf = (SimpleDiscountFactors)on.DiscountFactors;

            assertEquals(onDf.Curve.Name, dscCurve.Name);
            assertThrowsIllegalArg(() => ratesProvider.overnightIndexRates(GBP_SONIA));
            // check price curve must be interpolated
            assertThrowsIllegalArg(() => ratesProvider.priceIndexValues(US_CPI_U));
            // to immutable
            ImmutableRatesProvider expectedImmutable = ImmutableRatesProvider.builder(valDate).fxRateProvider(MarketDataFxRateProvider.of(md)).discountCurve(USD, dscCurve).indexCurve(USD_FED_FUND, dscCurve).indexCurve(USD_LIBOR_3M, fwdCurve).indexCurve(US_CPI_U, fwdCurve).build();

            assertEquals(ratesProvider.toImmutableRatesProvider(), expectedImmutable);
        }
        /// <summary>
        /// Tests calibration a curve containing FRAs and pricing the curve instruments using the curve.
        /// </summary>
        public virtual void roundTripFra()
        {
            InterpolatedNodalCurveDefinition curveDefn = CurveTestUtils.fraCurveDefinition();

//JAVA TO C# CONVERTER TODO TASK: Most Java stream collectors are not converted by Java to C# Converter:
            IList <FraCurveNode> nodes = curveDefn.Nodes.Select(typeof(FraCurveNode).cast).collect(toImmutableList());

//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: java.util.List<com.opengamma.strata.data.MarketDataId<?>> keys = nodes.stream().map(CurveTestUtils::key).collect(toImmutableList());
//JAVA TO C# CONVERTER TODO TASK: Most Java stream collectors are not converted by Java to C# Converter:
            IList <MarketDataId <object> > keys = nodes.Select(CurveTestUtils.key).collect(toImmutableList());
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: java.util.Map<com.opengamma.strata.data.MarketDataId<?>, double> inputData = com.google.common.collect.ImmutableMap.builder<com.opengamma.strata.data.MarketDataId<?>, double>().put(keys.get(0), 0.003).put(keys.get(1), 0.0033).put(keys.get(2), 0.0037).put(keys.get(3), 0.0054).put(keys.get(4), 0.007).put(keys.get(5), 0.0091).put(keys.get(6), 0.0134).build();
            IDictionary <MarketDataId <object>, double> inputData = ImmutableMap.builder <MarketDataId <object>, double>().put(keys[0], 0.003).put(keys[1], 0.0033).put(keys[2], 0.0037).put(keys[3], 0.0054).put(keys[4], 0.007).put(keys[5], 0.0091).put(keys[6], 0.0134).build();

            CurveGroupName   groupName   = CurveGroupName.of("Curve Group");
            CurveName        curveName   = CurveName.of("FRA Curve");
            RatesCurveInputs curveInputs = RatesCurveInputs.of(inputData, DefaultCurveMetadata.of(curveName));

            RatesCurveGroupDefinition groupDefn = RatesCurveGroupDefinition.builder().name(groupName).addCurve(curveDefn, Currency.USD, IborIndices.USD_LIBOR_3M).build();

            RatesCurveGroupMarketDataFunction function = new RatesCurveGroupMarketDataFunction();
            LocalDate          valuationDate           = date(2011, 3, 8);
            ScenarioMarketData inputMarketData         = ImmutableScenarioMarketData.builder(valuationDate).addValue(RatesCurveInputsId.of(groupName, curveName, ObservableSource.NONE), curveInputs).build();
            MarketDataBox <RatesCurveGroup> curveGroup = function.buildCurveGroup(groupDefn, CALIBRATOR, inputMarketData, REF_DATA, ObservableSource.NONE);

            Curve curve = curveGroup.SingleValue.findDiscountCurve(Currency.USD).get();

//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: java.util.Map<com.opengamma.strata.data.MarketDataId<?>, Object> marketDataMap = com.google.common.collect.ImmutableMap.builder<com.opengamma.strata.data.MarketDataId<?>, Object>().putAll(inputData).put(com.opengamma.strata.market.curve.CurveId.of(groupName, curveName), curve).build();
            IDictionary <MarketDataId <object>, object> marketDataMap = ImmutableMap.builder <MarketDataId <object>, object>().putAll(inputData).put(CurveId.of(groupName, curveName), curve).build();

            MarketData            marketData         = ImmutableMarketData.of(valuationDate, marketDataMap);
            TestMarketDataMap     scenarioMarketData = new TestMarketDataMap(valuationDate, marketDataMap, ImmutableMap.of());
            RatesMarketDataLookup lookup             = RatesMarketDataLookup.of(groupDefn);
            RatesProvider         ratesProvider      = lookup.ratesProvider(scenarioMarketData.scenario(0));

            // The PV should be zero for an instrument used to build the curve
            nodes.ForEach(node => checkFraPvIsZero(node, ratesProvider, marketData));
        }
        //-------------------------------------------------------------------------
        public virtual void test_of_map()
        {
            ImmutableMap <Currency, CurveId> discounts = ImmutableMap.of(USD, CURVE_ID_DSC);
            ImmutableMap <Index, CurveId>    forwards  = ImmutableMap.of(USD_LIBOR_3M, CURVE_ID_FWD);
            RatesMarketDataLookup            test      = RatesMarketDataLookup.of(discounts, forwards);

            assertEquals(test.queryType(), typeof(RatesMarketDataLookup));
            assertEquals(test.DiscountCurrencies, ImmutableSet.of(USD));
            assertEquals(test.getDiscountMarketDataIds(USD), ImmutableSet.of(CURVE_ID_DSC));
            assertEquals(test.ForwardIndices, ImmutableSet.of(USD_LIBOR_3M));
            assertEquals(test.getForwardMarketDataIds(USD_LIBOR_3M), ImmutableSet.of(CURVE_ID_FWD));
            assertThrowsIllegalArg(() => test.getDiscountMarketDataIds(GBP));
            assertThrowsIllegalArg(() => test.getForwardMarketDataIds(GBP_LIBOR_3M));
            assertEquals(test.ObservableSource, ObservableSource.NONE);
            assertEquals(test.FxRateLookup, FxRateLookup.ofRates());

            assertEquals(test.requirements(USD), FunctionRequirements.builder().valueRequirements(CURVE_ID_DSC).outputCurrencies(USD).build());
            assertEquals(test.requirements(USD, USD_LIBOR_3M), FunctionRequirements.builder().valueRequirements(CURVE_ID_DSC, CURVE_ID_FWD).timeSeriesRequirements(IndexQuoteId.of(USD_LIBOR_3M)).outputCurrencies(USD).build());
            assertEquals(test.requirements(ImmutableSet.of(USD), ImmutableSet.of(USD_LIBOR_3M)), FunctionRequirements.builder().valueRequirements(CURVE_ID_DSC, CURVE_ID_FWD).timeSeriesRequirements(IndexQuoteId.of(USD_LIBOR_3M)).outputCurrencies(USD).build());
            assertThrowsIllegalArg(() => test.requirements(ImmutableSet.of(USD), ImmutableSet.of(GBP_LIBOR_3M)));

            assertEquals(test.ratesProvider(MOCK_MARKET_DATA), DefaultLookupRatesProvider.of((DefaultRatesMarketDataLookup)test, MOCK_MARKET_DATA));
        }
        public virtual void roundTripFraAndFixedFloatSwap()
        {
            CurveGroupName groupName = CurveGroupName.of("Curve Group");
            InterpolatedNodalCurveDefinition curveDefn = CurveTestUtils.fraSwapCurveDefinition();
            CurveName         curveName = curveDefn.Name;
            IList <CurveNode> nodes     = curveDefn.Nodes;

            RatesCurveGroupDefinition groupDefn = RatesCurveGroupDefinition.builder().name(groupName).addCurve(curveDefn, Currency.USD, IborIndices.USD_LIBOR_3M).build();

            RatesCurveGroupMarketDataFunction function = new RatesCurveGroupMarketDataFunction();
            LocalDate valuationDate = date(2011, 3, 8);

//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: java.util.Map<com.opengamma.strata.data.MarketDataId<?>, double> inputData = com.google.common.collect.ImmutableMap.builder<com.opengamma.strata.data.MarketDataId<?>, double>().put(CurveTestUtils.key(nodes.get(0)), 0.0037).put(CurveTestUtils.key(nodes.get(1)), 0.0054).put(CurveTestUtils.key(nodes.get(2)), 0.005).put(CurveTestUtils.key(nodes.get(3)), 0.0087).put(CurveTestUtils.key(nodes.get(4)), 0.012).build();
            IDictionary <MarketDataId <object>, double> inputData = ImmutableMap.builder <MarketDataId <object>, double>().put(CurveTestUtils.key(nodes[0]), 0.0037).put(CurveTestUtils.key(nodes[1]), 0.0054).put(CurveTestUtils.key(nodes[2]), 0.005).put(CurveTestUtils.key(nodes[3]), 0.0087).put(CurveTestUtils.key(nodes[4]), 0.012).build();

            RatesCurveInputs   curveInputs     = RatesCurveInputs.of(inputData, DefaultCurveMetadata.of(curveName));
            ScenarioMarketData inputMarketData = ImmutableScenarioMarketData.builder(valuationDate).addValue(RatesCurveInputsId.of(groupName, curveName, ObservableSource.NONE), curveInputs).build();

            MarketDataBox <RatesCurveGroup> curveGroup = function.buildCurveGroup(groupDefn, CALIBRATOR, inputMarketData, REF_DATA, ObservableSource.NONE);
            Curve curve = curveGroup.SingleValue.findDiscountCurve(Currency.USD).get();

//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: java.util.Map<com.opengamma.strata.data.MarketDataId<?>, Object> marketDataMap = com.google.common.collect.ImmutableMap.builder<com.opengamma.strata.data.MarketDataId<?>, Object>().putAll(inputData).put(com.opengamma.strata.market.curve.CurveId.of(groupName, curveName), curve).build();
            IDictionary <MarketDataId <object>, object> marketDataMap = ImmutableMap.builder <MarketDataId <object>, object>().putAll(inputData).put(CurveId.of(groupName, curveName), curve).build();
            MarketData            marketData         = ImmutableMarketData.of(valuationDate, marketDataMap);
            TestMarketDataMap     scenarioMarketData = new TestMarketDataMap(valuationDate, marketDataMap, ImmutableMap.of());
            RatesMarketDataLookup lookup             = RatesMarketDataLookup.of(groupDefn);
            RatesProvider         ratesProvider      = lookup.ratesProvider(scenarioMarketData.scenario(0));

            checkFraPvIsZero((FraCurveNode)nodes[0], ratesProvider, marketData);
            checkFraPvIsZero((FraCurveNode)nodes[1], ratesProvider, marketData);
            checkSwapPvIsZero((FixedIborSwapCurveNode)nodes[2], ratesProvider, marketData);
            checkSwapPvIsZero((FixedIborSwapCurveNode)nodes[3], ratesProvider, marketData);
            checkSwapPvIsZero((FixedIborSwapCurveNode)nodes[4], ratesProvider, marketData);
        }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @ImmutableConstructor private DefaultRatesMarketData(RatesMarketDataLookup lookup, com.opengamma.strata.data.MarketData marketData)
        private DefaultRatesMarketData(RatesMarketDataLookup lookup, MarketData marketData)
        {
            this.lookup                = ArgChecker.notNull(lookup, "lookup");
            this.marketData            = ArgChecker.notNull(marketData, "marketData");
            this.ratesProvider_Renamed = lookup.ratesProvider(marketData);
        }