# 🧙‍♂️ Gandalf's Hyperliquid Funding Rate Trading Bot

## Strategy: Funding Rate Timing

**Historical Performance:**
- Sharpe Ratio: 2.23
- Win Rate: 60%
- Max Drawdown: -10.1%

### Entry Rules:
- **LONG**: Funding rate near zero OR negative (shorts paying longs) + positive price momentum
- **SHORT**: Funding rate high positive (longs paying shorts) + negative price momentum

### Exit Rules:
- Stop Loss: 2%
- Take Profit: 4%
- Max Hold Time: 24 hours

---

## Quick Start

```bash
cd /home/node/.openclaw/workspace/crypto-wallet/bot

# Install dependencies
pip install -r requirements.txt

# Run bot + dashboard
python3 start_bot.py

# Dashboard only
python3 start_bot.py --dashboard-only
```

## Dashboard

Access at: **http://localhost:5000**

## Configuration

Edit `config.py` to adjust:
- `PAPER_TRADING = True/False` - Paper or Live mode
- `BANKROLL` - Starting capital
- `POSITION_SIZE_MIN/MAX` - Trade size ($10-20)
- `TRADING_PAIRS` - Assets to trade
- `STOP_LOSS_PERCENT`, `TAKE_PROFIT_PERCENT` - Risk parameters

## Currently Trading

- BTC, ETH, SOL, ARB, LINK, AVAX, MATIC

## Mode

**PAPER TRADING** (no real funds used)

The bot is running with simulated trades based on real-time Hyperliquid market data.

## Files

- `config.py` - All configuration parameters
- `hyperliquid_bot.py` - Core trading engine + simulation
- `dashboard.py` - Flask web dashboard
- `start_bot.py` - Starter script
- `trades.log` - Detailed trade log

## Disclaimer

This bot is for educational purposes. Cryptocurrency trading involves substantial risk of loss. Past performance does not guarantee future results.
