Jackpot Poller Service
Relevant source files
The following files were used as context for generating this wiki page:
The Jackpot Poller Service is a critical background data collection component of the SweepBot ecosystem. Its primary purpose is to monitor and record progressive jackpot values across over 20 supported sweepstakes casino platforms at 60-second intervals. By creating a high-resolution time-series dataset of jackpot growth and hits, the service enables downstream features such as machine learning predictions, trend analysis, and optimal play timing for users.
This service is part of the project's "Data Moat" strategy, designed to accumulate proprietary data that cannot be reconstructed retroactively. It operates as a standalone Python service, typically deployed on Replit with "Always On" enabled to ensure continuous data ingestion into the central PostgreSQL database.
Sources: services/DEPLOYMENT_GUIDE.md:9-14, AGENTS.md:121-124, CLAUDE.md:57-57
Architecture and Data Flow
The Jackpot Poller follows a simple but robust polling architecture. It retrieves a list of active platforms from the database, scrapes or fetches current jackpot values for various categories (Mega, Major, Minor, etc.), and persists these snapshots back to a partitioned table in the database.
Core Logic Flow
The following diagram illustrates the execution cycle of the poller service:
Components and Integration
The poller is integrated into the broader SweepBot infrastructure as follows:
- Replit (Python 3.11): The execution environment providing "Always On" capabilities to prevent data gaps.
- Supabase (PostgreSQL 16): The destination for all captured snapshots.
- Platform Detection Engine: Utilizes logic shared with the browser extension to identify and target specific jackpot endpoints on casino sites.
Sources: services/DEPLOYMENT_GUIDE.md:27-31, DATABASE_LAYER_COMPLETE.md:46-52, AGENTS.md:144-145
Data Model
The service writes to the jackpot_snapshots table. To handle the high volume of data (projected at ~630MB/month), the table is partitioned quarterly.
jackpot_snapshots Table Schema
| Field | Type | Description |
|---|---|---|
id | UUID | Primary key, auto-generated. |
platform_id | UUID | Foreign key referencing the platforms table. |
jackpot_type | TEXT | Type of jackpot (mega, major, minor, mini, progressive, mystery). |
current_value | DECIMAL(12,2) | The numeric value of the jackpot at the time of polling. |
currency | TEXT | Currency code (default 'USD'). |
snapshot_hash | TEXT | A hash of the data used for idempotency/duplicate checking. |
captured_at | TIMESTAMP | The specific time the data was polled. |
Sources: services/DEPLOYMENT_GUIDE.md:37-47, DATABASE_LAYER_COMPLETE.md:10-12, services/DEPLOYMENT_GUIDE.md:243-247
Entity Relationship
The relationship between the Poller's data collection and the core platform management is defined below:
Service Configuration
The service requires specific environment variables to communicate with the Supabase backend.
| Variable | Description |
|---|---|
SUPABASE_URL | The API URL for the Supabase project. |
SUPABASE_SERVICE_ROLE_KEY | The secret service role key required for bypass of RLS during automated ingestion. |
Sources: services/DEPLOYMENT_GUIDE.md:21-25, services/DEPLOYMENT_GUIDE.md:115-119
Deployment and Maintenance
Deployment is managed via Replit, requiring the upload of poller.py and requirements.txt. Operations include regular partitioning of the database to ensure performance as the dataset grows.
Partition Management
Because the service generates approximately 1,440 polls per day per platform, the database must be prepared with quarterly partitions.
-- Example for Q1 2025
CREATE TABLE jackpot_snapshots_2025_q1 PARTITION OF jackpot_snapshots
FOR VALUES FROM ('2025-01-01') TO ('2025-04-01');
Sources: services/DEPLOYMENT_GUIDE.md:49-59, DATABASE_LAYER_COMPLETE.md:12-13
Operational Health Checks
Developers can verify the service is running correctly by checking the lag between the current time and the most recent captured_at timestamp. A lag significantly greater than 60 seconds indicates a service interruption or rate-limiting issue.
Sources: services/DEPLOYMENT_GUIDE.md:215-220, services/DEPLOYMENT_GUIDE.md:265-267
Summary
The Jackpot Poller Service is a foundational element of the SweepBot data strategy. By consistently capturing high-resolution jackpot data, it provides the raw material for the platform's advanced analytics, Trust Index scores, and real-time dashboard updates, ensuring a significant competitive advantage through its unique time-series data moat.
Sources: services/DEPLOYMENT_GUIDE.md:9-14, DATABASE_LAYER_COMPLETE.md:112-115