Decentralized Prediction Markets for GitHub Pull Requests
BlockSmiths revolutionizes developer collaboration by creating prediction markets for GitHub pull request outcomes. Trade tokens representing the probability of PR merges, backed by real GitHub data and powered by bonding curve economics.
BlockSmiths bridges Web2 development workflows with Web3 economics, enabling developers and stakeholders to:
- Create prediction markets for any GitHub repository's pull requests
- Trade tokens representing PR merge probabilities using bonding curve pricing
- Earn rewards when predictions are correct and PRs resolve
- Incentivize quality contributions through market-driven feedback
- Uncertainty in PR outcomes: Contributors and maintainers lack clear signals about which PRs will merge
- Limited incentives for code review: Quality reviewing is undervalued and unrewarded
- Difficulty prioritizing PRs: Maintainers struggle to identify high-impact contributions
- Market-driven predictions: Let the crowd wisdom determine PR merge probabilities
- Economic incentives: Reward accurate predictions and quality contributions
- Real-time feedback: Provide immediate market signals for PR quality and likelihood
GitHub Repo โ Factory Contract โ ProjectCoin Token
- Anyone can create a
ProjectCoinfor any GitHub repository (0.01 ETH fee) - Tokens represent prediction markets for that repo's PRs
- Factory manages all project tokens and provides discovery
Early Buyers: 0.001 ETH โ 1000 tokens
Later Buyers: 0.002 ETH โ 1000 tokens (price increases)
- Dynamic pricing: Token prices increase with demand via bonding curves
- Early adopter advantage: First buyers get better prices
- Market efficiency: Prices reflect collective sentiment
Every token purchase splits fees:
- 30% โ Treasury: Platform development and maintenance
- 50% โ Reward Pool: Distributed when PRs resolve
- 20% โ Buyback Fund: Token burns to manage supply
PR Merges โ Reward Pool โ Token Holders
PR Rejects โ Buyback & Burn โ Deflationary pressure
- Merge rewards: Successful predictions earn from the reward pool
- Burn mechanism: Failed predictions result in token burns
- Market resolution: Automated via GitHub API integration
ProjectCoinFactory.sol: Creates and manages project tokensProjectCoin.sol: ERC20 tokens with bonding curve mechanics- Hardhat setup: Testing, deployment, and verification tools
- Next.js application: Modern React-based interface
- Web3 integration: Wagmi + MetaMask for blockchain interactions
- GitHub API: Real-time PR data and metadata
- Responsive design: Mobile-first, accessible UI
- Real-time market discovery: Search and explore active prediction markets
- Integrated trading interface: Buy/sell tokens directly from PR pages
- Portfolio tracking: Monitor your positions and performance
- Live GitHub data: Authentic PR information and status updates
// Bonding curve formula
nextPrice = currentPrice + priceIncrement
// Where priceIncrement = 0.0001 ETH per batchif (PR.status === 'merged') {
distributeRewards(rewardPool, tokenHolders);
} else {
burnTokens(buybackPool);
}probability = calculateFromMetrics({
comments: PR.comments,
reviews: PR.reviews,
labels: PR.labels,
age: PR.createdAt,
authorReputation: contributor.reputation
});- Create markets for your repositories to gauge community sentiment
- Trade on PRs you believe will merge based on code quality
- Earn rewards for accurate predictions and quality contributions
- Discover high-quality PRs through market signals
- Prioritize reviews based on community confidence
- Incentivize contributors through prediction market participation
- Speculate on development outcomes using domain expertise
- Support promising projects through token purchases
- Earn returns from successful prediction strategies
- Reentrancy protection: ReentrancyGuard on critical functions
- Access controls: Ownable patterns for admin functions
- Overflow protection: SafeMath and Solidity 0.8+ built-ins
- Supply caps: Maximum token supply prevents infinite inflation
- Fee mechanisms: Multiple revenue streams ensure sustainability
- Burn mechanics: Deflationary pressure maintains token value
# Clone the repository
git clone https://github.com/WhyAsh5114/blocksmiths
cd blocksmiths
# Install dependencies
npm install
cd blockchain && npm install
cd ../frontend && npm install
# Set up environment
cp frontend/.env.example frontend/.env.local
# Add your GitHub token and contract addresses
# Start development
npm run dev- Node.js 18+ and npm
- MetaMask wallet with Sepolia ETH
- GitHub personal access token
- Hardhat for contract development (optional)
blocksmiths/
โโโ blockchain/ # Smart contracts and deployment
โ โโโ contracts/ # Solidity contracts
โ โโโ test/ # Contract tests
โ โโโ scripts/ # Deployment scripts
โ โโโ hardhat.config.ts
โโโ frontend/ # Next.js application
โ โโโ src/
โ โ โโโ app/ # App router pages
โ โ โโโ components/ # Reusable UI components
โ โ โโโ hooks/ # Custom React hooks
โ โ โโโ lib/ # Utilities and configurations
โ โโโ package.json
โโโ README.md # This file
โโโ package.json # Root dependencies
- โ Core smart contracts (ProjectCoin + Factory)
- โ Basic frontend with wallet integration
- โ GitHub API integration for PR data
- ๐ Sepolia testnet deployment
- ๐ฎ Advanced probability algorithms
- ๐ฎ Multi-outcome predictions (merge time, review count)
- ๐ฎ Automated market makers (AMM) integration
- ๐ฎ Cross-repository prediction baskets
- ๐ฎ Reputation systems for predictors
- ๐ฎ Social features (following, leaderboards)
- ๐ฎ DAO governance for platform decisions
- ๐ฎ Integration with development tools
- ๐ฎ Private repository support
- ๐ฎ Enterprise dashboard and analytics
- ๐ฎ API for third-party integrations
- ๐ฎ Mainnet deployment and scaling
We welcome contributions! Please see our contributing guidelines:
- Fork the repository and create a feature branch
- Write tests for new functionality
- Follow code style guidelines (Prettier + ESLint)
- Submit a pull request with clear description
# Run tests
cd blockchain && npm test
cd frontend && npm test
# Lint and format
npm run lint
npm run format
# Local blockchain
cd blockchain && npx hardhat nodeMIT License - see LICENSE for details.
- Live Demo: [Coming Soon]
- Documentation: Wiki
- Discord: Community
- Twitter: @BlockSmiths
Open source development lacks market signals for PR quality and merge probability.
- Contributors: Waste time on PRs unlikely to merge, no feedback on quality
- Maintainers: Can't prioritize valuable PRs, overwhelmed by review queue
- Ecosystem: No economic incentives, uneven code quality
- ๐ Market Predictions: Real-time probability scores for PR outcomes
- ๐ฐ Economic Incentives: Reward accurate predictions and quality contributions
- โก Priority Signals: Help maintainers focus on high-value PRs first
- Challenge: Designing sustainable bonding curve tokenomics
- Solution: Linear price increases with multi-tiered fee distribution
- Learning: Batch operations significantly reduce gas costs
- Challenge: 5,000 requests/hour limit for real-time PR data
- Solution: Intelligent caching with exponential backoff
- Learning: Aggressive caching essential for production
- Challenge: Making blockchain accessible to traditional developers
- Solution: Progressive disclosure of Web3 complexity with clear error messages
- Learning: Fallback mechanisms crucial for adoption
- Solidity 0.8.28 - Smart contracts with OpenZeppelin libraries
- Hardhat - Development environment and testing
- Sepolia - Ethereum testnet deployment
- Next.js 14 - React framework with TypeScript
- Wagmi + Viem - Web3 React hooks and Ethereum library
- Tailwind CSS - Utility-first styling
- GitHub REST API - Real-time PR and repository data
- React Query - Data fetching and caching
- MetaMask - Primary wallet connection
Built with โค๏ธ by the BlockSmiths team
Empowering developers through prediction markets and decentralized collaboration.