Monitoring & Bot Operations
How to monitor games and operate finalization bots for Gaambl Lotto
Monitoring Overview
The Gaambl platform uses a two-phase completion system where anyone can trigger the finalization of games that are ready.
Two-Phase System
- • Phase 1: Randomness request (lightweight transaction)
- • Phase 2: Finalization (heavy computation, separate transaction)
- • Benefit: Prevents gas failures and allows proper gas estimation
Finalization Process
Games that are ready for completion can be finalized by anyone. This ensures games complete even without dedicated infrastructure.
Detection Methods
- • Monitor RandomnessReceived events
- • Check isGameReadyForCompletion(gameId) function
- • Verify 2-block delay has passed
Finalization Requirements
- • Game must be in READY_FOR_COMPLETION state
- • Must wait 2 blocks after randomness for MEV protection
- • Caller pays gas costs (no special rewards)
Bot Operations
Community bot operators provide essential infrastructure services for platform reliability.
Finalization Bots
- • Monitor RandomnessReceived events
- • Wait 2 blocks for MEV protection
- • Call finalizeGameCompletion(gameId) when ready
- • Handle expired game completion
Expired Game Bots
- • Monitor active games for expiration
- • Call completeExpiredGame(gameId) after expiration
- • Handle single-player refunds automatically
Key Functions
Finalization
function finalizeGameCompletion(uint256 gameId) external Finalize games that are ready for completion (READY_FOR_COMPLETION state)
Expired Games
function completeExpiredGame(uint256 gameId) external Complete games that have expired (anyone can call)
State Checking
function isGameReadyForCompletion(uint256 gameId) external view returns (bool) Check if a game is ready for finalization
Community Service
Bot operation is a community service that benefits all platform users.
No Special Access
Finalization functions are public - anyone can operate bots and ensure games complete.
No Rewards
Bot operators pay gas costs but receive no special rewards - it's a community service.
Decentralized Reliability
Multiple bot operators ensure games complete even if some bots fail.