polymarket slug
This commit is contained in:
@@ -23,18 +23,45 @@ export function saveOverrides(overrides: SimOverrides): void {
|
||||
} catch { /* quota exceeded */ }
|
||||
}
|
||||
|
||||
// Plausibles Standardergebnis aus Polymarket-Wahrscheinlichkeiten.
|
||||
// Favorit gewinnt 1:0; bei hoher W'keit (>=0.65) 2:0.
|
||||
// Ohne prob: Gruppe → 1:1, K.o. → null (Nutzer muss selbst eingeben).
|
||||
// Plausibles Standardergebnis aus Polymarket-3-Wege-Wahrscheinlichkeiten.
|
||||
//
|
||||
// Schwellen (zentral):
|
||||
// Draw am höchsten ODER max(home,away) < 0.40 → 0:0 (Gruppe) / 1:0 Heim (K.o.)
|
||||
// Favorit 0.40–0.60 → 1:0
|
||||
// Favorit 0.60–0.78 → 2:0
|
||||
// Favorit > 0.78 → 3:0
|
||||
//
|
||||
// Beispiele:
|
||||
// Schweiz–Kanada (0.385/0.315/0.295) → 0:0
|
||||
// Schottland–Brasilien (0.10/0.17/0.75) → 0:2
|
||||
// Marokko–Haiti (0.83/0.13/0.05) → 3:0
|
||||
export function defaultScore(match: Match): { homeScore: number; awayScore: number } | null {
|
||||
const prob = match.prob;
|
||||
if (!prob) {
|
||||
if (match.stage === "GROUP") return { homeScore: 1, awayScore: 1 };
|
||||
return null;
|
||||
}
|
||||
|
||||
const maxFA = Math.max(prob.home, prob.away);
|
||||
const isDraw = prob.draw > prob.home && prob.draw > prob.away;
|
||||
const isGroup = match.stage === "GROUP";
|
||||
|
||||
if (isDraw || maxFA < 0.40) {
|
||||
if (isGroup) return { homeScore: 0, awayScore: 0 };
|
||||
return { homeScore: 1, awayScore: 0 }; // K.o.: knapp Heim (kein Remis)
|
||||
}
|
||||
|
||||
// Favorit bestimmen
|
||||
const homeFav = prob.home >= prob.away;
|
||||
const favProb = Math.max(prob.home, prob.away);
|
||||
const goals = favProb >= 0.65 ? 2 : 1;
|
||||
let goals: number;
|
||||
if (maxFA > 0.78) {
|
||||
goals = 3;
|
||||
} else if (maxFA >= 0.60) {
|
||||
goals = 2;
|
||||
} else {
|
||||
goals = 1; // 0.40–0.60
|
||||
}
|
||||
|
||||
if (homeFav) return { homeScore: goals, awayScore: 0 };
|
||||
return { homeScore: 0, awayScore: goals };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user