A unified multi-tool hub for sports betting, investing, gambling, and odds analysis. Compare expected returns across time horizons, backtest sports wagering strategies over 25 years of game data, and analyze edges.
Edge Spectrum is an interactive playground for exploring mathematical edges. It brings together two core analytical applications:
- The Edge Spectrum Expected-Return Visualizer (
/spectrum/): Compares expected cumulative returns across 187 financial, investing, trading, and gambling activities over 7 time horizons (1 Bet to 10 Years), standardized using the DU/CED framework. - The Backtest Simulator (
/backtester): Backtests sports wagering strategies across 25 years of MLB, NFL, NHL, and NBA games, providing ROI diagnostics, equity curves, live ESPN scores, and an AI Strategy Advisor powered by Gemini.
Served as a static page at /spectrum/index.html (internally routes to public/spectrum/index.html).
- 13 Asset/Bet Categories: Stocks, Bonds, Real Estate, Crypto, Precious Metals, Collectibles, Insurance/Annuities, Sports Betting, Casino, Poker, Prediction Markets, and Lottery.
-
Universal DU/CED Framework: Standardized expected returns via:
$$\text{Expected Return} = \text{Decision Units (DU)} \times \text{Capital Exposure per Decision (CED)} \times \text{Edge}$$ - Interactive Controls: Toggle any combination of categories, adjust time horizons (1 Bet to 10 Years), switch overlays (Raw Returns, Fee-Adjusted, After-Tax).
-
Insights Overlays:
- Addiction Risk Scoring: Color-coded border alerts based on feedback loops and documentation of problem behavior.
- Ruin Calculator: Projects hand/bet count until a $1,000 bankroll hits zero under negative-edge scenarios.
- Dollar Cost Comparison: Translates percentages into actual dollar outcomes based on a $100/week contribution.
Served inside the SPA React shell at /backtester.
- 25 Years of Historical Odds & Results: In-depth database for MLB, NFL, NHL, and NBA.
- Custom Strategy Builder: Define wager filters based on home/away status, bookmaker odds (favorites/underdogs), and custom edge margins.
- Position Sizing Models: Standard flat betting vs. Kelly Criterion sizing (Full/Fractional).
- Interactive Reports: Analyze cumulative profit curves, win rates, ROI, Kelly diagnostics, and drawdowns.
- Live Scoreboard integration: Pulls real-time ESPN scoreboard updates.
- Gemini AI Strategy Advisor: Iterates on backtest results to suggest portfolio optimizations, staking alterations, or parameter tuning.
edge-spectrum/
├── site/ # ← THE WEB APP (Vercel Root Directory = site)
│ ├── api/ # Vercel serverless functions (backtest, ESPN, Gemini advisor)
│ ├── public/
│ │ ├── favicon.svg # The served app icon
│ │ └── spectrum/ # The Edge Spectrum static Plotly visualization page
│ ├── src/
│ │ ├── components/ # Backtester UI components (AiAdvisor, StrategyBuilder, ProfitChart, etc.)
│ │ ├── pages/
│ │ │ └── Home.tsx # Landing page (dashboard tile grid mapping over tools.ts)
│ │ ├── server/ # Shared backend engines (backtest, ESPN score, Gemini prompt engines)
│ │ ├── App.tsx # Main router shell & top-nav bar
│ │ ├── main.tsx # React bootstrap
│ │ └── tools.ts # The Registry — SINGLE SOURCE OF TRUTH for all tools
│ ├── server.ts # Express local dev server (proxies/runs Vite + serverless local engines)
│ ├── package.json # Scripts & node dependencies
│ └── vercel.json # Vercel configuration (SPA routing overrides & API serverless mappings)
├── Docs/ # In-depth logs, standardized analysis, and future ideas
├── Data/ # Current and legacy edge datasets
├── Images/ # Logos, icons, screenshots, and favicon.svg (archived copy of the app icon)
└── Versions/ # Legacy and alternate versions (Streamlit port, original themes)
Note: everything the site needs lives under
site/; the repo root holds only docs and archives. Run all app commands (npm …,vercel …) from insidesite/.
- Node.js (v18+ recommended)
- Gemini API Key (to enable the AI Advisor)
Clone the repository, then install the dependencies from the site/ directory (where the app lives):
cd site
npm installCreate a .env file inside site/:
GEMINI_API_KEY=your_gemini_api_key_here
PORT=3001Starts the local Express server at http://localhost:3001 with Vite middleware for React hot-reloading:
npm run devnpm run build
npm startTo add a new tool to the Edge Spectrum hub, follow the three-step recipe:
- Register the Tool: Add an entry to the
TOOLSarray in tools.ts:{ slug: 'my-new-tool', title: 'My Custom Tool', blurb: 'Brief description of the tool...', icon: MyIconName, href: '/my-new-tool', // or direct static path kind: 'route', // 'route' | 'static' | 'external' status: 'live', // 'live' | 'wip' | 'soon' accent: 'violet', // Color scheme name tag: 'Utility' }
- Mount the Code:
routekind: Build the page component undersite/src/pages/MyNewTool.tsxand add its<Route>path inside App.tsx.statickind: Put your HTML/CSS/JS folder insidesite/public/my-new-tool/and link itshrefto/my-new-tool/index.html.externalkind: Sethrefto the external destination URL (it will open in a new tab).
- Accent Setup: Ensure the selected
accentname exists inside the Tailwind literal mapping inside Home.tsx so the JIT compiler generates the appropriate borders and glows.
The site is hosted on Vercel (edge-spectrum.mikesailab.com). The Vercel project's Root Directory is set to site, so it builds from the app subdirectory.
- Production branch:
main(automatically deployed on push/merge). - Local deployment check: You can use the Vercel CLI (run from
site/) to verify preview environments before merging:cd site vercel deploy
Expected returns are modeled averages derived from historical market data, bookmaker averages, and retail-trader statistics. Individual results vary drastically due to short-term variance.
Caution
For educational purposes only. This tool does not constitute investment or gambling advice.
Managed by Mike's AI Lab · Standalone HTML/CSS/Plotly viz and React/Vite dashboard
GAMBLING: LINEAR DECAY · INVESTING: COMPOUND APPRECIATION