// Vérifie que chaque action surveillée a bien un cours, en euros ou en dollars. // Usage : pnpm tsx scripts/check-universe.mts import YahooFinance from "yahoo-finance2"; import { UNIVERSE } from "../src/lib/universe"; const yf = new YahooFinance({ suppressNotices: ["yahooSurvey"] }); const rows = await yf.quote(UNIVERSE.map((s) => s.symbol)); const found = new Map(rows.map((r) => [r.symbol, r])); let bad = 0; for (const s of UNIVERSE) { const r = found.get(s.symbol); if (!r || r.regularMarketPrice == null || !["EUR", "USD"].includes(r.currency ?? "")) { bad++; console.log("PROBLEME", s.symbol, s.name, r?.currency, r?.regularMarketPrice); } } console.log(`${UNIVERSE.length - bad}/${UNIVERSE.length} actions OK`);