# Database Configuration
# ======================
# Updated: 2026-01-25 - Homologated to use local PostgreSQL only

# PostgreSQL - Primary Database (trading_platform)
# All data now stored locally in PostgreSQL
postgres:
  host: "${DB_HOST:-localhost}"
  port: "${DB_PORT:-5432}"
  database: "${DB_NAME:-trading_platform}"
  user: "${DB_USER:-trading_user}"
  password: "${DB_PASSWORD:-trading_dev_2026}"
  pool_size: 10
  max_overflow: 20
  pool_timeout: 30
  pool_recycle: 3600
  echo: false

# MySQL - DEPRECATED (2026-01-25)
# Historical data has been migrated to PostgreSQL market_data schema
# This section is kept for reference only and is NOT used
mysql:
  _deprecated: true
  _deprecation_note: "Use PostgreSQL market_data schema instead"
  _migration_date: "2026-01-25"
  host: "72.60.226.4"  # Remote server no longer accessible
  port: 3306
  user: "root"
  password: "[REDACTED]"
  database: "db_trading_meta"

redis:
  host: "localhost"
  port: 6379
  db: 0
  password: null
  decode_responses: true
  max_connections: 50
  
# Data fetching settings
data:
  default_limit: 50000
  batch_size: 5000
  cache_ttl: 300  # seconds
  
# Table names (PostgreSQL market_data schema)
tables:
  # Primary OHLCV tables
  ohlcv_5m: "market_data.ohlcv_5m"
  ohlcv_15m: "market_data.ohlcv_15m"
  tickers: "market_data.tickers"

  # Legacy mappings (for backward compatibility)
  tickers_agg_data: "market_data.ohlcv_5m"      # Maps to 5-minute data
  tickers_agg_ind_data: "market_data.ohlcv_5m"  # Same table, indicators computed at runtime
  tickers_agg_data_predict: "ml.predictions"    # ML predictions table