# Market Data Service Configuration
# Copy to .env and fill in your values

# ── Binance (no key needed for public WebSocket) ──────────────────────
BINANCE_WS_URL=wss://stream.binance.com:9443/ws
# BINANCE_REST_URL=https://api.binance.com

# ── Bybit (backup crypto — no key needed) ────────────────────────────
BYBIT_WS_URL=wss://stream.bybit.com/v5/public/spot

# ── Alpaca (paper trading — free) ─────────────────────────────────────
# Get free paper keys at: https://app.alpaca.markets/paper/dashboard/overview
ALPACA_KEY=
ALPACA_SECRET=
ALPACA_BASE_URL=https://paper-api.alpaca.markets
ALPACA_DATA_WS_URL=wss://stream.data.alpaca.markets/v2/iex
ALPACA_DRY_RUN=true  # Set to false when keys are configured

# ── Storage ───────────────────────────────────────────────────────────
SQLITE_URL=sqlite+aiosqlite:///market_data.db
JSONL_PATH=events.jsonl

# ── Reliability ───────────────────────────────────────────────────────
RECONNECT_MAX_RETRIES=20
RECONNECT_BASE_DELAY=1.0
RECONNECT_MAX_DELAY=60.0
HEARTBEAT_TIMEOUT=30.0

# ── HTTP Server / Metrics ─────────────────────────────────────────────
HTTP_HOST=0.0.0.0
HTTP_PORT=8891
METRICS_ENABLED=true

# ── NATS Output (SenpAI integration) ─────────────────────────────────
# Enable to push events to NATS for SenpAI consumption
# Subject schema: md.events.{type}.{symbol}  e.g. md.events.trade.BTCUSDT
NATS_URL=nats://localhost:4222
NATS_SUBJECT_PREFIX=md.events
NATS_ENABLED=false

# ── Logging ───────────────────────────────────────────────────────────
LOG_LEVEL=INFO
LOG_SAMPLE_RATE=100
