Simplify resolve_marketcap_pair()

This commit is contained in:
mrpabloyeah
2025-08-11 22:40:49 +02:00
parent e7d9ac2247
commit 761d3f216e

View File

@@ -164,17 +164,17 @@ class MarketCapPairList(IPairList):
markets: list[str],
filtered_pairlist: list[str],
) -> str | None:
if any(p.startswith(test_pair) for p in filtered_pairlist):
if test_pair in filtered_pairlist:
return None
if any(p.startswith(test_pair) for p in pairlist):
if test_pair in pairlist:
return test_pair
if not any(p.startswith(test_pair) for p in markets):
if not test_pair in markets:
for prefix in prefixes:
test_prefix = f"{prefix}{test_pair}"
if any(p.startswith(test_prefix) for p in pairlist):
if test_prefix in pairlist:
return test_prefix
return None