feat(markets): surface gold and silver across dashboard and briefs

This commit is contained in:
calesthio
2026-03-28 22:53:23 -07:00
parent 3f3d050382
commit 1b80539cdc
7 changed files with 46 additions and 9 deletions

View File

@@ -428,7 +428,7 @@ export class DiscordAlerter {
const highs = signals.filter(s => s.severity === 'high');
const nukeSignal = signals.find(s => s.key === 'nuke_anomaly');
const osintNew = signals.filter(s => s.key?.startsWith('tg_urgent'));
const marketSignals = signals.filter(s => ['vix', 'hy_spread', 'wti', 'brent', '10y2y'].includes(s.key));
const marketSignals = signals.filter(s => ['vix', 'hy_spread', 'wti', 'brent', 'natgas', 'gold', 'silver', '10y2y'].includes(s.key));
const conflictSignals = signals.filter(s => ['conflict_events', 'conflict_fatalities', 'thermal_total'].includes(s.key));
if (nukeSignal) {

View File

@@ -222,7 +222,7 @@ export class TelegramAlerter {
const highs = signals.filter(s => s.severity === 'high');
const nukeSignal = signals.find(s => s.key === 'nuke_anomaly');
const osintNew = signals.filter(s => s.key?.startsWith('tg_urgent'));
const marketSignals = signals.filter(s => ['vix', 'hy_spread', 'wti', 'brent', '10y2y'].includes(s.key));
const marketSignals = signals.filter(s => ['vix', 'hy_spread', 'wti', 'brent', 'natgas', 'gold', 'silver', '10y2y'].includes(s.key));
const conflictSignals = signals.filter(s => ['conflict_events', 'conflict_fatalities', 'thermal_total'].includes(s.key));
// FLASH: nuclear anomaly, or ≥3 critical signals across domains
@@ -667,7 +667,7 @@ Respond with ONLY valid JSON:
const sections = [];
// Categorize signals
const marketSignals = signals.filter(s => ['vix', 'hy_spread', 'wti', 'brent', 'natgas', '10y2y', 'fed_funds', '10y_yield', 'usd_index'].includes(s.key));
const marketSignals = signals.filter(s => ['vix', 'hy_spread', 'wti', 'brent', 'natgas', 'gold', 'silver', '10y2y', 'fed_funds', '10y_yield', 'usd_index'].includes(s.key));
const osintSignals = signals.filter(s => s.key === 'tg_urgent' || s.item?.channel);
const conflictSignals = signals.filter(s => ['conflict_events', 'conflict_fatalities', 'thermal_total'].includes(s.key));
const otherSignals = signals.filter(s => !marketSignals.includes(s) && !osintSignals.includes(s) && !conflictSignals.includes(s));

View File

@@ -13,6 +13,8 @@ const DEFAULT_NUMERIC_THRESHOLDS = {
wti: 3,
brent: 3,
natgas: 5,
gold: 2,
silver: 3,
unemployment: 2,
fed_funds: 1,
'10y_yield': 3,
@@ -41,6 +43,8 @@ const NUMERIC_METRICS = [
{ key: 'wti', extract: d => d.energy?.wti, label: 'WTI Crude' },
{ key: 'brent', extract: d => d.energy?.brent, label: 'Brent Crude' },
{ key: 'natgas', extract: d => d.energy?.natgas, label: 'Natural Gas' },
{ key: 'gold', extract: d => d.metals?.gold, label: 'Gold' },
{ key: 'silver', extract: d => d.metals?.silver, label: 'Silver' },
{ key: 'unemployment', extract: d => d.bls?.find(b => b.id === 'LNS14000000' || b.id === 'UNRATE')?.value, label: 'Unemployment' },
{ key: 'fed_funds', extract: d => d.fred?.find(f => f.id === 'DFF')?.value, label: 'Fed Funds Rate' },
{ key: '10y_yield', extract: d => d.fred?.find(f => f.id === 'DGS10')?.value, label: '10Y Yield' },

View File

@@ -73,6 +73,15 @@ function compactSweepForLLM(data, delta, previousIdeas) {
sections.push(`ENERGY: WTI=$${data.energy.wti}, Brent=$${data.energy.brent}, NatGas=$${data.energy.natgas}, CrudeStocks=${data.energy.crudeStocks}bbl`);
}
// Metals
if (data.metals?.gold != null || data.metals?.silver != null) {
const gold = data.metals?.gold != null ? `$${data.metals.gold}` : 'n/a';
const silver = data.metals?.silver != null ? `$${data.metals.silver}` : 'n/a';
const goldChg = data.metals?.goldChangePct != null ? ` (${data.metals.goldChangePct >= 0 ? '+' : ''}${data.metals.goldChangePct}%)` : '';
const silverChg = data.metals?.silverChangePct != null ? ` (${data.metals.silverChangePct >= 0 ? '+' : ''}${data.metals.silverChangePct}%)` : '';
sections.push(`METALS: Gold=${gold}${goldChg}, Silver=${silver}${silverChg}`);
}
// BLS
if (data.bls?.length) {
sections.push(`LABOR: ${data.bls.map(b => `${b.id}=${b.value}`).join(', ')}`);