env.example 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. # ========================================
  2. # Hyperliquid API Configuration (CCXT Style)
  3. # ========================================
  4. # Your Hyperliquid API Generator Secret Key (from https://app.hyperliquid.xyz/API)
  5. # This is the SECRET KEY generated by the API panel - NOT your main wallet's private key!
  6. HYPERLIQUID_SECRET_KEY=your_api_secret_key_here
  7. # Your API Wallet Address (from https://app.hyperliquid.xyz/API)
  8. # This is the NEW wallet address created by the API generator - NOT your main MetaMask address!
  9. # It will be different from your main wallet address (0x...)
  10. HYPERLIQUID_WALLET_ADDRESS=your_api_wallet_address_here
  11. # Network selection: true for testnet (safe), false for mainnet (real money!)
  12. HYPERLIQUID_TESTNET=true
  13. # Margin mode for all positions: ISOLATED (recommended) or CROSS
  14. # ISOLATED = Each position has its own margin (safer)
  15. # CROSS = All positions share the same margin pool (riskier)
  16. HYPERLIQUID_MARGIN_MODE=ISOLATED
  17. # ========================================
  18. # Trading Bot Configuration
  19. # ========================================
  20. # Default token for market/price commands (when no token specified)
  21. DEFAULT_TRADING_TOKEN=BTC
  22. # Risk management settings
  23. RISK_MANAGEMENT_ENABLED=true
  24. # Stop loss threshold based on ROE (Return on Equity) percentage - matches Hyperliquid UI
  25. # This is the percentage loss of your actual cash investment, not margin
  26. # For hard exits: 10.0 = -10% ROE triggers automatic position closure
  27. # Set to 100.0 to disable (would require -100% ROE = total loss)
  28. STOP_LOSS_PERCENTAGE=10.0
  29. # ========================================
  30. # Copy Trading Configuration
  31. # ========================================
  32. # Enable/disable copy trading functionality
  33. COPY_TRADING_ENABLED=true
  34. # Trader address to follow (from our analysis)
  35. COPY_TRADING_TARGET_ADDRESS=0x59a15c79a007cd6e9965b949fcf04125c2212524
  36. # Portfolio allocation percentage for copy trading (0.0 to 1.0)
  37. # 0.1 = 10% of account, 0.5 = 50% of account, 1.0 = 100% of account
  38. COPY_TRADING_PORTFOLIO_PERCENTAGE=0.05
  39. # Copy trading mode: PROPORTIONAL or FIXED
  40. # PROPORTIONAL: Scale position size based on target trader's portfolio percentage
  41. # FIXED: Use fixed percentage of your account regardless of their position size
  42. COPY_TRADING_MODE=FIXED
  43. # Maximum leverage to use when copying (safety limit)
  44. # Will use target trader's leverage but cap it at this value
  45. COPY_TRADING_MAX_LEVERAGE=5
  46. # Minimum position size in USD (to avoid dust trades)
  47. COPY_TRADING_MIN_POSITION_SIZE=10.0
  48. # Delay between trade detection and execution (seconds)
  49. # Small delay to avoid API rate limits and ensure data consistency
  50. COPY_TRADING_EXECUTION_DELAY=5
  51. # Enable copy trading notifications via Telegram
  52. COPY_TRADING_NOTIFICATIONS=true
  53. # Only copy NEW trades (skip existing positions on startup)
  54. # true = Only copy trades that happen after bot starts (recommended)
  55. # false = Copy all positions immediately on startup (legacy behavior)
  56. COPY_TRADING_ONLY_NEW_TRADES=true
  57. # ========================================
  58. # RSI Notification Configuration
  59. # ========================================
  60. # Enable/disable RSI vs RSI_SMA notifications
  61. RSI_NOTIFICATION_ENABLED=true
  62. # Timeframe for RSI analysis
  63. RSI_TIMEFRAME=1h
  64. # RSI calculation period (typically 14)
  65. RSI_PERIOD=14
  66. # RSI SMA period for smoothing (typically 5-10)
  67. RSI_SMA_PERIOD=5
  68. # ========================================
  69. # Telegram Bot Configuration
  70. # ========================================
  71. # Get these from @BotFather in Telegram
  72. TELEGRAM_BOT_TOKEN=your_telegram_bot_token_here
  73. # Get this by running: python utils/get_telegram_chat_id.py
  74. TELEGRAM_CHAT_ID=your_chat_id_here
  75. # Enable/disable Telegram integration
  76. TELEGRAM_ENABLED=true
  77. # ========================================
  78. # Web UI Configuration
  79. # ========================================
  80. # Enable/disable Web UI
  81. WEB_ENABLED=true
  82. # Web server host and port
  83. WEB_HOST=127.0.0.1
  84. WEB_PORT=8080
  85. # API key for web authentication (generate a secure random string)
  86. WEB_API_KEY=your_secure_api_key_here
  87. # CORS origins (comma-separated list)
  88. WEB_CORS_ORIGINS=http://localhost:8080,http://127.0.0.1:8080
  89. # ========================================
  90. # Custom Keyboard Configuration
  91. # ========================================
  92. # Enable/disable custom keyboard shortcuts (Freqtrade-style persistent buttons)
  93. TELEGRAM_CUSTOM_KEYBOARD_ENABLED=true
  94. # Custom keyboard layout - comma-separated commands per row, pipe-separated rows
  95. # Format: "cmd1,cmd2,cmd3|cmd4,cmd5|cmd6,cmd7,cmd8,cmd9"
  96. # Example: "/daily,/performance,/balance|/stats,/positions,/orders|/price,/market,/help,/commands"
  97. TELEGRAM_CUSTOM_KEYBOARD_LAYOUT="/daily,/performance,/balance|/stats,/positions,/orders|/price,/market,/help,/commands"
  98. # ========================================
  99. # Bot Monitoring Configuration
  100. # ========================================
  101. # Heartbeat interval for monitoring orders, positions, and price alarms (in seconds)
  102. # Default: 10 seconds - good balance between responsiveness and API usage
  103. # Minimum recommended: 10 seconds (to avoid rate limiting)
  104. # Maximum recommended: 300 seconds (5 minutes)
  105. BOT_HEARTBEAT_SECONDS=10
  106. # Interval (in heartbeats) for running less frequent cleanup tasks in MarketMonitor
  107. # (e.g., orphaned stop loss cleanup, position synchronization)
  108. # Default: 10 heartbeats (e.g., if BOT_HEARTBEAT_SECONDS is 10s, cleanup runs every 100s)
  109. MARKET_MONITOR_CLEANUP_INTERVAL_HEARTBEATS=10
  110. # ========================================
  111. # Logging
  112. # ========================================
  113. # Options: DEBUG, INFO, WARNING, ERROR
  114. LOG_LEVEL=INFO
  115. # Enable/disable logging to file (true/false)
  116. LOG_TO_FILE=true
  117. # Log file path (relative to project root)
  118. LOG_FILE_PATH=logs/trading_bot.log
  119. # Log rotation type: 'size' (rotate when file gets too big) or 'time' (rotate daily/hourly)
  120. LOG_ROTATION_TYPE=time
  121. # For size-based rotation: max file size in MB before rotation
  122. LOG_MAX_SIZE_MB=10
  123. # For time-based rotation: when to rotate ('midnight', 'H' for hourly, 'D' for daily)
  124. LOG_ROTATION_INTERVAL=midnight
  125. # Number of backup log files to keep (older files are automatically deleted)
  126. LOG_BACKUP_COUNT=5