class RatesCurveGroupMarketDataFunction implements MarketDataFunction<RatesCurveGroup, RatesCurveGroupId> {

  @Override
  public MarketDataBox<RatesCurveGroup> build(
      RatesCurveGroupId id,
      MarketDataConfig marketDataConfig,
      ScenarioMarketData marketData,
      ReferenceData refData) {

    // create the calibrator, using the configured RootFinderConfig if found
    RootFinderConfig rfc = marketDataConfig.find(RootFinderConfig.class).orElse(RootFinderConfig.standard());
    RatesCurveCalibrator calibrator = RatesCurveCalibrator.of(
        rfc.getAbsoluteTolerance(), rfc.getRelativeTolerance(), rfc.getMaximumSteps(), calibrationMeasures);

    // calibrate
    CurveGroupName groupName = id.getCurveGroupName();
    RatesCurveGroupDefinition configuredDefn = marketDataConfig.get(RatesCurveGroupDefinition.class, groupName);
    return buildCurveGroup(configuredDefn, calibrator, marketData, refData, id.getObservableSource());
  }

  public  RatesCurveGroupMarketDataFunction();
  public  RatesCurveGroupMarketDataFunction(CalibrationMeasures calibrationMeasures);

}