gazbert / bxbot

A simple Bitcoin trading bot written in Java.
MIT License
779 stars 275 forks source link

Bug in GDAX Exchange adapter #44

Closed Gondee closed 7 years ago

Gondee commented 7 years ago

On canceling an order, the adapter looks for the payload to equal OK. Line 283 - GDAX Exchange Adapter It should be looking for the ReasonPhrase, as I have corrected below. :) if (response.getReasonPhrase().equalsIgnoreCase("OK")) { return true; } else { final String errorMsg = "Failed to cancel order on exchange. Details: " + response; LOG.error(errorMsg); return false; }

I'm not too familiar with patching other peoples projects on Github, so not really sure where to start with that. Im going to look into it for next time! Anyway, the fix is above! :)

gazbert commented 7 years ago

Good spot Josh, nice one. The adapter code was out of date. GDAX now return the cancelled orderId in the payload instead of 'OK'. Code fixed and integration tests pass. Also running on GDAX now and cancelling fine.

If you fancy a go at fixing code next time, just send a PR in... check out the https://github.com/gazbert/bxbot/blob/master/CONTRIBUTING.md link - it's dead easy, and you'll become a contributor to the project :-)

gazbert commented 7 years ago

Released.