Skip to content

NBA prop betting analysis tool using real-time stats and Kelly Criterion for optimal bet sizing

Notifications You must be signed in to change notification settings

coleschaffer/PropWise

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

80 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PropWise

React TypeScript Flask Tailwind

An intelligent NBA prop betting analysis tool that evaluates betting opportunities using real-time statistics and the Kelly Criterion.

Overview

PropWise helps sports bettors identify profitable NBA player prop bets by combining live player statistics with advanced financial algorithms. It fetches real-time data from the NBA Stats API, calculates hit rates based on recent and career performance, computes expected value, and allocates capital optimally using the Kelly Criterion.

Instead of manually analyzing hundreds of daily props, get instant evaluations with confidence scores and optimal bet sizing.

Features

  • Real-Time NBA Data - Fetches live player statistics via official NBA Stats API
  • Smart Analysis - Evaluates props using Kelly Criterion for optimal capital allocation
  • Hit Rate Calculation - Analyzes last 10 games (60% weight) and career stats (40% weight)
  • Expected Value (EV) - Computes EV for each betting opportunity
  • Edge Detection - Identifies bets with positive edge vs. implied probability
  • Multi-Sportsbook Support - Compare odds across DraftKings, FanDuel, BetMGM, William Hill
  • Bet Tracking - Track placed bets and view historical performance
  • Player Caching - Efficient batching system minimizes API calls

Tech Stack

Category Technology
Frontend React 18, TypeScript 5, Vite 5
Styling Tailwind CSS 3.4, Framer Motion
Backend Flask 3.0, Python 3.11+
Data NBA Stats API, The Odds API
Proxy Zyte API (bypasses rate limits)
Production Gunicorn, Render.com

Getting Started

Prerequisites

  • Node.js 18+
  • Python 3.11+
  • Zyte API key
  • The Odds API key

Installation

# Clone the repository
git clone https://github.com/coleschaffer/PropWise.git
cd PropWise

# Install frontend dependencies
npm install

# Install backend dependencies
cd backend && pip install -r requirements.txt && cd ..

# Configure environment
cp .env.example .env

Configuration

Edit .env with your API keys:

ZYTE_API_KEY=your_zyte_api_key
ODDS_API_KEY=your_odds_api_key
VITE_BACKEND_URL=http://localhost:5001
VITE_ODDS_API_KEY=your_odds_api_key

Running Locally

# Terminal 1: Start backend
cd backend && python server.py
# Runs on http://localhost:5001

# Terminal 2: Start frontend
npm run dev
# Runs on http://localhost:5173

Project Structure

PropWise/
├── src/
│   ├── components/              # React components
│   │   ├── BetCard.tsx         # Individual bet display
│   │   ├── PortfolioSummary.tsx # Allocation summary
│   │   └── BetHistory.tsx      # Historical bets
│   ├── services/
│   │   ├── scoring.ts          # Hit rate & EV calculation
│   │   ├── allocation.ts       # Kelly Criterion
│   │   ├── nbaApiService.ts    # NBA stats fetching
│   │   └── oddsApiService.ts   # Odds API integration
│   └── types/                  # TypeScript interfaces
├── backend/
│   ├── server.py              # Flask API server
│   └── requirements.txt       # Python dependencies
├── NBA API for WebApp/        # Custom NBA Stats client
└── backtest-worker/           # Historical data collection

How It Works

Data Pipeline

  1. Fetches live props from The Odds API (~1,658 daily props)
  2. Deduplicates to ~250 unique players
  3. Batches player stat requests (20/batch with delays)
  4. Uses Zyte proxy to bypass NBA API rate limits

Bet Evaluation

  1. Hit Rate - % of games player exceeded/stayed under the line
  2. Confidence Score - Weighted: 60% recent (10 games) + 40% career
  3. Implied Probability - Derived from sportsbook odds
  4. Edge - Hit Rate minus Implied Probability
  5. Expected Value - EV = (Hit Rate × Decimal Odds) - 1
  6. Kelly Criterion - Optimal bet size for bankroll growth

API Endpoints

Endpoint Description
GET /health Health check
GET /api/player/<name> Get player stats
GET /api/player/<name>/game-logs?games=10 Recent game logs
GET /api/player/<name>/career Career statistics
GET /api/search?q=<query> Search players
GET /api/current-season Current NBA season

Deployment

Configured for Render.com deployment:

  1. Push code to GitHub
  2. Connect repo to Render
  3. Render auto-detects render.yaml
  4. Add environment variables in dashboard

License

MIT License

About

NBA prop betting analysis tool using real-time stats and Kelly Criterion for optimal bet sizing

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published