code: public static Trade adaptTrade(
        CoingiUserTransaction tx, CurrencyPair currencyPair, int timeScale) {
  
      OrderType orderType = tx.getType() == 0 ? OrderType.BID : OrderType.ASK;
      final String tradeId = tx.getId();
      Date date =
          DateUtils.fromMillisUtc(
              tx.getTimestamp()
                  * timeScale); // polled order books provide a timestamp in seconds, stream in ms
      return new Trade(orderType, tx.getBaseAmount(), currencyPair, tx.getPrice(), date, tradeId);
    }
docs: Adapts a Transaction to a Trade Object
  
  @param tx The Coingi transaction
  @param currencyPair (e.g. BTC/USD)
  @param timeScale polled order books provide a timestamp in seconds, stream in ms
  @return The XChange Trade