class IgIndexResponseParser {

  public static InstrumentInfo createInstrumentInfo(String json) throws IOException {
    checkNotNull(json);
    JsonNode jsonNode = checkNotNull((new ObjectMapper()).readTree(json));

    JsonNode instrumentNode = checkNotNull(jsonNode.get(TAG_INSTRUMENT));
    String instrumentId = getInstrumentIdByEpic(instrumentNode.get(TAG_EPIC).asText());
    String instrumentName = instrumentNode.get(TAG_NAME).asText();
    InstrumentType instrumentType = getInstrumentTypeByText(instrumentNode.get(TAG_TYPE).asText());
    String expiry = checkNotNullOrEmpty(instrumentNode.get(TAG_EXPIRY).asText());

    JsonNode snapshotNode = checkNotNull(jsonNode.get(TAG_SNAPSHOT));
    int scalingFactor = snapshotNode.get(TAG_SCALING_FACTOR).asInt();

    return new InstrumentInfo(instrumentId, instrumentName, instrumentType, scalingFactor, expiry);
  }

}