Skip to content

polymarket-go

Go SDK for building AI trading agents on Polymarket prediction markets.

Features

  • Polymarket API Client - Full client for Gamma (markets) and CLOB (trading) APIs
  • Multi-Agent Workflows - Define agent teams using multi-agent-spec format
  • LLM Integration - Works with any LLM via omnillm + LangChainGo
  • Portable Specs - Same agent definitions deploy to Claude Code, Go servers, or Kubernetes

Architecture

┌─────────────────────────────────────────────────────────────┐
│  polymarket-go                                               │
├─────────────────────────────────────────────────────────────┤
│  cmd/polymarket-agent/     CLI for running agent workflows   │
├─────────────────────────────────────────────────────────────┤
│  agents/specs/             Multi-agent-spec definitions      │
│  ├── agents/               Agent markdown files              │
│  ├── team.json             Workflow configuration            │
│  └── deployment-*.json     Platform-specific configs         │
├─────────────────────────────────────────────────────────────┤
│  internal/                                                   │
│  ├── polymarket/           Polymarket API client             │
│  ├── loader/               Spec file parsers                 │
│  ├── executor/             Workflow execution engine         │
│  └── tools/                Agent tools for Polymarket        │
├─────────────────────────────────────────────────────────────┤
│  omnillm-langchaingo       LangChainGo adapter               │
├─────────────────────────────────────────────────────────────┤
│  omnillm-core              Unified LLM provider abstraction  │
└─────────────────────────────────────────────────────────────┘

Agent Team

The default trading team consists of three agents in a graph workflow:

Agent Role Model
market-analyst Discovers trading opportunities sonnet
superforecaster Generates probability estimates sonnet
trader Executes trades based on analysis haiku

Workflow: discover → forecast → execute

Dependencies

Package Purpose
omnillm-core LLM provider abstraction
omnillm-langchaingo LangChainGo adapter
langchaingo Go LLM framework