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

Kraken: Rate limiting for backfilling and warning instead of error on API retries #216

Closed
wants to merge 30 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
586bb69
Add kraken support
May 26, 2017
2a28d62
Fixing some misplaced variables
nibzo1 May 27, 2017
92b8bc3
Merge pull request #1 from nibzo1/feat/kraken
Alexandre-io May 27, 2017
c1646c6
fix trade time
Alexandre-io May 27, 2017
13ae46f
better error handling
Alexandre-io May 28, 2017
5e9f49a
Fix getOrder && trade
Alexandre-io May 28, 2017
ba274c5
Added default config options, fix trade and error reporting
May 28, 2017
287f27b
Merge branch 'feat/kraken' into feat/kraken
crubb May 28, 2017
d46cdae
Remove debug
Alexandre-io May 28, 2017
d914037
Merge branch 'feat/kraken' into feat/kraken
Alexandre-io May 28, 2017
0fb0790
Merge pull request #2 from crubb/feat/kraken
Alexandre-io May 28, 2017
47693ab
Remove retries
May 28, 2017
5bfa8cc
- getOrders now working & reporting closed orders properly
May 29, 2017
2f637c4
Merge pull request #3 from crubb/feat/kraken
Alexandre-io May 29, 2017
ad55946
More error handling for recoverable/reconnect errors and trade
crubb May 29, 2017
841fb51
Merge pull request #4 from crubb/feat/kraken
Alexandre-io May 30, 2017
d6367e4
Fix errors matching
Alexandre-io May 30, 2017
75a4a62
Fix retry
Alexandre-io May 30, 2017
813c86e
More verbose retries (we need to eliminate them! ;))
crubb May 30, 2017
4b7dbc3
Merge with timeout of 2.5s
crubb May 30, 2017
1bbde4a
Adjust to an earlier upstream change
crubb May 31, 2017
2e39f93
Merge https://github.com/carlos8f/zenbot into feat/kraken
crubb May 31, 2017
d2975e6
Longer retries when hitting API rate limit and retry() also for getTr…
crubb May 31, 2017
9965103
Borrowed order caching from extensions/poloniex/
crubb May 31, 2017
1dd61ef
It's min_size: 0.01 and not min_total...
crubb May 31, 2017
4bbf666
update-products.sh for min_size
crubb May 31, 2017
a90a12f
Added logic for post only orders (handled differently by Kraken), add…
crubb Jun 3, 2017
e851647
Removed more ;
crubb Jun 3, 2017
32edc75
Merge https://github.com/carlos8f/zenbot into feat/kraken
crubb Jun 3, 2017
6632c7e
Kraken: Rate limiting for backfilling and warning instead of error on…
crubb Jun 3, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion commands/backfill.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,11 @@ module.exports = function container (get, set, clear) {
console.log('\ndownload complete!\n')
process.exit(0)
}
setImmediate(getNext)
if (exchange.backfillRateLimit) {
setTimeout(getNext, exchange.backfillRateLimit)
} else {
setImmediate(getNext)
}
})
})
}
Expand Down
4 changes: 3 additions & 1 deletion extensions/kraken/exchange.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ module.exports = function container(get, set, clear) {
var timeout = 2500
}

console.error(('\nKraken API error - unable to call ' + method + ' (' + error + '), retrying in ' + timeout / 1000 + 's').red)
console.warn(('\nKraken API warning - unable to call ' + method + ' (' + error + '), retrying in ' + timeout / 1000 + 's').yellow)
setTimeout(function () {
exchange[method].apply(exchange, args)
}, timeout)
Expand All @@ -50,6 +50,8 @@ module.exports = function container(get, set, clear) {
name: 'kraken',
historyScan: 'forward',
makerFee: 0.16,
// The limit for the public API is not document, 1750 ms between getTrades in backfilling seems to do the trick to omit warning messages.
backfillRateLimit: 1750,

getProducts: function () {
return require('./products.json')
Expand Down