Skip to content

0xtarunkm/anchor-prediction-market

Repository files navigation

Cricket Prediction Market

This repository contains a Cricket Prediction Market contract written in Anchor for the Solana blockchain. The contract allows users to participate in a decentralized prediction market by placing bets on the outcomes of cricket matches.

Features

  • Prediction Markets: Users can place predictions (bets) on cricket match outcomes.
  • Cricket Match Integration: Results are based on real cricket matches, fetched from external APIs or oracles.
  • Decentralized: The smart contract runs on the Solana blockchain, ensuring transparency and fairness.
  • Anchor Framework: Built using the Anchor framework for Rust-based Solana programs.
  • Tokenized Bets: Bets are represented as tokens that can be traded or redeemed based on the outcome.
  • Automated Settlement: Upon match completion, winnings are distributed automatically based on the match result.

Table of Contents

Installation

To install and build the project locally:

  1. Clone the repository:

    git clone https://github.com/0xtarunkm/anchor-prediction-market.git
    cd anchor-prediction-market
  2. Install dependencies:

    yarn install
  3. Build the Anchor program:

    anchor build
  4. Deploy the program to Solana Localnet:

    anchor deploy

Usage

Once deployed, users can interact with the contract via CLI or through a web interface (if implemented). The contract supports the following operations:

  1. Create a Market: Create a new prediction market for a specific cricket match.
  2. Place a Bet: Users place their bets on possible outcomes (win/loss/draw).
  3. Close the Market: After the match is concluded, the market is settled based on the actual result.
  4. Claim Winnings: Users with successful predictions can claim their rewards.

About

Anchor program for a cricket prediction market

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published