Skip to content

Commit

Permalink
Fix poloniex minimal cost
Browse files Browse the repository at this point in the history
It is currently possible to receive this exception from poloniex:

```
ccxt.base.errors.InvalidOrder: poloniex {"error":"Total must be at least 0.0001."}
```

Inspired by askmike/gekko#2167, and specifically https://github.com/askmike/gekko/pull/2167/files#diff-c212a282e676846ba239680f7a180455R255, I copied the known minimums based on the market quote currency.
  • Loading branch information
miracle2k committed Jun 4, 2018
1 parent e22eba2 commit 53f756e
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion js/poloniex.js
Expand Up @@ -186,6 +186,15 @@ module.exports = class poloniex extends Exchange {
base = this.commonCurrencyCode (base);
quote = this.commonCurrencyCode (quote);
let symbol = base + '/' + quote;
let minimalCost = {
'BTC': 0.0001,
'ETH': 0.0001,
'XMR': 0.0001,
'USDT': 1.0
}[quote];
if (minimalCost === undefined) {
minimalCost == 0.00000000;
};
result.push (this.extend (this.fees['trading'], {
'id': id,
'symbol': symbol,
Expand All @@ -206,7 +215,7 @@ module.exports = class poloniex extends Exchange {
'max': 1000000000,
},
'cost': {
'min': 0.00000000,
'min': minimalCost,
'max': 1000000000,
},
},
Expand Down

0 comments on commit 53f756e

Please sign in to comment.