# Oracle Publisher API Keys - Quick Fix Guide

**Date**: $(date)

---

## ✅ Quick Answer

**Do you need API keys?**

- **CoinGecko**: Optional but **recommended** (higher rate limits)
- **Binance**: Not needed (removed - geo-blocked anyway)
- **CryptoCompare**: No API key needed (now used as alternative)

---

## 🔧 Current Configuration (After Fix)

The service now uses:
1. **CoinGecko** - Can work without API key, but you'll hit rate limits (429 errors)
2. **CryptoCompare** - No API key needed, works globally

---

## 📝 To Add CoinGecko API Key (Optional but Recommended)

### Step 1: Get Free API Key

1. Visit: https://www.coingecko.com/en/api/pricing
2. Sign up for free "Basic" plan
3. Copy your API key from dashboard

### Step 2: Update Configuration

```bash
ssh root@192.168.11.10
pct exec 3500 -- bash
cd /opt/oracle-publisher
nano .env
```

Add or update:
```bash
COINGECKO_API_KEY=your_api_key_here
DATA_SOURCE_1_URL=https://api.coingecko.com/api/v3/simple/price?ids=ethereum&vs_currencies=usd&x_cg_demo_api_key=your_api_key_here
```

Or use the environment variable:
```bash
COINGECKO_API_KEY=your_api_key_here
DATA_SOURCE_1_URL=https://api.coingecko.com/api/v3/simple/price?ids=ethereum&vs_currencies=usd&x_cg_demo_api_key=${COINGECKO_API_KEY}
```

### Step 3: Restart Service

```bash
systemctl restart oracle-publisher
systemctl status oracle-publisher
```

---

## 🔍 Verify It's Working

```bash
# Check logs
ssh root@192.168.11.10 "pct exec 3500 -- journalctl -u oracle-publisher -f"

# Should see successful price fetches without 429 errors
```

---

## 📊 API Comparison

| API | API Key Needed? | Rate Limits | Geo-blocking |
|-----|----------------|-------------|--------------|
| CoinGecko (free) | No | 10-50 calls/min | No |
| CoinGecko (with key) | Yes | 500+ calls/min | No |
| CryptoCompare | No | Unlimited (fair use) | No |
| Binance | No | N/A | **Yes** (removed) |

---

## ✅ Summary

**Current Status**: Service configured with CryptoCompare (no API key needed). Works without any API keys.

**Recommendation**: Add CoinGecko API key for redundancy and higher rate limits.

---

**Last Updated**: $(date)

