Running the Alphapoly Pipeline

Running the Alphapoly Pipeline is a skill for Claude Code, Codex from chainstacklabs/polymarket-alpha-bot. It costs 74 tokens per session (495 once invoked), scanned A, original, Apache-2.0.

A tool for running the Alphapoly data pipeline, which collects prediction markets from Polymarket and turns related markets into hedged portfolio opportunities. It can process new data incrementally or rebuild all stored results.

In plain words
What is it for?
Use it to fetch Polymarket events, group related markets, identify logical implications, validate market pairs, build portfolios, regenerate results, or reset and restore seed data.
Why use it?
It removes the need to run each data-processing stage by hand when refreshing markets, updating portfolios, or troubleshooting results. Cached work can be reused for incremental runs.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/chainstacklabs/polymarket-alpha-bot/alphapoly-pipeline
Any agent
npx skills add chainstacklabs/polymarket-alpha-bot --skill alphapoly-pipeline
Clone the repo
git clone --depth 1 https://github.com/chainstacklabs/polymarket-alpha-bot

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for Running the Alphapoly Pipeline

README.md
[![agentmods](https://agentmods.dev/badge/skills/chainstacklabs/polymarket-alpha-bot/alphapoly-pipeline.svg)](https://agentmods.dev/skills/chainstacklabs/polymarket-alpha-bot/alphapoly-pipeline)
Your own site
<a href="https://agentmods.dev/skills/chainstacklabs/polymarket-alpha-bot/alphapoly-pipeline"><img src="https://agentmods.dev/badge/skills/chainstacklabs/polymarket-alpha-bot/alphapoly-pipeline.svg" alt="Measured on agentmods" height="20"></a>
Per session 74 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 495 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00074 $0.00495
Opus 5 $0.00037 $0.00247
Sonnet 5 $0.00015 $0.00099
Haiku 4.5 $0.00007 $0.00049

Measured 6d ago against content hash 3440496b43dc, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

Running the Alphapoly Pipeline scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/alphapoly-pipeline/SKILL.md · 56 lines

What it actually says

Running the Alphapoly Pipeline

The pipeline fetches Polymarket events, groups related markets, extracts logical implications via LLM, and builds hedged portfolios. Output lands in data/_live/.

Quick Run

make pipeline         # Incremental (new groups only, uses cache)
make pipeline-full    # Full reprocess (resets all state)

With Model Overrides

Run from the backend/ directory:

uv run python -c "
from core.runner import run
run(
    implications_model='openai/gpt-4o-mini',
    validation_model='openai/gpt-4o',
)"

Pipeline Steps

  1. Fetch events from Polymarket
  2. Build market groups
  3. Detect new groups (incremental check)
  4. Extract implications (LLM, cached)
  5. Expand to market-level pairs
  6. Validate pairs (LLM, cached)
  7. Build portfolios with tier metrics
  8. Export to data/_live/

Price updates happen separately via the WebSocket service when the backend is running.

Seed Data

make export-seed    # Save current state as seed
make import-seed    # Reset DB and import seed (resets state)

Verify

After running, confirm the pipeline produced output:

  • Check data/_live/ for output files
  • Or start the backend (make backend) and hit GET /data/portfolios to see generated portfolios

Troubleshooting

  • Crashes on startup → verify .env has all three required vars: OPENROUTER_API_KEY, IMPLICATIONS_MODEL, VALIDATION_MODEL
  • LLM errors → check OPENROUTER_API_KEY is valid; try a different model via override
  • Stale state → make pipeline-full to reprocess everything
  • Partial outputs → check data/_live/ then re-run make pipeline to resume incrementally
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 56 lines · 74 tokens per session scan A 3440496b43dc

Subscribe to this mod's changes

Running the Alphapoly Pipeline is a skill published in the GitHub repository chainstacklabs/polymarket-alpha-bot (174 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 74 tokens to every session and 495 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.