- Delete obsolete files: data_fetcher_old.py, market_old.py, base_strategy.py (root), strategy_sma_cross.py, and old architecture remnants (address_monitor.py, position_monitor.py, trade_log.py, wallet_data.py, whale_tracker.py) - Delete zero-byte Docker artifacts and runtime files (clp_hedger.log, clp_hedger/hedge_status.json) - Move one-off utility scripts to scripts/ directory - Move example/template files to .temp/ directory - Update .gitignore: add entries for clp_hedger.log, clp_hedger/hedge_status.json, Docker layer hash files, Using, Running, and backups/ - Update .dockerignore: add clp_hedger.log, clp_hedger/hedge_status.json, backups/ - Create example config files: _data/strategies.json.example, _data/backtesting_conf.json.example, _data/coin_precision.json.example - Update GEMINI.md: remove outdated session summaries and duplicate review section - Update review.md: add cleanup status section, update remaining recommendations - Update MIGRATION_PLAN.md: mark completed phases, update file references - Update DOCKER_MIGRATION_GUIDE.md: update import_csv.py path reference
2.2 KiB
Project Overview
This project is a sophisticated, multi-process automated trading bot for the Hyperliquid decentralized exchange. It is written in Python and uses a modular architecture to separate concerns like data fetching, strategy execution, and trade management.
The bot uses a high-performance data pipeline with SQLite for storing market data. Trading strategies are defined and configured in a JSON file, allowing for easy adjustments without code changes. The system supports multiple, independent trading agents for risk segregation and PNL tracking. A live terminal dashboard provides real-time monitoring of market data, strategy signals, and the status of all background processes.
Building and Running
1. Setup
-
Create and activate a virtual environment:
# For Windows python -m venv .venv .\.venv\Scripts\activate # For macOS/Linux python3 -m venv .venv source .venv/bin/activate -
Install dependencies:
pip install -r requirements.txt -
Configure environment variables: Create a
.envfile in the root of the project (you can copy.env.example) and add your Hyperliquid wallet private key and any agent keys. -
Configure strategies: Edit
_data/strategies.jsonto enable and configure your desired trading strategies.
2. Running the Bot
To run the main application, which includes the dashboard and all background processes, execute the following command:
python main_app.py
Development Conventions
- Modularity: The project is divided into several scripts, each with a specific responsibility (e.g.,
data_fetcher.py,trade_executor.py). - Configuration-driven: Strategies are defined in
_data/strategies.json, not hardcoded. This allows for easy management of strategies. - Multi-processing: The application uses the
multiprocessingmodule to run different components in parallel for performance and stability. - Strategies: Custom strategies should inherit from the
BaseStrategyclass (defined instrategies/base_strategy.py) and implement thecalculate_signalsmethod. - Documentation: The
WIKI/directory contains detailed documentation for the project. Start withWIKI/SUMMARY.md.