// Mock data for prediction market analytics prototype

function genSeries(n, start, vol, drift) {
  const pts = [start];
  for (let i = 1; i < n; i++) {
    const next = Math.max(2, Math.min(98, pts[i - 1] + (Math.random() - 0.5 + drift) * vol));
    pts.push(Math.round(next * 10) / 10);
  }
  return pts;
}

export const MARKETS = [
  {
    id: "fed-sep-cut",
    question: "Fed cuts rates at September meeting?",
    category: "Economics",
    status: "Active",
    resolves: "Sep 18, 2026",
    yesPrice: 71.4,
    change24h: 4.2,
    volume24h: 2840000,
    volumeTotal: 41200000,
    liquidity: 6120000,
    openInterest: 18400000,
    traders: 8340,
    yesSeries: genSeries(40, 55, 4, 0.06),
    noSeries: null,
    orderBook: {
      bids: [[71.0, 182000], [70.5, 240000], [70.0, 310000], [69.5, 198000], [69.0, 145000]],
      asks: [[71.5, 165000], [72.0, 221000], [72.5, 290000], [73.0, 176000], [73.5, 130000]]
    },
    holders: [
      { trader: "0xA13f…9c2", side: "Yes", size: 420000, value: 300000 },
      { trader: "quant_owl", side: "Yes", size: 318000, value: 227000 },
      { trader: "0x77Bd…41a", side: "No", size: 275000, value: 78600 },
      { trader: "resolvr", side: "Yes", size: 210000, value: 150000 },
      { trader: "0x9F02…c88", side: "No", size: 188000, value: 53700 }
    ],
    topTraders: ["quant_owl", "resolvr", "arb_meridian", "0xA13f…9c2"]
  },
  {
    id: "btc-150k",
    question: "Bitcoin above $150,000 by year end?",
    category: "Crypto",
    status: "Active",
    resolves: "Dec 31, 2026",
    yesPrice: 38.2,
    change24h: -2.8,
    volume24h: 5120000,
    volumeTotal: 88900000,
    liquidity: 11400000,
    openInterest: 34200000,
    traders: 21300,
    yesSeries: genSeries(40, 45, 5, -0.02),
    noSeries: null,
    orderBook: {
      bids: [[38.0, 410000], [37.5, 380000], [37.0, 512000], [36.5, 290000], [36.0, 210000]],
      asks: [[38.5, 390000], [39.0, 460000], [39.5, 330000], [40.0, 280000], [40.5, 190000]]
    },
    holders: [
      { trader: "satoshi_fan", side: "Yes", size: 890000, value: 340000 },
      { trader: "0x4Ac1…d02", side: "No", size: 720000, value: 445000 },
      { trader: "bot_delta_9", side: "No", size: 610000, value: 377000 },
      { trader: "arb_meridian", side: "Yes", size: 540000, value: 206000 },
      { trader: "0xE221…7b4", side: "Yes", size: 480000, value: 183000 }
    ],
    topTraders: ["satoshi_fan", "bot_delta_9", "arb_meridian", "0x4Ac1…d02"]
  },
  {
    id: "ucl-winner",
    question: "Real Madrid win Champions League 2027?",
    category: "Sports",
    status: "Active",
    resolves: "May 30, 2027",
    yesPrice: 22.6,
    change24h: 1.1,
    volume24h: 980000,
    volumeTotal: 14300000,
    liquidity: 3210000,
    openInterest: 7600000,
    traders: 5120,
    yesSeries: genSeries(40, 20, 3, 0.03),
    noSeries: null,
    orderBook: {
      bids: [[22.0, 92000], [21.5, 110000], [21.0, 88000], [20.5, 64000], [20.0, 51000]],
      asks: [[22.5, 87000], [23.0, 101000], [23.5, 76000], [24.0, 55000], [24.5, 40000]]
    },
    holders: [
      { trader: "resolvr", side: "Yes", size: 210000, value: 47000 },
      { trader: "0xB901…5e3", side: "No", size: 198000, value: 153000 },
      { trader: "quant_owl", side: "Yes", size: 155000, value: 35000 },
      { trader: "farmer_jo", side: "Yes", size: 121000, value: 27000 }
    ],
    topTraders: ["resolvr", "quant_owl", "0xB901…5e3"]
  },
  {
    id: "us-election-28",
    question: "Democratic candidate wins 2028 election?",
    category: "Politics",
    status: "Active",
    resolves: "Nov 7, 2028",
    yesPrice: 54.8,
    change24h: 0.6,
    volume24h: 3620000,
    volumeTotal: 61500000,
    liquidity: 9870000,
    openInterest: 28100000,
    traders: 14700,
    yesSeries: genSeries(40, 50, 3.5, 0.01),
    noSeries: null,
    orderBook: {
      bids: [[54.5, 260000], [54.0, 310000], [53.5, 220000], [53.0, 190000], [52.5, 140000]],
      asks: [[55.0, 245000], [55.5, 300000], [56.0, 210000], [56.5, 175000], [57.0, 120000]]
    },
    holders: [
      { trader: "0x2Ff8…a10", side: "Yes", size: 610000, value: 334000 },
      { trader: "arb_meridian", side: "No", size: 540000, value: 244000 },
      { trader: "night_owl_88", side: "Yes", size: 410000, value: 224000 },
      { trader: "0xC450…9d1", side: "Yes", size: 380000, value: 208000 }
    ],
    topTraders: ["0x2Ff8…a10", "arb_meridian", "night_owl_88"]
  },
  {
    id: "openai-ipo",
    question: "OpenAI IPOs before end of 2027?",
    category: "Business",
    status: "Active",
    resolves: "Dec 31, 2027",
    yesPrice: 16.9,
    change24h: -0.4,
    volume24h: 740000,
    volumeTotal: 9800000,
    liquidity: 2140000,
    openInterest: 5300000,
    traders: 3980,
    yesSeries: genSeries(40, 18, 2.5, -0.01),
    noSeries: null,
    orderBook: {
      bids: [[16.5, 61000], [16.0, 72000], [15.5, 58000], [15.0, 40000], [14.5, 33000]],
      asks: [[17.0, 55000], [17.5, 63000], [18.0, 47000], [18.5, 36000], [19.0, 28000]]
    },
    holders: [
      { trader: "bot_delta_9", side: "No", size: 310000, value: 258000 },
      { trader: "0x9F02…c88", side: "Yes", size: 190000, value: 32000 },
      { trader: "farmer_jo", side: "No", size: 140000, value: 116000 }
    ],
    topTraders: ["bot_delta_9", "0x9F02…c88"]
  },
  {
    id: "fifa-worldcup",
    question: "Brazil wins 2026 FIFA World Cup?",
    category: "Sports",
    status: "Resolved · No",
    resolves: "Jul 19, 2026",
    yesPrice: 0,
    change24h: 0,
    volume24h: 0,
    volumeTotal: 27600000,
    liquidity: 0,
    openInterest: 0,
    traders: 19200,
    yesSeries: genSeries(40, 30, 5, 0.1).map((v,i,a)=> i>34 ? Math.max(0, 30 - (i-34)*6) : v),
    noSeries: null,
    orderBook: { bids: [], asks: [] },
    holders: [
      { trader: "night_owl_88", side: "No", size: 520000, value: 520000 },
      { trader: "0xC450…9d1", side: "Yes", size: 300000, value: 0 }
    ],
    topTraders: ["night_owl_88", "0xC450…9d1"]
  }
];

export const TRADERS = [
  {
    id: "quant_owl",
    handle: "quant_owl",
    wallet: "0x1a4F…88bC",
    traits: ["Arbitrage Bot", "High Volume"],
    joined: "Mar 2024",
    pnlRealized: 184200,
    pnlUnrealized: 32100,
    winRate: 68.4,
    volume: 4820000,
    avgPositionSize: 41200,
    activePositions: 14,
    pnlSeries: genSeries(30, 40, 6, 0.08),
    positions: [
      { market: "Fed cuts rates at September meeting?", side: "Yes", size: 318000, entry: 62.1, current: 71.4, pnl: 29580, status: "Open" },
      { market: "Real Madrid win Champions League 2027?", side: "Yes", size: 155000, entry: 18.4, current: 22.6, pnl: 6510, status: "Open" },
      { market: "US Presidential Election 2028", side: "No", size: 96000, entry: 48.2, current: 45.2, pnl: 2880, status: "Open" },
      { market: "Bitcoin above $100k Jan 2026", side: "Yes", size: 210000, entry: 55.0, current: 100, pnl: 94500, status: "Resolved" }
    ],
    connectedWallets: ["0x88Ac…2f01", "0x5b0D…e410"]
  },
  {
    id: "bot_delta_9",
    handle: "bot_delta_9",
    wallet: "0x5C90…14fA",
    traits: ["Trading Bot", "Resolution Farming"],
    joined: "Jan 2025",
    pnlRealized: 61400,
    pnlUnrealized: -8200,
    winRate: 54.1,
    volume: 12400000,
    avgPositionSize: 18300,
    activePositions: 62,
    pnlSeries: genSeries(30, 30, 3, 0.02),
    positions: [
      { market: "Bitcoin above $150,000 by year end?", side: "No", size: 610000, entry: 41.0, current: 38.2, pnl: 17080, status: "Open" },
      { market: "OpenAI IPOs before end of 2027?", side: "No", size: 310000, entry: 84.2, current: 83.1, pnl: 3410, status: "Open" },
      { market: "Brazil wins 2026 FIFA World Cup?", side: "No", size: 520000, entry: 71.0, current: 100, pnl: 150800, status: "Resolved" }
    ],
    connectedWallets: ["0x14fA…C90D", "0x77b2…9e11", "0x0021…aabc"]
  },
  {
    id: "arb_meridian",
    handle: "arb_meridian",
    wallet: "0x902D…7Ac1",
    traits: ["Arbitrage Bot"],
    joined: "Aug 2023",
    pnlRealized: 402800,
    pnlUnrealized: 51200,
    winRate: 71.9,
    volume: 22100000,
    avgPositionSize: 68400,
    activePositions: 9,
    pnlSeries: genSeries(30, 60, 5, 0.05),
    positions: [
      { market: "Bitcoin above $150,000 by year end?", side: "Yes", size: 540000, entry: 30.5, current: 38.2, pnl: 41580, status: "Open" },
      { market: "Democratic candidate wins 2028 election?", side: "No", size: 540000, entry: 47.0, current: 45.2, pnl: 9720, status: "Open" },
      { market: "Fed cuts rates at September meeting?", side: "Yes", size: 180000, entry: 58.0, current: 71.4, pnl: 24120, status: "Open" }
    ],
    connectedWallets: []
  },
  {
    id: "resolvr",
    handle: "resolvr",
    wallet: "0xF001…22Cd",
    traits: ["Human", "Resolution Farming"],
    joined: "Nov 2024",
    pnlRealized: 92300,
    pnlUnrealized: 12800,
    winRate: 59.7,
    volume: 6740000,
    avgPositionSize: 27600,
    activePositions: 22,
    pnlSeries: genSeries(30, 35, 4, 0.03),
    positions: [
      { market: "Fed cuts rates at September meeting?", side: "Yes", size: 210000, entry: 60.0, current: 71.4, pnl: 23940, status: "Open" },
      { market: "Real Madrid win Champions League 2027?", side: "Yes", size: 210000, entry: 15.2, current: 22.6, pnl: 15540, status: "Open" }
    ],
    connectedWallets: ["0x22Cd…F001"]
  },
  {
    id: "night_owl_88",
    handle: "night_owl_88",
    wallet: "0x3E77…B420",
    traits: ["Human", "High Volume"],
    pnlRealized: 128900,
    pnlUnrealized: 4100,
    winRate: 62.2,
    volume: 9120000,
    avgPositionSize: 35200,
    activePositions: 11,
    pnlSeries: genSeries(30, 42, 4, 0.04),
    positions: [
      { market: "Democratic candidate wins 2028 election?", side: "Yes", size: 410000, entry: 51.0, current: 54.8, pnl: 15580, status: "Open" },
      { market: "Brazil wins 2026 FIFA World Cup?", side: "No", size: 520000, entry: 68.0, current: 100, pnl: 166400, status: "Resolved" }
    ],
    connectedWallets: []
  },
  {
    id: "farmer_jo",
    handle: "farmer_jo",
    wallet: "0xA210…6Bf0",
    traits: ["Human", "Resolution Farming"],
    pnlRealized: 21400,
    pnlUnrealized: -3100,
    winRate: 48.9,
    volume: 1840000,
    avgPositionSize: 9200,
    activePositions: 31,
    pnlSeries: genSeries(30, 20, 3, -0.01),
    positions: [
      { market: "Real Madrid win Champions League 2027?", side: "Yes", size: 121000, entry: 24.0, current: 22.6, pnl: -1690, status: "Open" },
      { market: "OpenAI IPOs before end of 2027?", side: "No", size: 140000, entry: 80.0, current: 83.1, pnl: -4340, status: "Open" }
    ],
    connectedWallets: ["0x6Bf0…A210", "0x9021…4Ccb"]
  }
];
