leoyeai/openclaw-master-skills/vibetrading-code-gen
Claude Code and agent skill by leoyeai/openclaw-master-skills
- community
- ext:[{"type":"template","description":"Custom templates for code generation"},{"type":"config","description":"Configuration overrides"}]
Checking that the SKILL.md file is still in the repository.
Generate executable Hyperliquid trading strategy code from natural language prompts. Use when a user wants to create automated trading strategies for Hyperliquid exchange based on their trading ideas, technical indicators, or VibeTrading signals. The skill generates complete Python code with proper error handling, logging, and configuration using actual Hyperliquid API wrappers.
Install
npx vskill@latest install leoyeai/openclaw-master-skills/vibetrading-code-genSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as leoyeai/openclaw-master-skills/vibetrading-code-gen.
VibeTrading Code Generator
Generate executable Hyperliquid trading strategy code from natural language prompts. This skill transforms trading ideas into ready-to-run Python code using actual Hyperliquid API implementations. Generated code includes complete API integration, error handling, logging, and configuration management.
Quick Start
Basic Usage
Output Structure
The generator creates:
- Strategy Python file - Complete trading strategy class
- Configuration file - Strategy parameters and settings
- Usage instructions - How to run and monitor the strategy
- Requirements file - Python dependencies
Code Validation System
Automatic Code Validation
All generated code is automatically validated and fixed using the built-in validation system:
Validation Steps
The validation system performs these checks:
- Syntax Validation - Python syntax checking
- Import Validation - Module import verification
- Compatibility Checks - Python 3.5+ compatibility
- Common Issue Detection - Missing imports, encoding issues, etc.
Automatic Fixes
When validation fails, the system automatically fixes common issues:
- Add missing imports - Add typing imports if type annotations are used
- Fix encoding declaration - Add
# -*- coding: utf-8 -*-if missing - Remove incompatible syntax - Remove f-strings and type annotations for Python 3.5 compatibility
- Fix import paths - Add sys.path modifications for API wrappers
- Fix logger initialization order - Ensure logger is initialized before API client
- Remove pathlib usage - Replace with os.path for Python 3.4 compatibility
- Fix string formatting - Convert f-strings to .format() method
Validation Configuration
The validation system can be configured via command-line arguments:
Validation Rules
The system enforces these rules for generated code:
- Python 3.5+ Compatibility
- No f-strings (use
.format()or%formatting) - No type annotations (remove or use comments)
- No pathlib (use
os.pathinstead) - No typing module imports
- Code Quality
- Proper encoding declaration (
# -*- coding: utf-8 -*-) - Logger initialized before API client
- All imports are resolvable
- No syntax errors
- Security
- API keys loaded from environment variables
- No hardcoded credentials
- Proper error handling for API calls
- Performance
- Reasonable check intervals (not too frequent)
- Efficient data fetching
- Proper resource cleanup
Validation Workflow
Validation Failure Handling
When validation fails, the system automatically updates the code with these steps:
- Error Analysis - Identify the specific validation errors
- Fix Application - Apply appropriate fixes based on error type
- Re-validation - Validate again after fixes
- Iterative Repair - Repeat until code is valid (max 3 iterations)
- Fallback Strategy - If automatic fixes fail, provide detailed error report and manual fix instructions
Automatic Fix Examples
Fix 1: Missing Imports
Fix 2: Encoding Issues
Fix 3: Python 3.5 Incompatibility
Fix 4: Import Path Issues
Supported Strategy Types
1. Technical Indicator Strategies
- RSI-based: Oversold/overbought trading
- MACD-based: Trend following with MACD crossovers
- Moving Average: SMA/EMA cross strategies
- Bollinger Bands: Mean reversion strategies
2. Advanced Trading Strategies
- Grid Trading: Price range trading with multiple orders
- Mean Reversion: Statistical arbitrage strategies
- Trend Following: Momentum-based strategies
- Arbitrage: Spot-perp or cross-exchange arbitrage
3. Signal-Driven Strategies
- VibeTrading Integration: Follow AI-generated trading signals
- News-based: React to market news and sentiment
- Whale Activity: Track large wallet movements
- Funding Rate: Funding rate arbitrage strategies
How It Works
Step 1: Prompt Analysis
The generator analyzes your natural language prompt to identify:
- Trading symbol (BTC, ETH, SOL, etc.)
- Strategy type (grid, RSI, signal-based, etc.)
- Key parameters (price ranges, grid counts, indicator values)
- Risk management preferences
Step 2: Template Selection
Based on the analysis, the system selects the most appropriate template from:
templates/grid_trading.py- Grid trading strategy template
Step 3: Code Generation
The generator:
- Fills template parameters with your values
- Adds proper error handling and logging
- Includes configuration management
- Generates complete runnable code
Step 4: Code Validation
The generated code is automatically validated and fixed:
- Syntax checking - Ensure valid Python syntax
- Import verification - Check all imports are resolvable
- Compatibility testing - Verify Python 3.5+ compatibility
- Automatic fixes - Apply fixes for common issues
- Re-validation - Validate again after fixes
- Error reporting - If fixes fail, provide detailed error report
Validation Failure Handling
If validation fails after automatic fixes:
- Error Analysis Report - Detailed breakdown of remaining issues
- Manual Fix Instructions - Step-by-step guidance for manual fixes
- Fallback Template - Option to use a simpler, validated template
- Support Contact - Instructions for getting help
Step 5: Output Delivery
You receive validated, runnable code including:
- Validated Python strategy file - Fully tested and fixed
- Configuration template - Strategy parameters and settings
- Validation report - Summary of validation results and fixes applied
- Usage instructions - How to run and monitor the strategy
- Troubleshooting guide - Common issues and solutions
- Risk warnings - Important safety information
API Integration
The generated code uses mature Hyperliquid API implementations that support:
Trading Operations
- Spot trading (buy/sell with limit/market orders)
- Perpetual contracts (long/short with leverage)
- Order management (cancel, modify, query)
- Position management (reduce, hedge)
Market Data
- Real-time prices and OHLCV data
- Funding rates and open interest
- Order book depth
- Historical data access
Account Management
- Balance queries (spot and futures)
- Position tracking
- PNL calculation
- Risk metrics
Template System
Template Structure
Each template includes:
- Strategy class with initialization and main logic
- Configuration section for easy parameter tuning
- Error handling with comprehensive logging
- Risk management features
- Monitoring loop for continuous operation
Available Templates
Grid Trading Template
grid_trading.py- Grid trading within price ranges (Python 3.5+ compatible)- No f-strings
- No type annotations
- Proper encoding declaration
- Logger initialized before API client
Configuration Management
Strategy Configuration
Generated strategies include configurable parameters:
Environment Setup
Risk Management Features
All generated strategies include:
1. Position Sizing
- Fixed percentage of portfolio
- Dynamic position sizing based on volatility
- Maximum position limits
2. Stop Loss Mechanisms
- Percentage-based stop loss
- Trailing stops
- Time-based exits
3. Risk Controls
- Maximum daily loss limits
- Drawdown protection
- Correlation checks
- Market condition filters
4. Monitoring & Alerts
- Real-time position tracking
- Telegram/Slack notifications
- Performance reporting
- Error alerts and recovery
Integration with VibeTrading Signals
Generated strategies can integrate with VibeTrading Global Signals:
Usage Examples
Example 1: Simple RSI Strategy
Prompt: "Generate a BTC RSI strategy, buy 0.01 BTC when RSI below 30, sell when above 70"
Generated Code Features:
- RSI calculation with 14-period default
- Configurable oversold/overbought thresholds
- Proper error handling for API calls
- Logging for all trading actions
- 1-hour check interval
Example 2: Grid Trading Strategy
Prompt: "ETH grid trading strategy, price range 3000-4000, 20 grids, 0.1 ETH per grid"
Generated Code Features:
- Automatic grid price calculation
- Order placement and management
- Grid rebalancing logic
- Price monitoring and adjustment
- Comprehensive logging
Example 3: Signal-Based Strategy
Prompt: "SOL trading strategy based on VibeTrading signals, buy on bullish signals, sell on bearish signals, 10 SOL per trade"
Generated Code Features:
- VibeTrading API integration
- Signal polling and parsing
- Trade execution based on sentiment
- Position management
- Performance tracking
Best Practices
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/vibetrading-code-gen/SKILL.md
Popularity
- Repository stars
- 2,157
- Repository forks
- 324
- 7-day trend score
- 43
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Extension points
templateCustom templates for code generationconfigConfiguration overrides
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/leoyeai/openclaw-master-skills/vibetrading-code-gen)