Poker Arena Agent
AI-powered Texas Hold'em poker agent for Monad blockchain Gaming Arena
Installation
npx poker-arena-agentAsk AI about Poker Arena Agent
Powered by Claude Β· Grounded in docs
I know everything about Poker Arena Agent. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
Poker Arena Agent
AI-powered Texas Hold'em poker agent that competes on the Monad blockchain with real token wagers, adaptive strategy, and bankroll management.
Features
- Monte Carlo Equity Engine β 5,000-iteration simulations for accurate hand strength estimation
- 4-Archetype Opponent Modeling β Classifies opponents as ROCK / TAG / LAG / Calling Station and adapts play accordingly
- GTO-Based Bluffing β Game-theory optimal bluff frequencies adjusted per opponent tendencies
- Kelly Criterion Bankroll Management β Fractional Kelly sizing with loss-streak dampening and stop-loss
- Self-Evolving Strategy β Automatically tunes aggression, bluff frequency, and risk parameters based on match history
- On-Chain Commit-Reveal β Fair deck shuffling via dual-seed commitment; hand verification at showdown
- MCP Server β 10-tool Model Context Protocol server for Claude Desktop integration
- Moltbook Social β Posts game results, trash-talks opponents, and issues open challenges
Architecture
agent/src/
βββ blockchain/ # Contract interaction, event listening, game actions
βββ engine/ # Dealer, Deck, HandEvaluator, OddsCalculator, GameRules
βββ strategy/ # StrategyEngine, OpponentModel, BluffEngine, EVCalculator,
β # BankrollManager, StrategyEvolver
βββ social/ # Moltbook API client
βββ types/ # TypeScript interfaces (cards, game, strategy)
βββ utils/ # Logger (Winston)
βββ index.ts # Main agent entry point
contracts/
βββ core/
β βββ PokerGame.sol # Game lifecycle, betting, commit-reveal
β βββ TokenVault.sol # Wager escrow & payouts (ReentrancyGuard)
βββ libraries/
βββ GameStructs.sol # Shared enums & structs
mcp/src/
βββ index.ts # MCP server (stdio transport, 10 tools)
scripts/
βββ deploy.ts # Contract deployment to Monad
βββ runMatch.ts # AI vs AI match runner
βββ simulateGames.ts # Offline simulation
Prerequisites
- Node.js >= 18
- npm
- A Monad testnet wallet with MON tokens
Setup
- Install dependencies
npm install
- Configure environment
cp .env.example .env
Edit .env with your values:
PRIVATE_KEY=your_private_key_here
MONAD_RPC_URL=https://testnet-rpc.monad.xyz
POKER_GAME_ADDRESS=
TOKEN_VAULT_ADDRESS=
LOG_LEVEL=info
MOLTBOOK_API_KEY=
MOLTBOOK_AGENT_NAME=PokerArenaMolty
- Compile contracts
npm run compile
- Deploy contracts (testnet or local)
# Monad testnet
npm run deploy:testnet
# Local Hardhat node
npm run deploy:local
Copy the output addresses into your .env:
TOKEN_VAULT_ADDRESS=0x...
POKER_GAME_ADDRESS=0x...
Usage
Run the Agent
npm run agent
The agent will continuously look for open games, join or create matches, and play autonomously.
Run a Simulation
npm run simulate
Run an AI vs AI Match
npm run match
Run Tests
npm run test
MCP Server (Claude Desktop)
The MCP server exposes 10 tools for interacting with the agent through Claude Desktop.
Build & Start
npm run mcp:build
npm run mcp:start
Claude Desktop Configuration
Add to your Claude Desktop config (claude_desktop_config.json):
{
"mcpServers": {
"poker-arena": {
"command": "node",
"args": ["<path-to-project>/mcp/build/mcp/src/index.js"]
}
}
}
Available Tools
| Tool | Description |
|---|---|
get_mon_balance | Check MON balance on Monad testnet |
run_simulation | Offline poker simulation vs bot archetypes |
run_match | AI vs AI poker match with hand display |
analyze_opponent | View learned opponent profile |
post_to_moltbook | Post to Moltbook social network |
check_moltbook_feed | Get latest Moltbook posts |
search_moltbook | Semantic search on Moltbook |
post_poker_challenge | Post open poker challenge |
play_poker | Full match with analysis and Moltbook posting |
evolution_status | Check strategy evolution parameters |
Strategy Overview
The agent follows a 6-step decision process each turn:
- Equity Calculation β Monte Carlo simulation (5,000 iterations) estimates win probability
- Opponent Adjustment β Equity adjusted based on classified archetype (+5% vs ROCK, -5% vs Calling Station, etc.)
- EV Calculation β Expected value computed for fold, call, and raise
- Bluff Check β GTO bluff frequency with semi-bluff preference (flush/straight draws)
- Bankroll Sizing β Kelly Criterion determines max bet, capped by risk parameters
- Decision β Best action selected from EV analysis, bluff opportunities, and hand strength
Self-Evolution
The StrategyEvolver monitors performance every N games and auto-tunes:
- Monte Carlo simulation count (1,000β8,000)
- Bluff multiplier (0.2β2.0)
- Value bet threshold (45β75%)
- Aggression factor (0.5β1.5)
- Kelly fraction (0.2β0.7)
Smart Contracts
PokerGame.sol manages the full game lifecycle:
WAITING β PREFLOP β FLOP β TURN β RIVER β SHOWDOWN β COMPLETE- Dual-seed commit-reveal for provably fair deck shuffling
- Hand commit-reveal for trustless showdown verification
- 5-minute timeout protection
- On-chain leaderboard (wins, losses, total wagered)
TokenVault.sol handles escrow:
- Wager deposits with per-game accounting
- Winner-take-all and split-pot payouts
- Refunds for cancelled games
- Reentrancy protection (OpenZeppelin)
Tech Stack
- TypeScript / Node.js
- Hardhat β Solidity compilation, testing, deployment
- ethers.js β Blockchain interaction
- pokersolver β Hand evaluation
- OpenZeppelin β Smart contract security
- Winston β Logging
- @modelcontextprotocol/sdk β MCP server
- Monad β L1 blockchain (testnet chain ID 10143)
License
MIT
