Skill flagged — suspicious patterns detected

ClawHub Security flagged this skill as suspicious. Review the scan results before using.

Crypto Executor Optimizer

Autonomous optimizer skill for Wesley — reads Binance trading performance every 6 hours, analyzes win rate and strategy metrics, then safely tunes executor.p...

MIT-0 · Free to use, modify, and redistribute. No attribution required.
0 · 227 · 0 current installs · 0 all-time installs
byWesley Armando@georges91560
MIT-0
Security Scan
VirusTotalVirusTotal
Suspicious
View report →
OpenClawOpenClaw
Suspicious
medium confidence
Purpose & Capability
The name/description match what the files implement: analyzing performance and modifying/restarting a trading executor. Required binaries (python3, bash, systemctl) and use of cron are consistent. Minor inconsistency: registry metadata lists no required env vars, while SKILL.md/setup scripts collect and persist BINANCE_API_KEY and BINANCE_API_SECRET during setup (they are needed but not declared in registry).
!
Instruction Scope
The runtime instructions and scripts legitimately read performance files and executor.py and then edit it via regex and restart the service — that is within stated scope. However the skill instructs downloading external code from raw.githubusercontent.com (un-pinned 'main' branch), persists Binance credentials to /workspace/data/bot_config.env, and will source that file when restarting the bot. The apply_optimization.sh modifications use regex replacements which may be brittle and could change unintended lines if executor.py differs. The scripts also instruct pip install with --break-system-packages. These steps expand the attack/accident surface beyond a simple analyzer.
Install Mechanism
There is no formal install spec (instruction-only), but setup scripts download executor.py and an optional oracle from raw.githubusercontent.com. Raw GitHub content is a known host (lower risk than random IPs), but downloads target the 'main' branch (not pinned to a commit/tag) which is insecure. No archive extraction occurs. The scripts also call pip install --break-system-packages which can alter host Python environment on shared systems.
!
Credentials
The skill collects and persists BINANCE_API_KEY and BINANCE_API_SECRET (reasonable for a trading bot), and optionally Telegram tokens. However these credentials are not declared in the registry's required env list (incoherence). The credentials are stored on disk in /workspace/data/bot_config.env and sourced by fallback restart paths — storing and sourcing secrets is functional but high-impact. No unrelated third-party credentials are requested.
Persistence & Privilege
The skill does not force always:true. The SKILL.md requests sudo/systemctl to restart a system service (uses_sudo: true) and will fall back to pkill/nohup if systemd isn't available. Installing a recurring cron (via openclaw cron or system crontab) gives it periodic execution. These privileges are consistent with restarting/automating a trading bot, but combined with network downloads and credential persistence they increase potential blast radius.
What to consider before installing
This skill appears to implement the advertised optimizer, but it carries non-trivial operational risks. Before installing: 1) Audit the remotely downloaded executor.py and optional oracle code and prefer pinning to a specific commit/tag rather than downloading from 'main'. 2) Understand that the setup will persist your BINANCE_API_KEY and BINANCE_API_SECRET to /workspace/data/bot_config.env (chmod 600) — run this only in an isolated environment you control. 3) The skill requires sudo to restart a systemd service (or will pkill/launch the bot), so verify you are comfortable granting that ability on the host. 4) The scripts call pip install --break-system-packages; avoid this on shared hosts or use a virtualenv. 5) The regex-based in-place edits are brittle — review executor.py to ensure patterns match and backups work as intended. 6) Consider running this in a sandbox or dedicated VM, pin external downloads, and test manually before enabling the cron automation.

Like a lobster shell, security has layers — review code before you run it.

Current versionv1.0.3
Download zip
latestvk971p3wzm3ft0bchad18n8gkmh824y2t

License

MIT-0
Free to use, modify, and redistribute. No attribution required.

Runtime requirements

🤖 Clawdis
Binspython3, bash, systemctl

SKILL.md

Crypto Executor Optimizer 🤖

Ce skill permet à Wesley d'optimiser automatiquement le bot de trading crypto-executor toutes les 6 heures.


⚠️ SCOPE & CAPABILITIES

Ce que ce skill fait :

  • ✅ Lit les fichiers de performance (performance_metrics.json, learned_config.json)
  • ✅ Analyse les métriques (win rate, trades/jour, win rate par stratégie)
  • ✅ Décide des nouvelles valeurs pour les paramètres de trading
  • ✅ Modifie executor.py via regex (backup → modify → validate → restart)
  • ✅ Envoie des alertes Telegram sur chaque optimisation
  • [SETUP UNIQUEMENT] Télécharge executor.py et crypto_oracle.py depuis GitHub
  • [SETUP UNIQUEMENT] Persiste les credentials Binance dans /workspace/data/bot_config.env (chmod 600)
  • [SETUP UNIQUEMENT] Installe un cron job toutes les 6h

Ce que ce skill ne fait PAS :

  • ❌ Ne place pas d'ordres directement — mais redémarrer executor.py via systemd/pkill peut reprendre le trading automatiquement
  • ❌ Ne modifie jamais les credentials Binance dans executor.py
  • ❌ Ne modifie jamais les circuit breakers ou stop loss
  • ❌ Ne touche jamais à la structure des classes Python
  • ❌ Ne persiste aucune donnée au-delà de /workspace

🔐 Credentials & Sécurité

Credentials collectés par setup_binance_20euros.sh

VariableRequisUsage
BINANCE_API_KEYOui (setup)Authentification Binance — jamais modifié après setup
BINANCE_API_SECRETOui (setup)Authentification Binance — jamais modifié après setup
TELEGRAM_BOT_TOKENNonNotifications d'optimisation
TELEGRAM_CHAT_IDNonDestination des notifications

Stockage des credentials :

# Fichier créé par setup_binance_20euros.sh
/workspace/data/bot_config.env

# Permissions automatiquement appliquées
chmod 600 /workspace/data/bot_config.env
# → Lecture réservée à l'utilisateur courant uniquement
# → Jamais visible dans systemctl status ou ps aux

Ce que Wesley ne modifie JAMAIS :

  • BINANCE_API_KEY et BINANCE_API_SECRET — Wesley ne modifie pas ces valeurs. En revanche, lors du fallback restart, apply_optimization.sh (déclenché par Wesley) source /workspace/data/bot_config.env pour relancer executor.py avec les credentials existants.
  • DRAWDOWN_KILL_PCT, DRAWDOWN_PAUSE_PCT — protection capitale hors portée

📦 Installation & Setup

Vue d'ensemble

setup_binance_20euros.sh    → Setup initial (run once)
install_cron.sh             → Installe le cron Wesley (run once)
apply_optimization.sh       → Appelé par Wesley toutes les 6h (automatique)

Téléchargements externes (setup uniquement)

Le script de setup télécharge du code externe depuis GitHub — auditer avant d'exécuter :

# executor.py — le bot de trading principal
https://raw.githubusercontent.com/georges91560/crypto-executor/main/executor.py

# crypto_oracle.py — signaux OBI/VWAP (optionnel)
https://raw.githubusercontent.com/georges91560/crypto-sniper-oracle/main/crypto_oracle.py

Recommandation sécurité : Épingler un commit spécifique plutôt que main :

# Vérifier le commit sur GitHub, puis :
# git checkout <commit-hash>

Dépendance Python

# Sur shared hosting (Hostinger, cPanel) :
pip install websocket-client --break-system-packages

# Sur VPS/serveur standard (recommandé) :
python3 -m venv venv && source venv/bin/activate && pip install websocket-client

Privilèges requis

ActionPourquoi
sudo systemctl restart crypto-executorRedémarrer le bot après optimisation
sudo systemctl stop/start crypto-executorContrôle du service au setup
pkill -f executor.pyFallback si systemd indisponible
crontab -eInstaller le job récurrent (fallback system cron)

🤖 Rôle de Wesley

Wesley est l'intelligence. Wesley lit les données de performance, analyse, décide des changements, puis exécute les scripts bash pour les appliquer.


Ce que Wesley doit faire toutes les 6 heures

Étape 1 — Lire les données

cat /workspace/performance_metrics.json
cat /workspace/learned_config.json
cat /workspace/skills/crypto-executor/executor.py

Étape 2 — Analyser les performances

Wesley analyse :

Win rate :

  • < 80% → serrer les seuils OBI (+0.02), réduire les stratégies agressives
  • 80–88% → ajustements mineurs seulement
  • 88% → peut augmenter le Kelly factor (max 0.6)

Trades par jour :

  • < 20 trades/jour → baisser les seuils OBI (-0.01), baisser price_change trigger
  • 80 trades/jour → monter les seuils (qualité > quantité)

Win rate par stratégie :

  • < 70% → réduire son allocation de 10%, redistribuer vers la meilleure
  • 92% → augmenter son allocation de 5%

Si tout est optimal (win rate > 90%, 30–60 trades/jour, toutes stratégies > 85%) : → Aucun changement. Wesley note "no changes needed" dans le log.

Étape 3 — Décider des nouvelles valeurs

Wesley détermine les nouvelles valeurs pour ces paramètres :

ParamètreValeur par défautPlage autorisée
obi > X scalping0.100.06 – 0.18
obi > X momentum0.120.08 – 0.20
price_change > X0.80.4 – 2.0
spread_bps < X84 – 15
kelly * X factor0.50.3 – 0.6
strategy mix scalping0.700.50 – 0.90
strategy mix momentum0.250.05 – 0.40
strategy mix stat_arb0.050.02 – 0.15

Wesley ne doit JAMAIS modifier :

  • Les credentials Binance (API key/secret)
  • La structure des classes (BinanceClient, PortfolioManager, RiskEngine, BinanceWebSocket)
  • Les circuit breakers et stop loss
  • DRAWDOWN_KILL_PCT, DRAWDOWN_PAUSE_PCT
  • Le code WebSocket

Étape 4 — Appliquer les changements

Wesley appelle le script avec les nouvelles valeurs :

bash /workspace/skills/crypto-executor-optimizer/apply_optimization.sh \
  --obi-scalping 0.11 \
  --obi-momentum 0.13 \
  --price-change 0.9 \
  --spread-bps 9 \
  --kelly-factor 0.5 \
  --mix-scalping 0.72 \
  --mix-momentum 0.23 \
  --mix-stat-arb 0.05 \
  --reason "Win rate 76%, tightening OBI thresholds"

Le script va automatiquement :

  1. Créer un backup horodaté de executor.py
  2. Modifier les valeurs via regex (uniquement les seuils OBI, Kelly et strategy mix)
  3. Valider la syntaxe Python (python3 -m py_compile)
  4. Redémarrer le bot via systemd (ou pkill en fallback)
  5. Envoyer une alerte Telegram
  6. Logger les changements dans auto_optimize.log et wesley_optimizations.log
  7. Rollback automatique si erreur syntaxe ou restart échoué

Étape 5 — Si aucun changement nécessaire

bash /workspace/skills/crypto-executor-optimizer/apply_optimization.sh --no-changes \
  --reason "Performance optimal, no changes needed"

🔒 Sécurité — apply_optimization.sh

Ce que le script modifie dans executor.py :

  • Uniquement les seuils numériques OBI, price_change, spread_bps, Kelly factor et strategy mix
  • Via regex ciblées — aucune autre ligne du code n'est touchée
  • Jamais les credentials, jamais les circuit breakers, jamais la structure des classes

Protections en place :

  • Backup automatique horodaté avant chaque modification
  • Validation syntaxe Python (py_compile) avant restart
  • Rollback automatique si syntaxe invalide
  • Rollback automatique si restart échoué
  • Conservation des 5 derniers backups uniquement
  • Alerte Telegram en cas d'erreur

📅 Cron & Persistance

Le skill installe un job récurrent via install_cron.sh :

# Schedule : toutes les 6h
0 */6 * * *

# Via OpenClaw cron (prioritaire) :
openclaw cron add --name "crypto-executor-optimizer" --cron "0 */6 * * *"

# Via system crontab (fallback si openclaw CLI indisponible) :
0 */6 * * * openclaw run --skill crypto-executor-optimizer

Désinstaller le cron :

openclaw cron remove --name crypto-executor-optimizer
# OU
crontab -e  # supprimer la ligne crypto-executor-optimizer

📁 Fichiers importants

FichierRôle
/workspace/performance_metrics.jsonStats de performance du bot
/workspace/learned_config.jsonHistorique des configurations précédentes
/workspace/skills/crypto-executor/executor.pyLe bot à optimiser
/workspace/data/bot_config.envCredentials Binance (chmod 600)
/workspace/logs/auto_optimize.logLog des cycles d'optimisation
/workspace/logs/wesley_optimizations.logHistorique des décisions de Wesley
/workspace/skills/crypto-executor/executor_backup_*.pyBackups horodatés (5 max)

📊 Monitoring

# Voir le dernier cycle
tail -50 /workspace/logs/auto_optimize.log

# Historique des optimisations
tail -100 /workspace/logs/wesley_optimizations.log

# Backups disponibles
ls -lh /workspace/skills/crypto-executor/executor_backup_*.py

# Status du bot
sudo systemctl status crypto-executor

Files

5 total
Select a file
Select a file to preview.

Comments

Loading comments…