kennyhyder an hour ago
A few things I wrestled with that might be interesting to HN:
*No-vig math at scale.* Computing the per-market de-vigged probability requires knowing every outcome on the book's market. Some books split markets weirdly (separate moneyline+spread vs combined; futures with 100+ contestants where some have no Kalshi equivalent). I ended up normalizing post-fetch in Postgres rather than at the API layer because the same raw book row gets reused across multiple "comparable" Kalshi markets.
*Slug collisions.* MLB plays the same teams 3 days in a row, each with a "Hits" prop event. All three slugify to the same string. event-by-slug returned null on maybeSingle() and 404'd in the wild. Fix: append date suffix to the slug for repeating event types. Almost shipped this with a one-off backfill but ended up just self-healing on next cron-ingest tick.
*Kalshi fee math.* The fee formula caps at 7¢ per contract regardless of contract count, which is asymmetric vs sportsbook vig (which scales with stake). I show edge gross-of-fee for Pro users and net-of-fee for Elite, because at typical bet sizes the fee compresses small edges enough to matter and the math isn't intuitive.
Open to porting more leagues (WNBA, MLS Cup, FIFA Club WC) if HN folks have interest. Drop a comment.
kennyhyder an hour ago