-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathrobopump.py
More file actions
56 lines (46 loc) · 1.88 KB
/
robopump.py
File metadata and controls
56 lines (46 loc) · 1.88 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import os
import requests
import time
from dotenv import load_dotenv
load_dotenv()
PUBLIC_KEY = os.getenv("SOLANA_PUBLIC")
PRIVATE_KEY = os.getenv("SOLANA_PRIVATE")
VALOR_ENTRADA = 0.0005 # 0.50 SOL em valor
LUCRO_MINIMO = 1.0 # 100% (dobrar)
INTERVALO_CHECAGEM = 10 # segundos
def fetch_tokens():
try:
r = requests.get("https://pump.fun/api/markets/live")
if r.status_code == 200:
return r.json()
except Exception as e:
print("Erro ao buscar tokens:", e)
return []
def calcula_score(token):
volume = float(token.get("volumeUsd24h", 0))
variacao = float(token.get("priceChangePercent", 0))
holders = int(token.get("holderCount", 0))
score = (volume / 10000) * 40 + variacao * 2 + holders * 0.5
return score
def comprar_token(token):
print(f"🔥 COMPRANDO {token['name']} com {VALOR_ENTRADA} SOL")
print(f"📈 Volume: {token.get('volumeUsd24h')} | Holders: {token.get('holderCount')} | % Pump: {token.get('priceChangePercent')}")
# Aqui você implementaria chamada real para comprar usando SDK (Jupiter ou Pump.fun API)
# Exemplo: client.send_transaction(...)
# 🚧 Esta parte depende da integração futura com transações reais Solana
def monitorar_venda(token):
print(f"⏳ Monitorando {token['name']} para venda com lucro de +{int(LUCRO_MINIMO*100)}%...")
# Aqui você integraria com API de preço e executaria venda quando atingir lucro
def main():
print("🤖 Robô sniper Pump.fun (modo real/simulado) iniciado.")
while True:
tokens = fetch_tokens()
for token in tokens:
score = calcula_score(token)
variacao = float(token.get("priceChangePercent", 0))
if score > 85 and variacao > 5:
comprar_token(token)
monitorar_venda(token)
time.sleep(INTERVALO_CHECAGEM)
if __name__ == "__main__":
main()