brackt/app/routes
Chris Parsons 79ec477a98 feat: implement Expected Value System with ICM probability calculator
Implements Phase 5.2 of the EV system with Harville-Malmuth Independent Chip Model
for calculating participant placement probabilities from futures odds.

## Key Features

### ICM Probability Calculator
- Implements Harville-Malmuth method for distributing probabilities
- Converts American odds to championship probabilities
- Generates P(1st) through P(8th) for all participants
- Column-normalized: each placement sums to 100% across all teams
- Works with any number of participants (not limited to 8)

### Admin UI - Futures Odds Entry
- Enter American odds (e.g., +550, -200) for championship futures
- Live preview of ICM-calculated probability distributions
- Displays all 8 placement probabilities
- Persists odds for editing on subsequent visits
- Automatic probability normalization (removes bookmaker vig)

### Database Schema Updates
- Renamed participant_expected_values.season_id → sports_season_id
- Updated foreign key to reference sports_seasons instead of seasons
- Added source_odds field to store original futures odds
- Migration 0025: Column rename and FK update
- Migration 0026: Add source_odds field

### Model Layer
- participant-expected-value: CRUD operations for probability distributions
- Supports multiple probability sources (manual, futures_odds, elo_simulation)
- Automatic EV calculation based on league scoring rules
- Probability validation and normalization

### Service Layer
- icm-calculator: Harville-Malmuth probability distribution
- probability-engine: Odds conversion and Elo utilities (for future use)
- bracket-simulator: Monte Carlo simulation (for future hybrid approach)
- ev-calculator: Expected value computation from probabilities

## Technical Details

- Uses exponential decay favoring top positions for strong teams
- Preserves championship probability ordering in final distributions
- Row sums vary (strong teams ~100%, weak teams lower)
- All probabilities between 0-1, mathematically valid
- Comprehensive test suite: 97 tests passing

## Future Enhancements

- Hybrid approach: ICM pre-playoffs, bracket simulation during playoffs
- Integration with league-specific scoring rules
- Historical probability tracking for accuracy analysis

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-17 22:19:46 -08:00
..
api feat: Implement autodraft chain logic and timer initialization for next team picks 2025-10-25 22:11:10 -07:00
leagues feat: add recharts library and implement PointProgressionChart component for historical views 2025-11-14 21:18:34 -08:00
teams feat: add random team name generation and improve league exit flow 2025-10-14 22:45:24 -07:00
admin._index.tsx feat: implement daily standings snapshot system with admin management interface 2025-11-14 09:15:58 -08:00
admin.data-sync.tsx feat: add admin routes and checkbox component for sports management 2025-10-12 21:54:49 -07:00
admin.participants.tsx feat: add admin routes and checkbox component for sports management 2025-10-12 21:54:49 -07:00
admin.sports-seasons.$id.events.$eventId.bracket.server.ts feat: Implement team breakdown pages with detailed score breakdown 2025-11-14 20:01:21 -08:00
admin.sports-seasons.$id.events.$eventId.bracket.tsx feat: Implement team breakdown pages with detailed score breakdown 2025-11-14 20:01:21 -08:00
admin.sports-seasons.$id.events.$eventId.server.ts feat: Implement Qualifying Points Standings component and related logic 2025-11-11 10:08:25 -08:00
admin.sports-seasons.$id.events.$eventId.tsx feat: Implement team breakdown pages with detailed score breakdown 2025-11-14 20:01:21 -08:00
admin.sports-seasons.$id.events.server.ts feat: Implement Qualifying Points Standings component and related logic 2025-11-11 10:08:25 -08:00
admin.sports-seasons.$id.events.tsx feat: Implement Qualifying Points Standings component and related logic 2025-11-11 10:08:25 -08:00
admin.sports-seasons.$id.expected-values.tsx feat: implement Expected Value System with ICM probability calculator 2025-11-17 22:19:46 -08:00
admin.sports-seasons.$id.futures-odds.tsx feat: implement Expected Value System with ICM probability calculator 2025-11-17 22:19:46 -08:00
admin.sports-seasons.$id.participants.tsx feat: add bulk participant creation and expected value field 2025-10-15 21:21:33 -07:00
admin.sports-seasons.$id.tsx feat: implement Expected Value System with ICM probability calculator 2025-11-17 22:19:46 -08:00
admin.sports-seasons.new.tsx feat: Implement Qualifying Points Standings component and related logic 2025-11-11 10:08:25 -08:00
admin.sports-seasons.tsx feat: add bulk participant creation and expected value field 2025-10-15 21:21:33 -07:00
admin.sports.$id.tsx feat: add icon support for sports with file upload and active seasons display 2025-10-13 10:30:47 -07:00
admin.sports.new.tsx feat: add icon support for sports with file upload and active seasons display 2025-10-13 10:30:47 -07:00
admin.sports.tsx feat: add icon support for sports with file upload and active seasons display 2025-10-13 10:30:47 -07:00
admin.standings-snapshots.tsx feat: implement daily standings snapshot system with admin management interface 2025-11-14 09:15:58 -08:00
admin.templates.$id.tsx refactor: remove isRequired field from season sports and templates 2025-10-13 15:00:59 -07:00
admin.templates.new.tsx feat: add admin routes and checkbox component for sports management 2025-10-12 21:54:49 -07:00
admin.templates.tsx feat: add admin routes and checkbox component for sports management 2025-10-12 21:54:49 -07:00
admin.tsx feat: add admin routes and checkbox component for sports management 2025-10-12 21:54:49 -07:00
api.admin.export-sports-data.ts feat: add admin routes and checkbox component for sports management 2025-10-12 21:54:49 -07:00
home.tsx feat: add random team name generation and improve league exit flow 2025-10-14 22:45:24 -07:00
how-to-play.tsx refactor: replace About and Contact nav links with How To Play page 2025-10-12 16:42:15 -07:00
i.$inviteCode.tsx feat: add invite code system for league seasons with member access control 2025-10-14 12:20:36 -07:00
test-socket.tsx feat: add socket test route and echo event handler for debugging 2025-10-17 12:15:07 -07:00
user-profile.tsx feat: add user model, routes, and Clerk webhook integration 2025-10-11 00:53:39 -07:00