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

Slight differences between Binance.com and Binance-futures #1

Closed
hbizot opened this issue Nov 12, 2019 · 1 comment
Closed

Slight differences between Binance.com and Binance-futures #1

hbizot opened this issue Nov 12, 2019 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@hbizot
Copy link

hbizot commented Nov 12, 2019

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
The response message from a aggTrade stream is slightly different than than that from Binance.com. The resonse I get is:
{"stream":"btcusdt@aggTrade","data":{"e":"aggTrade","E":1573576417345,"a":6292316,"s":"BTCUSDT","p":"8718.19","q":"0.792","f":8414086,"l":8414086,"T":1573576417240,"m":true}}

This key doen't exist for futures:
stream_data['data']['M']

Describe the solution you'd like
A clear and concise description of what you want to happen.

Remove this part in method 'binance_websocket':
'ignore': stream_data['data']['M']

in:
if stream_data['data']['e'] == 'aggTrade':
unicorn_fied_data = {'stream_type': stream_data['stream'],
'event_type': stream_data['data']['e'],
'event_time': stream_data['data']['E'],
'symbol': stream_data['data']['s'],
'aggregate_trade_id': stream_data['data']['a'],
'price': stream_data['data']['p'],
'quantity': stream_data['data']['q'],
'first_trade_id': stream_data['data']['f'],
'last_trade_id': stream_data['data']['l'],
'trade_time': stream_data['data']['T'],
'is_market_maker': stream_data['data']['m'],
--> 'ignore': stream_data['data']['M'] <-- }

since it's not used anyway.

Thanks.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

@hbizot hbizot added the enhancement New feature or request label Nov 12, 2019
@oliver-zehentleitner
Copy link
Member

oliver-zehentleitner commented Nov 12, 2019

I only mention this, because i see your github account is very new.

If you want, you can fork the repository and create a pull request. Its not much more work for you than creating this issue and i am able to merge the code after a review. Your benefit is that you get added to contributors list and maybe its faster pushed to pypi because its less work for me :)

tell me if you want to try it!

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

No branches or pull requests

2 participants