Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible missing data? #137

Closed
jsam opened this issue Jun 12, 2018 · 4 comments
Closed

Possible missing data? #137

jsam opened this issue Jun 12, 2018 · 4 comments

Comments

@jsam
Copy link

jsam commented Jun 12, 2018

I'm trying to get ticker updates across multiple exchanges. In config.json I have enabled those exchanges and the data is streaming in. Now I'm writing the client which can consume those tickers updates and I'm stumbled a bit, cause the records which are getting streamed in do not contain exchange information (from which exchange the ticker update came from). Now, since BTCUSD and BTC_USD tickers are not the same I could build a mapping for those things, but exchanges which I'm currently looking at have the same ticker ID.

I would like to know from which exchange those ticker updates came from. Is there a way of doing this already or we should build this feature?

The second thing I see which is missing is the timestamps. Shouldn't those ticker updates be timestamped when they are read from the exchange?

Thanks

@jsam
Copy link
Author

jsam commented Jun 12, 2018

Ok, scratch that. To answer my own question.

Backend actually does send the exchange event, it's just that there is a bug in tools/websocket_client. In line 183, instead of using WebsocketEventResponse type we should use WebsocketEvent type, cause in that case unmarshal actually works correctly. Before I send PR with a fix, can somebody confirm this?

Also, what's the best practice for timestamping ticker updates?

@thrasher-
Copy link
Collaborator

Hey @jsam, you are correct. If you wish to get exchange ticker/orderbook streamed using the websocket client, you'd want a WebsocketEvent type in for the loop. This way you'll get the exchange info. As for timestamping ticker updates, a solution would be to have a variable in the ticker.Price struct which has a time.Time var and is set to whenever a ticker item is created/updated.

@gloriousCode
Copy link
Collaborator

gloriousCode commented Jun 13, 2018

Hey @jsam I'm already getting the exchange name from the ticker_update event.
So the message from the websocket is structured like:

{
data:any,
exchange:string,
error:any,
event:string
}

Or see my object here. I'm using the exchange property since its not contained within the data property

See here for where I map this object. It's what I use to render the selected exchange/currency here:
image

Timestamps are definitely missing though.

@jsam
Copy link
Author

jsam commented Jun 13, 2018

Thank you very much. I'll send a PR, after work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants