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

Commit

Permalink
fix exchange response key (#990)
Browse files Browse the repository at this point in the history
  • Loading branch information
leonzinger authored and DeviaVir committed Dec 27, 2017
1 parent 0f43dbc commit 70e7bbc
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions extensions/exchanges/kraken/exchange.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,15 @@ module.exports = function container(get, set, clear) {
if (assetsToFix.indexOf(asset) >= 0 && currency.length > 3) {
currency = currency.substring(1)
}
return asset + currency;
return `X${asset}X${currency}`
}

function retry(method, args, error) {
let timeout, errorMsg
if (error.message.match(/API:Rate limit exceeded/)) {
var timeout = 10000
timeout = 10000
} else {
var timeout = 150
timeout = 150
}

// silence common timeout errors
Expand Down

2 comments on commit 70e7bbc

@tiagosiebler
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This broke kraken backfills @leonzinger. I've tried 3 variations to get XRP-EUR data:

$ ./zenbot.sh backfill --days=5 kraken.XXRP-ZEUR

Trades error:
Error: Kraken API returned error: Query:Unknown asset pair
    at Request._callback (/Users/tsiebler/Documents/Projects/Financial/CryptoCurrency/Automation/zenbot-master/node_modules/kraken-api/kraken.js:155:34)
    at Request.self.callback (/Users/tsiebler/Documents/Projects/Financial/CryptoCurrency/Automation/zenbot-master/node_modules/request/request.js:186:22)
    at emitTwo (events.js:126:13)
    at Request.emit (events.js:214:7)
    at Request.<anonymous> (/Users/tsiebler/Documents/Projects/Financial/CryptoCurrency/Automation/zenbot-master/node_modules/request/request.js:1060:10)
    at emitOne (events.js:116:13)
    at Request.emit (events.js:211:7)
    at IncomingMessage.<anonymous> (/Users/tsiebler/Documents/Projects/Financial/CryptoCurrency/Automation/zenbot-master/node_modules/request/request.js:980:12)
    at Object.onceWrapper (events.js:313:30)
    at emitNone (events.js:111:20)
    at IncomingMessage.emit (events.js:208:7)
    at endReadableNT (_stream_readable.js:1056:12)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)

getTrades() returned no trades, --start may be too remotely in the past.

$ ./zenbot.sh backfill --days=10 kraken.XXRP-XEUR

Trades error:
Error: Kraken API returned error: Query:Unknown asset pair
    at Request._callback (/Users/tsiebler/Documents/Projects/Financial/CryptoCurrency/Automation/zenbot-master/node_modules/kraken-api/kraken.js:155:34)
    at Request.self.callback (/Users/tsiebler/Documents/Projects/Financial/CryptoCurrency/Automation/zenbot-master/node_modules/request/request.js:186:22)
    at emitTwo (events.js:126:13)
    at Request.emit (events.js:214:7)
    at Request.<anonymous> (/Users/tsiebler/Documents/Projects/Financial/CryptoCurrency/Automation/zenbot-master/node_modules/request/request.js:1060:10)
    at emitOne (events.js:116:13)
    at Request.emit (events.js:211:7)
    at IncomingMessage.<anonymous> (/Users/tsiebler/Documents/Projects/Financial/CryptoCurrency/Automation/zenbot-master/node_modules/request/request.js:980:12)
    at Object.onceWrapper (events.js:313:30)
    at emitNone (events.js:111:20)
    at IncomingMessage.emit (events.js:208:7)
    at endReadableNT (_stream_readable.js:1056:12)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)

getTrades() returned no trades, --start may be too remotely in the past.

$ ./zenbot.sh backfill --days=10 kraken.XRP-EUR

Trades error:
Error: Kraken API returned error: Query:Unknown asset pair
    at Request._callback (/Users/tsiebler/Documents/Projects/Financial/CryptoCurrency/Automation/zenbot-master/node_modules/kraken-api/kraken.js:155:34)
    at Request.self.callback (/Users/tsiebler/Documents/Projects/Financial/CryptoCurrency/Automation/zenbot-master/node_modules/request/request.js:186:22)
    at emitTwo (events.js:126:13)
    at Request.emit (events.js:214:7)
    at Request.<anonymous> (/Users/tsiebler/Documents/Projects/Financial/CryptoCurrency/Automation/zenbot-master/node_modules/request/request.js:1060:10)
    at emitOne (events.js:116:13)
    at Request.emit (events.js:211:7)
    at IncomingMessage.<anonymous> (/Users/tsiebler/Documents/Projects/Financial/CryptoCurrency/Automation/zenbot-master/node_modules/request/request.js:980:12)
    at Object.onceWrapper (events.js:313:30)
    at emitNone (events.js:111:20)
    at IncomingMessage.emit (events.js:208:7)
    at endReadableNT (_stream_readable.js:1056:12)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)

getTrades() returned no trades, --start may be too remotely in the past.

Is the syntax different now for kraken? This also contradicts the output from the list-selectors command:

$ ./zenbot.sh list-selectors | grep kraken | grep XRP
  kraken.XXRP-XXBT   (XRP/XBT)
  kraken.XXRP-ZEUR   (XRP/EUR)
  kraken.XXRP-ZUSD   (XRP/USD)

@tiagosiebler
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I can tell, this shouldn't assume the prefix is always X for the currency. Not sure about the asset.

Please sign in to comment.