cut the list to top x

This commit is contained in:
Stefano Ariestasia 2024-01-07 23:22:58 +09:00
parent 70cc2942d7
commit 2eb3b73a93

View File

@ -108,12 +108,22 @@ class MarketCapFilter(IPairList):
per_page='250', page='1', sparkline='false',
locale='en')
if data:
pairs_data = []
marketcap_list = []
for row in data:
pairs_data.append(row['symbol'])
marketcap_list.append(row['symbol'])
if len(marketcap_list) > 0:
self._marketcap_cache['marketcap'] = marketcap_list
can_filter = True
if can_filter:
filtered_pairlist = []
top_marketcap = marketcap_list[:self._max_rank:]
logger.info(top_marketcap)
logger.info(len(top_marketcap))
# for pair in pairlist:
if len(pairs_data) > 0:
logger.info(pairs_data)
self._marketcap_cache['marketcap'] = pairs_data
return pairlist