public static UserTrades adaptTradeHistory(HitbtcOwnTrade[] tradeHistoryRaw) {
List<UserTrade> trades = new ArrayList<UserTrade>(tradeHistoryRaw.length);
for (int i = 0; i < tradeHistoryRaw.length; i++) {
HitbtcOwnTrade t = tradeHistoryRaw[i];
OrderType type = t.getSide().equals("buy") ? OrderType.BID : OrderType.ASK;
String base = t.getSymbol().substring(0, 3);
String counter = t.getSymbol().substring(3, 6);
UserTrade trade = new UserTrade(type, t.getExecQuantity().divide(LOT_MULTIPLIER), new CurrencyPair(base, counter), t.getExecPrice(), new Date(t.getTimestamp()), t.getClientOrderId(),
Long.toString(t.getOriginalOrderId()), t.getFee(), counter);
trades.add(trade);
}
return new UserTrades(trades, TradeSortType.SortByID);