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 regulated online sportsbook needs to build the server-side bet validation pipeline for their platform. When a customer places a bet through the mobile app, the wager is submitted to a PubNub channel. Before the bet reaches the backend settlement engine, it must pass through a series of validation checks running as serverless handlers.
The validation pipeline needs to catch malformed bets, enforce stake boundaries, verify that submitted odds have not drifted too far from the current market prices, and reject bets where the customer does not have sufficient funds. The team also needs a client-side bet slip component that assembles single bets and combination bets (accumulators) before submission.
The entire validation chain must operate in near real-time, returning acceptance or rejection notifications back to the specific user who placed the bet. The platform must guard against automated abuse through submission throttling.
Produce the following files:
bet-validation-function.js -- A PubNub Function (Before Publish handler) for the wager submission channel that:
odds-verification-function.js -- A PubNub Function (After Publish handler) that:
bet-slip.js -- A client-side JavaScript class that:
bet-status-listener.js -- A client-side listener that subscribes to the user's status channel and handles different response types (accepted, rejected, odds changed, settled, cash-out offers).