TrustYBet

🚧 In active development

A mobile app that analyzes a photo of a betting slip and tells you whether the bet has positive expected value, using OCR, LLM extraction and a multi-agent quant pipeline.

Repository not public yet — happy to walk through the code on request.

Problem

Casual bettors have no idea whether the odds they're taking are good — bookmakers price in a margin, and comparing a slip against the sharp market by hand is impractical.

Solution

Users photograph a betting slip; the backend extracts teams, odds and market with GPT-4o-mini vision, normalizes them with fuzzy matching, pulls sharp-market odds from The Odds API, and runs two agents in parallel — a quant model deriving Poisson goal rates from de-vigged sharp odds and a scout scanning news feeds for injuries and form — then fuses everything into a single EV verdict.

Tech stack

  • Python
  • FastAPI
  • MongoDB
  • React Native
  • Expo
  • TypeScript
  • OpenAI API

Architecture

Two independently deployed services: a FastAPI + MongoDB backend exposing everything under /api, and a React Native (Expo Router) app. The core pipeline — upload → LLM extraction → normalization → sharp-odds lookup → parallel quant/scout agents → EV fusion → persistence — touches every backend module and feeds the history and tracker screens.

Technical highlights

  • OCR + LLM vision extraction of teams, odds, selection and bookmaker from slip screenshots
  • Fuzzy normalization of team and bookmaker names (rapidfuzz) against curated databases
  • Quant agent: Poisson grid search over goal rates derived from de-vigged sharp odds — no external stats API
  • Scout agent: RSS + LLM analysis of injuries, suspensions and form, run in parallel with asyncio
  • EV fusion combining market EV, quant EV and risk flags into a single verdict
  • Odds snapshots persisted to MongoDB for line-movement history and charts
  • Bearer-token session auth and per-tier daily rate limiting

Technical decisions

  • Derived true probabilities from de-vigged sharp bookmaker odds instead of paying for a stats API.
  • Ran the quant and scout agents concurrently with asyncio.gather to keep analysis latency acceptable.
  • Weighted market EV over model EV in the fusion formula, penalized by scout risk flags.

Challenges

  • Making LLM extraction reliable across many bookmaker slip layouts and languages.
  • Fuzzy-matching real-world team names against odds-API event names without false positives.

Future improvements

  • Add more sports and markets, and a proper bankroll tracker on top of the persisted analyses.

What I learned

  • LLMs are a practical extraction layer, but everything around them — normalization, validation, fallbacks — is where the engineering happens.