Build real-time betting and casino game platforms with PubNub
Does it follow best practices?
Evaluation — 93%
↑ 1.52xAgent success when using this tile
Validation for skill structure
A sports betting startup is launching a live football betting product. They need a backend service that broadcasts real-time odds updates to thousands of connected clients whenever a trader adjusts the prices for a match. The platform covers Premier League matches with markets like match winner, over/under goals, and both-teams-to-score.
The company has chosen PubNub as its real-time infrastructure and needs a JavaScript/Node.js module that handles: initializing the PubNub connection for the odds engine, organizing markets into a channel structure that clients can subscribe to efficiently, and publishing odds updates when the trading team pushes new prices. The service must support clients across the UK (fractional odds), Europe (decimal odds), and the US (American odds) simultaneously from a single broadcast.
During live matches, the service also needs to handle market suspensions triggered by in-game events such as goals or red cards -- suspending all markets for the affected match before any new odds are calculated and distributed.
Produce the following files:
odds-engine.js -- A Node.js module that exports:
client-subscriber.js -- A client-side module that:
access-setup.js -- A server-side script that configures channel permissions: