-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
GDAX price too precise #427
Comments
Hi, @anandanand84 ! Thank you for opening this issue! I will take a look into it asap. |
This isn't really wrong, because whenever we encounter 400, it means we had a HTTP error, which is a Network Error, not any other type of logic error. What other type of error would you suggest for HTTP 400?
We are currently reworking the error handling system, and it will allow to redefine the error handling for all exchanges. |
@kroitor Anything above 3XX is errors and 4XX errors are basically client errors and in particular 400 is consider an bad request data from the client and it doesn't necessarily mean it is a network error and it is definitely not caused by the information in possible reasons invalid API keys, bad or old nonce, exchange is down or offline, on maintenance, DDoS protection, rate-limiting. I would say 400 is bad request. |
In the terms of the library, there's no Bad Request error, so, of the errors left, we aligned the NetworkError to stand for any error that is related to a bad HTTP status code. In other words, if I asked you, what other type of error should we assign to it, what would you suggest it should be (of currently existing types, without adding a new one)? |
InvalidOrder |
@anandanand84 InvalidOrder for all 400 codes? Or for GDAX only? 400 may not be related to an order at all. |
@kroitor I mean it depends right, if 400 comes from exchange during openOrders request then you cannot say it as InvalidOrder, it is invalidrequest for open orders. |
I would recommend b124f57#diff-9453f5a8dee427abd6a1b4a0aed6a819R458 fix. Because there is a whole bunch of errors here is another one for instance "size must be greater than zero (0.00000000)", May be I am wrong when you ask what 400 corresponds to you in your scenario it should be ExchangeError and let the user handle the exchange error and not InvalidOrder. |
@anandanand84 the GDAX should now return InvalidOrder for that error starting from 1.9.293. See: bcaebcd As for the other exchanges and cases – we're still unifying it (in progress). Let us know if you have any other questions or difficulties with it. Thx again for your feedback. Cheers! |
@anandanand84 sorry, there's a small problem on Travis uploading to PyPI, it will be there shortly. |
Below error is thrown as Network error, but actual error should be Invalid Order.
gdax POST https://api.gdax.com/orders 400 Bad Request {"message":"price too precise (309.9557461094684)"} (possible reasons: invalid API keys, bad or old nonce, exchange is down or offline, on maintenance, DDoS protection, rate-limiting)"
Also currently there is no way to parse the exchange response, make sure always add the exchange response at first or at last of the message so parsing of the exchange response is possible.
Here https://github.com/ccxt/ccxt/blob/master/ccxt.js#L688 400 is considered Network error which is wrong, 400 is bad request and it can be caused for any type of invalid input.
The text was updated successfully, but these errors were encountered: