Skip to content
AlexReid0Public

About

Make bets with ur mates in groupchats

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

🎲 gruupie

Bet With Your Group Chat — Telegram bot that lets any group chat spin up a prediction market in 10 seconds.

"Will Sam quit by March?" · "Will ETH > $5k Friday?" · "Will our team ship by demo day?"

Crypto rails on TON. No fees. Winners take the pot.


How It Works

  1. Add the bot to any Telegram group
  2. Create a market: /create Will ETH hit $5k by Friday?
  3. Tap to bet: 🟢 YES or 🔴 NO — preset amounts (0.1, 0.5, 1, 5 TON)
  4. Creator resolves when the outcome is known
  5. Winners get paid — parimutuel payout, proportional to stake
🎲 Market #1
━━━━━━━━━━━━━━━━━━
Will ETH hit $5k by Friday?
━━━━━━━━━━━━━━━━━━
🟢 YES: 3.50 TON (5 bets)
🔴 NO:  1.50 TON (3 bets)
💰 Pool: 5.00 TON
━━━━━━━━━━━━━━━━━━
🔵 Active

[🟢 0.1] [🟢 0.5] [🟢 1] [🟢 5]
[🔴 0.1] [🔴 0.5] [🔴 1] [🔴 5]

Commands

Command Where What it does
/start DM Welcome + instructions
/create <question> Group Spin up a new market
/markets Group List active markets
/resolve Group Settle a market you created
/balance Anywhere Check your TON balance
/deposit DM Get wallet address + deposit memo
/withdraw <addr> <amount> DM Cash out TON
/help Anywhere How it works

Setup

1. Get a Telegram Bot Token

Message @BotFather → /newbot → copy the token.

2. Generate a TON Wallet

npm install
npm run generate-wallet

This prints a 24-word mnemonic + wallet address. Save both.

3. Configure

Create .env from env.example:

BOT_TOKEN=your_telegram_bot_token
TON_MNEMONIC=your 24 word mnemonic phrase here
TON_ENDPOINT=https://toncenter.com/api/v2/jsonRPC
TONCENTER_API_KEY=your_key (optional, get free at toncenter.com)
TON_NETWORK=mainnet

4. Run

npm run dev     # dev mode with hot reload
npm start       # production

Tech Stack

  • Telegraf — Telegram bot framework
  • TON — crypto deposits, withdrawals, settlement
  • SQLite — markets, bets, balances (zero infrastructure)
  • TypeScript + tsx — no build step needed

Architecture

src/
  index.ts          Bot + all command/callback handlers
  db.ts             SQLite — users, markets, bets, payouts
  ton.ts            TON blockchain — deposits, withdrawals
  generate-wallet.ts  One-time wallet generation script

Deposit flow: User sends TON to bot wallet with unique memo (g_<user_id>) → bot polls TonCenter API every 30s → auto-credits balance.

Payout model: Parimutuel — winners split the entire pool proportional to their bet size. No fees.

License

MIT

About

Make bets with ur mates in groupchats

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages