-- =====================================================
-- SEED DATA - Schema Market Data (Production)
-- =====================================================
-- Project: OrbiQuant IA (Trading Platform)
-- Table: market_data.tickers
-- Description: Market data tickers matching trading symbols
-- Date: 2026-01-27
-- Note: The DDL (01-tickers.sql) contains inline seeds for
--       the same 6 tickers. This seed file serves as the
--       canonical source and uses ON CONFLICT to be idempotent.
-- =====================================================

SET search_path TO market_data, public;

-- =====================================================
-- 1. MARKET DATA TICKERS (6 tickers)
-- =====================================================

INSERT INTO market_data.tickers (
  symbol, name,
  asset_type, base_currency, quote_currency,
  is_ml_enabled, supported_timeframes,
  polygon_ticker,
  is_active
) VALUES
  (
    'XAUUSD', 'Gold / US Dollar',
    'commodity', 'XAU', 'USD',
    true, ARRAY['5m', '15m', '1h'],
    'C:XAUUSD',
    true
  ),
  (
    'EURUSD', 'Euro / US Dollar',
    'forex', 'EUR', 'USD',
    true, ARRAY['5m', '15m'],
    'C:EURUSD',
    true
  ),
  (
    'GBPUSD', 'British Pound / US Dollar',
    'forex', 'GBP', 'USD',
    true, ARRAY['5m', '15m'],
    'C:GBPUSD',
    true
  ),
  (
    'USDJPY', 'US Dollar / Japanese Yen',
    'forex', 'USD', 'JPY',
    true, ARRAY['5m', '15m'],
    'C:USDJPY',
    true
  ),
  (
    'AUDUSD', 'Australian Dollar / US Dollar',
    'forex', 'AUD', 'USD',
    true, ARRAY['5m', '15m'],
    'C:AUDUSD',
    true
  ),
  (
    'BTCUSD', 'Bitcoin / US Dollar',
    'crypto', 'BTC', 'USD',
    true, ARRAY['5m', '15m', '1h'],
    'X:BTCUSD',
    true
  )
ON CONFLICT (symbol) DO NOTHING;

-- =====================================================
-- VERIFICATION
-- =====================================================
SELECT 'market_data.tickers seed:' AS info, COUNT(*) AS count FROM market_data.tickers;
