static FixedIborSwapCurveNode fixedIborSwapNode(Tenor tenor, String id) { QuoteKey quoteKey = QuoteKey.of(StandardId.of(TEST_SCHEME, id)); FixedIborSwapTemplate template = FixedIborSwapTemplate.of(Period.ZERO, tenor, SWAP_CONVENTION); return FixedIborSwapCurveNode.of(template, quoteKey); }
public static CurveGroupDefinition config( Period[] dscOisTenors, String[] dscIdValues, Period[] fwd3FraTenors, Period[] fwd3IrsTenors, String[] fwd3IdValues, Period[] fwd6FraTenors, Period[] fwd6IrsTenors, String[] fwd6IdValues) { CurveNode[] dscNodes = new CurveNode[dscOisTenors.length]; for (int i = 0; i < dscOisTenors.length; i++) { dscNodes[i] = FixedOvernightSwapCurveNode.of( FixedOvernightSwapTemplate.of( Period.ZERO, Tenor.of(dscOisTenors[i]), EUR_FIXED_1Y_EONIA_OIS), QuoteKey.of(StandardId.of(SCHEME, dscIdValues[i]))); } CurveNode[] fwd3Nodes = new CurveNode[fwd3IdValues.length]; fwd3Nodes[0] = IborFixingDepositCurveNode.of( IborFixingDepositTemplate.of(EUR_EURIBOR_3M), QuoteKey.of(StandardId.of(SCHEME, fwd3IdValues[0]))); for (int i = 0; i < fwd3FraTenors.length; i++) { fwd3Nodes[i + 1] = FraCurveNode.of( FraTemplate.of(fwd3FraTenors[i], EUR_EURIBOR_3M), QuoteKey.of(StandardId.of(SCHEME, fwd3IdValues[i + 1]))); } for (int i = 0; i < fwd3IrsTenors.length; i++) { fwd3Nodes[i + 1 + fwd3FraTenors.length] = FixedIborSwapCurveNode.of( FixedIborSwapTemplate.of( Period.ZERO, Tenor.of(fwd3IrsTenors[i]), EUR_FIXED_1Y_EURIBOR_3M), QuoteKey.of(StandardId.of(SCHEME, fwd3IdValues[i + 1]))); } CurveNode[] fwd6Nodes = new CurveNode[fwd6IdValues.length]; fwd6Nodes[0] = IborFixingDepositCurveNode.of( IborFixingDepositTemplate.of(EUR_EURIBOR_6M), QuoteKey.of(StandardId.of(SCHEME, fwd6IdValues[0]))); for (int i = 0; i < fwd6FraTenors.length; i++) { fwd6Nodes[i + 1] = FraCurveNode.of( FraTemplate.of(fwd6FraTenors[i], EUR_EURIBOR_6M), QuoteKey.of(StandardId.of(SCHEME, fwd6IdValues[i + 1]))); } for (int i = 0; i < fwd6IrsTenors.length; i++) { fwd6Nodes[i + 1 + fwd6FraTenors.length] = FixedIborSwapCurveNode.of( FixedIborSwapTemplate.of( Period.ZERO, Tenor.of(fwd6IrsTenors[i]), EUR_FIXED_1Y_EURIBOR_6M), QuoteKey.of(StandardId.of(SCHEME, fwd6IdValues[i + 1]))); } InterpolatedNodalCurveDefinition DSC_CURVE_DEFN = InterpolatedNodalCurveDefinition.builder() .name(DSCON_CURVE_NAME) .xValueType(ValueType.YEAR_FRACTION) .yValueType(ValueType.ZERO_RATE) .dayCount(CURVE_DC) .interpolator(INTERPOLATOR_LINEAR) .extrapolatorLeft(EXTRAPOLATOR_FLAT) .extrapolatorRight(EXTRAPOLATOR_FLAT) .nodes(dscNodes) .build(); InterpolatedNodalCurveDefinition FWD3_CURVE_DEFN = InterpolatedNodalCurveDefinition.builder() .name(FWD3_CURVE_NAME) .xValueType(ValueType.YEAR_FRACTION) .yValueType(ValueType.ZERO_RATE) .dayCount(CURVE_DC) .interpolator(INTERPOLATOR_LINEAR) .extrapolatorLeft(EXTRAPOLATOR_FLAT) .extrapolatorRight(EXTRAPOLATOR_FLAT) .nodes(fwd3Nodes) .build(); InterpolatedNodalCurveDefinition FWD6_CURVE_DEFN = InterpolatedNodalCurveDefinition.builder() .name(FWD6_CURVE_NAME) .xValueType(ValueType.YEAR_FRACTION) .yValueType(ValueType.ZERO_RATE) .dayCount(CURVE_DC) .interpolator(INTERPOLATOR_LINEAR) .extrapolatorLeft(EXTRAPOLATOR_FLAT) .extrapolatorRight(EXTRAPOLATOR_FLAT) .nodes(fwd6Nodes) .build(); return CurveGroupDefinition.builder() .name(CURVE_GROUP_NAME) .addCurve(DSC_CURVE_DEFN, EUR, EUR_EONIA) .addForwardCurve(FWD3_CURVE_DEFN, EUR_EURIBOR_3M) .addForwardCurve(FWD6_CURVE_DEFN, EUR_EURIBOR_6M) .build(); }