Skip to content

[Backend] — Live Odds WebSocket Channel per Market #1361

Description

@Olowodarey

Labels: backend, enhancement, websocket, markets

Problem

Clients must poll for odds updates because there is no push channel delivering per-market odds changes in real time.

Requirements

  1. Add a subscribe/unsubscribe flow for per-market odds rooms in the gateway.
  2. Broadcast odds updates to a market's room when they change.
  3. Throttle broadcasts to a configurable max frequency.
  4. Clean up empty rooms and handle disconnects.

Acceptance Criteria

  • Subscribers to a market receive odds updates without polling.
  • Broadcast frequency respects the configured throttle.
  • Rooms are cleaned up on last unsubscribe/disconnect.
  • Tests cover subscribe, broadcast, and cleanup.

Files

backend/src/websocket/events.gateway.ts, backend/src/websocket/broadcaster.service.ts, backend/src/websocket/websocket.module.ts

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions