Affiliate System
The DropBet affiliate system allows users to generate custom referral codes, track their referred users, and earn commissions based on their referrals’ activity. It is tier-based and designed to support content creators, streamers, and regular players.
7.1 Key Features
Affiliate Code Generation
- Users can generate up to 3 custom affiliate codes.
- Each code is unique and tied to the user’s ID.
- Codes can be copied and shared as links (e.g.
dropbet.com?ref=CODE
).
Referral Tracking
- When a new user signs up with a referral code, the referrer is saved in the system.
- Tracking is cookie-based for non-logged-in users and applied during account creation.
- The referral relationship is permanent and stored in the database.
Referral List
Each affiliate user can see a full list of users who signed up using their code. The list includes:
- Username or ID of referred users
- Registration date
- Total wagered
- Commission generated
Earnings and Commission
- The commission system is tier-based:
- Commission rates increase as the affiliate refers more wager volume or users.
- Commissions are based on referred players' losses or wagers, depending on configuration.
- Earnings are shown in a dashboard-style UI, updated in real-time or via daily sync.
7.2 Frontend Architecture
State Management:
- Uses Zustand (
useTrafficIncomeStore
) to track affiliate data on the frontend.
- May share logic with promocode handling via
useAffiliateCodeStore
.
React Query:
- Affiliate statistics and referral lists are fetched via
react-query
for real-time display.
UI Sections:
- Code generator (input + copy/share buttons)
- Referral list table
- Commission stats block (current tier, earnings, claimable balance)
- Terms & conditions/info tooltip or modal
7.3 Backend Logic
- Referral relationships are stored at user registration (
user_id → referred_by
).
- Commissions are calculated based on platform-defined formulas, likely triggered by:
- Bets placed by referred users
- Net losses over a time period
- Commission tiers are defined in configuration or admin settings.
- Affiliates have a balance that can be:
- Claimed manually to wallet
7.4 Admin & Control
Admins can:
- See top affiliates by revenue or user count
- Adjust commission tiers
- View referral lists
- Revoke or reset affiliate codes
The system includes limits such as:
- Minimum wager volume for commission eligibility
- Anti-abuse filters (e.g. self-referrals, duplicate IPs)
7.5 Promocode Connection
- Promocodes can optionally be linked to affiliate accounts.
- Claiming a promocode could trigger a referral attribution if no referrer is already set.
- Useful for streamers who give out both codes and links.