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

Regarding buysells ("side") in Unified trade history #410

Closed
LRonHubs opened this issue Oct 27, 2017 · 5 comments
Closed

Regarding buysells ("side") in Unified trade history #410

LRonHubs opened this issue Oct 27, 2017 · 5 comments
Assignees

Comments

@LRonHubs
Copy link

LRonHubs commented Oct 27, 2017

Kroitor you are an impressive human. i have been writing a similar lib for only 6 exchanges over the past 3 months and would love to help with the websocket stuff in the future if you'd like that. One thing I've found is that it's useful to have both orderbooks, trades, and "orderbook changes" (add, updates, removes), errors, and resets, as available endpoints.

I was wondering what you thought of the "side" parameter in the public trade APIs for each coin.
For example, GDAX has the following listed for their buy/sell trade history:

buy side indicates a down-tick because the maker was a buy order and their order was removed. Conversely, sell side indicates an up-tick.

On the other hand, Gemini seems to list them the other way:

  • buy means that an ask was removed from the book by an incoming buy order.* sell means that a bid was removed from the book by an incoming sell order. * auction indicates a bulk trade from an auction.

Thus a "buy" on Gemini is considered a "sell" on Gdax, messing up a Unified API that doesn't take this into consideration. As someone who has spent some time making the exact same thing as you, I feel your frustration with tedious differences like this.

I noticed in the docs you have listed:
'side': 'buy', // direction of the trade, 'buy' or 'sell'

Which is a little ambiguous.

I was just wondering whether CCXT has taken into account these buysell paramter differences between the exchanges.

@LRonHubs LRonHubs changed the title Regarding buysells in Unified trade history Regarding buysells ("side") in Unified trade history Oct 27, 2017
@kroitor kroitor self-assigned this Oct 27, 2017
@LRonHubs
Copy link
Author

LRonHubs commented Oct 27, 2017

rather than reading API docs (which often don't specify this), I suppose a simple way to test which exchanges were oddities would be to run a GET request during a period of relative stability to the Unified Trade API for a set of pairs. Then, you'd calculate the the average price for "sells" and the average price for "buys" on each exchange from the response.

If the average price for "sells" is lower, this indicates "sells" are a downtick on this exchange, similar to Gemini. If the average price for "buys" is lower, this indicates "buys" are a downtick, similar to Gdax.

@kroitor
Copy link
Member

kroitor commented Oct 27, 2017

Hi! Thx for the feedback!

I was just wondering whether CCXT has taken into account these buysell paramter differences between the exchanges.

This is currently a work in progress and we think that the side of the trade should indicate the taker order side. So, pay attention to that, because we don't have it unified completely yet, namely, the order API (including the trades) is still under development. There may be bugs and inconsistencies here and there, because, yes, those little differences are overwhelming. We will be happy if you report all inconsistencies that you find, and this way we will find and fix them completely. We will be even happier if you submit your contributions to the library, PRs are welcome. Fixing those types of inconsistencies is most of the time very straightforward, just make sure to read the CONTRIBUTING doc in the root of this repo. As with any public library, users are free to submit their contributions, this is what a library really means, many authors. So, the answer to your questions is: YES, but NO :) We are working on it, be careful, pay attention and report bugs, plz.

Let me know if the above answered your question, please. I'd close this for now. And I'll fix the difference of GDAX vs Gemini. Btw, thanks for the testing method suggestion as well, appreciate your involvement! If you find any particular inconsistency feel free to reopen this issue or open another one, or just ask your questions here if you have more.

@LRonHubs
Copy link
Author

Thanks. It appears Gdax is the exception to the 6 exchanges I'm looking at.

@kroitor
Copy link
Member

kroitor commented Oct 27, 2017

@LRonHubs I'll fix it very soon and will update you on this. Thx again for your help!

@kroitor
Copy link
Member

kroitor commented Oct 27, 2017

It was fixed for GDAX in 1.9.278, don't forget to update. Thx for your participation once again! Cheers!

dicaprio

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