diff --git a/app/api/macro/route.ts b/app/api/macro/route.ts index 5b0faff..62fe65e 100644 --- a/app/api/macro/route.ts +++ b/app/api/macro/route.ts @@ -5,7 +5,7 @@ import cpiOverridesRaw from "@/data/cpi_overrides.json"; import rateDecisionsRaw from "@/data/rate_decisions.json"; import { fetchFFThisWeek, fetchFFEvents } from "@/lib/forexfactory"; import type { FFEvent } from "@/lib/forexfactory"; -import { fetchTECoreInflation, fetchTEMoMInflation, fetchTEInflationYoY, fetchTECoreCPIMoM, fetchTECoreConsumerPricesIndex, fetchTEPPIMoM, fetchTECoreInflationPages, fetchTEInflationYoYPages, fetchTEAUDCommodityYoY, fetchTEGDPGrowthRate, fetchTEUnemploymentRate } from "@/lib/tecpi"; +import { fetchTECoreInflation, fetchTEMoMInflation, fetchTEInflationYoY, fetchTECoreCPIMoM, fetchTECoreConsumerPricesIndex, fetchTEPPIMoM, fetchTECoreInflationPages, fetchTEInflationYoYPages, fetchTEAUDCommodityYoY, fetchTEGDPGrowthRate, fetchTEUnemploymentRate, fetchTESTIRRate } from "@/lib/tecpi"; import { fetchTEInflationForecasts } from "@/lib/tradingeconomics"; const FRED_BASE = "https://api.stlouisfed.org/fred/series/observations"; @@ -1025,7 +1025,7 @@ export async function GET(req: NextRequest) { // Remplace séries FRED stale/erronées. // Nouvelles données : cpiYoY headline, cpiCoreMoM (pages individuelles), ppiMoM { - const [teCoreMap, teMoMMap, teYoYMap, teCoreMoMMap, teCoreIdxMap, tePPIMap, teCorePages, teYoYPages, teAUDComm, teGDPMap, teUneMap] = await Promise.all([ + const [teCoreMap, teMoMMap, teYoYMap, teCoreMoMMap, teCoreIdxMap, tePPIMap, teCorePages, teYoYPages, teAUDComm, teGDPMap, teUneMap, teSTIRMap] = await Promise.all([ fetchTECoreInflation(), fetchTEMoMInflation(), fetchTEInflationYoY(), @@ -1037,6 +1037,7 @@ export async function GET(req: NextRequest) { currency === "AUD" ? fetchTEAUDCommodityYoY() : Promise.resolve(null), fetchTEGDPGrowthRate(), fetchTEUnemploymentRate(), + fetchTESTIRRate(), ]); const teCore = teCoreMap[currency]; @@ -1136,6 +1137,29 @@ export async function GET(req: NextRequest) { }; } + // STIR 3M — Taux interbancaire 3 mois (SOFR 3M, EURIBOR 3M, SONIA 3M, TIBOR 3M…) + // Signal clé : STIR > policyRate = marché price des hausses (hawkish) + // STIR < policyRate = marché price des baisses (dovish) + // Tendance ↑ = conditions crédit plus restrictives (prêter plus risqué/cher) + // Tendance ↓ = conditions crédit plus souples (prêter plus sûr/moins cher) + { + const teSTIR = teSTIRMap[currency]; + if (teSTIR) { + const surprise = teSTIR.prev !== null + ? parseFloat((teSTIR.value - teSTIR.prev).toFixed(4)) + : null; + indicators.stir3m = { + value: teSTIR.value, + prev: teSTIR.prev, + surprise, + trend: teSTIR.prev !== null + ? (teSTIR.value > teSTIR.prev ? "up" : teSTIR.value < teSTIR.prev ? "down" : "flat") + : null, + lastUpdated: teSTIR.refMonth, + }; + } + } + // GDP Growth Rate QoQ% — TE country-list (source autoritaire, remplace FRED stale) // FRED : retourne souvent l'indice niveau brut → QoQ% faux ou en retard de plusieurs trimestres // TE country-list/gdp-growth-rate : QoQ% publié directement, mis à jour à chaque release diff --git a/components/CurrencyCard.tsx b/components/CurrencyCard.tsx index 136bc6c..fb71bc3 100644 --- a/components/CurrencyCard.tsx +++ b/components/CurrencyCard.tsx @@ -779,6 +779,59 @@ export default function CurrencyCard({ )} + {/* STIR 3M — Taux interbancaire court terme */} + {inds?.stir3m?.value != null && (() => { + const stir = inds.stir3m!.value!; + const stirPrev = inds.stir3m!.prev; + const stirTrend = inds.stir3m!.trend; + // Spread STIR - Taux directeur + const stirSpread = policyRateValue !== null + ? parseFloat((stir - policyRateValue).toFixed(2)) : null; + // Signal : spread positif = marché price des hausses (hawkish) + const stirSig: SignalDir = + stirTrend === "up" ? "bearish" // hausse STIR = crédit plus cher/risqué + : stirTrend === "down" ? "bullish" // baisse STIR = crédit plus sûr/souple + : "neutral"; + const spreadSig: SignalDir = + stirSpread !== null && stirSpread > 0.1 ? "bullish" // STIR > CT = hawkish bias + : stirSpread !== null && stirSpread < -0.1 ? "bearish" // STIR < CT = dovish bias + : "neutral"; + return ( + <> +
+
{item.summary}
)} - {/* Impact badges */} + {/* Impact badges + bouton détail */} {visibleImpacts.length > 0 && ( -