#!/bin/bash

# Bitcoin Trading Bot Setup Script

echo "======================================"
echo "Bitcoin Trading Bot - Setup"
echo "======================================"

# Check Python version
echo "Checking Python version..."
python3 --version

# Create virtual environment (optional)
echo ""
echo "Creating virtual environment..."
python3 -m venv venv

# Activate virtual environment
echo "Activating virtual environment..."
source venv/bin/activate

# Install dependencies
echo ""
echo "Installing dependencies..."
pip install --upgrade pip
pip install -r requirements.txt

# Create .env from example
if [ ! -f .env ]; then
    echo ""
    echo "Creating .env file from template..."
    cp .env.example .env
    echo "Please edit .env with your Kraken API credentials"
fi

# Create config.json if not exists
if [ ! -f config.json ]; then
    echo ""
    echo "config.json already exists"
fi

echo ""
echo "======================================"
echo "Setup Complete!"
echo "======================================"
echo ""
echo "Next steps:"
echo "1. Edit .env with your Kraken API credentials"
echo "2. (Optional) Edit config.json for custom settings"
echo "3. Run the bot in dry-run mode:"
echo "   python -m bot.main --dry-run --verbose"
echo ""
echo "Get Kraken API key: https://www.kraken.com/api/keygen"
echo "======================================"
