From ebd22b6863a2d187165138ef0dca788d7921e833 Mon Sep 17 00:00:00 2001 From: DiTus Date: Sat, 18 Oct 2025 15:13:40 +0200 Subject: [PATCH] readme --- README.md | 57 +++++++++++++++++++++++++ _data/strategy_status_sma_cross_1.json | 6 +-- _data/strategy_status_sma_cross_2.json | 2 +- requirements.txt | Bin 0 -> 1982 bytes 4 files changed, 61 insertions(+), 4 deletions(-) create mode 100644 README.md create mode 100644 requirements.txt diff --git a/README.md b/README.md new file mode 100644 index 0000000..b373377 --- /dev/null +++ b/README.md @@ -0,0 +1,57 @@ +# Automated Crypto Trading Bot + +This project is a sophisticated, multi-process automated trading bot designed to interact with the Hyperliquid decentralized exchange. It features a robust data pipeline, a flexible strategy engine, multi-agent trade execution, and a live terminal dashboard for real-time monitoring. + + + +## Features + +* **Multi-Process Architecture**: Core components (data fetching, trading, strategies) run in parallel processes for maximum performance and stability. +* **Comprehensive Data Pipeline**: + * Live price feeds for all assets. + * Historical candle data collection for any coin and timeframe. + * Historical market cap data fetching from the CoinGecko API. +* **High-Performance Database**: Uses SQLite with pandas for fast, indexed storage and retrieval of all market data. +* **Configuration-Driven Strategies**: Trading strategies are defined and managed in a simple JSON file (`_data/strategies.json`), allowing for easy configuration without code changes. +* **Multi-Agent Trading**: Supports multiple, independent trading agents for advanced risk segregation and PNL tracking. +* **Live Terminal Dashboard**: A real-time, flicker-free dashboard to monitor live prices, market caps, strategy signals, and the status of all background processes. +* **Secure Key Management**: Uses a `.env` file to securely manage all private keys and API keys, keeping them separate from the codebase. + +## Project Structure + +The project is composed of several key scripts that work together: + +* **`main_app.py`**: The central orchestrator. It launches all background processes and displays the main monitoring dashboard. +* **`trade_executor.py`**: The trading "brain." It reads signals from all active strategies and executes trades using the appropriate agent. +* **`data_fetcher.py`**: A background service that collects 1-minute historical candle data and saves it to the SQLite database. +* **`resampler.py`**: A background service that reads the 1-minute data and generates all other required timeframes (e.g., 5m, 1h, 1d). +* **`market_cap_fetcher.py`**: A scheduled service to download daily market cap data. +* **`strategy_*.py`**: Individual files containing the logic for different types of trading strategies (e.g., SMA Crossover). +* **`_data/strategies.json`**: The configuration file for defining and enabling/disabling your trading strategies. +* **`.env`**: The secure file for storing all your private keys and API keys. + +## Installation + +1. **Clone the Repository** + ```bash + git clone [https://github.com/your-username/your-repo-name.git](https://github.com/your-username/your-repo-name.git) + cd your-repo-name + + +2. **Create and Activate a Virtual Environment** + ```bash + # For Windows + python -m venv .venv + .\.venv\Scripts\activate + # For macOS/Linux + python3 -m venv .venv + source .venv/bin/activate +3. **Install Dependencies** + ```bash + pip install -r requirements.txt + +##Getting Started: Configuration + +Before running the application, you must configure your wallets, agents, and API keys. + +1. **Create the .env File In the root of the project, create a file named .env. Copy the following content into it and replace the placeholder values with your actual keys. ** diff --git a/_data/strategy_status_sma_cross_1.json b/_data/strategy_status_sma_cross_1.json index 165fab5..91d1414 100644 --- a/_data/strategy_status_sma_cross_1.json +++ b/_data/strategy_status_sma_cross_1.json @@ -1,7 +1,7 @@ { "strategy_name": "sma_cross_1", "current_signal": "SELL", - "last_signal_change_utc": "2025-10-18T12:29:00+00:00", - "signal_price": 3879.3, - "last_checked_utc": "2025-10-18T12:51:05.037979+00:00" + "last_signal_change_utc": "2025-10-18T13:02:00+00:00", + "signal_price": 3873.4, + "last_checked_utc": "2025-10-18T13:09:05.009625+00:00" } \ No newline at end of file diff --git a/_data/strategy_status_sma_cross_2.json b/_data/strategy_status_sma_cross_2.json index c7f118a..e0f6cbc 100644 --- a/_data/strategy_status_sma_cross_2.json +++ b/_data/strategy_status_sma_cross_2.json @@ -3,5 +3,5 @@ "current_signal": "SELL", "last_signal_change_utc": "2025-10-14T00:00:00+00:00", "signal_price": 113026.0, - "last_checked_utc": "2025-10-18T12:51:02.927448+00:00" + "last_checked_utc": "2025-10-18T13:13:03.538350+00:00" } \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..1fad1321c0b96875a5611d0ad5a10898301daf05 GIT binary patch literal 1982 zcmZ{l>yFw`41~|`N_`Yi3GAgm`YZ^-Em}xufR^y^ZRfM&1+Cu{Ov)%&w9GFwX@d0k9s_!5c*YT_7rhVS49NlOne}6 z%te{^$_p2`nGg$|$Xx4PBbJrURthKj-HCJC=Y{bt!;`TcG*QFIwpK2fT0JYVgf8L> z(_M30s>(4-)x;#AH8?!ePX0F5quRQ4>D|FaDst38b>78**D-}4#ys?g38kVc z{gls@CO5pH>#us~$mht3qG3NsO|5=i6#X&8&(iln3%uMNxIMpDdQ!|@EOgot%*m9%j?-lDd4;)FZl>e&x7>hA@l?QWx%Eh&G=939XY>3l z4QR#N+$XOFH+bI;e&Zo~WMlz>D!+N{psE-YgBb79Mw(82HtGVGvr!wj19zgrnYj?U zJF7o1OW_(*80dxR8!H(52{*G7vl0fcU3ygrkcrdm0sOAlM(m4-Ml0Dewc`XZyC3c>1G0JtD8*dc2Dw{rLgzjTNDuC z`n*ndMPzzd@A;N^@4`!Gy~#(ujFq;;yhr5U)8ERp7I!0U>`%TErQzwTZ)7ST?|EmF LJ$@mJY!d$g