← Back to Skills Marketplace
georges91560

Crypto Executor Optimizer

by Wesley Armando · GitHub ↗ · v1.0.3
cross-platform ⚠ suspicious
413
Downloads
0
Stars
0
Active Installs
4
Versions
Install in OpenClaw
/install crypto-executor-optimizer
Description
Autonomous optimizer skill for Wesley — reads Binance trading performance every 6 hours, analyzes win rate and strategy metrics, then safely tunes executor.p...
README (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

Variable Requis Usage
BINANCE_API_KEY Oui (setup) Authentification Binance — jamais modifié après setup
BINANCE_API_SECRET Oui (setup) Authentification Binance — jamais modifié après setup
TELEGRAM_BOT_TOKEN Non Notifications d'optimisation
TELEGRAM_CHAT_ID Non Destination 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 \x3Ccommit-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

Action Pourquoi
sudo systemctl restart crypto-executor Redémarrer le bot après optimisation
sudo systemctl stop/start crypto-executor Contrôle du service au setup
pkill -f executor.py Fallback si systemd indisponible
crontab -e Installer 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 :

  • \x3C 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 :

  • \x3C 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 :

  • \x3C 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ètre Valeur par défaut Plage autorisée
obi > X scalping 0.10 0.06 – 0.18
obi > X momentum 0.12 0.08 – 0.20
price_change > X 0.8 0.4 – 2.0
spread_bps \x3C X 8 4 – 15
kelly * X factor 0.5 0.3 – 0.6
strategy mix scalping 0.70 0.50 – 0.90
strategy mix momentum 0.25 0.05 – 0.40
strategy mix stat_arb 0.05 0.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

Fichier Rôle
/workspace/performance_metrics.json Stats de performance du bot
/workspace/learned_config.json Historique des configurations précédentes
/workspace/skills/crypto-executor/executor.py Le bot à optimiser
/workspace/data/bot_config.env Credentials Binance (chmod 600)
/workspace/logs/auto_optimize.log Log des cycles d'optimisation
/workspace/logs/wesley_optimizations.log Historique des décisions de Wesley
/workspace/skills/crypto-executor/executor_backup_*.py Backups 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
Usage Guidance
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.
Capability Analysis
Type: OpenClaw Skill Name: crypto-executor-optimizer Version: 1.0.3 The skill exhibits a significant supply chain vulnerability by downloading `executor.py` and `crypto_oracle.py` from the `main` branches of external GitHub repositories (`raw.githubusercontent.com/georges91560/crypto-executor/main/executor.py` and `raw.githubusercontent.com/georges91560/crypto-sniper-oracle/main/crypto_oracle.py`) in `setup_binance_20euros.sh`. This allows for remote code execution if the upstream repositories are compromised, as the downloaded code is not pinned to a specific commit and can change at any time. While the `SKILL.md` explicitly warns the user to 'Audit code before running', this design choice introduces a critical risk. Other aspects, such as `sudo` usage, cron job installation, and credential handling (chmod 600 for `bot_config.env`), are declared and appear aligned with the stated purpose, and the prompt injection surface in `SKILL.md` includes explicit prohibitions against malicious actions.
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install crypto-executor-optimizer
  3. After installation, invoke the skill by name or use /crypto-executor-optimizer
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.3
crypto-executor-optimizer v1.0.3 — No file changes from previous version. - No updates or code changes were made in this release. - Functionality and documentation remain identical to the previous version.
v1.0.2
No changes detected in this version. - Version bumped to 1.0.2, but no file or functionality changes were made. - All behavior, setup steps, and documentation remain identical to the previous release.
v1.0.1
Version 1.0.1 of crypto-executor-optimizer - Improved SKILL.md with much more detailed documentation on scope, setup, security, and external dependencies. - Added clear privilege, security, and network behavior metadata for better transparency and auditability. - Described setup and operational flows explicitly, including new install_notes and security recommendations. - Clarified credentials handling (now persistent in bot_config.env with restricted permissions). - No code changes; purely a documentation and metadata update for safer deployment and clearer usage.
v1.0.0
**Major update: Skill now automates periodic optimization of crypto-executor trading bot performance.** - Wesley analyzes bot metrics and applies optimizations every 6 hours, following defined logic for different performance scenarios. - Changes are safely applied via apply_optimization.sh, which backs up executor.py, edits values, validates Python syntax, and restarts the bot. - Strict guardrails ensure only specific trading parameters are modified; critical code and credentials remain untouched. - Full process is logged, with Telegram alerts and backup management included. - Monitoring instructions and expected file roles are documented for easy oversight.
Metadata
Slug crypto-executor-optimizer
Version 1.0.3
License
All-time Installs 0
Active Installs 0
Total Versions 4
Frequently Asked Questions

What is 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... It is an AI Agent Skill for Claude Code / OpenClaw, with 413 downloads so far.

How do I install Crypto Executor Optimizer?

Run "/install crypto-executor-optimizer" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Crypto Executor Optimizer free?

Yes, Crypto Executor Optimizer is completely free (open-source). You can download, install and use it at no cost.

Which platforms does Crypto Executor Optimizer support?

Crypto Executor Optimizer is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Crypto Executor Optimizer?

It is built and maintained by Wesley Armando (@georges91560); the current version is v1.0.3.

💬 Comments