Case Study · Canada · 2024–Present

SharpStakes
Ambassador Tech

Multi-role sportsbook affiliate operations platform engineered for scale. Backend-heavy, performance-tuned, built for real operator workflows.

5K+
Records Optimized
7+
Modules Built
0
Manual Payout Errors
0.3s
Real-Time Poll Rate
Bubble.ioBackend WorkflowsReal-Time APIsCommission EnginePerformance OptimizationAdmin ToolingStreak LogicReferral Systems
Project Overview

What SharpStakes does

SharpStakes is a production SaaS platform for sportsbook affiliates — the operational infrastructure running ambassador networks across US and Canadian betting markets. It replaces manual workflows (spreadsheet commissions, email approvals, DM-based support) with a fully automated multi-role system used daily by operators and hundreds of ambassadors.

The system handles large data volumes, real-time sportsbook feeds, complex commission logic, and daily operational workflows without degradation. Built to run a real business, not a demo.

👤

Ambassador Management

Full lifecycle: onboarding, tier assignment, referral tracking, status management, and performance monitoring with multi-role access.

📸

Screenshot Approval Pipeline

Ambassadors submit bet screenshots for commission. Automated review queue with approval, rejection, reason tracking, and payout triggering.

💰

Commission Engine

Configurable payout rules per tier and bet type. Automated calculation, queue processing, and disbursement with zero manual intervention.

📊

Analytics & Retention

Weekly streak system, leaderboards, performance dashboards, configurable time-range reporting, and operator-level analytics.

Real-Time Sportsbook Data

Live odds, parlay builder, and bet tracker integrated with US/Canada sportsbook APIs via recursive polling workflows.

🛠

Operator Admin Tooling

Full admin portal: ambassador oversight, bulk operations, system configuration, audit trails, and complete operational visibility.

Engineering Challenges

The hard problems

SharpStakes required solving several non-trivial engineering problems — performance at scale, complex temporal logic, real-time data handling, and operational reliability, simultaneously.

01

Large Dataset Performance at 5K+ Records

Eliminated all full-list searches. Every query uses :filtered with server-side constraints — role, status, date ranges — before results hit the page. Combined with :count guards and conditional states, query volume reduced over 70% versus a naive implementation.

02

Weekly Streak Calculation with Timezone Handling

Streak systems need consecutive weekly tracking. Bubble stores UTC; ambassadors span US Eastern, Central, and Canadian timezones. Built a server-side streak engine using scheduled backend workflows that calculate week boundaries in the ambassador's local timezone, storing last_active_week and comparing against current_week_number without any frontend calculation.

03

Commission Logic Complexity

Rules differ by ambassador tier, sportsbook, bet type, and market. Built a configurable commission rule engine — a data-driven table of conditions and multipliers evaluated per submission by the backend, rather than hardcoded branching. Operators modify commission structures without developer involvement.

04

Recursive Workflow Architecture for Real-Time Data

Implemented a recursive backend workflow pattern — a workflow that triggers itself on completion — enabling continuous API polling at controlled intervals. Key constraint: circuit-breaker logic terminates the loop on repeated API errors rather than creating an infinite cascade.

05

Screenshot Approval at Scale

Designed the screenshot data type with index-able fields from day one — market, status, ambassador, date, sportsbook. The approval workflow is entirely server-side: status transitions, payout triggers, notification sends, and audit log writes all happen in a single backend chain without a page refresh.

06

Multi-Country Market Segmentation

US and Canadian markets have different odds formats, payment rails, and commission structures. Built market-aware data architecture — a top-level market flag propagating through the commission engine, display logic, and reporting layer, keeping operations logically separated without duplicating workflows.

07

Referral Attribution Integrity

Referral chains need atomic attribution. Used Bubble's option set + lock field pattern to ensure single-write attribution, with a server-side validation step that checks attribution before committing the referral record — no race conditions.

08

Admin Query Performance

Consolidated aggregations into pre-computed summary fields updated by backend workflows on relevant events (new submission, status change, weekly rollup). Admin pages read from summary records rather than recomputing live on load.

Architecture

System architecture & data flow

SharpStakes is structured around a backend-first architecture — all business logic lives in server-side workflows, the frontend reads pre-computed state, and UI interactions trigger backend chains rather than in-page calculations.

Ambassador Commission Flow
Ambassadorsubmits screenshot
Validationformat + duplicate
Review Queueoperator review
Commission Calcrule engine
Payoutauto-disbursement
Audit Logimmutable record
Data Layer
Ambassador Data Model
View Image

Ambassador Data Model

Normalized types with indexed query fields. Commission rules stored as data records, not code branches.

Workflow Engine
Backend Workflow Chain
View Image

Backend Workflow Chain

Approval → calculation → payout → notification → audit. One atomic chain, zero page refreshes.

Real-Time Layer
Recursive Polling System
View Image

Recursive Polling System

Self-triggering loop for live sportsbook data. Circuit breaker on API failure. No degradation over time.

Streak System
Weekly Streak Engine
View Image

Weekly Streak Engine

Scheduled backend calculation with timezone normalization. Continuation vs. reset determined server-side.

Admin Portal
Operator Dashboard
View Image

Operator Dashboard

Pre-aggregated summary reads. Bulk operations via server-side list processing. Configurable time ranges.

Commission Engine
💰
Rule-Based Commission
View Image

Rule-Based Commission

Data-driven rule table evaluated per submission. Operators configure rules without developer involvement.

Performance Engineering

Optimization techniques

Performance on Bubble.io at scale requires deliberate architectural decisions. Here are the core patterns applied across SharpStakes.

Query Design

Constrained Server-Side Searches

Every search applies the minimum constraint set before Bubble fetches. Status + date range + market filter applied server-side — never filtering a full list client-side.

// Always constrain before fetch
Search Ambassadors
 :status = active
 :market = user.market
 :created > start_of_week
Aggregation Pattern

Pre-Computed Summary Fields

Admin dashboards read from summary records updated by backend events — not live aggregations. Total commissions, submission counts, streak values: all pre-computed on event trigger.

// On every approval:
Make changes to AmbassadorSummary
 total_paid += commission_amount
 approved_count += 1
Pagination

Server-Side Pagination

All list views use Bubble's built-in pagination with server-side page counts. No client-side list slicing. Page size tuned to 25 items for optimal load time.

// Never load full list
RG data source:
 Search Submissions > paginate
 Page current_page, size 25
State Management

Custom State for UI Only

UI state (active tab, filter selection) stored in custom states — never re-fetched from the database on toggle. Filter changes trigger a single new constrained search.

// Filter change → one search
When filter changes:
 Set state active_filter
 RG updates automatically
Backend Workflows

Chained Server-Side Processing

Multi-step operations execute in a single backend workflow chain. The page never waits for intermediary steps — it just reads the final state.

// One trigger, full chain
Backend: approve_submission
 Step 1: Update submission
 Step 2: Trigger commission_calc
 Step 3: Send notification
Data Modeling

Indexed Query Fields by Design

Data types designed with query patterns in mind from day one — market, status, week_number, and tier fields exist specifically because they appear in search constraints.

// Designed for search first
Ambassador type:
 market: option (US / CA)
 streak: number
 tier: option set
Outcomes

Results & impact

SharpStakes replaced manual operations with automated systems. Here's the measured impact across key operational areas.

100%
Commission Automation
Zero manual payout calculations. Rule engine handles all tier/market variants
5K+
Records Tuned
All queries constrained server-side. No full-list scans in production
7+
Modules Shipped
Ambassador, Admin, Parlay, Chat, Analytics, Referral, Streak System
~0s
Admin Load Time
Pre-aggregated summaries. Dashboards load from single summary records

Operational shift: Daily manual work from operators — reviewing screenshots, calculating commissions, tracking ambassador performance — now runs automatically. Operators oversee the system, not maintain it.

Technical shift: SharpStakes demonstrates that Bubble.io can handle genuine enterprise-scale operational workflows when the architecture is right. The constraint isn't the platform — it's how you use it.

Next Case Study
Djiminy — Enterprise Device & Lifecycle Platform
View Case Study