Skip to content

Commit

Permalink
Merging in fix for USDT trading
Browse files Browse the repository at this point in the history
  • Loading branch information
cmroche authored and askmike committed Dec 4, 2017
1 parent 6d6f64c commit d564b89
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions exchanges/kraken.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ var addPrefix = function(value) {

// Some currencies in Kraken don't use the prefix, not clearly documented
var getAssetPair = function(asset, currency) {
if (asset === 'USDT')
return 'USDTZUSD'; // Yet another kraken inconsistency

if (_.contains(assets_without_prefix, asset))
return asset + currency;
else
Expand Down Expand Up @@ -132,12 +135,8 @@ Trader.prototype.getTrades = function(since, callback, descending) {
return this.retry(this.getTrades, args, err, true);
}

var pair = this.pair;
if (this.asset === 'USDT')
pair = 'USDTZUSD'; // Yet another kraken inconsistency

var parsedTrades = [];
_.each(trades.result[pair], function(trade) {
_.each(trades.result[this.pair], function(trade) {
// Even when you supply 'since' you can still get more trades than you asked for, it needs to be filtered
if (_.isNull(startTs) || startTs < moment.unix(trade[2]).valueOf()) {
parsedTrades.push({
Expand Down

0 comments on commit d564b89

Please sign in to comment.