tzurbaev / bittrex-orderbook-manager

Bittrex.com orderbook manager
MIT License
5 stars 1 forks source link

top of book feature #1

Open pabx06 opened 5 years ago

pabx06 commented 5 years ago

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...

tzurbaev commented 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:

if (item.rate > this.lowestBidsRate) {
    this.emit('lowestRateUpdated', { side: 'bids', rate: item.rate})
    this.lowestBidsRate = item.rate
}
pabx06 commented 5 years ago

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