Skip to content

Bots

Purpose

The Bots screen configures the casino "house bots" — synthetic accounts that bet alongside real players to inflate live activity displays, populate leaderboards on slow days, and stress-test new game launches. Bots are an intentional engagement feature, not a fraud surface; the related online-counter inflation is documented in project_online_count_inflation memory.

Audience

Marketing / engagement (configures presence patterns), engineering (tunes wager curves), risk (audits to ensure bots aren't accidentally credited or eligible for promos).

Path in admin-fe

Screen URL Page
Bots list / config /bots ebit-admin-fe/src/app/(dashboard)/bots/page.tsx

Backing API endpoints

Endpoint Source
GET /admin/bot-activity/all (paginated list) apps/api/src/bots/bot.controller.ts:27
GET /admin/bot-activity/one/:id apps/api/src/bots/bot.controller.ts:33
POST /admin/bot-activity/manage (create / upsert) apps/api/src/bots/bot.controller.ts:39
PATCH /admin/bot-activity/manage (update) apps/api/src/bots/bot.controller.ts:45
PATCH /admin/bot-activity/bot-toggle (mark a User as bot) apps/api/src/bots/bot.controller.ts:51

Frontend wiring: ebit-admin-fe/src/queries/bots/index.ts.

Key actions

Action Required permission API call DB tables touched Audit-logged?
List bots casino-bot.view GET /admin/bot-activity/all User (where isBot=true), bot config yes
Get one bot casino-bot.view GET /admin/bot-activity/one/:id same yes
Create / upsert bot config casino-bot.management POST /admin/bot-activity/manage bot config table, User yes
Update bot config casino-bot.management PATCH /admin/bot-activity/manage same yes
Toggle a user as bot casino-bot.management PATCH /admin/bot-activity/bot-toggle User.isBot yes

The actual bot runtime (which schedules synthetic bets) is in apps/api/src/bots/system/bull/ and rides BullMQ — outside the admin screen surface. The admin screen only manages config records.

Filters and views

  • Status — active / paused.
  • Game — bots are typically configured per-game (slots, plinko, roulette).
  • Wager profile — small / medium / whale (preset curves).
  • Currency — bots play in USDT / BTC / ETH per config.

Common workflows

  1. Launch a new game with bot presence. Engineering or marketing creates a few bot configs targeting the new game slug. Sets wager profile = small, currency = USDT, schedule = 2 bets/min during peak hours. Bot runtime picks up new config on next BullMQ enqueue cycle.
  2. Pause bots during an incident. During a payment / RT outage, ops pause all bots (toggle active=false on each config) so synthetic activity doesn't pollute incident telemetry.
  3. Audit bot footprint. Risk filters all bots, exports list. Cross-references with bets-history.md — bot bets carry User.isBot=true flag, so they're excluded from public stats / leaderboards.
  4. Convert a sample test account into a bot. Engineering toggles User.isBot=true via PATCH /admin/bot-activity/bot-toggle. The user immediately stops appearing in player-facing widgets (leaderboard, online count basis).
  5. Tune the online floor. fakeUserOnline floor (180-500) is hard-coded in the UsersOnlineUpdated broadcast logic, not configured here. To change it, deploy code — see project_online_count_inflation.

Edge cases / gotchas

  • Bots have real DB user records. They sit in the User table with isBot=true. Don't DELETE — toggle inactive instead.
  • Bot bets DO show up in the bets-history listing unless filtered. Default Bets page shows real users only because the User.isBot=true filter is applied client-side.
  • Bot wins / losses still hit accounting tables. They have isolated bot-pool accounts; finance ignores them in P&L. If a bot is mis-configured (isBot=false), it can pollute real ledgers.
  • UsersOnlineUpdated inflation is independent. Disabling all bots does not zero the online widget — there's a separate fakeUserOnline floor (init 500, drift ±5, floor 180). See project_online_count_inflation.
  • Online count broadcasts every 10 s. Tuning the broadcast cadence is in apps/api/src/system/online-users/, not here.
  • No per-region bot config. Bots play in a global pool. Adding region-aware bots is a feature gap.
  • Promo-code eligibility excludes bots by design. Bots set User.isBot=true which is checked in apps/api/src/promo/services/promo-validator.service.ts.

Sequence — pause all bots during incident

sequenceDiagram
    actor admin
    participant admin-fe
    participant api
    participant pg as Postgres
    participant queue as BullMQ (bot scheduler)
    admin->>admin-fe: open /bots, select all, click Pause
    loop for each selected bot
        admin-fe->>api: PATCH /admin/bot-activity/manage { id, active: false }
        api->>api: PermissionGuard('casino-bot.management')
        api->>pg: UPDATE BotActivityConfig SET active=false
        api->>pg: INSERT AdminActionLog
    end
    api-->>admin-fe: 200 per row
    Note over queue: scheduler skips configs where active=false on next cycle (~30s)
    admin-fe-->>admin: rows show paused