chatpricebet

Chat Price Bet πŸŽ²πŸ’¬

A Web3 hackathon project for ETHGlobal Buenos Aires 2025 that combines group chat betting with real-time crypto price predictions.

🎯 Concept

Chat Price Bet is a social betting platform where friends can bet on crypto prices in real-time through XMTP group chats. Users place bets on whether ETH price will go UP or DOWN within 5 minutes, powered by Pyth Network’s real-time price feeds.

πŸ† Hackathon Tracks

This project qualifies for multiple prize tracks:

πŸ› οΈ Tech Stack

πŸš€ Quick Start

Prerequisites

Installation

  1. Clone and install dependencies:
npm install
  1. Set up environment variables:
cp .env.example .env

Edit .env and add:

  1. Compile and deploy smart contracts:
# Compile contracts
npm run compile

# Deploy to Base Sepolia (make sure you have PRIVATE_KEY in .env)
npm run deploy
  1. Run the development server:
npm run dev

Open http://localhost:3000 in your browser.

πŸ“± How It Works

  1. Connect Wallet: Connect your Web3 wallet using RainbowKit
  2. Initialize XMTP: Start chatting with friends in group conversations
  3. Place Bets:
    • Choose UP or DOWN prediction
    • Set bet amount (0.001 - 1 ETH)
    • Wait 5 minutes for price movement
  4. Resolve Bets: After 5 minutes, resolve your bet using Pyth price feeds
  5. Win or Lose: Get 2x payout if your prediction is correct!

πŸ—οΈ Project Structure

chat-price-bet/
β”œβ”€β”€ app/                 # Next.js app directory
β”‚   β”œβ”€β”€ layout.tsx      # Root layout with providers
β”‚   β”œβ”€β”€ page.tsx        # Main page
β”‚   └── providers.tsx   # Web3 & XMTP providers
β”œβ”€β”€ components/          # React components
β”‚   β”œβ”€β”€ ChatInterface.tsx  # XMTP chat UI
β”‚   └── BettingPanel.tsx  # Betting interface
β”œβ”€β”€ contracts/          # Solidity smart contracts
β”‚   └── PriceBet.sol    # Main betting contract
β”œβ”€β”€ hooks/              # Custom React hooks
β”‚   β”œβ”€β”€ useXMTP.ts      # XMTP client hook
β”‚   └── usePythPrice.ts # Pyth price fetching
β”œβ”€β”€ lib/                # Utilities
β”‚   └── contracts.ts    # Contract ABIs
└── scripts/            # Deployment scripts
    └── deploy.js        # Contract deployment

πŸ”§ Smart Contract Details

The PriceBet contract:

πŸ“š Integration Guides

XMTP Integration

Pyth Network Integration

🎨 Features

🚧 Future Enhancements

πŸ“ Hackathon Submission Checklist

🀝 Team

Built for ETHGlobal Buenos Aires 2025

πŸ“„ License

MIT

πŸ™ Acknowledgments


Note: This is a hackathon project. For production use, additional security audits and optimizations are recommended.