Skip to content
This repository has been archived by the owner on Feb 16, 2020. It is now read-only.

Commit

Permalink
renew kraken market pairs, fix #318
Browse files Browse the repository at this point in the history
  • Loading branch information
askmike committed Jun 10, 2016
1 parent b7f34d6 commit 780c166
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 27 deletions.
44 changes: 26 additions & 18 deletions exchanges.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,30 +107,38 @@ var exchanges = [
slug: 'kraken',
direct: false,
infinityOrder: false,
currencies: ['XRP', 'EUR', 'KRW', 'USD', 'LTC', 'XVN'],
assets: ['LTC', 'NMC', 'XBT', 'XVN', 'EUR', 'KRW', 'USD'],
// technically not true..
currencies: ['ETH', 'XBT', 'CAD', 'EUR', 'GBP', 'JPY', 'XRP', 'XDG', 'XLM', 'USD'],
assets: ['DAO', 'ETH', 'LTC', 'XBT'],
markets: [
{ pair: ['XRP', 'LTC'], minimalOrder: { amount: 0.01, unit: 'currency' } },
{ pair: ['ETH', 'DAO'], minimalOrder: { amount: 0.01, unit: 'currency' } },
{ pair: ['XBT', 'DAO'], minimalOrder: { amount: 0.01, unit: 'currency' } },
{ pair: ['CAD', 'DAO'], minimalOrder: { amount: 0.01, unit: 'currency' } },
{ pair: ['EUR', 'DAO'], minimalOrder: { amount: 0.01, unit: 'currency' } },
{ pair: ['GBP', 'DAO'], minimalOrder: { amount: 0.01, unit: 'currency' } },
{ pair: ['JPY', 'DAO'], minimalOrder: { amount: 0.01, unit: 'currency' } },
{ pair: ['USD', 'DAO'], minimalOrder: { amount: 0.01, unit: 'currency' } },

{ pair: ['XBT', 'ETH'], minimalOrder: { amount: 0.01, unit: 'currency' } },
{ pair: ['CAD', 'ETH'], minimalOrder: { amount: 0.01, unit: 'currency' } },
{ pair: ['EUR', 'ETH'], minimalOrder: { amount: 0.01, unit: 'currency' } },
{ pair: ['GBP', 'ETH'], minimalOrder: { amount: 0.01, unit: 'currency' } },
{ pair: ['JPY', 'ETH'], minimalOrder: { amount: 0.01, unit: 'currency' } },
{ pair: ['USD', 'ETH'], minimalOrder: { amount: 0.01, unit: 'currency' } },

{ pair: ['CAD', 'LTC'], minimalOrder: { amount: 0.01, unit: 'currency' } },
{ pair: ['EUR', 'LTC'], minimalOrder: { amount: 0.01, unit: 'currency' } },
{ pair: ['KRW', 'LTC'], minimalOrder: { amount: 0.01, unit: 'currency' } },
{ pair: ['USD', 'LTC'], minimalOrder: { amount: 0.01, unit: 'currency' } },
{ pair: ['XRP', 'NMC'], minimalOrder: { amount: 0.01, unit: 'currency' } },
{ pair: ['EUR', 'NMC'], minimalOrder: { amount: 0.01, unit: 'currency' } },
{ pair: ['KRW', 'NMC'], minimalOrder: { amount: 0.01, unit: 'currency' } },
{ pair: ['USD', 'NMC'], minimalOrder: { amount: 0.01, unit: 'currency' } },

{ pair: ['LTC', 'XBT'], minimalOrder: { amount: 0.01, unit: 'currency' } },
{ pair: ['NMC', 'XBT'], minimalOrder: { amount: 0.01, unit: 'currency' } },
{ pair: ['XDG', 'XBT'], minimalOrder: { amount: 0.01, unit: 'currency' } },
{ pair: ['XLM', 'XBT'], minimalOrder: { amount: 0.01, unit: 'currency' } },
{ pair: ['XRP', 'XBT'], minimalOrder: { amount: 0.01, unit: 'currency' } },
{ pair: ['XVN', 'XBT'], minimalOrder: { amount: 0.01, unit: 'currency' } },
{ pair: ['CAD', 'XBT'], minimalOrder: { amount: 0.01, unit: 'currency' } },
{ pair: ['EUR', 'XBT'], minimalOrder: { amount: 0.01, unit: 'currency' } },
{ pair: ['KRW', 'XBT'], minimalOrder: { amount: 0.01, unit: 'currency' } },
{ pair: ['USD', 'XBT'], minimalOrder: { amount: 0.01, unit: 'currency' } },
{ pair: ['XRP', 'XVN'], minimalOrder: { amount: 0.01, unit: 'currency' } },
{ pair: ['XRP', 'EUR'], minimalOrder: { amount: 0.01, unit: 'currency' } },
{ pair: ['XVN', 'EUR'], minimalOrder: { amount: 0.01, unit: 'currency' } },
{ pair: ['XRP', 'KRW'], minimalOrder: { amount: 0.01, unit: 'currency' } },
{ pair: ['XRP', 'USD'], minimalOrder: { amount: 0.01, unit: 'currency' } },
{ pair: ['XVN', 'USD'], minimalOrder: { amount: 0.01, unit: 'currency' } }
{ pair: ['GBP', 'XBT'], minimalOrder: { amount: 0.01, unit: 'currency' } },
{ pair: ['JPY', 'XBT'], minimalOrder: { amount: 0.01, unit: 'currency' } },
{ pair: ['USD', 'XBT'], minimalOrder: { amount: 0.01, unit: 'currency' } }
],
requires: ['key', 'secret'],
providesHistory: false,
Expand Down
26 changes: 17 additions & 9 deletions exchanges/kraken.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,20 @@ var log = require('../core/log');

var crypto_currencies = [
"LTC",
"NMC",
"XBT",
"XVN",
"XRP",
"DAO",
"ETH",
"XDG",
"XLM",
"XRP"
];

var fiat_currencies = [
"EUR",
"KRW",
"USD"
"GBP",
"USD",
"JPY"
];

// Method to check if asset/currency is a crypto currency
Expand Down Expand Up @@ -53,12 +57,16 @@ Trader.prototype.setAssetPair = function() {
var assetPrefix = "X";
var currencyPrefix = "Z";

if (isFiat(this.asset)) {
if (isFiat(this.asset))
assetPrefix = "Z";
}
if (isCrypto(this.currency)) {
else if(isCrypto(this.currency))
assetPrefix = "X";


if (isFiat(this.currency))
currencyPrefix = "Z";
else if(isCrypto(this.currency))
currencyPrefix = "X";
}

this.pair = assetPrefix + this.asset + currencyPrefix + this.currency;
};
Expand Down Expand Up @@ -92,7 +100,7 @@ Trader.prototype.retry = function(method, args, err) {
Trader.prototype.getTrades = function(since, callback, descending) {
var args = _.toArray(arguments);
var process = function(err, trades) {

console.log('trades', trades.result[this.pair].length);
if (err || !trades || trades.length === 0)
return this.retry(this.getTrades, args, err);

Expand Down

0 comments on commit 780c166

Please sign in to comment.