diff --git a/GEMINI.md b/GEMINI.md new file mode 100644 index 0000000..89eb87c --- /dev/null +++ b/GEMINI.md @@ -0,0 +1,127 @@ +# 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 + +1. **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 + ``` + +2. **Install dependencies:** + ```bash + pip install -r requirements.txt + ``` + +3. **Configure environment variables:** + Create a `.env` file in the root of the project (you can copy `.env.example`) and add your Hyperliquid wallet private key and any agent keys. + +4. **Configure strategies:** + Edit `_data/strategies.json` to 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: + +```bash +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 `multiprocessing` module to run different components in parallel for performance and stability. +* **Strategies:** Custom strategies should inherit from the `BaseStrategy` class (defined in `strategies/base_strategy.py`) and implement the `calculate_signals` method. +* **Documentation:** The `WIKI/` directory contains detailed documentation for the project. Start with `WIKI/SUMMARY.md`. + +# Project Review and Recommendations + +This review provides an analysis of the current state of the automated trading bot project, proposes specific code improvements, and identifies files that appear to be unused or are one-off utilities that could be reorganized. + +The project is a well-structured, multi-process Python application for crypto trading. It has a clear separation of concerns between data fetching, strategy execution, and trade management. The use of `multiprocessing` and a centralized `main_app.py` orchestrator is a solid architectural choice. + +The following sections detail recommendations for improving configuration management, code structure, and robustness, along with a list of files recommended for cleanup. + +--- + +## Proposed Code Changes + +### 1. Centralize Configuration + +- **Issue:** Key configuration variables like `WATCHED_COINS` and `required_timeframes` are hardcoded in `main_app.py`. This makes them difficult to change without modifying the source code. +- **Proposal:** + - Create a central configuration file, e.g., `_data/config.json`. + - Move `WATCHED_COINS` and `required_timeframes` into this new file. + - Load this configuration in `main_app.py` at startup. +- **Benefit:** Decouples configuration from code, making the application more flexible and easier to manage. + +### 2. Refactor `main_app.py` for Clarity + +- **Issue:** `main_app.py` is long and handles multiple responsibilities: process orchestration, dashboard rendering, and data reading. +- **Proposal:** + - **Abstract Process Management:** The functions for running subprocesses (e.g., `run_live_candle_fetcher`, `run_resampler_job`) contain repetitive logic for logging, shutdown handling, and process looping. This could be abstracted into a generic `ProcessRunner` class. + - **Create a Dashboard Class:** The complex dashboard rendering logic could be moved into a separate `Dashboard` class to improve separation of concerns and make the main application loop cleaner. +- **Benefit:** Improves code readability, reduces duplication, and makes the application easier to maintain and extend. + +### 3. Improve Project Structure + +- **Issue:** The root directory is cluttered with numerous Python scripts, making it difficult to distinguish between core application files, utility scripts, and old/example files. +- **Proposal:** + - Create a `scripts/` directory and move all one-off utility and maintenance scripts into it. + - Consider creating a `src/` or `app/` directory to house the core application source code (`main_app.py`, `trade_executor.py`, etc.), separating it clearly from configuration, data, and documentation. +- **Benefit:** A cleaner, more organized project structure that is easier for new developers to understand. + +### 4. Enhance Robustness and Error Handling + +- **Issue:** The agent loading in `trade_executor.py` relies on discovering environment variables by a naming convention (`_AGENT_PK`). This is clever but can be brittle if environment variables are named incorrectly. +- **Proposal:** + - Explicitly define the agent names and their corresponding environment variable keys in the proposed `_data/config.json` file. The `trade_executor` would then load only the agents specified in the configuration. +- **Benefit:** Makes agent configuration more explicit and less prone to errors from stray environment variables. + +--- + +## Identified Unused/Utility Files + +The following files were identified as likely being unused by the core application, being obsolete, or serving as one-off utilities. It is recommended to **move them to a `scripts/` directory** or **delete them** if they are obsolete. + +### Obsolete / Old Versions: +- `data_fetcher_old.py` +- `market_old.py` +- `base_strategy.py` (The one in the root directory; the one in `strategies/` is used). + +### One-Off Utility Scripts (Recommend moving to `scripts/`): +- `!migrate_to_sqlite.py` +- `import_csv.py` +- `del_market_cap_tables.py` +- `fix_timestamps.py` +- `list_coins.py` +- `create_agent.py` + +### Examples / Unused Code: +- `basic_ws.py` (Appears to be an example file). +- `backtester.py` +- `strategy_sma_cross.py` (A strategy file in the root, not in the `strategies` folder). +- `strategy_template.py` + +### Standalone / Potentially Unused Core Files: +The following files seem to have their logic already integrated into the main multi-process application. They might be remnants of a previous architecture and may not be needed as standalone scripts. +- `address_monitor.py` +- `position_monitor.py` +- `trade_log.py` +- `wallet_data.py` +- `whale_tracker.py` + +### Data / Log Files (Recommend archiving or deleting): +- `hyperliquid_wallet_data_*.json` (These appear to be backups or logs). \ No newline at end of file diff --git a/IMPROVEMENT_ROADMAP.md b/IMPROVEMENT_ROADMAP.md new file mode 100644 index 0000000..503fad1 --- /dev/null +++ b/IMPROVEMENT_ROADMAP.md @@ -0,0 +1,300 @@ +# Improvement Roadmap - Hyperliquid Trading Bot + +## Overview +This document outlines the detailed implementation plan for transforming the trading bot into a production-ready system. + +## Phase 1: Foundation (Weeks 1-2) + +### Week 1: Security & Stability + +#### Day 1-2: Critical Security Fixes +- [ ] **Implement Encrypted Key Storage** + - Create `security/key_manager.py` + - Replace environment variable key access + - Add key rotation mechanism + - **Files**: `trade_executor.py`, `create_agent.py` + +- [ ] **Add Input Validation Framework** + - Create `validation/trading_validator.py` + - Validate all trading parameters + - Add sanitization for user inputs + - **Files**: `position_manager.py`, `trade_executor.py` + +#### Day 3-4: Risk Management +- [ ] **Implement Circuit Breakers** + - Create `risk/circuit_breaker.py` + - Add trading halt conditions + - Implement automatic recovery + - **Files**: `trade_executor.py`, `position_manager.py` + +- [ ] **Fix Import Resolution Issues** + - Update relative imports + - Add `__init__.py` files where missing + - Test all module imports + - **Files**: `main_app.py`, all strategy files + +#### Day 5-7: Code Quality +- [ ] **Refactor Dashboard Display** + - Extract `DashboardRenderer` class + - Split into market/strategy/position components + - Add configuration for display options + - **Files**: `main_app.py` + +### Week 2: Configuration & Error Handling + +#### Day 8-9: Configuration Management +- [ ] **Create Centralized Configuration** + - Create `config/settings.py` + - Move all magic numbers to config + - Add environment-specific configs + - **Files**: All Python files + +- [ ] **Standardize Error Handling** + - Create `utils/error_handlers.py` + - Implement retry decorators + - Add structured exception classes + - **Files**: All core modules + +#### Day 10-12: Database Improvements +- [ ] **Implement Connection Pool** + - Create `database/connection_pool.py` + - Replace direct SQLite connections + - Add connection health monitoring + - **Files**: `base_strategy.py`, all data access files + +- [ ] **Add Database Migrations** + - Create `database/migrations/` + - Version control schema changes + - Add rollback capabilities + - **Files**: Database schema files + +#### Day 13-14: Basic Testing +- [ ] **Create Test Framework** + - Set up `tests/` directory structure + - Add pytest configuration + - Create test fixtures and mocks + - **Files**: New test files + +## Phase 2: Performance & Testing (Weeks 3-4) + +### Week 3: Performance Optimization + +#### Day 15-17: Caching Layer +- [ ] **Implement Redis/Memory Cache** + - Create `cache/cache_manager.py` + - Cache frequently accessed data + - Add cache invalidation logic + - **Files**: `data_fetcher.py`, `base_strategy.py` + +#### Day 18-19: Async Operations +- [ ] **Convert to Async/Await** + - Identify blocking operations + - Convert to async patterns + - Add async context managers + - **Files**: `live_market_utils.py`, API calls + +#### Day 20-21: Batch Processing +- [ ] **Implement Batch Operations** + - Batch database writes + - Bulk API requests + - Optimize data processing + - **Files**: Data processing modules + +### Week 4: Testing Framework + +#### Day 22-24: Unit Tests +- [ ] **Comprehensive Unit Test Suite** + - Test all core classes + - Mock external dependencies + - Achieve >80% coverage + - **Files**: `tests/unit/` + +#### Day 25-26: Integration Tests +- [ ] **End-to-End Testing** + - Test complete workflows + - Mock Hyperliquid API + - Test process communication + - **Files**: `tests/integration/` + +#### Day 27-28: Paper Trading +- [ ] **Paper Trading Mode** + - Create simulation environment + - Mock trade execution + - Add performance tracking + - **Files**: `trade_executor.py`, new simulation files + +## Phase 3: Monitoring & Observability (Weeks 5-6) + +### Week 5: Metrics & Monitoring + +#### Day 29-31: Metrics Collection +- [ ] **Add Prometheus Metrics** + - Create `monitoring/metrics.py` + - Track key performance indicators + - Add custom business metrics + - **Files**: All core modules + +#### Day 32-33: Health Checks +- [ ] **Health Check System** + - Create `monitoring/health_check.py` + - Monitor all system components + - Add dependency checks + - **Files**: `main_app.py`, all processes + +#### Day 34-35: Alerting +- [ ] **Alerting System** + - Create `monitoring/alerts.py` + - Configure alert rules + - Add notification channels + - **Files**: New alerting files + +### Week 6: Documentation & Developer Experience + +#### Day 36-38: API Documentation +- [ ] **Auto-Generated Docs** + - Set up Sphinx/ MkDocs + - Document all public APIs + - Add code examples + - **Files**: `docs/` directory + +#### Day 39-40: Setup Improvements +- [ ] **Interactive Setup** + - Create setup wizard + - Validate configuration + - Add guided configuration + - **Files**: `setup.py`, new setup files + +#### Day 41-42: Examples & Guides +- [ ] **Strategy Examples** + - Create example strategies + - Add development tutorials + - Document best practices + - **Files**: `examples/`, `WIKI/` + +## Phase 4: Advanced Features (Weeks 7-8) + +### Week 7: Advanced Risk Management + +#### Day 43-45: Position Sizing +- [ ] **Dynamic Position Sizing** + - Volatility-based sizing + - Portfolio risk metrics + - Kelly criterion implementation + - **Files**: `position_manager.py`, new risk modules + +#### Day 46-47: Advanced Orders +- [ ] **Advanced Order Types** + - Stop-loss orders + - Take-profit orders + - Conditional orders + - **Files**: `trade_executor.py` + +#### Day 48-49: Portfolio Management +- [ ] **Portfolio Optimization** + - Correlation analysis + - Risk parity allocation + - Rebalancing logic + - **Files**: New portfolio modules + +### Week 8: Production Readiness + +#### Day 50-52: Deployment +- [ ] **Production Deployment** + - Docker containerization + - Kubernetes manifests + - CI/CD pipeline + - **Files**: `docker/`, `.github/workflows/` + +#### Day 53-54: Performance Profiling +- [ ] **Profiling Tools** + - Performance monitoring + - Memory usage tracking + - Bottleneck identification + - **Files**: New profiling modules + +#### Day 55-56: Final Polish +- [ ] **Production Hardening** + - Security audit + - Load testing + - Documentation review + - **Files**: All files + +## Implementation Guidelines + +### Daily Workflow +1. **Morning Standup**: Review progress, identify blockers +2. **Development**: Focus on assigned tasks +3. **Testing**: Write tests alongside code +4. **Code Review**: Peer review all changes +5. **Documentation**: Update docs with changes + +### Quality Gates +- All code must pass linting and formatting +- New features require unit tests +- Integration tests for critical paths +- Security review for sensitive changes + +### Risk Mitigation +- Feature flags for new functionality +- Gradual rollout with monitoring +- Rollback procedures for each change +- Regular backup and recovery testing + +## Success Criteria + +### Phase 1 Success +- [ ] All security vulnerabilities fixed +- [ ] Import resolution issues resolved +- [ ] Basic test framework in place +- [ ] Configuration management implemented + +### Phase 2 Success +- [ ] Performance improvements measured +- [ ] Test coverage >80% +- [ ] Paper trading mode functional +- [ ] Async operations implemented + +### Phase 3 Success +- [ ] Monitoring dashboard operational +- [ ] Alerting system functional +- [ ] Documentation complete +- [ ] Developer experience improved + +### Phase 4 Success +- [ ] Production deployment ready +- [ ] Advanced features working +- [ ] Performance benchmarks met +- [ ] Security audit passed + +## Resource Requirements + +### Development Team +- **Senior Python Developer**: Lead architecture and security +- **Backend Developer**: Performance and database optimization +- **DevOps Engineer**: Deployment and monitoring +- **QA Engineer**: Testing framework and automation + +### Tools & Services +- **Development**: PyCharm/VSCode, Git, Docker +- **Testing**: Pytest, Mock, Coverage tools +- **Monitoring**: Prometheus, Grafana, AlertManager +- **CI/CD**: GitHub Actions, Docker Hub +- **Documentation**: Sphinx/MkDocs, ReadTheDocs + +### Infrastructure +- **Development**: Local development environment +- **Testing**: Staging environment with test data +- **Production**: Cloud deployment with monitoring +- **Backup**: Automated backup and recovery system + +## Timeline Summary + +| Phase | Duration | Key Deliverables | +|-------|----------|------------------| +| Phase 1 | 2 weeks | Security fixes, basic testing, configuration | +| Phase 2 | 2 weeks | Performance optimization, comprehensive testing | +| Phase 3 | 2 weeks | Monitoring, documentation, developer tools | +| Phase 4 | 2 weeks | Advanced features, production deployment | +| **Total** | **8 weeks** | **Production-ready trading system** | + +This roadmap provides a structured approach to transforming the trading bot into a robust, scalable, and maintainable system suitable for production use. \ No newline at end of file diff --git a/PROJECT_REVIEW_AND_PROPOSALS.md b/PROJECT_REVIEW_AND_PROPOSALS.md new file mode 100644 index 0000000..e96a1da --- /dev/null +++ b/PROJECT_REVIEW_AND_PROPOSALS.md @@ -0,0 +1 @@ +"# Comprehensive Project Review and Improvement Proposals" diff --git a/_data/backtesting_conf.json b/_data/backtesting_conf.json index 66c76cf..aec37b7 100644 --- a/_data/backtesting_conf.json +++ b/_data/backtesting_conf.json @@ -1,6 +1,6 @@ { "sma_cross_eth_5m": { - "strategy_name": "sma_cross_2", + "strategy_name": "sma_cross_1", "script": "strategies.ma_cross_strategy.MaCrossStrategy", "optimization_params": { "fast": { diff --git a/_data/coin_id_map.json b/_data/coin_id_map.json new file mode 100644 index 0000000..f6c9d78 --- /dev/null +++ b/_data/coin_id_map.json @@ -0,0 +1,208 @@ +{ + "0G": "zero-gravity", + "2Z": "doublezero", + "AAVE": "aave", + "ACE": "endurance", + "ADA": "ada-the-dog", + "AI": "sleepless-ai", + "AI16Z": "ai16z", + "AIXBT": "aixbt", + "ALGO": "dear-algorithm", + "ALT": "altlayer", + "ANIME": "anime-token", + "APE": "ape-3", + "APEX": "apex-token-2", + "APT": "aptos", + "AR": "arweave", + "ARB": "osmosis-allarb", + "ARK": "ark-3", + "ASTER": "astar", + "ATOM": "lost-bitcoin-layer", + "AVAX": "binance-peg-avalanche", + "AVNT": "avantis", + "BABY": "baby-2", + "BADGER": "badger-dao", + "BANANA": "nforbanana", + "BCH": "bitcoin-cash", + "BERA": "berachain-bera", + "BIGTIME": "big-time", + "BIO": "bio-protocol", + "BLAST": "blast", + "BLUR": "blur", + "BLZ": "bluzelle", + "BNB": "binancecoin", + "BNT": "bancor", + "BOME": "book-of-meme", + "BRETT": "brett", + "BSV": "bitcoin-cash-sv", + "BTC": "bitcoin", + "CAKE": "pancakeswap-token", + "CANTO": "canto", + "CATI": "catizen", + "CELO": "celo", + "CFX": "cosmic-force-token-v2", + "CHILLGUY": "just-a-chill-guy", + "COMP": "compound-governance-token", + "CRV": "curve-dao-token", + "CYBER": "cyberconnect", + "DOGE": "doge-on-pulsechain", + "DOOD": "doodles", + "DOT": "xcdot", + "DYDX": "dydx-chain", + "DYM": "dymension", + "EIGEN": "eigenlayer", + "ENA": "ethena", + "ENS": "ethereum-name-service", + "ETC": "ethereum-classic", + "ETH": "ethereum", + "ETHFI": "ether-fi", + "FARTCOIN": "fartcoin-2", + "FET": "fetch-ai", + "FIL": "filecoin", + "FRIEND": "friend-tech", + "FTM": "fantom", + "FTT": "ftx-token", + "GALA": "gala", + "GAS": "gas", + "GMT": "stepn", + "GMX": "gmx", + "GOAT": "goat", + "GRASS": "grass-3", + "GRIFFAIN": "griffain", + "HBAR": "hedera-hashgraph", + "HEMI": "hemi", + "HMSTR": "hamster-kombat", + "HYPE": "hyperliquid", + "HYPER": "hyper-4", + "ILV": "illuvium", + "IMX": "immutable-x", + "INIT": "initia", + "INJ": "injective-protocol", + "IO": "io", + "IOTA": "iota-2", + "IP": "story-2", + "JELLY": "jelly-time", + "JTO": "jito-governance-token", + "JUP": "jupiter-exchange-solana", + "KAITO": "kaito", + "KAS": "wrapped-kaspa", + "LAUNCHCOIN": "ben-pasternak", + "LAYER": "unilayer", + "LDO": "linea-bridged-ldo-linea", + "LINEA": "linea", + "LINK": "osmosis-alllink", + "LISTA": "lista", + "LOOM": "loom", + "LTC": "litecoin", + "MANTA": "manta-network", + "MATIC": "matic-network", + "MAV": "maverick-protocol", + "MAVIA": "heroes-of-mavia", + "ME": "magic-eden", + "MEGA": "megaeth", + "MELANIA": "melania-meme", + "MEME": "mpx6900", + "MERL": "merlin-chain", + "MET": "metya", + "MEW": "cat-in-a-dogs-world", + "MINA": "mina-protocol", + "MKR": "maker", + "MNT": "mynth", + "MON": "mon-protocol", + "MOODENG": "moo-deng-2", + "MORPHO": "morpho", + "MOVE": "movement", + "MYRO": "myro", + "NEAR": "near", + "NEO": "neo", + "NIL": "nillion", + "NOT": "nothing-3", + "NTRN": "neutron-3", + "NXPC": "nexpace", + "OGN": "origin-protocol", + "OM": "mantra-dao", + "OMNI": "omni-2", + "ONDO": "ondo-finance", + "OP": "optimism", + "ORBS": "orbs", + "ORDI": "ordinals", + "OX": "ox-fun", + "PANDORA": "pandora", + "PAXG": "pax-gold", + "PENDLE": "pendle", + "PENGU": "pudgy-penguins", + "PEOPLE": "constitutiondao-wormhole", + "PIXEL": "pixel-3", + "PNUT": "pnut", + "POL": "proof-of-liquidity", + "POLYX": "polymesh", + "POPCAT": "popcat", + "PROMPT": "wayfinder", + "PROVE": "succinct", + "PUMP": "pump-fun", + "PURR": "purr-2", + "PYTH": "pyth-network", + "RDNT": "radiant-capital", + "RENDER": "render-token", + "REQ": "request-network", + "RESOLV": "resolv", + "REZ": "renzo", + "RLB": "rollbit-coin", + "RSR": "reserve-rights-token", + "RUNE": "thorchain", + "S": "token-s", + "SAGA": "saga-2", + "SAND": "the-sandbox-wormhole", + "SCR": "scroll", + "SEI": "sei-network", + "SHIA": "shiba-saga", + "SKY": "sky", + "SNX": "havven", + "SOL": "solana", + "SOPH": "sophon", + "SPX": "spx6900", + "STBL": "stbl", + "STG": "stargate-finance", + "STRAX": "stratis", + "STRK": "starknet", + "STX": "stox", + "SUI": "sui", + "SUPER": "superfarm", + "SUSHI": "sushi", + "SYRUP": "syrup", + "TAO": "the-anthropic-order", + "TIA": "tia", + "TNSR": "tensorium", + "TON": "tontoken", + "TRB": "tellor", + "TRUMP": "trumpeffect69420", + "TRX": "tron-bsc", + "TST": "test-3", + "TURBO": "turbo", + "UMA": "uma", + "UNI": "uni", + "UNIBOT": "unibot", + "USTC": "wrapped-ust", + "USUAL": "usual", + "VINE": "vine", + "VIRTUAL": "virtual-protocol", + "VVV": "venice-token", + "W": "w", + "WCT": "connect-token-wct", + "WIF": "wif-secondchance", + "WLD": "worldcoin-wld", + "WLFI": "world-liberty-financial", + "XAI": "xai-blockchain", + "XLM": "stellar", + "XPL": "pulse-2", + "XRP": "ripple", + "YGG": "yield-guild-games", + "YZY": "yzy", + "ZEC": "zcash", + "ZEN": "zenith-3", + "ZEREBRO": "zerebro", + "ZETA": "zeta", + "ZK": "zksync", + "ZORA": "zora", + "ZRO": "layerzero" +} \ No newline at end of file diff --git a/_data/coin_precision.json b/_data/coin_precision.json index fb9d0e8..7d927f3 100644 --- a/_data/coin_precision.json +++ b/_data/coin_precision.json @@ -101,6 +101,7 @@ "MAV": 0, "MAVIA": 1, "ME": 1, + "MEGA": 0, "MELANIA": 1, "MEME": 0, "MERL": 0, diff --git a/_data/executor_managed_positions.json b/_data/executor_managed_positions.json deleted file mode 100644 index 4a80fe9..0000000 --- a/_data/executor_managed_positions.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "sma_cross_2": { - "coin": "BTC", - "side": "short", - "size": 0.0001 - } -} \ No newline at end of file diff --git a/_data/market_cap_data.json b/_data/market_cap_data.json index 967c76d..45b1096 100644 --- a/_data/market_cap_data.json +++ b/_data/market_cap_data.json @@ -1,47 +1,1043 @@ { - "BTC_market_cap": { - "datetime_utc": "2025-10-14 19:07:32", - "market_cap": 2254100854707.6426 + "0G_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 266618645.60905194 }, - "ETH_market_cap": { - "datetime_utc": "2025-10-14 19:07:45", - "market_cap": 498260644977.71 + "2Z_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 556733577.2083987 }, - "SOL_market_cap": { - "datetime_utc": "2025-10-14 19:07:54", - "market_cap": 110493585034.85222 + "AAVE_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 3043486983.2528467 }, - "BNB_market_cap": { - "datetime_utc": "2025-10-14 19:08:01", - "market_cap": 169461959349.39044 + "ACE_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 19021793.55897193 }, - "ZEC_market_cap": { - "datetime_utc": "2025-10-14 19:08:32", - "market_cap": 3915238492.7266335 + "ADA_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 252519.9851697924 }, - "SUI_market_cap": { - "datetime_utc": "2025-10-14 19:08:51", - "market_cap": 10305847774.680008 + "AI_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 7831210.097665075 }, - "STABLECOINS_market_cap": { - "datetime_utc": "2025-10-14 00:00:00", - "market_cap": 551315140796.8396 + "AI16Z_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 75642873.65855925 + }, + "AIXBT_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 64014261.43038649 + }, + "ALGO_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 15203.326275876343 + }, + "ALT_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 80742549.40336938 + }, + "ANIME_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 60608.99835541969 + }, + "APE_market_cap": { + "datetime_utc": "2025-11-02 00:00:00", + "timestamp_ms": 1762041600000, + "market_cap": 0.0 + }, + "APEX_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 108228391.87106021 + }, + "APT_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 1997332824.5102599 + }, + "AR_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 246076704.36594132 + }, + "ARB_market_cap": { + "datetime_utc": "2025-09-28 00:00:00", + "timestamp_ms": 1759017600000, + "market_cap": 72619.00796098988 + }, + "ARK_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 411547691.74511635 }, "ASTER_market_cap": { - "datetime_utc": "2025-10-14 20:47:18", - "market_cap": 163953008.77347806 + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 122331099.54500043 + }, + "ATOM_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 29172.50856824532 + }, + "AVAX_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 33300889.08351314 + }, + "AVNT_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 140133510.68489558 + }, + "BABY_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 36558.97600941408 + }, + "BADGER_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 15180909.125460342 + }, + "BANANA_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 43487.97083739428 + }, + "BCH_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 10073215006.561533 + }, + "BERA_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 205588072.4053306 + }, + "BIGTIME_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 51337212.447418235 + }, + "BIO_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 136544057.938857 + }, + "BLAST_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 56400161.83168796 + }, + "BLUR_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 109559269.254535 + }, + "BLZ_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 10064448.528690653 + }, + "BNB_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 136686241889.6909 + }, + "BNT_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 59682479.43158628 + }, + "BOME_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 58354558.41112271 + }, + "BRETT_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 0.0 + }, + "BSV_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 420933092.7541339 + }, + "BTC_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 2122955589451.965 + }, + "CAKE_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 762791857.5600649 + }, + "CANTO_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 1322199.2787484196 + }, + "CATI_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 13552995.092222402 + }, + "CELO_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 135053601.0443175 + }, + "CFX_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 0.0 + }, + "CHILLGUY_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 174042.3083893369 + }, + "COMP_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 315522371.1288435 + }, + "CRV_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 610727599.216157 + }, + "CYBER_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 42360332.624864906 + }, + "DOGE_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 0.0 + }, + "DOOD_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 48649820.43027841 + }, + "DOT_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 0.0 + }, + "DYDX_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 214018887.73670998 + }, + "DYM_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 32110231.189281642 + }, + "EIGEN_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 330085205.96449065 + }, + "ENA_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 2376161450.7710357 + }, + "ENS_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 446155832.60514927 + }, + "ETC_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 2313131264.106589 + }, + "ETH_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 434299353161.9843 + }, + "ETHFI_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 485118477.0247199 + }, + "FARTCOIN_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 284376.59519821126 + }, + "FET_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 544489908.0582802 + }, + "FIL_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 1016083740.0190436 + }, + "FRIEND_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 2869341.0552818435 + }, + "FTM_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 0.0 + }, + "FTT_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 0.0 + }, + "GALA_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 410214884.087835 + }, + "GAS_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 149857716.9366841 + }, + "GMT_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 68841557.52603114 + }, + "GMX_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 91807230.98538564 + }, + "GOAT_market_cap": { + "datetime_utc": "2025-11-01 00:00:00", + "timestamp_ms": 1761955200000, + "market_cap": 0.0 + }, + "GRASS_market_cap": { + "datetime_utc": "2025-10-28 00:00:00", + "timestamp_ms": 1761609600000, + "market_cap": 38585.3005549229 + }, + "GRIFFAIN_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 17392444.018734735 + }, + "HBAR_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 7432895531.68406 + }, + "HEMI_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 34585774.62743865 + }, + "HMSTR_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 21881457.716577947 }, "HYPE_market_cap": { - "datetime_utc": "2025-10-14 20:55:21", - "market_cap": 10637373991.458858 + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 10744066200.305445 }, - "TOTAL_market_cap_daily": { - "datetime_utc": "2025-10-16 00:00:00", - "market_cap": 3849619103702.8604 + "HYPER_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 0.0 + }, + "ILV_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 89567990.66438538 + }, + "IMX_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 867440139.0762451 + }, + "INIT_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 21128296.434240393 + }, + "INJ_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 659065871.8067399 + }, + "IO_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 62505119.61215299 + }, + "IOTA_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 24767325.336265605 + }, + "IP_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 1288944497.962775 + }, + "JELLY_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 14213.078326048195 + }, + "JTO_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 323919252.5143652 + }, + "JUP_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 1165472279.016814 + }, + "KAITO_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 218111601.119164 + }, + "KAS_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 0.0 + }, + "LAUNCHCOIN_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 25018591.623293683 + }, + "LAYER_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 151162.8640712551 + }, + "LDO_market_cap": { + "datetime_utc": "1970-01-01 00:00:00", + "timestamp_ms": 0, + "market_cap": 0.0 + }, + "LINEA_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 187698529.9079421 + }, + "LINK_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 142279.72147959325 + }, + "LISTA_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 60841645.41038552 + }, + "LOOM_market_cap": { + "datetime_utc": "2025-10-31 00:00:00", + "timestamp_ms": 1761868800000, + "market_cap": 0.0 + }, + "LTC_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 6676039164.434603 + }, + "MANTA_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 44172013.01770599 + }, + "MATIC_market_cap": { + "datetime_utc": "2025-10-18 00:00:00", + "timestamp_ms": 1760745600000, + "market_cap": 0.0 + }, + "MAV_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 21911706.62724472 + }, + "MAVIA_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 4349810.405317102 + }, + "ME_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 67292619.84739074 + }, + "MEGA_market_cap": { + "datetime_utc": "1970-01-01 00:00:00", + "timestamp_ms": 0, + "market_cap": 0.0 + }, + "MELANIA_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 83583412.31513013 + }, + "MEME_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 15763.231214597714 + }, + "MERL_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 319327522.04054844 + }, + "MET_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 32895038.943529557 + }, + "MEW_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 135877052.97681496 + }, + "MINA_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 146020322.58194762 + }, + "MKR_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 0.0 + }, + "MNT_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 3696107.9048805744 + }, + "MON_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 9902800.530109076 + }, + "MOODENG_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 4397771.673453087 + }, + "MORPHO_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 969536559.8181872 + }, + "MOVE_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 157221083.89906973 + }, + "MYRO_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 15177548.156639775 + }, + "NEAR_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 2441358181.0741878 + }, + "NEO_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 342951027.6266851 + }, + "NIL_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 48840509.7250443 + }, + "NOT_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 82734.58508245819 + }, + "NTRN_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 23300375.381838094 + }, + "NXPC_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 69995236.7033223 + }, + "OGN_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 27580147.38301667 + }, + "OM_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 103697970.86476313 + }, + "OMNI_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 175528.067636899 + }, + "ONDO_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 1939142073.1196306 + }, + "OP_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 667649627.9813179 + }, + "ORBS_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 55029682.46756348 + }, + "ORDI_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 85185811.81412612 + }, + "OX_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 157634.6740919531 + }, + "PANDORA_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 3732534.93769119 + }, + "PAXG_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 1328106155.2408018 + }, + "PENDLE_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 457437840.1263986 + }, + "PENGU_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 965538140.3936106 + }, + "PEOPLE_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 0.0 + }, + "PIXEL_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 17048.083686552345 + }, + "PNUT_market_cap": { + "datetime_utc": "2025-11-01 00:00:00", + "timestamp_ms": 1761955200000, + "market_cap": 41233.07758518409 + }, + "POL_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 0.0 + }, + "POLYX_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 84490920.71016563 + }, + "POPCAT_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 121914452.19243732 + }, + "PROMPT_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 13562717.140439501 + }, + "PROVE_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 116187315.47981949 }, "PUMP_market_cap": { - "datetime_utc": "2025-10-14 21:02:30", - "market_cap": 1454398647.593871 + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 1369591728.1563232 }, - "summary_last_updated_utc": "2025-10-16T00:16:09.640449+00:00" + "PURR_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 65827661.55315251 + }, + "PYTH_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 539864997.208216 + }, + "RDNT_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 17498638.40698302 + }, + "RENDER_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 1034536484.2636255 + }, + "REQ_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 91529547.52464016 + }, + "RESOLV_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 14454926.320095224 + }, + "REZ_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 35173756.487066366 + }, + "RLB_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 118321265.08017306 + }, + "RSR_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 289318202.78928894 + }, + "RUNE_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 273947984.4115854 + }, + "S_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 0.0 + }, + "SAGA_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 27144628.5109482 + }, + "SAND_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 0.0 + }, + "SCR_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 32156822.293870974 + }, + "SEI_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 1035086503.8850844 + }, + "SHIA_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 197371.205124278 + }, + "SKY_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 1233438036.0145807 + }, + "SNX_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 308463989.3443749 + }, + "SOL_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 91566229600.40993 + }, + "SOPH_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 44742895.41423028 + }, + "SPX_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 679837069.7818836 + }, + "STBL_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 33660031.81704132 + }, + "STG_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 121555604.60671808 + }, + "STRAX_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 53632087.832194604 + }, + "STRK_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 480385612.1404703 + }, + "STX_market_cap": { + "datetime_utc": "2025-10-18 00:00:00", + "timestamp_ms": 1760745600000, + "market_cap": 398553.8861129834 + }, + "SUI_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 7582956962.382049 + }, + "SUPER_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 204583506.78983364 + }, + "SUSHI_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 86457467.04928584 + }, + "SYRUP_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 452516339.28053576 + }, + "TAO_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 21277.096113283824 + }, + "TIA_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 829003.4351000187 + }, + "TNSR_market_cap": { + "datetime_utc": "2025-11-03 00:00:00", + "timestamp_ms": 1762128000000, + "market_cap": 17857.56728532014 + }, + "TON_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 2403893.0332234623 + }, + "TRB_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 61551593.46789807 + }, + "TRUMP_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 22832.523567028387 + }, + "TRX_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 0.0 + }, + "TST_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 14465287.743795844 + }, + "TURBO_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 129449187.01694113 + }, + "UMA_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 87273593.42946458 + }, + "UNI_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 104652.2631986404 + }, + "UNIBOT_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 2078443.042996259 + }, + "USTC_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 0.0 + }, + "USUAL_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 28390048.92847462 + }, + "VINE_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 39341979.273077086 + }, + "VIRTUAL_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 937625889.5719905 + }, + "VVV_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 57616550.27696967 + }, + "W_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 130075.1315857268 + }, + "WCT_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 22144472.357325494 + }, + "WIF_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 110210.67851447531 + }, + "WLD_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 1643720220.8479671 + }, + "WLFI_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 3142696248.2576 + }, + "XAI_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 39683418.65722079 + }, + "XLM_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 8919546413.962923 + }, + "XPL_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 0.0 + }, + "XRP_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 139177666460.96902 + }, + "YGG_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 72289782.70350341 + }, + "YZY_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 49793986.29032182 + }, + "ZEC_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 6917445577.244665 + }, + "ZEN_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 35095.44531613883 + }, + "ZEREBRO_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 46689984.60393194 + }, + "ZETA_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 14461161.692064932 + }, + "ZK_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 373362446.8403737 + }, + "ZORA_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 272850912.0455221 + }, + "ZRO_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 159343859.3580481 + }, + "STABLECOINS_market_cap": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 275682631775.5859 + }, + "TOTAL_market_cap_daily": { + "datetime_utc": "2025-11-04 00:00:00", + "timestamp_ms": 1762214400000, + "market_cap": 3609757629625.9795 + }, + "summary_last_updated_utc": "2025-11-04T00:24:54.992739+00:00" } \ No newline at end of file diff --git a/_data/opened_positions.json b/_data/opened_positions.json new file mode 100644 index 0000000..254e134 --- /dev/null +++ b/_data/opened_positions.json @@ -0,0 +1,11 @@ +{ + "copy_trader_eth_ETH": { + "strategy": "copy_trader_eth", + "coin": "ETH", + "side": "long", + "open_time_utc": "2025-11-02T20:35:02.988272+00:00", + "open_price": 3854.9, + "amount": 0.0055, + "leverage": 3 + } +} \ No newline at end of file diff --git a/_data/strategies.json b/_data/strategies.json index e4ad53e..8ea4a3a 100644 --- a/_data/strategies.json +++ b/_data/strategies.json @@ -1,12 +1,11 @@ { - "sma_cross_eth_5m": { - "enabled": true, - "script": "strategy_runner.py", + "sma_cross_1": { + "enabled": false, "class": "strategies.ma_cross_strategy.MaCrossStrategy", "agent": "scalper_agent", "parameters": { "coin": "ETH", - "timeframe": "1m", + "timeframe": "15m", "short_ma": 7, "long_ma": 44, "size": 0.0055, @@ -14,19 +13,39 @@ "leverage_short": 5 } }, - "sma_125d_btc": { - "enabled": true, - "script": "strategy_runner.py", + "sma_44d_btc": { + "enabled": false, "class": "strategies.single_sma_strategy.SingleSmaStrategy", - "agent": "swing_agent", "parameters": { + "agent": "swing", "coin": "BTC", "timeframe": "1d", "sma_period": 44, "size": 0.0001, - "leverage_long": 2, + "leverage_long": 3, "leverage_short": 1 } + }, + "copy_trader_eth": { + "enabled": true, + "is_event_driven": true, + "class": "strategies.copy_trader_strategy.CopyTraderStrategy", + "parameters": { + "agent": "scalper", + "target_address": "0x32885a6adac4375858E6edC092EfDDb0Ef46484C", + "coins_to_copy": { + "ETH": { + "size": 0.0055, + "leverage_long": 3, + "leverage_short": 3 + }, + "BTC": { + "size": 0.0002, + "leverage_long": 1, + "leverage_short": 1 + } + } + } } } diff --git a/_data/strategy_state_copy_trader_eth.json b/_data/strategy_state_copy_trader_eth.json new file mode 100644 index 0000000..003ccf3 --- /dev/null +++ b/_data/strategy_state_copy_trader_eth.json @@ -0,0 +1,7 @@ +{ + "ETH": { + "side": "long", + "size": 0.018, + "entry": 3864.2 + } +} \ No newline at end of file diff --git a/_data/strategy_status_copy_trader_eth.json b/_data/strategy_status_copy_trader_eth.json new file mode 100644 index 0000000..c75c89a --- /dev/null +++ b/_data/strategy_status_copy_trader_eth.json @@ -0,0 +1,7 @@ +{ + "strategy_name": "copy_trader_eth", + "current_signal": "WAIT", + "last_signal_change_utc": null, + "signal_price": null, + "last_checked_utc": "2025-11-02T09:55:08.460168+00:00" +} \ No newline at end of file diff --git a/_data/strategy_status_ma_cross_btc.json b/_data/strategy_status_ma_cross_btc.json deleted file mode 100644 index 7882e85..0000000 --- a/_data/strategy_status_ma_cross_btc.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "strategy_name": "ma_cross_btc", - "current_signal": "HOLD", - "last_signal_change_utc": "2025-10-12T17:00:00+00:00", - "signal_price": 114286.0, - "last_checked_utc": "2025-10-15T11:48:55.092260+00:00" -} \ No newline at end of file diff --git a/_data/strategy_status_sma_125d_btc.json b/_data/strategy_status_sma_125d_btc.json deleted file mode 100644 index 4932ea0..0000000 --- a/_data/strategy_status_sma_125d_btc.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "strategy_name": "sma_125d_btc", - "current_signal": "SELL", - "last_signal_change_utc": "2025-10-14T00:00:00+00:00", - "signal_price": 113026.0, - "last_checked_utc": "2025-10-16T10:42:03.203292+00:00" -} \ No newline at end of file diff --git a/_data/strategy_status_sma_125d_eth.json b/_data/strategy_status_sma_125d_eth.json deleted file mode 100644 index 5c77164..0000000 --- a/_data/strategy_status_sma_125d_eth.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "strategy_name": "sma_125d_eth", - "current_signal": "BUY", - "last_signal_change_utc": "2025-08-26T00:00:00+00:00", - "signal_price": 4600.63, - "last_checked_utc": "2025-10-15T17:35:17.663159+00:00" -} \ No newline at end of file diff --git a/_data/strategy_status_sma_44d_btc.json b/_data/strategy_status_sma_44d_btc.json deleted file mode 100644 index f7966e0..0000000 --- a/_data/strategy_status_sma_44d_btc.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "strategy_name": "sma_44d_btc", - "current_signal": "SELL", - "last_signal_change_utc": "2025-10-14T00:00:00+00:00", - "signal_price": 113026.0, - "last_checked_utc": "2025-10-16T10:42:03.202977+00:00" -} \ No newline at end of file diff --git a/_data/strategy_status_sma_5m_eth.json b/_data/strategy_status_sma_5m_eth.json deleted file mode 100644 index e136da7..0000000 --- a/_data/strategy_status_sma_5m_eth.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "strategy_name": "sma_5m_eth", - "current_signal": "SELL", - "last_signal_change_utc": "2025-10-15T17:30:00+00:00", - "signal_price": 3937.5, - "last_checked_utc": "2025-10-15T17:35:05.035566+00:00" -} \ No newline at end of file diff --git a/_data/strategy_status_sma_cross.json b/_data/strategy_status_sma_cross.json deleted file mode 100644 index f51a39e..0000000 --- a/_data/strategy_status_sma_cross.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "strategy_name": "sma_cross", - "current_signal": "SELL", - "last_signal_change_utc": "2025-10-15T11:45:00+00:00", - "signal_price": 111957.0, - "last_checked_utc": "2025-10-15T12:10:05.048434+00:00" -} \ No newline at end of file diff --git a/_data/strategy_status_sma_cross_1.json b/_data/strategy_status_sma_cross_1.json deleted file mode 100644 index e9a5b44..0000000 --- a/_data/strategy_status_sma_cross_1.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "strategy_name": "sma_cross_1", - "current_signal": "FLAT", - "last_signal_change_utc": "2025-10-18T20:22:00+00:00", - "signal_price": 3893.9, - "last_checked_utc": "2025-10-18T20:30:05.021192+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 a4b5055..0b4e967 100644 --- a/_data/strategy_status_sma_cross_2.json +++ b/_data/strategy_status_sma_cross_2.json @@ -1,7 +1,7 @@ { "strategy_name": "sma_cross_2", "current_signal": "SELL", - "last_signal_change_utc": "2025-10-20T00:00:00+00:00", - "signal_price": 110811.0, - "last_checked_utc": "2025-10-20T18:45:51.578502+00:00" + "last_signal_change_utc": "2025-10-27T00:00:00+00:00", + "signal_price": 114111.0, + "last_checked_utc": "2025-11-09T21:06:17.671443+00:00" } \ No newline at end of file diff --git a/_data/strategy_status_sma_cross_eth_5m.json b/_data/strategy_status_sma_cross_eth_5m.json deleted file mode 100644 index 58400d0..0000000 --- a/_data/strategy_status_sma_cross_eth_5m.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "strategy_name": "sma_cross_eth_5m", - "current_signal": "SELL", - "last_signal_change_utc": "2025-10-15T11:45:00+00:00", - "signal_price": 4106.1, - "last_checked_utc": "2025-10-15T12:05:05.022308+00:00" -} \ No newline at end of file diff --git a/_data/wallets_info.json b/_data/wallets_info.json new file mode 100644 index 0000000..222a8f6 --- /dev/null +++ b/_data/wallets_info.json @@ -0,0 +1,290 @@ +{ + "Whale 1 (BTC Maxi)": { + "address": "0xb83de012dba672c76a7dbbbf3e459cb59d7d6e36", + "core_state": { + "raw_state": { + "marginSummary": { + "accountValue": "30018881.1193690002", + "totalNtlPos": "182930683.6996490061", + "totalRawUsd": "212949564.8190180063", + "totalMarginUsed": "22969943.9848450013" + }, + "crossMarginSummary": { + "accountValue": "30018881.1193690002", + "totalNtlPos": "182930683.6996490061", + "totalRawUsd": "212949564.8190180063", + "totalMarginUsed": "22969943.9848450013" + }, + "crossMaintenanceMarginUsed": "5420634.4984849999", + "withdrawable": "7043396.1885489998", + "assetPositions": [ + { + "type": "oneWay", + "position": { + "coin": "BTC", + "szi": "-546.94441", + "leverage": { + "type": "cross", + "value": 10 + }, + "entryPx": "115183.2", + "positionValue": "62795781.6009199992", + "unrealizedPnl": "203045.067519", + "returnOnEquity": "0.0322299761", + "liquidationPx": "159230.7089577085", + "marginUsed": "6279578.1600919999", + "maxLeverage": 40, + "cumFunding": { + "allTime": "-6923407.0911370004", + "sinceOpen": "-6923407.0970780002", + "sinceChange": "-1574.188052" + } + } + }, + { + "type": "oneWay", + "position": { + "coin": "ETH", + "szi": "-13938.989", + "leverage": { + "type": "cross", + "value": 10 + }, + "entryPx": "4106.64", + "positionValue": "58064252.5784000009", + "unrealizedPnl": "-821803.895073", + "returnOnEquity": "-0.1435654683", + "liquidationPx": "5895.7059682083", + "marginUsed": "5806425.2578400001", + "maxLeverage": 25, + "cumFunding": { + "allTime": "-6610045.8844170002", + "sinceOpen": "-6610045.8844170002", + "sinceChange": "-730.403023" + } + } + }, + { + "type": "oneWay", + "position": { + "coin": "SOL", + "szi": "-75080.68", + "leverage": { + "type": "cross", + "value": 10 + }, + "entryPx": "201.3063", + "positionValue": "14975592.4328000005", + "unrealizedPnl": "138627.573942", + "returnOnEquity": "0.0917199656", + "liquidationPx": "519.0933515657", + "marginUsed": "1497559.2432800001", + "maxLeverage": 20, + "cumFunding": { + "allTime": "-792893.154387", + "sinceOpen": "-922.301401", + "sinceChange": "-187.682929" + } + } + }, + { + "type": "oneWay", + "position": { + "coin": "DOGE", + "szi": "-109217.0", + "leverage": { + "type": "cross", + "value": 10 + }, + "entryPx": "0.279959", + "positionValue": "22081.49306", + "unrealizedPnl": "8494.879599", + "returnOnEquity": "2.7782496288", + "liquidationPx": "213.2654356057", + "marginUsed": "2208.149306", + "maxLeverage": 10, + "cumFunding": { + "allTime": "-1875.469799", + "sinceOpen": "-1875.469799", + "sinceChange": "45.79339" + } + } + }, + { + "type": "oneWay", + "position": { + "coin": "INJ", + "szi": "-18747.2", + "leverage": { + "type": "cross", + "value": 3 + }, + "entryPx": "13.01496", + "positionValue": "162200.7744", + "unrealizedPnl": "81793.4435", + "returnOnEquity": "1.005680924", + "liquidationPx": "1208.3529290194", + "marginUsed": "54066.9248", + "maxLeverage": 10, + "cumFunding": { + "allTime": "-539.133533", + "sinceOpen": "-539.133533", + "sinceChange": "-7.367325" + } + } + }, + { + "type": "oneWay", + "position": { + "coin": "SUI", + "szi": "-376577.6", + "leverage": { + "type": "cross", + "value": 3 + }, + "entryPx": "3.85881", + "positionValue": "989495.3017599999", + "unrealizedPnl": "463648.956001", + "returnOnEquity": "0.9571980625", + "liquidationPx": "64.3045458208", + "marginUsed": "329831.767253", + "maxLeverage": 10, + "cumFunding": { + "allTime": "-45793.455728", + "sinceOpen": "-45793.450891", + "sinceChange": "-1233.875821" + } + } + }, + { + "type": "oneWay", + "position": { + "coin": "XRP", + "szi": "-39691.0", + "leverage": { + "type": "cross", + "value": 20 + }, + "entryPx": "2.468585", + "positionValue": "105486.7707", + "unrealizedPnl": "-7506.1484", + "returnOnEquity": "-1.5321699789", + "liquidationPx": "607.2856858464", + "marginUsed": "5274.338535", + "maxLeverage": 20, + "cumFunding": { + "allTime": "-2645.400002", + "sinceOpen": "-116.036833", + "sinceChange": "-116.036833" + } + } + }, + { + "type": "oneWay", + "position": { + "coin": "HYPE", + "szi": "-750315.16", + "leverage": { + "type": "cross", + "value": 5 + }, + "entryPx": "43.3419", + "positionValue": "34957933.6195600033", + "unrealizedPnl": "-2437823.0249080001", + "returnOnEquity": "-0.3748177636", + "liquidationPx": "76.3945326684", + "marginUsed": "6991586.7239119997", + "maxLeverage": 5, + "cumFunding": { + "allTime": "-1881584.4214250001", + "sinceOpen": "-1881584.4214250001", + "sinceChange": "-45247.838743" + } + } + }, + { + "type": "oneWay", + "position": { + "coin": "FARTCOIN", + "szi": "-4122236.7999999998", + "leverage": { + "type": "cross", + "value": 10 + }, + "entryPx": "0.80127", + "positionValue": "1681584.057824", + "unrealizedPnl": "1621478.3279619999", + "returnOnEquity": "4.9090151459", + "liquidationPx": "6.034656163", + "marginUsed": "168158.405782", + "maxLeverage": 10, + "cumFunding": { + "allTime": "-72941.395024", + "sinceOpen": "-51271.5204", + "sinceChange": "-6504.295598" + } + } + }, + { + "type": "oneWay", + "position": { + "coin": "PUMP", + "szi": "-1921732999.0", + "leverage": { + "type": "cross", + "value": 5 + }, + "entryPx": "0.005551", + "positionValue": "9176275.0702250004", + "unrealizedPnl": "1491738.24016", + "returnOnEquity": "0.6991640321", + "liquidationPx": "0.0166674064", + "marginUsed": "1835255.0140450001", + "maxLeverage": 10, + "cumFunding": { + "allTime": "-196004.534539", + "sinceOpen": "-196004.534539", + "sinceChange": "-9892.654861" + } + } + } + ], + "time": 1761595358385 + }, + "account_value": 30018881.119369, + "margin_used": 22969943.984845, + "margin_utilization": 0.765183215640378, + "available_margin": 7048937.134523999, + "total_position_value": 0.0, + "portfolio_leverage": 0.0 + }, + "open_orders": { + "raw_orders": [ + { + "coin": "WLFI", + "side": "B", + "limitPx": "0.10447", + "sz": "2624.0", + "oid": 194029229960, + "timestamp": 1760131688558, + "origSz": "12760.0", + "cloid": "0x00000000000000000000001261000016" + }, + { + "coin": "@166", + "side": "A", + "limitPx": "1.01", + "sz": "103038.77", + "oid": 174787748753, + "timestamp": 1758819420037, + "origSz": "3000000.0" + } + ] + }, + "account_metrics": { + "cumVlm": "2823125892.6900000572", + "nRequestsUsed": 1766294, + "nRequestsCap": 2823135892 + } + } +} \ No newline at end of file diff --git a/_data/wallets_to_track.json b/_data/wallets_to_track.json new file mode 100644 index 0000000..bcb906d --- /dev/null +++ b/_data/wallets_to_track.json @@ -0,0 +1,7 @@ +[ + { + "name": "Whale 1 (BTC Maxi)", + "address": "0xb83de012dba672c76a7dbbbf3e459cb59d7d6e36", + "tags": ["btc", "high_leverage"] + } +] diff --git a/position_logic/__init__.py b/position_logic/__init__.py new file mode 100644 index 0000000..c4127c9 --- /dev/null +++ b/position_logic/__init__.py @@ -0,0 +1,2 @@ +# This file can be empty. +# It tells Python that 'position_logic' is a directory containing modules. diff --git a/position_logic/base_logic.py b/position_logic/base_logic.py new file mode 100644 index 0000000..a6cbe99 --- /dev/null +++ b/position_logic/base_logic.py @@ -0,0 +1,31 @@ +from abc import ABC, abstractmethod +import logging + +class BasePositionLogic(ABC): + """ + Abstract base class for all strategy-specific position logic. + Defines the interface for how the PositionManager interacts with logic modules. + """ + def __init__(self, strategy_name: str, send_order_callback, log_trade_callback): + self.strategy_name = strategy_name + self.send_order = send_order_callback + self.log_trade = log_trade_callback + logging.info(f"Initialized position logic for '{strategy_name}'") + + @abstractmethod + def handle_signal(self, signal_data: dict, current_strategy_positions: dict) -> dict: + """ + The core logic method. This is called by the PositionManager when a + new signal arrives for this strategy. + + Args: + signal_data: The full signal dictionary from the strategy. + current_strategy_positions: A dict of this strategy's current positions, + keyed by coin (e.g., {"BTC": {"side": "long", ...}}). + + Returns: + A dictionary representing the new state for the *specific coin* in the + signal (e.g., {"side": "long", "size": 0.1}). + Return None to indicate the position for this coin should be closed/removed. + """ + pass diff --git a/position_logic/default_flip_logic.py b/position_logic/default_flip_logic.py new file mode 100644 index 0000000..c8dfb9a --- /dev/null +++ b/position_logic/default_flip_logic.py @@ -0,0 +1,83 @@ +import logging +from position_logic.base_logic import BasePositionLogic + +class DefaultFlipLogic(BasePositionLogic): + """ + The standard "flip-on-signal" logic used by most simple strategies + (SMA, MA Cross, and even the per-coin Copy Trader signals). + + - BUY signal: Closes any short, opens a long. + - SELL signal: Closes any long, opens a short. + - FLAT signal: Closes any open position. + """ + def handle_signal(self, signal_data: dict, current_strategy_positions: dict) -> dict: + """ + Processes a BUY, SELL, or FLAT signal and issues the necessary orders + to flip or open a position. + """ + name = self.strategy_name + params = signal_data['config']['parameters'] + coin = signal_data['coin'] + desired_signal = signal_data['signal'] + signal_price = signal_data.get('signal_price', 0) + + size = params.get('size') + leverage_long = int(params.get('leverage_long', 2)) + leverage_short = int(params.get('leverage_short', 2)) + agent_name = signal_data['config'].get("agent", "default").lower() + + # --- This logic now correctly targets a specific coin --- + current_position = current_strategy_positions.get(coin) + new_position_state = None # Return None to close position + + if desired_signal == "BUY" or desired_signal == "INIT_BUY": + new_position_state = {"coin": coin, "side": "long", "size": size} + + if not current_position: + logging.warning(f"[{name}]-[{coin}] ACTION: Setting leverage to {leverage_long}x and opening LONG.") + self.send_order(agent_name, "update_leverage", coin, is_buy=True, size=leverage_long) + self.send_order(agent_name, "market_open", coin, is_buy=True, size=size) + self.log_trade(strategy=name, coin=coin, action="OPEN_LONG", price=signal_price, size=size, signal=desired_signal) + + elif current_position['side'] == 'short': + logging.warning(f"[{name}]-[{coin}] ACTION: Closing SHORT and opening LONG with {leverage_long}x leverage.") + self.send_order(agent_name, "update_leverage", coin, is_buy=True, size=leverage_long) + self.send_order(agent_name, "market_open", coin, is_buy=True, size=current_position['size'], reduce_only=True) + self.log_trade(strategy=name, coin=coin, action="CLOSE_SHORT", price=signal_price, size=current_position['size'], signal=desired_signal) + self.send_order(agent_name, "market_open", coin, is_buy=True, size=size) + self.log_trade(strategy=name, coin=coin, action="OPEN_LONG", price=signal_price, size=size, signal=desired_signal) + + else: # Already long, do nothing + logging.info(f"[{name}]-[{coin}] INFO: Already LONG, no action taken.") + new_position_state = current_position # State is unchanged + + elif desired_signal == "SELL" or desired_signal == "INIT_SELL": + new_position_state = {"coin": coin, "side": "short", "size": size} + + if not current_position: + logging.warning(f"[{name}]-[{coin}] ACTION: Setting leverage to {leverage_short}x and opening SHORT.") + self.send_order(agent_name, "update_leverage", coin, is_buy=False, size=leverage_short) + self.send_order(agent_name, "market_open", coin, is_buy=False, size=size) + self.log_trade(strategy=name, coin=coin, action="OPEN_SHORT", price=signal_price, size=size, signal=desired_signal) + + elif current_position['side'] == 'long': + logging.warning(f"[{name}]-[{coin}] ACTION: Closing LONG and opening SHORT with {leverage_short}x leverage.") + self.send_order(agent_name, "update_leverage", coin, is_buy=False, size=leverage_short) + self.send_order(agent_name, "market_open", coin, is_buy=False, size=current_position['size'], reduce_only=True) + self.log_trade(strategy=name, coin=coin, action="CLOSE_LONG", price=signal_price, size=current_position['size'], signal=desired_signal) + self.send_order(agent_name, "market_open", coin, is_buy=False, size=size) + self.log_trade(strategy=name, coin=coin, action="OPEN_SHORT", price=signal_price, size=size, signal=desired_signal) + + else: # Already short, do nothing + logging.info(f"[{name}]-[{coin}] INFO: Already SHORT, no action taken.") + new_position_state = current_position # State is unchanged + + elif desired_signal == "FLAT": + if current_position: + logging.warning(f"[{name}]-[{coin}] ACTION: Close {current_position['side']} position.") + is_buy = current_position['side'] == 'short' # To close a short, we buy + self.send_order(agent_name, "market_open", coin, is_buy=is_buy, size=current_position['size'], reduce_only=True) + self.log_trade(strategy=name, coin=coin, action=f"CLOSE_{current_position['side'].upper()}", price=signal_price, size=current_position['size'], signal=desired_signal) + # new_position_state is already None, which will remove it + + return new_position_state diff --git a/review.md b/review.md new file mode 100644 index 0000000..d0fe34c --- /dev/null +++ b/review.md @@ -0,0 +1,79 @@ +# Project Review and Recommendations + +This review provides an analysis of the current state of the automated trading bot project, proposes specific code improvements, and identifies files that appear to be unused or are one-off utilities that could be reorganized. + +The project is a well-structured, multi-process Python application for crypto trading. It has a clear separation of concerns between data fetching, strategy execution, and trade management. The use of `multiprocessing` and a centralized `main_app.py` orchestrator is a solid architectural choice. + +The following sections detail recommendations for improving configuration management, code structure, and robustness, along with a list of files recommended for cleanup. + +--- + +## Proposed Code Changes + +### 1. Centralize Configuration + +- **Issue:** Key configuration variables like `WATCHED_COINS` and `required_timeframes` are hardcoded in `main_app.py`. This makes them difficult to change without modifying the source code. +- **Proposal:** + - Create a central configuration file, e.g., `_data/config.json`. + - Move `WATCHED_COINS` and `required_timeframes` into this new file. + - Load this configuration in `main_app.py` at startup. +- **Benefit:** Decouples configuration from code, making the application more flexible and easier to manage. + +### 2. Refactor `main_app.py` for Clarity + +- **Issue:** `main_app.py` is long and handles multiple responsibilities: process orchestration, dashboard rendering, and data reading. +- **Proposal:** + - **Abstract Process Management:** The functions for running subprocesses (e.g., `run_live_candle_fetcher`, `run_resampler_job`) contain repetitive logic for logging, shutdown handling, and process looping. This could be abstracted into a generic `ProcessRunner` class. + - **Create a Dashboard Class:** The complex dashboard rendering logic could be moved into a separate `Dashboard` class to improve separation of concerns and make the main application loop cleaner. +- **Benefit:** Improves code readability, reduces duplication, and makes the application easier to maintain and extend. + +### 3. Improve Project Structure + +- **Issue:** The root directory is cluttered with numerous Python scripts, making it difficult to distinguish between core application files, utility scripts, and old/example files. +- **Proposal:** + - Create a `scripts/` directory and move all one-off utility and maintenance scripts into it. + - Consider creating a `src/` or `app/` directory to house the core application source code (`main_app.py`, `trade_executor.py`, etc.), separating it clearly from configuration, data, and documentation. +- **Benefit:** A cleaner, more organized project structure that is easier for new developers to understand. + +### 4. Enhance Robustness and Error Handling + +- **Issue:** The agent loading in `trade_executor.py` relies on discovering environment variables by a naming convention (`_AGENT_PK`). This is clever but can be brittle if environment variables are named incorrectly. +- **Proposal:** + - Explicitly define the agent names and their corresponding environment variable keys in the proposed `_data/config.json` file. The `trade_executor` would then load only the agents specified in the configuration. +- **Benefit:** Makes agent configuration more explicit and less prone to errors from stray environment variables. + +--- + +## Identified Unused/Utility Files + +The following files were identified as likely being unused by the core application, being obsolete, or serving as one-off utilities. It is recommended to **move them to a `scripts/` directory** or **delete them** if they are obsolete. + +### Obsolete / Old Versions: +- `data_fetcher_old.py` +- `market_old.py` +- `base_strategy.py` (The one in the root directory; the one in `strategies/` is used). + +### One-Off Utility Scripts (Recommend moving to `scripts/`): +- `!migrate_to_sqlite.py` +- `import_csv.py` +- `del_market_cap_tables.py` +- `fix_timestamps.py` +- `list_coins.py` +- `create_agent.py` + +### Examples / Unused Code: +- `basic_ws.py` (Appears to be an example file). +- `backtester.py` +- `strategy_sma_cross.py` (A strategy file in the root, not in the `strategies` folder). +- `strategy_template.py` + +### Standalone / Potentially Unused Core Files: +The following files seem to have their logic already integrated into the main multi-process application. They might be remnants of a previous architecture and may not be needed as standalone scripts. +- `address_monitor.py` +- `position_monitor.py` +- `trade_log.py` +- `wallet_data.py` +- `whale_tracker.py` + +### Data / Log Files (Recommend archiving or deleting): +- `hyperliquid_wallet_data_*.json` (These appear to be backups or logs).