@Override
  public Trades getTrades(CurrencyPair pair, Object... args) throws IOException {
    try {
      Long fromId = tradesArgument(args, 0, Long::valueOf);
      Long startTime = tradesArgument(args, 1, Long::valueOf);
      Long endTime = tradesArgument(args, 2, Long::valueOf);
      Integer limit = tradesArgument(args, 3, Integer::valueOf);
      List<BinanceAggTrades> aggTrades =
          binance.aggTrades(BinanceAdapters.toSymbol(pair), fromId, startTime, endTime, limit);
      List<Trade> trades =
          aggTrades.stream()
              .map(
                  at ->
                      new Trade(
                          BinanceAdapters.convertType(at.buyerMaker),
                          at.quantity,
                          pair,
                          at.price,
                          at.getTimestamp(),
                          Long.toString(at.aggregateTradeId)))
              .collect(Collectors.toList());
      return new Trades(trades, TradeSortType.SortByTimestamp);
    } catch (BinanceException e) {
      throw BinanceErrorAdapter.adapt(e);
    }
  }
@ Override public Trades getTrades ( CurrencyPair pair , Object ... args ) throws IOException { try { Long fromId = tradesArgument ( args , 0 , Long :: valueOf ) ; Long startTime = tradesArgument ( args , 1 , Long :: valueOf ) ; Long endTime = tradesArgument ( args , 2 , Long :: valueOf ) ; Integer limit = tradesArgument ( args , 3 , Integer :: valueOf ) ; List < BinanceAggTrades > aggTrades = binance . aggTrades ( BinanceAdapters . toSymbol ( pair ) , fromId , startTime , endTime , limit ) ; List < Trade > trades = aggTrades . stream ( ) . map ( at -> new Trade ( BinanceAdapters . convertType ( at . buyerMaker ) , at . quantity , pair , at . price , at . getTimestamp ( ) , Long . toString ( at . aggregateTradeId ) ) ) . collect ( Collectors . toList ( ) ) ; return new Trades ( trades , TradeSortType . SortByTimestamp ) ; } catch ( BinanceException e ) { throw BinanceErrorAdapter . adapt ( e ) ; } }
optional parameters provided in the args array:

<ul>
<li>0: Long fromId optional, ID to get aggregate trades from INCLUSIVE.
<li>1: Long startTime optional, Timestamp in ms to get aggregate trades from INCLUSIVE.
<li>2: Long endTime optional, Timestamp in ms to get aggregate trades until INCLUSIVE.
<li>3: Integer limit optional, Default 500; max 500.
</ul>

<p>