n0mad01 / node.bittrex.api

No longer maintained
MIT License
183 stars 187 forks source link

Is 'SubscribeToExchangeDeltas' the only function available via websockets? #61

Closed gcoulby closed 7 years ago

gcoulby commented 7 years ago

Are there any functions other than 'SubscribeToExchangeDeltas' that can be accessed via Websockets. I would ideally like to get the data for /public/getmarkethistory as this gives more information regarding the orders.

It would also be good to get data for: /public/getmarketsummaries /public/getticker without having to do lots of queries via the REST API? However, it is more important to get the markethistory via websocket.

dparlevliet commented 7 years ago

Using the responses provided by SubscribeToExchangeDeltas you can gather all of the information to track the candles, ticker, market history and order books. This is how the website does it and this is how they expect us to access that information, too, for now - we don't know if they have plans to change that in the future. See #23 for more information.

I have a bot that keeps track of the candles, tickers and order books for every coin pair on Bittrex using just the Websocket data provided. It takes some work but it's possible.

gcoulby commented 7 years ago

@dparlevliet OK, That is great to know and #23 was valuable information and I can now get updateSummaryState and updateExchangeState. I am using the follow method

_coreHubProxy.On("updateSummaryState", marketJSon =>
                {
                    HandleUpdatedExchangeState(marketJSon);
                }
            );

Are the subscriptions that you talk about (candles, ticker, market history and order books) documented anywhere? Do you know which others there are... I Tried updateMarketState and updateTickerState, but got nowhere.

dparlevliet commented 7 years ago

No - there are no subscriptions candles, ticker, market history or order books - you have to build that functionality yourself using the information provided from the existing socket channels. Everything you want to make can be done using the information provided in #23.

gcoulby commented 7 years ago

I see, I also found this https://bittrex.slack.com/archives/C3ZGRGLAV/p1503970115000185 where gliderman20 shows you how to get the raw data. Which comes in handy. Thanks for the help I feel I understand now. Basically ExchangeDeltas and SummaryDeltas provide all the information then you have extract the ticker data and orderbooks etc from that.

madshargreave commented 7 years ago

@dparlevliet Out of curiosity, how does your bot handle rehydration of data if for example you restart your server?

dparlevliet commented 7 years ago

Every time a new period starts it writes the data to disk. When it starts up it loads the disk data and then downloads the available site data and reconciles the differences. Depending on how long the bot is off there might be gaps for things like the market history but for the candles it's unlikely a gap will occur. While data is loading and reconciliation is taking place all WS data is buffered and then it is replayed on completion.

madshargreave commented 7 years ago

Nice, thanks for the info

jayarjo commented 6 years ago

Could you guys invite me to Bittrex Slack channel? @gcoulby perhaps?