-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtoken_filters.py
More file actions
30 lines (26 loc) · 1.17 KB
/
token_filters.py
File metadata and controls
30 lines (26 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
def check_token(token):
# Ajout de vérifications de structure
if not isinstance(token, dict):
return False
# Protection des accès nested
metrics = token.get('metrics') or {}
security = token.get('security') or {}
dex = token.get('dex') or {}
# Conversion des pourcentages
liquidity_locked = float(security.get('liquidityLockedPercent', 0))
dev_holding = float(security.get('devHoldings', 0))
top10_holding = float(security.get('top10Holdings', 0))
# Nouveau : gestion des types
filters = {
'supply': float(metrics.get('circulatingSupply', 0)) <= 1e9,
'marketcap': float(metrics.get('marketCap', 0)) >= 150000,
'liquidity': float(metrics.get('liquidity', 0)) >= 70000,
'liquidity_locked': liquidity_locked in [99.0, 100.0],
'dev_holding': dev_holding <= 20.0,
'top10_holding': top10_holding <= 35.0,
'marketers': int(metrics.get('marketers', 0)) >= 500,
'holders': int(metrics.get('holders', 0)) >= 200,
'volume': float(metrics.get('volume24h', 0)) >= 200000,
'dex_listed': dex.get('name') == 'DexScreener'
}
return all(filters.values())