Skip to content

Commit

Permalink
Fixes issue 1786 (askmike#1886)
Browse files Browse the repository at this point in the history
* Only round price to precision, not amount. That can round 0.05XBT to 0 and cause an error.
  • Loading branch information
Huvudfoting authored and askmike committed Feb 9, 2018
1 parent fe069c4 commit b366e81
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions exchanges/kraken.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,7 @@ Trader.prototype.roundAmount = function(amount) {
};

Trader.prototype.addOrder = function(tradeType, amount, price, callback) {
amount = this.roundAmount(amount);
price = this.roundAmount(price); // but the link talks about rounding price... And I had the bug
price = this.roundAmount(price); // only round price, not amount

log.debug('[kraken.js] (addOrder)', tradeType.toUpperCase(), amount, this.asset, '@', price, this.currency);

Expand Down

0 comments on commit b366e81

Please sign in to comment.