Skip to content

Commit

Permalink
More docstring polish
Browse files Browse the repository at this point in the history
  • Loading branch information
miohtama committed Sep 4, 2024
1 parent a6f5f16 commit 54b7b4e
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions eth_defi/token_analysis/tokensniffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,8 @@ def fetch_token_info(self, chain_id: int, address: str | HexAddress) -> TokenSni
class CachedTokenSniffer(TokenSniffer):
"""Add file-system based cache for TokenSniffer API.
- See :py:class:`TokenSniffer` class for details
- Use SQLite DB as a key-value cache backend
- No cache expiration
Expand All @@ -478,17 +480,17 @@ class CachedTokenSniffer(TokenSniffer):
db_file = Path(cache_path) / "tokensniffer.sqlite"
sniffer = CachedTokenSniffer(
db_file,
TOKENSNIFFER_API_KEY,
db_file,
TOKENSNIFFER_API_KEY,
)
ticker = make_full_ticker(pair_metadata[pair_id])
address = pair_metadata[pair_id]["base_token_address"]
sniffed_data = sniffer.fetch_token_info(chain_id.value, address)
if not is_tradeable_token(sniffed_data, tokensniffer_threshold):
score = sniffed_data["score"]
print(f"WARN: Skipping pair {ticker} as the TokenSniffer score {score} is below our risk threshold")
continue
if not is_tradeable_token(sniffed_data, risk_score_threshold=tokensniffer_threshold):
score = sniffed_data["score"]
print(f"WARN: Skipping pair {ticker} as the TokenSniffer score {score} is below our risk threshold")
continue
"""

Expand Down

0 comments on commit 54b7b4e

Please sign in to comment.