Sidebet-Monad won the third prize at the second Monad Blitz, Bangalore Hackathon organised by the Monad Foundation.
Drop a /sidebet
in your group chat — settle it with crypto.
No spreadsheets. No Discord mods. Just pure, social speculation — on-chain and on demand.
A Telegram bot for creating and participating in prediction markets on Monad blockchain.
- 🔗 Wallet Connection: Each user gets their own wallet
- 🎯 Market Creation: Users can create prediction markets with custom stakes
- 💰 Betting: Place bets using your own funds
- 🏆 Claim Rewards: Winners can claim their share of the pot
- 👥 Multi-user: Each user manages their own wallet and funds
-
Install dependencies:
npm install
-
Configure environment:
cp .env.example .env # Edit .env with your values
-
Required environment variables:
TELEGRAM_BOT_TOKEN
: Your Telegram bot tokenCONTRACT_ADDRESS
: Deployed SidebetsFactory contract addressRPC_URL
: Blockchain RPC endpointADMIN_PRIVATE_KEY
: Private key for market resolution (oracle)ADMIN_IDS
: Comma-separated Telegram user IDs for admins
-
Deploy the contract: Deploy
MyContract.sol
and set the contract address in.env
-
Run the bot:
npm start
-
Connect Wallet (
/wallet
)- Bot generates a unique wallet for each user
- User receives wallet address and private key
- User must fund the wallet with MON tokens
-
Create Markets (
/sidebet <amount> <question>
)- Example:
/sidebet 0.1 Will it rain tomorrow?
- Uses user's own funds for the stake
- Example:
-
Place Bets (
/bet <market_id> <yes/no>
)- Example:
/bet 0 yes
- Deducts stake from user's wallet
- Example:
-
Claim Winnings (
/claim <market_id>
)- Winners claim their share after resolution
- Resolve Markets (
/resolve <market_id> <yes/no>
)- Only admins can resolve markets
- Uses oracle functionality from the contract
Command | Description | Example |
---|---|---|
/wallet |
Connect your wallet | /wallet |
/status |
Check wallet status | /status |
/sidebet |
Create a market | /sidebet 0.1 Will BTC hit 100k? |
/markets |
List active markets | /markets |
/bet |
Place a bet | /bet 0 yes |
/claim |
Claim winnings | /claim 0 |
/resolve |
Resolve market (admin) | /resolve 0 yes |
/debug |
Show technical info | /debug |
/help |
Show help message | /help |
-
Private Keys: In this demo, private keys are logged to console. In production:
- Use secure key management
- Implement proper wallet connect protocols
- Never log private keys
-
Wallet Generation: Currently generates random wallets. In production:
- Integrate with MetaMask/WalletConnect
- Use hardware wallets for admin functions
- Implement proper authentication
-
Admin Functions: Admin private key should be:
- Stored securely (not in .env in production)
- Use hardware wallet or secure key management
- Rotated regularly
The bot integrates with two smart contracts:
- SidebetsFactory: Creates and manages markets
- PredictionMarket: Individual market contracts for betting
See MyContract.sol
for the complete contract implementation.
# Development mode with auto-restart
npm run dev
- "Wallet not connected": Use
/wallet
to connect first - "Insufficient balance": Fund your wallet with MON tokens
- "Contract rejected": Check if market is still active
- "Not authorized": Only admins can resolve markets
MIT