Open pabx06 opened 5 years ago
Hi, @pabx06!
This package was created for one of my projects that is currently frozen and unfortunately I have no time to provide code updates at this moment.
If you can make PR for requested changes, I would glad to review them and merge.
Some hints:
update
event - raw payload from Bittrex will be it's first argument (see https://github.com/tzurbaev/bittrex-orderbook-manager/blob/master/src/BittrexOrderBook.js#L224);const minBidsRate = Math.min(...Object.keys(orderBook.orders.bids))
const maxBidsRate = Math.min(...Object.keys(orderBook.order.bids))
BittrexOrderBook.addOrder
and emit this new event if something changes:if (item.rate > this.lowestBidsRate) {
this.emit('lowestRateUpdated', { side: 'bids', rate: item.rate})
this.lowestBidsRate = item.rate
}
exactly what i was thinking biggest bid and lowest ask. also would be nice to make the orderbook generic enough to plug it on other exchanges implementations. and swap signalr-client for @discordjs/uws websocket tiny memory footprint
i was wondering how to efficiently get the top line of bids and asks without iteration over all the keys . sinc asks and bis ar stored as one big object instead of an array of object. Also a new event when the top1 of bid/ask change will be helpful too...