AI agent framework for Polymarket prediction markets
Top 62.6% on sourcepulse
This project provides a developer framework and utilities for building AI agents to trade autonomously on Polymarket, a prediction market platform. It targets developers and researchers interested in applying AI to decentralized finance and forecasting, enabling automated participation in prediction markets.
How It Works
The framework employs a modular architecture with distinct components for API integration, data sourcing, and LLM tooling. It leverages Chroma.py for vectorizing data from news sources and other APIs, allowing for custom vector database implementations. Market and event data are managed via Gamma.py and Polymarket.py, which interface with the Polymarket Gamma API for fetching metadata and executing trades. Data models are defined using Pydantic for structured representation of trades, markets, and events.
Quick Start & Requirements
pip install -r requirements.txt
..env
file from .env.example
and populate it with API keys.python scripts/python/cli.py
) or run agents directly (python agents/application/trade.py
). Docker support is available via ./scripts/bash/build-docker.sh
and ./scripts/bash/run-docker-dev.sh
.Highlighted Details
Maintenance & Community
The project is open source under the MIT License. Contributions are welcomed via pull requests following standard Git workflow and pre-commit hooks. Related repositories include py-clob-client
, python-order-utils
, and TypeScript clients for Polymarket CLOB.
Licensing & Compatibility
Licensed under the MIT License, permitting commercial use and closed-source linking. However, Polymarket's Terms of Service prohibit US persons and individuals from certain other jurisdictions from trading on the platform, including via its API and agents.
Limitations & Caveats
The Terms of Service restrict trading for users in specific jurisdictions, which would also apply to agents operating on their behalf. Data is viewable globally, but trading is restricted.
9 months ago
Inactive