question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

fetch_trades reply structure across exchanges

See original GitHub issue

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?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
vonpuppcommented, Oct 29, 2017

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

1reaction
vonpuppcommented, 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 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Exchanges — ccxt 2.4.71 documentation
The ccxt library is a collection of available crypto exchanges or exchange classes. Each class implements the public and private API for a...
Read more >
changes in fetchTrades, fetchMyTrades, fetchOrders ... - GitHub
We support all endpoints for all exchanges out of the box, ... With your syntax fetching how can decompose my Response structure?
Read more >
ccxt Documentation - Read the Docs
Supported Exchanges. The ccxt library currently supports the following 115 cryptocurrency exchange markets and trading APIs:.
Read more >
CCXT for WX.Network - Waves.Exchange
Fetch exchange transactions for the account by trading pair. Parameters and output are the same as the fetchTrades. For now, you can only...
Read more >
ccxt-dev/ccxt - Gitter
Does anyone here maybe knows the answer to the questions I have wrote above? Thanks! ... Is there a way to fetch trades...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found