Appearance
GameFi
Three games run alongside the DEX, sharing the same backend, the same wallet identity and the same BlazPoints economy.
Home: rewards.blazpay.com
Prediction markets
Price-prediction betting with leaderboards and win/loss statistics.
| Concern | Where |
|---|---|
| Routes | bz-backend/routes/predictionRoutes.js → /api/prediction |
| Market model | models/predictionMarketModel.js |
| Bet model | models/predictionBetModel.js |
| Per-user stats | models/userPredictionStatsModel.js |
| Settlement cron | services/predictionCron.js, started via initPredictionCron() in index.js |
A market has a subject (a token), a direction, a threshold and a resolution time. Users bet; the cron resolves against a price feed at expiry and settles.
userPredictionStatsModel keeps the aggregate — wins, losses, streaks — which is what feeds the leaderboard rather than recomputing from bets each time.
Poker
On-chain poker tournaments with hand history.
| Concern | Where |
|---|---|
| Contract | contract-deployment/contracts/poker/PokerManager.sol |
| Routes | routes/pokerRoutes.js → /api/poker |
| Table / game model | models/pokerModel.js |
| Hand history | models/pokerHandHistory.js |
| Docs in repo | bz-backend/poker.md, pokerFrontend.md |
PokerManager.sol is the on-chain component; the backend runs table state and dealing, and persists hand history so a hand can be replayed and disputed.
Realtime table updates go over Socket.io — see runtime topology. bz-backend/SOCKET_DEBUG_GUIDE.md is the debugging reference when a table desynchronises.
Mines
A mining mini-game. models/MinesGame.js, plus models/RouletteSpin.js for a spin mechanic.
Mines is the simplest of the three: reveal tiles, avoid the mine, cash out. It exists mainly as a low-friction BlazPoints sink.
Shared game infrastructure
| Concern | Where |
|---|---|
| Generic game model | models/game.js |
| Game wallet | models/gameWalletModel.js |
| Routes | routes/gameRoutes.js → /api/game |
| Contract | contracts/Blazpay_ProductsV2.sol (per chain) |
| Games ABI | utils/abi/games.json |
Blazpay_ProductsV2.sol is deployed per chain (arbitrum_sepolia, avax, hemi, qubetics, soneium directories) and is the shared on-chain product contract the games settle against.
Economics
Games are a BlazPoints sink and a retention loop, not a revenue line. Points earned from staking and quests get spent here or in the marketplace, which is what stops points from being pure inflation.
The business analysis is in bz-backend/MODULE_BUSINESS_AUDIT_2026-06.md.
Known limits
- No BlazAI intents. None of the three games is reachable from chat.
- Realtime state is Socket.io-dependent. A dropped connection during a poker hand needs a resync path;
SOCKET_DEBUG_GUIDE.mdexists because this has been a real problem. - Prediction settlement depends on a price feed at a single point in time, which is manipulable in thin markets. Market selection matters.
- Regulatory surface. Prediction markets and poker are gambling-adjacent in many jurisdictions. That is a product and legal question, not an engineering one, but it is a real constraint on where these can be promoted.
- Documented in ad-hoc repo markdown, not here.
poker.mdandpokerFrontend.mdare the authority for endpoint-level detail.