Skip to Content
PredictorSDK

Spread rows can no longer carry the opposing team's market

Fix

GET /v1/matching-markets/sports?include_submarkets=true returns spread submarkets with a signed line and a subject. Because the sign is only meaningful relative to the subject, a source market filed under the wrong subject inverts the position for anyone trading off the row — it is a sign error, not a cosmetic mismatch.

Two things could produce that inversion.

Team codes were matched as bare substrings. Canonical codes are two or three characters and appear inside the other team's name: pit inside "Capitals", ari inside "Mariners", lad inside "Philadelphia", la inside "Dallas", tor inside "Storm", fla inside "Flames". A substring hit decided the subject, and it was consulted before Polymarket's own -spread-away- / -spread-home- slug token, so a collision beat the authoritative signal. Sweeping every ordered same-league pair through the classifier, 1,210 of 5,884 cases resolved to the opposing team, and 33 still did with the structured slug signal present.

Subject resolution now reads explicit source-native signals first — the provider's own team code, then Polymarket's slug side — and only then scans the title, as whole-word phrases through the league alias table rather than as bare substrings. The scan is greedy longest-first, so "Chicago Cubs" is no longer decided by the "Chicago" it shares with the White Sox, and a title naming both teams is treated as ambiguous instead of resolving to whichever name was read first.

SX Bet's side was inferred from label order. Its market_name is only the fixture's team pair — identical across the moneyline, every spread and every total on that game — so the side lives exclusively in the outcome labels, each of which names its own team and carries its own sign ("Baltimore Orioles -1.5" against "St. Louis Cardinals +1.5"). The classifier read which label carried the sign rather than which team the label named. It now reads the team out of the label.

When no source-native signal resolves the side, the market is dropped from the spread submarket space rather than filed against a default participant. A spread you cannot attribute is not a spread; the previous behaviour booked it against the away team, which is correct exactly half the time.

No response fields changed, and no correct row moved: all 257 spread source markets in the live snapshot resolve identically before and after. Affected rows are those on matchups where a team's code collides with the opponent's name — WNBA Seattle at Toronto and MLB Seattle at Arizona are both real fixtures that would have inverted.