A fully automated Solana-based gaming platform where players allocate points across risk pools and compete for prizes based on randomly generated multipliers. Built as a Turborepo monorepo for optimal development workflow.
SOLPOT is a decentralized gaming protocol featuring automated lifecycle management, risk-based strategy gameplay, and batched settlement processing.
This Turborepo monorepo includes:
contracts: Solana Anchor program for the SOLPOT gameweb: Next.js web application with wallet integrationmobile: React Native mobile application with Solana Mobile Stack integration@repo/eslint-config: ESLint configurations (shared)@repo/typescript-config: TypeScript configurations (shared)@repo/ui: Shared UI components@solpot/anchor-sdk: Anchor SDK package
Each package/app is 100% TypeScript.
- Automated Game Lifecycle: Games start automatically every hour with no manual intervention required
- Risk-Based Strategy: Players allocate 1000 points across Low, Medium, and High risk pools plus an in-game wallet
- Batched Settlement: Supports up to 10 players through efficient single-transaction processing
- Permissionless Participation: Anyone can help calculate scores during settlement
- Prize Distribution: Top 3 players share 90% of the prize pool (60%/30%/10%)
- Wallet Integration: Support for Phantom, Solflare, and Backpack wallets
- Node.js 18+
- Rust 1.70+
- Solana CLI 1.18+
- Anchor CLI 0.31+
- pnpm
# Install dependencies
pnpm install
# Run development servers
pnpm devYou can also run specific apps:
pnpm --filter @solpot/web dev
pnpm --filter @solpot/contracts buildTo build all apps and packages:
pnpm buildTo build a specific package:
pnpm --filter @solpot/web build
pnpm --filter @solpot/contracts buildTurborepo can use Remote Caching to share build caches with your team and CI/CD pipelines.
To enable Remote Caching, you need a Vercel account:
# Login to Vercel
pnpm exec turbo login
# Link your Turborepo to Remote Cache
pnpm exec turbo link- Web App:
pnpm --filter @solpot/web dev- Start the Next.js development server - Contracts:
pnpm --filter @solpot/contracts build- Build the Anchor program - All Apps:
pnpm dev- Run all development servers
- Initialize: Admin sets up the game configuration (one-time)
- Automated Creation: Keeper bot creates games every hour (production) / manual for testing
- Join Game: Players pay 0.1 SOL to join (last 5 seconds closed in testing / 5 minutes in production)
- Allocate Points: Players distribute 1000 points across risk pools (one-time)
- Automated Settlement: After 10 seconds (testing) / 1 hour (production), keeper bot processes:
- Generate random multipliers
- Calculate all player scores in single transaction
- Determine top 3 winners
- Claim Prizes: Winners claim their share of the prize pool
- Repeat: Process continues automatically
- In-Game Wallet: 1.0x multiplier (Safe storage option)
- Low Risk: 0.95x - 1.1x multiplier (Conservative strategy)
- Medium Risk: 0.7x - 1.8x multiplier (Balanced strategy)
- High Risk: 0x - 3x multiplier (Aggressive strategy)
- Entry Fee: 0.1 SOL per player
- House Fee: 10% of total pool
- Points Per Player: 1000 (fixed allocation)
- Game Duration: 10 seconds (testing) / 1 hour (production)
- Minimum Players: 2 (auto-cancel if below)
- Join Deadline: 5 seconds before game end (testing) / 5 minutes (production)
- Program ID:
EYiGJxS2H3bozkwDoifJ6ckwbJmJ95DNBTpBR2i3Y8Bf
sol-pot-turbo/
├── apps/
│ ├── contracts/ # Solana Anchor program
│ │ ├── programs/contracts/
│ ├── web/ # Next.js web application
│ └── mobile/ # React Native mobile application
└── packages/
├── anchor-sdk/ # Anchor SDK package
├── eslint-config/ # ESLint configuration (shared)
├── typescript-config/ # TypeScript configuration (shared)
└── ui/ # Shared UI components
Settlement processes all players (up to 10) in a single transaction for efficiency.
The keeper bot (to be implemented) will run continuously to:
- Monitor active games
- Create new games automatically every hour (production) / as needed (testing)
- Initiate settlement when games end
- Cancel games with <2 players (auto-refund)
- Maintain game lifecycle without manual intervention
Currently, keeper operations (create_game, settle_game, cancel_game) are called manually via instructions.
- PDA-based account security with deterministic addresses
- Signer verification for all state-changing operations
- Overflow/underflow protection using checked arithmetic
- Timestamp validation for game timing constraints
- Double-claim prevention for prizes
- One-time allocation enforcement (cannot change after locking)
- Minimum player requirement for valid games
- Active game tracking to prevent duplicate games
- Batched settlement for compute safety
# Deploy program
cd apps/contracts && anchor build
anchor deploy --provider.cluster devnet
# Initialize (one-time)
PROGRAM_ID=<deployed-program-id> pnpm run initialize
# Fund keeper wallet with 1+ SOL for transaction fees
# Deploy keeper bot to server (Railway, Heroku, etc.)Run the comprehensive test suite:
cd apps/contracts && anchor testTests cover: game lifecycle, player management, batched settlement, prize distribution, and edge cases.
✅ CONTRACT IMPLEMENTED: The SOLPOT smart contract is fully implemented with all game logic.
Key Achievements:
- ✅ Smart contract with complete game lifecycle (create, join, allocate, settle, claim)
- ✅ Batched settlement supporting up to 10 players per transaction
- ✅ Permissionless score calculation during settlement
- ✅ Comprehensive test suite
- ✅ Production-ready security measures with checked arithmetic
- ✅ Modern monorepo structure with Turborepo
- ✅ Wallet integration ready for frontend
Current Limitations:
⚠️ Uses slot-based randomness (demo purposes only - not cryptographically secure)⚠️ Keeper operations require manual calls (automation bot to be implemented)⚠️ Testing configuration with 10-second games (production: 1 hour)
Next Steps:
- Deploy to devnet for testing
- Implement automated keeper bot
- Integrate Switchboard VRF for production randomness
- Launch frontend application
Built with ❤️ on Solana