-- ============================================================
-- SA Fund Seed Data — CostusWorx © 2026
-- Major SA unit trusts, ETFs, and living annuity wrappers.
--
-- ⚠ PROVENANCE: This file was AI-assembled from training-data
--    knowledge of well-known SA fund managers (Allan Gray,
--    Satrix, Coronation, etc.). Fund names and managers are
--    real; ISINs, TERs, inception dates, and benchmarks have
--    NOT been independently verified against ASISA or
--    Morningstar and may be inaccurate or out of date.
--
--    All rows inserted by this seed are flagged is_verified=0
--    (column default after funds_ingest.sql migration). The UI
--    surfaces an "illustrative — verify before client use"
--    warning on these funds. They are superseded automatically
--    when an authoritative source (e.g. JSE ETF list,
--    Sharenet feed) ingests a row with the same ISIN/JSE code.
-- ============================================================

INSERT INTO funds (isin, jse_code, name, fund_manager, asisa_category, fund_type, benchmark_index, ter, risk_rating, inception_date) VALUES

-- ── Satrix ETFs (listed on JSE) ───────────────────────────────
('ZAE000164462', 'STXSWX', 'Satrix SWIX 40 ETF',                        'Satrix',       'SA Equity Large Cap',     'etf',          'J406',  0.0035, 'medium_high', '2005-09-01'),
('ZAE000014070', 'STX40',  'Satrix Top 40 ETF',                          'Satrix',       'SA Equity Large Cap',     'etf',          'J200',  0.0035, 'medium_high', '2000-11-01'),
('ZAE000190436', 'STXALSI','Satrix All Share ETF',                       'Satrix',       'SA Equity General',       'etf',          'J203',  0.0035, 'medium_high', '2016-04-01'),
('ZAE000239057', 'STXWDM', 'Satrix MSCI World Equity ETF',               'Satrix',       'Global Equity General',   'etf',          'MSCI World',0.0035,'high',      '2018-05-01'),
('ZAE000192060', 'STXGOV', 'Satrix Government Bond ETF',                 'Satrix',       'SA Bond',                 'etf',          'ALBI',  0.0025, 'medium',      '2017-02-01'),
('ZAE000255281', 'STXILB', 'Satrix Inflation Linked Bond ETF',           'Satrix',       'SA Bond',                 'etf',          'CILI',  0.0025, 'medium',      '2019-06-01'),

-- ── 1nvest ETFs ──────────────────────────────────────────────
('ZAE000201446', 'ETFSP500','1nvest S&P 500 ETF',                        '1nvest',       'Global Equity General',   'etf',          'S&P 500',0.0035,'high',        '2016-11-01'),
('ZAE000254274', 'ETFGLD', '1nvest Gold ETF',                            '1nvest',       'Commodities',             'etf',          NULL,    0.0040, 'high',        '2004-11-01'),
('ZAE000200861', 'ETFPLD', '1nvest Palladium ETF',                       '1nvest',       'Commodities',             'etf',          NULL,    0.0040, 'high',        '2017-03-01'),

-- ── CoreShares ETFs ───────────────────────────────────────────
('ZAE000179115', 'CSPROP', 'CoreShares SA Listed Property ETF',          'CoreShares',   'SA Real Estate',          'etf',          'SAPY',  0.0040, 'medium_high', '2013-11-01'),

-- ── Allan Gray ────────────────────────────────────────────────
('ZAE000036003', NULL,     'Allan Gray Equity Fund',                     'Allan Gray',   'SA Equity General',       'unit_trust',   'J203',  0.0105, 'high',        '1998-10-01'),
('ZAE000036011', NULL,     'Allan Gray Balanced Fund',                   'Allan Gray',   'MA High Equity',          'unit_trust',   'CPI+5%',0.0104, 'medium_high', '1999-10-01'),
('ZAE000036029', NULL,     'Allan Gray Stable Fund',                     'Allan Gray',   'MA Low Equity',           'unit_trust',   'CPI+3%',0.0088, 'medium',      '2000-07-01'),
('ZAE000036037', NULL,     'Allan Gray Bond Fund',                       'Allan Gray',   'SA Bond',                 'unit_trust',   'ALBI',  0.0057, 'medium',      '2004-11-01'),
('ZAE000036045', NULL,     'Allan Gray Money Market Fund',               'Allan Gray',   'SA Money Market',         'money_market', 'STeFI', 0.0031, 'low',         '2001-07-01'),
(NULL,           NULL,     'Allan Gray Living Annuity',                  'Allan Gray',   NULL,                      'living_annuity',NULL,   NULL,   NULL,          NULL),

-- ── Coronation ────────────────────────────────────────────────
('ZAE000016059', NULL,     'Coronation Equity Fund',                     'Coronation',   'SA Equity General',       'unit_trust',   'J203',  0.0120, 'high',        '1996-06-01'),
('ZAE000065051', NULL,     'Coronation Balanced Plus Fund',              'Coronation',   'MA High Equity',          'unit_trust',   'CPI+5%',0.0116, 'medium_high', '1996-04-01'),
('ZAE000119398', NULL,     'Coronation Market Plus Fund',                'Coronation',   'MA High Equity',          'unit_trust',   'CPI+5%',0.0090, 'medium_high', '2001-07-01'),
('ZAE000025862', NULL,     'Coronation Bond Fund',                       'Coronation',   'SA Bond',                 'unit_trust',   'ALBI',  0.0059, 'medium',      '2000-07-01'),
('ZAE000025870', NULL,     'Coronation Strategic Income Fund',           'Coronation',   'SA Multi Asset Income',   'unit_trust',   'STeFI+2%',0.0064,'medium_low',  '2001-07-01'),
(NULL,           NULL,     'Coronation Living Annuity',                  'Coronation',   NULL,                      'living_annuity',NULL,   NULL,   NULL,          NULL),

-- ── Ninety One (formerly Investec) ────────────────────────────
('ZAE000013767', NULL,     'Ninety One SA Equity Fund',                  'Ninety One',   'SA Equity General',       'unit_trust',   'J203',  0.0118, 'high',        '1998-01-01'),
('ZAE000048488', NULL,     'Ninety One Opportunity Fund',                'Ninety One',   'MA High Equity',          'unit_trust',   'CPI+5%',0.0114, 'medium_high', '1998-07-01'),
('ZAE000090375', NULL,     'Ninety One Cautious Managed Fund',           'Ninety One',   'MA Low Equity',           'unit_trust',   'CPI+3%',0.0094, 'medium',      '2005-04-01'),
(NULL,           NULL,     'Ninety One Living Annuity',                  'Ninety One',   NULL,                      'living_annuity',NULL,   NULL,   NULL,          NULL),

-- ── Old Mutual ────────────────────────────────────────────────
('ZAE000052603', NULL,     'Old Mutual Balanced Fund',                   'Old Mutual',   'MA High Equity',          'unit_trust',   'CPI+5%',0.0120, 'medium_high', '1992-01-01'),
('ZAE000052611', NULL,     'Old Mutual Equity Fund',                     'Old Mutual',   'SA Equity General',       'unit_trust',   'J203',  0.0120, 'high',        '1992-01-01'),
('ZAE000077504', NULL,     'Old Mutual Income Fund',                     'Old Mutual',   'SA Multi Asset Income',   'unit_trust',   'STeFI+2%',0.0075,'medium_low',  '2001-11-01'),
(NULL,           NULL,     'Old Mutual Invest Living Annuity',           'Old Mutual',   NULL,                      'living_annuity',NULL,   NULL,   NULL,          NULL),

-- ── Sanlam ────────────────────────────────────────────────────
('ZAE000015036', NULL,     'Sanlam General Equity Fund',                 'Sanlam',       'SA Equity General',       'unit_trust',   'J203',  0.0118, 'high',        '1965-01-01'),
('ZAE000015069', NULL,     'Sanlam Balanced Fund',                       'Sanlam',       'MA High Equity',          'unit_trust',   'CPI+5%',0.0114, 'medium_high', '1965-01-01'),
(NULL,           NULL,     'Sanlam Living Annuity',                      'Sanlam',       NULL,                      'living_annuity',NULL,   NULL,   NULL,          NULL),

-- ── M&G (formerly Prudential) ─────────────────────────────────
('ZAE000048504', NULL,     'M&G Equity Fund',                            'M&G Investments','SA Equity General',     'unit_trust',   'J203',  0.0107, 'high',        '1999-08-01'),
('ZAE000048496', NULL,     'M&G Balanced Fund',                          'M&G Investments','MA High Equity',        'unit_trust',   'CPI+5%',0.0101, 'medium_high', '1999-08-01'),
(NULL,           NULL,     'M&G Living Annuity',                         'M&G Investments',NULL,                    'living_annuity',NULL,   NULL,   NULL,          NULL),

-- ── Foord ────────────────────────────────────────────────────
('ZAE000017511', NULL,     'Foord Balanced Fund',                        'Foord',        'MA High Equity',          'unit_trust',   'CPI+5%',0.0100, 'medium_high', '1982-01-01'),
('ZAE000017529', NULL,     'Foord Equity Fund',                          'Foord',        'SA Equity General',       'unit_trust',   'J203',  0.0100, 'high',        '1982-01-01'),
('ZAE000118077', NULL,     'Foord Conservative Fund',                    'Foord',        'MA Low Equity',           'unit_trust',   'CPI+3%',0.0075, 'medium',      '2009-04-01'),

-- ── PSG ───────────────────────────────────────────────────────
('ZAE000117830', NULL,     'PSG Balanced Fund',                          'PSG Asset Management','MA High Equity',   'unit_trust',   'CPI+5%',0.0120, 'medium_high', '2009-01-01'),
('ZAE000117855', NULL,     'PSG Equity Fund',                            'PSG Asset Management','SA Equity General','unit_trust',   'J203',  0.0120, 'high',        '2009-01-01'),

-- ── Absa/Absacap ─────────────────────────────────────────────
('ZAE000016133', NULL,     'Absa Balanced Fund',                         'Absa Asset Management','MA High Equity',  'unit_trust',   'CPI+5%',0.0110, 'medium_high', '1997-01-01'),

-- ── Stanlib ───────────────────────────────────────────────────
('ZAE000016042', NULL,     'Stanlib Balanced Fund',                      'Stanlib',      'MA High Equity',          'unit_trust',   'CPI+5%',0.0115, 'medium_high', '1996-01-01'),
('ZAE000016034', NULL,     'Stanlib Equity Fund',                        'Stanlib',      'SA Equity General',       'unit_trust',   'J203',  0.0115, 'high',        '1996-01-01'),

-- ── Glacier / Sanlam ─────────────────────────────────────────
(NULL,           NULL,     'Glacier Living Annuity',                     'Glacier by Sanlam',NULL,                  'living_annuity',NULL,   NULL,   NULL,          NULL),
(NULL,           NULL,     'Glacier Invest Living Annuity',              'Glacier by Sanlam',NULL,                  'living_annuity',NULL,   NULL,   NULL,          NULL),

-- ── Discovery ─────────────────────────────────────────────────
(NULL,           NULL,     'Discovery Balanced Fund of Funds',           'Discovery Invest','MA High Equity',        'unit_trust',  'CPI+5%', 0.0160,'medium_high', '2008-01-01'),
(NULL,           NULL,     'Discovery Living Annuity',                   'Discovery Invest',NULL,                    'living_annuity',NULL,  NULL,   NULL,          NULL),

-- ── Money market / cash ───────────────────────────────────────
(NULL,           NULL,     'Coronation Money Market Fund',               'Coronation',   'SA Money Market',         'money_market', 'STeFI', 0.0035, 'low',        '2001-01-01'),
(NULL,           NULL,     'Stanlib Money Market Fund',                  'Stanlib',      'SA Money Market',         'money_market', 'STeFI', 0.0038, 'low',        '1999-01-01'),
(NULL,           NULL,     'Nedbank Money Market Fund',                  'Nedbank',      'SA Money Market',         'money_market', 'STeFI', 0.0025, 'low',        '2000-01-01');

-- ── How to add fund_performance rows ──────────────────────────
-- Replace the fund_id values with the actual IDs from the funds table above.
-- Source: ASISA quarterly performance data (asisa.org.za → Statistics)
-- or Morningstar Direct export.
--
-- Example:
-- INSERT INTO fund_performance (fund_id, year, annual_return, source, verified) VALUES
-- (1, 2023,  0.1456, 'ASISA Q4 2023 report', 1),
-- (1, 2022, -0.0823, 'ASISA Q4 2022 report', 1),
-- ...
--
-- Bulk import from ASISA CSV export:
-- LOAD DATA LOCAL INFILE '/path/to/asisa_performance.csv'
-- INTO TABLE fund_performance (fund_id, year, annual_return, source);
