• Homepage •
Supported protocols •
Chainstack blog •
Blockchain API reference •
• Start for free •
Trades against Polymarket V2 (pUSD collateral). The legacy V1 (USDC.e) stack was retired on 2026-04-28 —
git checkout v1-finalto inspect it. If you hold USDC.e, wrap it to pUSD withexperiments/trading/02_wrap_to_pusd.pybefore trading.
Find covering portfolios across correlated prediction markets using predefined rules and LLM decisions. The system detects relationships between markets, classifies them to identify hedging pairs, and tracks their prices. The platform offers a smooth UI for entering detected pairs when profit opportunities exist and tracking your positions.
For a good experience, you'll need to add an LLM from OpenRouter and an RPC node (see .env.example).
- Groups - Fetches markets from Polymarket (e.g., "Presidential Election Winner")
- Implications (LLM) - Extracts logical relationships between groups
- Validation (LLM) - Validates implications at the individual market level
- Portfolios - Computes cost and expected profit for validated pairs using live market prices
- Positions - Tracks your purchased position pairs
cp .env.example .env
# With make
make install && make dev
# Without make
cd backend && uv sync
cd frontend && npm install
cd backend && uv run python -m uvicorn server.main:app --port 8000 &
cd frontend && npm run devDashboard: http://localhost:3000 · API: http://localhost:8000/docs
With make (auto-detects fnm/nvm/volta):
make install # Install deps
make dev # Start both servers
make pipeline # Run ML pipeline (incremental, also available in UI)
make lint # Auto-fix: ruff + prettier + eslintWithout make:
# Backend
cd backend && uv sync
cd backend && uv run python -m uvicorn server.main:app --reload --port 8000
# Frontend
cd frontend && npm install
cd frontend && npm run devThis repo is configured for AI coding agents via the .claude/ directory:
CLAUDE.md— project context, commands, conventions, and API routeshooks/— auto-lint on edit, guard against writing secrets (Claude Code only)skills/— workflows for pipeline management, trading, and feature development
The .claude/skills/ directory contains Agent Skills — an open standard for extending AI coding agents with reusable, modular capabilities. Each skill is a directory with a SKILL.md file (YAML frontmatter + natural-language instructions) that teaches an agent how to perform a domain-specific workflow.
| Skill | Purpose |
|---|---|
alphapoly-pipeline |
Run, debug, and manage the ML pipeline |
alphapoly-portfolios |
Fetch and display portfolio opportunities |
alphapoly-enter-position |
Execute a covered pair trade |
alphapoly-exit-position |
Exit or manage an open position |
alphapoly-feature |
Add features following stack conventions |
alphapoly-experiment |
Scaffold standalone experiment scripts |
To use the skills in this repo with a different agent, point it at .claude/skills/ or copy the skill directories into the agent's expected location (e.g., ~/.codex/skills/ for Codex CLI).
CLAUDE.md is read natively by Claude Code and by GitHub Copilot in VS Code (opt-in via chat.useClaudeMdFile). For broader cross-agent compatibility, AGENTS.md is also provided as a symlink to CLAUDE.md — an open format supported by Codex, Cursor, Copilot, and others.
Standalone research scripts (no imports from backend/). Three groups:
| Folder | Description |
|---|---|
experiments/ |
Pipeline-step learning examples — fetch events, build groups, extract implications, validate, score portfolios, stream prices. Mirrors what backend/core/runner.py orchestrates, one stage per file. |
experiments/trading/ |
Wallet + funding + position helpers. Generate a wallet, swap native USDC → USDC.e (one-time DEX hop), wrap USDC.e ↔ pUSD via Polymarket's CollateralOnramp/Offramp (1:1, gas-only, no slippage), buy a position, transfer tokens. |
experiments/onchain-otc/ |
On-chain OTC trading without the CLOB — split/merge, P2P transfers, atomic escrow, NegRisk conversions, and intent-based settlement on an Anvil fork of Polygon. Forked-chain research; uses USDC.e collateral (the fork's frozen state predates Polymarket V2 / pUSD). |
Disclaimer: This software is provided as-is for educational and research purposes only. It is not financial advice. Trading prediction markets involves risk—you may lose money. Use at your own discretion.

