Bug
KalshiAdapter.searchMarkets() fails to match any Kalshi events to Shipp games because of two issues in the event title parsing logic at src/adapters/kalshi.ts:162-170.
Problem 1: Wrong separator
The code splits event titles on "vs":
const [eventHome, eventAway] = eventTitle.split('vs')
But Kalshi NBA event titles use "at" as the separator:
Milwaukee at New Orleans
Denver at Portland
LA Clippers at Los Angeles L
Since "vs" never appears, split('vs') returns the full title as element 0 and undefined as element 1. The match check then fails for every event.
Problem 2: Home/away order is reversed
The destructuring assumes [home, away], but the "X at Y" format means away at home — so the correct destructuring should be [away, home].
Problem 3: Name format mismatch
Even with the correct separator and order, Shipp returns full team names (e.g., "Milwaukee Bucks", "New Orleans Pelicans") while Kalshi titles use city-only names (e.g., "Milwaukee", "New Orleans"). The current startsWith comparison happens to handle this correctly ("milwaukee bucks".startsWith("milwaukee") → true), but cleanName() doesn't strip team mascots, so this is fragile.
Reproduction
./index.ts value-bet --game 01KHT4DVTP874NMCEVJVP3ERYA
Logs show:
Kalshi checking event title: Milwaukee at New Orleans
...
No event matches, falling back to market search
Found 0 markets for Milwaukee Bucks @ New Orleans Pelicans
The fallback market search (lines 191-216) also returns 0 because it searches by full team name using includes(), which won't find "new orleans pelicans" in Kalshi market titles that only say "New Orleans".
Suggested fix
- Split on multiple separators (
" vs ", " at ", " @ ")
- Correct the destructuring order for
"at" / "@" formats (away at home)
- Consider normalizing team names to city-only to improve matching reliability across data sources
Environment
- alph-bot v0.1.0-alpha
- Kalshi production API (
api.elections.kalshi.com)
- Sport: NBA
Bug
KalshiAdapter.searchMarkets()fails to match any Kalshi events to Shipp games because of two issues in the event title parsing logic atsrc/adapters/kalshi.ts:162-170.Problem 1: Wrong separator
The code splits event titles on
"vs":But Kalshi NBA event titles use
"at"as the separator:Since
"vs"never appears,split('vs')returns the full title as element 0 andundefinedas element 1. The match check then fails for every event.Problem 2: Home/away order is reversed
The destructuring assumes
[home, away], but the"X at Y"format means away at home — so the correct destructuring should be[away, home].Problem 3: Name format mismatch
Even with the correct separator and order, Shipp returns full team names (e.g.,
"Milwaukee Bucks","New Orleans Pelicans") while Kalshi titles use city-only names (e.g.,"Milwaukee","New Orleans"). The currentstartsWithcomparison happens to handle this correctly ("milwaukee bucks".startsWith("milwaukee")→ true), butcleanName()doesn't strip team mascots, so this is fragile.Reproduction
Logs show:
The fallback market search (lines 191-216) also returns 0 because it searches by full team name using
includes(), which won't find"new orleans pelicans"in Kalshi market titles that only say"New Orleans".Suggested fix
" vs "," at "," @ ")"at"/"@"formats (away at home)Environment
api.elections.kalshi.com)