Closed and1player closed 6 years ago
Maybe I wrong, but if I look at the code around getOrderBook method I see possibly performance bottleneck in MinMaxPriorityQueueUtils class that sorting the list of bid and ask levels every time. I'm just testing GDAX (orderbook snapshot has more then 8k bids!) and Bitfinex market data implementation for exchange-stream. In my case I'm using simply TreeMap. The TreeMap is always sorted according to the natural ordering of its keys. Therefore it's not necessarily sort all bids and asks of the orderbook again when it receives "modify event" and it's still running real-time.
Thank you for your help. I understand what you say. But Below code is not provides array data. Orderbook is same too.
StreamingExchange exchange = StreamingExchangeFactory.INSTANCE.createExchange(PoloniexStreamingExchange.class.getName());
exchange.connect().blockingAwait();
exchange.getStreamingMarketDataService().getTrades(CurrencyPair.BTC_USD).subscribe(trade -> {
System.out.println("TRADE: {}" + trade);
}, throwable -> LOG.error("ERROR in getting trades: ", throwable));
Ok, I've rewritten poloniex streaming by using api v2 (the version what it is used on their webpage, wss://api2.poloniex.com). You can try/test it if you want from my fork (branch poloniex) Poloniex2. I'd like to prepare PR of this new version but it depends on "live" PR (https://github.com/bitrich-info/xchange-stream/pull/22). Therefore the code can be changed in the near future. Let me know your feedback if you are going to test it. :)
The PR #26
@and1player Is it fixed with v2 api?
Closed for no response.
I use xchange-stream lib for Polonix websocket. It's works! But that provides too old Orderboox and Trade data.
For example I have received 30. OCT Trade Data as ETH/BTC. How can i fix it?