Filter tickers on stake-currency for kraken
This commit is contained in:
parent
9df7014de3
commit
138e867a68
@ -953,7 +953,7 @@ class Exchange:
|
|||||||
raise OperationalException(e) from e
|
raise OperationalException(e) from e
|
||||||
|
|
||||||
@retrier
|
@retrier
|
||||||
def get_tickers(self, cached: bool = False) -> Dict:
|
def get_tickers(self, symbols: List[str] = None, cached: bool = False) -> Dict:
|
||||||
"""
|
"""
|
||||||
:param cached: Allow cached result
|
:param cached: Allow cached result
|
||||||
:return: fetch_tickers result
|
:return: fetch_tickers result
|
||||||
@ -963,7 +963,7 @@ class Exchange:
|
|||||||
if tickers:
|
if tickers:
|
||||||
return tickers
|
return tickers
|
||||||
try:
|
try:
|
||||||
tickers = self._api.fetch_tickers()
|
tickers = self._api.fetch_tickers(symbols)
|
||||||
self._fetch_tickers_cache['fetch_tickers'] = tickers
|
self._fetch_tickers_cache['fetch_tickers'] = tickers
|
||||||
return tickers
|
return tickers
|
||||||
except ccxt.NotSupported as e:
|
except ccxt.NotSupported as e:
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
""" Kraken exchange subclass """
|
""" Kraken exchange subclass """
|
||||||
import logging
|
import logging
|
||||||
from typing import Any, Dict
|
from typing import Any, Dict, List
|
||||||
|
|
||||||
import ccxt
|
import ccxt
|
||||||
|
|
||||||
@ -33,6 +33,12 @@ class Kraken(Exchange):
|
|||||||
return (parent_check and
|
return (parent_check and
|
||||||
market.get('darkpool', False) is False)
|
market.get('darkpool', False) is False)
|
||||||
|
|
||||||
|
def get_tickers(self, symbols: List[str] = None, cached: bool = False) -> Dict:
|
||||||
|
# Only fetch tickers for current stake currency
|
||||||
|
# Otherwise the request for kraken becomes too large.
|
||||||
|
symbols = list(self.get_markets(quote_currencies=[self._config['stake_currency']]))
|
||||||
|
return super().get_tickers(symbols=symbols, cached=cached)
|
||||||
|
|
||||||
@retrier
|
@retrier
|
||||||
def get_balances(self) -> dict:
|
def get_balances(self) -> dict:
|
||||||
if self._config['dry_run']:
|
if self._config['dry_run']:
|
||||||
|
@ -29,12 +29,12 @@ EXCHANGES = {
|
|||||||
'hasQuoteVolume': True,
|
'hasQuoteVolume': True,
|
||||||
'timeframe': '5m',
|
'timeframe': '5m',
|
||||||
},
|
},
|
||||||
# 'kraken': {
|
'kraken': {
|
||||||
# 'pair': 'BTC/USDT',
|
'pair': 'BTC/USDT',
|
||||||
# 'stake_currency': 'USDT',
|
'stake_currency': 'USDT',
|
||||||
# 'hasQuoteVolume': True,
|
'hasQuoteVolume': True,
|
||||||
# 'timeframe': '5m',
|
'timeframe': '5m',
|
||||||
# },
|
},
|
||||||
'ftx': {
|
'ftx': {
|
||||||
'pair': 'BTC/USDT',
|
'pair': 'BTC/USDT',
|
||||||
'stake_currency': 'USDT',
|
'stake_currency': 'USDT',
|
||||||
|
Loading…
Reference in New Issue
Block a user