#!/usr/bin/env python3
"""
run_trader.py - Entry point for the trading bot
Run this to start trading without the dashboard
"""

import sys
import os
sys.path.insert(0, os.path.dirname(__file__))

import hyperliquid_bot

# Run simulation (paper trading)
print("🤖 Starting Gandalf's Hyperliquid Trader...")
print("📊 Strategy: Funding Rate Timing")
print("📄 Mode: PAPER TRADING (simulated)")
print()

status_fn = hyperliquid_bot.run_simulation()

# Keep the main thread alive so daemon threads keep running
try:
    while True:
        import time
        time.sleep(30)
        # Periodically print status
        stats = status_fn()
        print(f"📊 [{stats['mode']}] Bankroll: ${stats['bankroll']:.2f} | "
              f"P&L: ${stats['total_pnl']:.2f} | "
              f"Trades: {stats['closed_trades']} | "
              f"Open: {stats['open_positions']}")
except KeyboardInterrupt:
    print("\n🛑 Bot stopped by user.")
