Thank you for your interest in contributing! This project is about pushing the boundaries of AI reasoning in prediction markets. Every contribution helps us understand what AI agents can (and can't) do with real economic decisions.
See the Roadmap for detailed feature proposals. We're especially interested in:
- Model Debate System - Make models challenge each other's reasoning
- News Sentiment Integration - Add real-time news context via GDELT or similar
- Temporal Reasoning Checks - Prevent time-confusion errors
- Historical Fact Verification - Reduce hallucinations about historical data
- Whale Tracker Agent - Monitor smart money movements
git clone https://github.com/YourUsername/polymarket-agent.git
cd polymarket-agent# Create virtual environment
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Copy environment template
cp .env.template .envEdit .env with your credentials:
- BLOCKRUN_WALLET_KEY - For AI payments (get testnet USDC on Base Sepolia)
- POLYGON_WALLET_PRIVATE_KEY - For trading (use testnet if available)
- USE_GCS_STORAGE=false - Use local storage for development
python app.py
# Visit http://127.0.0.1:5000polymarket-agent/
├── src/
│ ├── agent.py # Main orchestrator
│ ├── market/
│ │ └── polymarket.py # Market data fetching
│ ├── analysis/
│ │ └── ai_analyzer.py # Multi-model consensus
│ ├── trading/
│ │ ├── executor.py # Order execution
│ │ └── wallet.py # Wallet management
│ ├── signals/ # Trading signals (whale tracking, etc.)
│ └── storage/
│ └── gcs_storage.py # Persistent storage
├── templates/ # Web UI
├── app.py # Flask application
└── main.py # CLI entry point
- Python: Follow PEP 8
- Line length: 100 characters max
- Docstrings: Use for all public functions
- Type hints: Encouraged but not required
- Logging: Use
logger.info()for important events,logger.debug()for details
Example:
def analyze_market(question: str, current_odds: float) -> Dict[str, Any]:
"""
Analyze a prediction market using multi-model consensus.
Args:
question: Market question (e.g., "Will Bitcoin reach $150K?")
current_odds: Current YES probability (0.0 to 1.0)
Returns:
Dictionary with consensus, probability, and reasoning
"""
logger.info(f"Analyzing: {question}")
# Implementation...Before submitting a PR:
# Run the agent in dry-run mode (no actual trades)
python main.py --analyze
# Check that the dashboard loads
python app.py
# Visit http://127.0.0.1:5000We don't have formal tests yet - contributing a test suite would be valuable!
git checkout -b feature/model-debate-system- Keep commits focused and atomic
- Write descriptive commit messages
- Add comments for complex logic
- Update README.md if adding new features
- Run the agent locally
- Verify it doesn't break existing functionality
- Test with
USE_GCS_STORAGE=falseandUSE_GCS_STORAGE=true
git push origin feature/model-debate-systemThen open a PR on GitHub with:
- Clear title: e.g., "Add model debate system for improved reasoning"
- Description: What problem does this solve? How does it work?
- Testing: How did you test it?
- Screenshots: If UI changes, include before/after
We'll review your PR and may suggest changes. This is a collaborative process - don't be discouraged by feedback!
If you're adding a new type of analysis (news, whale tracking, etc.):
- Create a new module in
src/signals/orsrc/analysis/ - Follow the pattern of existing analyzers
- Add configuration to
.env.template - Document in README.md
Example structure:
# src/signals/news_analyzer.py
import logging
logger = logging.getLogger(__name__)
class NewsAnalyzer:
def __init__(self, api_key: str = None):
"""Initialize news analyzer with optional API credentials"""
self.api_key = api_key
logger.info("News analyzer initialized")
def get_sentiment(self, question: str) -> Dict[str, Any]:
"""
Fetch news sentiment for a market question.
Args:
question: Market question
Returns:
Dictionary with sentiment score and articles
"""
# Implementation...
return {
"sentiment": 0.7, # -1 to 1
"articles": [...],
"summary": "Recent news is bullish"
}To add your feature to the decision-making process:
# In src/agent.py or app.py
from src.signals.news_analyzer import NewsAnalyzer
# Initialize
news_analyzer = NewsAnalyzer(api_key=os.getenv("NEWS_API_KEY"))
# Use in analysis
news_sentiment = news_analyzer.get_sentiment(question)
# Pass to AI models
analysis = analyzer.consensus_analysis(
question=question,
current_odds=yes_odds,
news_context=news_sentiment # NEW
)Found a bug? Have a feature idea? Open an issue!
For bugs:
- Describe what happened vs. what you expected
- Include error messages and logs
- Provide steps to reproduce
- Mention your Python version and OS
For features:
- Explain the problem it solves
- Describe your proposed solution
- Link to relevant research or examples
- GitHub Issues - For bugs and feature requests
- GitHub Discussions - For questions and ideas
- Twitter - @BlockRunAI
By contributing, you agree that your contributions will be licensed under the MIT License.
This project builds on learnings from the broader prediction market AI community, including:
- @ahall_research - Kalshi agent insights
- Manifold Markets - Prediction market design
- Polymarket - Real-world market data
Ready to contribute? Pick a feature from the Roadmap and open an issue to discuss your approach. We're excited to see what you build!