use of org.knowm.xchange.ccex.dto.marketdata.CCEXMarket in project XChange by knowm.
the class CCEXAdapters method adaptToExchangeMetaData.
public static ExchangeMetaData adaptToExchangeMetaData(ExchangeMetaData exchangeMetaData, List<CCEXMarket> products) {
Map<CurrencyPair, CurrencyPairMetaData> currencyPairs = new HashMap<>();
Map<CurrencyPair, CurrencyPairMetaData> existingCurrencyPairMetadata = exchangeMetaData.getCurrencyPairs();
Map<Currency, CurrencyMetaData> currencies = new HashMap<>();
for (CCEXMarket product : products) {
BigDecimal minSize = product.getMinTradeSize();
CurrencyPair pair = adaptCurrencyPair(product);
CurrencyPairMetaData existingMetaForPair = existingCurrencyPairMetadata.get(pair);
FeeTier[] existingFeeTiers = null;
if (existingMetaForPair != null) {
existingFeeTiers = existingMetaForPair.getFeeTiers();
}
CurrencyPairMetaData cpmd = new CurrencyPairMetaData(null, minSize, null, 0, existingFeeTiers);
currencyPairs.put(pair, cpmd);
currencies.put(pair.base, null);
currencies.put(pair.counter, null);
}
return new ExchangeMetaData(currencyPairs, currencies, null, null, true);
}
Aggregations