polymarket slug

This commit is contained in:
2026-06-24 11:28:26 -05:00
parent 253b8cfbcd
commit ddaa1db876
4 changed files with 185 additions and 57 deletions

View File

@@ -16,12 +16,16 @@ export async function GET() {
try {
const odds = await fetchOdds();
matches = attachOdds(rawMatches, teams, odds);
} catch {
// still ohne Wahrscheinlichkeiten
} catch (err) {
console.error("[polymarket] fetchOdds fehlgeschlagen:", err);
}
const groupTables = computeGroupTables(teams, matches);
const groupTablesLive = computeGroupTables(teams, matches, true);
// prob-Feld normalisieren: immer null statt undefined, damit JSON konsistent ist
const normalizedMatches = matches.map((m) => ({ ...m, prob: m.prob ?? null }));
const thirdTable = computeThirdPlaceTable(groupTablesLive);
const qGroups = qualifiedThirdGroups(thirdTable);
const annex = qGroups.length === 8 ? resolveAnnexC(qGroups) : null;
@@ -29,7 +33,7 @@ export async function GET() {
return NextResponse.json({
updatedAt: new Date().toISOString(),
teams,
matches,
matches: normalizedMatches,
groupTables,
groupTablesLive,
thirdTable,