agents  by Polymarket

AI agent framework for Polymarket prediction markets

created 1 year ago
504 stars

Top 62.6% on sourcepulse

GitHubView on GitHub
1 Expert Loves This Project
Project Summary

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

  • Install: Clone the repository, create and activate a Python 3.9 virtual environment, and install dependencies with pip install -r requirements.txt.
  • Prerequisites: Python 3.9, OpenAI API Key, Polygon Wallet Private Key.
  • Setup: Create a .env file from .env.example and populate it with API keys.
  • Usage: Interact via a CLI (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.
  • Docs: View Demo

Highlighted Details

  • Integrates with the Polymarket API for market data and trade execution.
  • Supports local and remote Retrieval-Augmented Generation (RAG).
  • Sources data from betting services, news providers, and web search.
  • Provides LLM tools for prompt engineering.

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.

Health Check
Last commit

9 months ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
180 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.