class FxRateMarketDataFunction implements MarketDataFunction<FxRate, FxRateId> {

  @Override
  public MarketDataRequirements requirements(FxRateId id, MarketDataConfig marketDataConfig) {
    FxRateConfig fxRateConfig = marketDataConfig.get(FxRateConfig.class, id.getObservableSource());
    Optional<QuoteId> optional = fxRateConfig.getObservableRateKey(id.getPair());
    return optional.map(key -> MarketDataRequirements.of(key)).orElse(MarketDataRequirements.empty());
  }

}