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

fetch_trades reply structure across exchanges #417

Closed
vonpupp opened this issue Oct 29, 2017 · 9 comments
Closed

fetch_trades reply structure across exchanges #417

vonpupp opened this issue Oct 29, 2017 · 9 comments
Assignees

Comments

@vonpupp
Copy link
Contributor

vonpupp commented Oct 29, 2017

Hi again Kroitor,

I have noticed that when calling the fetch_trades method the result doesn't have the same structure across exchanges:

In [1]: import ccxt
   ...: print(ccxt.bittrex().fetch_trades('BTC/USDT')[0])
{'id': '21765375', 'info': {'Id': 21765375, 'TimeStamp': '2017-10-29T17:55:37.15', 'Quantity': 0.16484899, 'Price': 5968.58810856, 'Total': 983.91572142, 'FillType': 'PARTIAL_FILL', 'OrderType': 'SELL'}, 'timestamp': 1509299737000, 'datetime': '2017-10-29T17:55:37.000Z', 'symbol': 'BTC/USDT', 'type': 'limit', 'side': 'sell', 'price': 5968.58810856, 'amount': 0.16484899}
                                                                                                                                                                         
In [2]: import ccxt
   ...: print(ccxt.gdax().fetch_trades('BTC/USD')[0])                                                                                                                                                           
{'time': '2017-10-29T17:56:01.703Z', 'trade_id': 22715331, 'price': '5961.83000000', 'size': '0.00000167', 'side': 'sell'}

When I switch the exchange I am having an exception due to the different hashes (camelcase vs. lowercase). Is this intentional? I guess ccxt does not process the response, but return it in raw, right?

@kroitor kroitor self-assigned this Oct 29, 2017
@kroitor
Copy link
Member

kroitor commented Oct 29, 2017

Hi, @vonpupp! Thanks for opening this issue. Looks like GDAX is not parsing the trade result. It will be fixed in 5-10 minutes. Stay tuned!

kroitor added a commit that referenced this issue Oct 29, 2017
@vonpupp
Copy link
Contributor Author

vonpupp commented Oct 29, 2017

Cool, thank you very much for being so responsive. That is just awesome! Kudos.

@kroitor
Copy link
Member

kroitor commented Oct 29, 2017

It was fixed in 1.9.284+. Don't forget to update it. Thx!

@vonpupp
Copy link
Contributor Author

vonpupp commented Oct 29, 2017

Great, thanks a lot! I will give it a try and if needed provide some feedback. If you are into algo-trading/bots I would love to share some ideas with you in the future and keep in touch. We are apparently into similar stuff :)

@vonpupp
Copy link
Contributor Author

vonpupp commented Oct 29, 2017

Is it ok for the data within the info hash section to be different between exchanges, right?

@kroitor
Copy link
Member

kroitor commented Oct 29, 2017

@vonpupp , yes, the info field contains a raw response from the exchange, untouched, non-parsed, non-converted, as is (just in case you need something from there). The other fields contain the same info, but parsed into a unified common format (all recognized fields are parsed).

@vonpupp
Copy link
Contributor Author

vonpupp commented Oct 29, 2017

Great. Thanks!

@kroitor
Copy link
Member

kroitor commented Oct 29, 2017

You're welcome! The format and fields recognized for trades are described here: https://github.com/ccxt/ccxt/wiki/Manual#trades-orders-executions-transactions

@vonpupp
Copy link
Contributor Author

vonpupp commented Oct 29, 2017

Awesome, I saw that a while ago and forgot about it. That helped me out thanks!

academe-01 pushed a commit to academe-01/ccxt that referenced this issue Oct 2, 2022
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

2 participants