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.
- 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.
To install and build the project locally:
-
Clone the repository:
git clone https://github.com/0xtarunkm/anchor-prediction-market.git cd anchor-prediction-market
-
Install dependencies:
yarn install
-
Build the Anchor program:
anchor build
-
Deploy the program to Solana Localnet:
anchor deploy
Once deployed, users can interact with the contract via CLI or through a web interface (if implemented). The contract supports the following operations:
- Create a Market: Create a new prediction market for a specific cricket match.
- Place a Bet: Users place their bets on possible outcomes (win/loss/draw).
- Close the Market: After the match is concluded, the market is settled based on the actual result.
- Claim Winnings: Users with successful predictions can claim their rewards.