HumanAIFusion
Trading & Finance
fully-autonomous

Polymarket Agents

Trade autonomously on Polymarket using AI Agents

A developer framework and set of utilities for building AI agents that trade autonomously on Polymarket prediction markets. Integrates with Polymarket API, supports RAG for data sourcing from news and betting services, and provides LLM tools for prompt engineering.

Autonomy
fully-autonomous
Harness
Custom
Deployment
Self-hosted (local or Docker)
License
MIT
00

Overview

Overview

Polymarket Agents is a developer framework for building AI agents that trade autonomously on Polymarket prediction markets. The framework provides modular components for market data retrieval, order execution, and AI-driven decision-making.

Architecture

The system features modular APIs and connectors:

  • Gamma API Client: Fetches and parses market and event metadata from Polymarket Gamma API
  • Polymarket API Client: Retrieves market data, manages events, and executes trades on the Polymarket DEX
  • Chroma Integration: Vector database for storing and querying news sources and API data
  • Data Models: Pydantic-based representations for trades, markets, events, and related entities

Data Sourcing

Agents leverage retrieval-augmented generation (RAG) to inform trading decisions. The framework supports:

  • Local and remote RAG implementations
  • News provider integration
  • Betting service data
  • Web search capabilities
  • Vector storage via Chroma for efficient retrieval

Command Line Interface

The CLI (cli.py) provides commands for market queries, news retrieval, LLM interactions, and trade execution. Example: get-all-markets retrieves markets sorted by volume with configurable limits.

Deployment

Supports local Python execution or Docker-based deployment. Requires Python 3.9, a funded USDC wallet on Polygon, and API keys for OpenAI and Polymarket services.

01

Primitives

07 entries
  • Retrieves market and event data from Polymarket

  • Executes trades on Polymarket DEX

  • Sources data from news providers and web search

  • Performs retrieval-augmented generation (RAG)

  • Builds and signs orders programmatically

  • Queries local vector databases

  • Interfaces with LLMs for decision-making

02

Outcomes

03 entries
  • 01Autonomous trading on prediction markets
  • 02Data-driven market analysis
  • 03Executed buy/sell orders on Polymarket
03

Integrations

06 entries
Polymarket API
Polymarket Gamma API
Polymarket CLOB
Chroma vector database
OpenAI
Polygon blockchain
04

Autonomy & guardrails

AutonomousHuman-in-the-loop
85%15%
Approval-gated actions
  • Operates within Polymarket Terms of Service restrictions
  • Requires initial wallet setup and funding
  • Uses configured API keys for external services
05

Guardrails & requirements

Guardrails

  • Geographic restrictions per Polymarket Terms of Service
  • Private key management required
  • USDC wallet funding required

Requirements

  • Python 3.9
  • POLYGON_WALLET_PRIVATE_KEY environment variable
  • OPENAI_API_KEY environment variable
  • USDC-funded wallet
06

Technical specifications

Runtime

Harness
Custom
Deployment
Self-hosted (local or Docker)
License
MIT

Models & tooling

Models
OpenAI models (via OPENAI_API_KEY)
Tooling
Pydantic for data models
Chroma for vector storage
py-clob-client for Polymarket CLOB
python-order-utils for order signing
Langchain utilities

Security & compliance

Auth model
Private key-based wallet authentication for Polygon; API key authentication for OpenAI and Polymarket
08

Architecture notes

Memory architecture

Vector database (Chroma) for news sources and API data

Context strategy

Retrieval-augmented generation (RAG) from vectorized news and market data

Ready to deploy
Get the Polymarket Agents spec sheet brief