GeminiAdapters { public static Map<CurrencyPair, Fee> AdaptDynamicTradingFees( GeminiTrailingVolumeResponse volumeResponse, List<CurrencyPair> currencyPairs) { Map<CurrencyPair, Fee> result = new Hashtable<>(); BigDecimal bpsToFraction = BigDecimal.ONE.divide(BigDecimal.ONE.scaleByPowerOfTen(4), 4, RoundingMode.HALF_EVEN); Fee feeAcrossCurrencies = new Fee( volumeResponse.apiMakerFeeBPS.multiply(bpsToFraction), volumeResponse.apiTakerFeeBPS.multiply(bpsToFraction)); for (CurrencyPair currencyPair : currencyPairs) { result.put(currencyPair, feeAcrossCurrencies); } return result; } private  GeminiAdapters(); static List<CurrencyPair> adaptCurrencyPairs(Collection<String> GeminiSymbol); static CurrencyPair adaptCurrencyPair(String symbol); static String adaptCurrencyPair(CurrencyPair pair); static OrderBook adaptOrderBook(GeminiDepth btceDepth, CurrencyPair currencyPair); static OrdersContainer adaptOrders(
      GeminiLevel[] GeminiLevels, CurrencyPair currencyPair, OrderType orderType); static Order adaptOrder(GeminiOrderStatusResponse geminiOrderStatusResponse); static LimitOrder adaptOrder(
      BigDecimal amount,
      BigDecimal price,
      CurrencyPair currencyPair,
      OrderType orderType,
      Date timestamp); static List<FixedRateLoanOrder> adaptFixedRateLoanOrders(
      GeminiLendLevel[] orders, String currency, String orderType, String id); static FixedRateLoanOrder adaptFixedRateLoanOrder(
      String currency,
      BigDecimal amount,
      int dayPeriod,
      String direction,
      String id,
      BigDecimal rate); static List<FloatingRateLoanOrder> adaptFloatingRateLoanOrders(
      GeminiLendLevel[] orders, String currency, String orderType, String id); static FloatingRateLoanOrder adaptFloatingRateLoanOrder(
      String currency,
      BigDecimal amount,
      int dayPeriod,
      String direction,
      String id,
      BigDecimal rate); static Trade adaptTrade(GeminiTrade trade, CurrencyPair currencyPair); static Trades adaptTrades(GeminiTrade[] trades, CurrencyPair currencyPair); static Ticker adaptTicker(GeminiTicker GeminiTicker, CurrencyPair currencyPair); static Wallet adaptWallet(GeminiBalancesResponse[] response); static OpenOrders adaptOrders(GeminiOrderStatusResponse[] activeOrders); static UserTrades adaptTradeHistory(GeminiTradeResponse[] trades, String symbol); static ExchangeMetaData adaptMetaData(
      List<CurrencyPair> currencyPairs, ExchangeMetaData metaData); static Map<CurrencyPair, Fee> AdaptDynamicTradingFees(
      GeminiTrailingVolumeResponse volumeResponse, List<CurrencyPair> currencyPairs); static FundingRecord adapt(GeminiTransfer transfer); static final Logger log; }
@Test public void testAdaptDynamicTradingFees() throws IOException { InputStream is = GeminiAdaptersTest.class.getResourceAsStream( "/org/knowm/xchange/gemini/v1/account/example-notionalvolume.json"); ObjectMapper mapper = new ObjectMapper(); GeminiTrailingVolumeResponse trailingVolumeResp = mapper.readValue(is, GeminiTrailingVolumeResponse.class); List<CurrencyPair> fakeSupportedCurrencyPairs = new ArrayList<CurrencyPair>( Arrays.asList(CurrencyPair.BTC_USD, CurrencyPair.BTC_LTC, CurrencyPair.LTC_XRP)); Map<CurrencyPair, Fee> dynamicFees = GeminiAdapters.AdaptDynamicTradingFees(trailingVolumeResp, fakeSupportedCurrencyPairs); assertThat(dynamicFees.size()).isEqualTo(fakeSupportedCurrencyPairs.size()); for (CurrencyPair pair : fakeSupportedCurrencyPairs) { assertThat(dynamicFees.get(pair).getMakerFee()).isEqualTo(new BigDecimal("0.0035")); assertThat(dynamicFees.get(pair).getTakerFee()).isEqualTo(new BigDecimal("0.0010")); } }