openPoly by KoNananachan: open, news-driven, on-chain-verifiable live trading for Polymarket.
openPoly
Open, news-driven, on-chain-verifiable live trading for Polymarket.
Public release, deployment, and maintenance by KoNananachan.
Experimental live-trading system for Polymarket prediction markets. A single-process Python backend drives an event-driven strategy pipeline; a React Flow canvas lets you wire that pipeline up and tune it visually.
โ ๏ธ openPoly can place real orders with real money. It defaults to **paper
mode** and never touches funds until you explicitly switch to live. Prediction
markets are high risk and restricted in many jurisdictions. Read the
DISCLAIMER before going anywhere near live mode.
See the demo first (no backend, no setup)
โถ Live demo:
What it is
openPoly trades one strategy at a time at grain-scale capital ($5โ$50), built to iterate fast and validate signal alpha on real markets. The strategy decision logic is atomized into pluggable "sections" โ typed, swappable modules (news source, market source, embedding, analyzer, entry, exit, โฆ) that you can reconfigure on the canvas without touching the framework.
It is a deliberately single system: one process, one pipeline, one SQLite file โ zero infra to stand up. See docs/architecture/ for the design.
| Layer | Choice | |---|---| | Backend | Python + FastAPI, single process | | Storage | SQLite (single writer) | | Polymarket SDK | py-clob-client | | Frontend | React + React Flow (strategy canvas) |
Built on external APIs. openPoly is a thin orchestration layer over two
third-party services: news signals come from the TradingNews API, and all
market data and order placement go through the official Polymarket API
(via py-clob-client). It
ships no proprietary data or matching of its own โ you bring credentials for
each service (see .env.example) and openPoly wires them into the pipeline.
Features
- Visual strategy canvas โ wire up and tune the whole decision pipeline on a
- Pluggable typed sections โ the decision logic is atomized into swappable
Config, so its params are a single source of
truth shared by backend and canvas.
- Event-driven, single process โ one FastAPI process drives the pipeline; the
- Paper mode by default โ runs against real markets with no funds at risk;
- Live activity monitoring โ equity curve, open positions, and the incoming
- Zero hardcoded secrets โ every credential resolves via
*_refindirection
env: / local: / keychain); nothing sensitive lives in the repo.
- Zero infra โ a single Python process and one SQLite file. Nothing to stand
Early results โ a first read on the signal
openPoly has run live, on real money on Polymarket (Polygon mainnet) at grain scale ($1โ$10 per entry). One window โ 25 positions over ~6 days โ is a tiny sample, but it already says something useful about where the edge lives.

| Live window ยท 2026-05-25 โ 05-31 | Result | |---|---| | Realized return on notional, net of fees | +5.2% | | Mark-to-market return (snapshot) | +6.7% | | Closed win rate | 62% (13 / 21) | | Live fills / distinct positions | 46 / 25 | | Entry notional deployed | $229.42 | | On-chain settlement | 39 / 40 receipts 0x1 |
Every entry (25/25) was triggered by an incoming news item โ openPoly never trades on price alone. And after those news-triggered entries, **23 of 25 positions moved in the trade's favor** before exit, several sharply (post-entry peaks of +67%, +80%, +142%, +161% against entry price). The news, in other words, tended to arrive ahead of the market repricing. That is where the edge appears to live โ in the news signal itself (streamed in via the TradingNews API), not in anything clever downstream.
The realized number is deliberately modest next to those peaks, and that gap is the honest takeaway: the signal found the move; the exit logic gave most of it back (one position peaked +161% but booked +$1.68; another ran +142% then stopped out at โ$2.90). Closed win rate was 13/21.
A tiny, early sample (n=25) on grain-scale capital โ suggestive of a real
directional edge, not a proven or repeatable return. Past results say nothing
about the future, and openPoly is not investment advice. Read the
DISCLAIMER before going near live mode.
How a trade gets decided
news_source โ embedding โ analyzer โ entry โ exit, each a swappable section: a news item arrives, the embedding narrows it to the markets it actually moves, the analyzer scores the directional signal, entry fires only past an edge threshold, and exit manages the position (take-profit / trailing-stop / stop-loss).
Where it improves next
The data points the work at exits and sizing, not the signal:
- Let winners run โ trailing/stop exits surrendered large post-entry peaks;
- Size by conviction โ flat ~$5โ10 sizing treats a +161% setup like a coin
- Tighter entries โ a few stop-losses fired on positions that peaked sharply
Strategy changelog
The strategy is a living thing โ entry gates, exit thresholds, and risk brakes have all changed as paper and live data came in, and each change is recorded with its reasoning (including the ideas that were considered and rejected). See CHANGELOG.md for the full decision-by-decision history.
Quickstart (paper mode, same machine)
Prerequisites: uv (Python toolchain) and Node.js + yarn.
# 1. Backend โ binds 127.0.0.1:8000, paper mode by default
uv run uvicorn openpoly.api.main:app
2. Frontend โ in another terminal, proxies to the local backend on :8000
cd frontend && yarn install && yarn dev
Open the Vite URL it prints and the strategy canvas loads. No environment variables, no funds, no live orders โ paper mode is the default. To configure secrets for later, copy .env.example to .env (gitignored) and fill it in.
Trading live from a Polymarket-geoblocked region? Order placement is region -blocked there, so the backend has to run from an allowed region while the frontend stays local. See docs/deploy/.
Repo layout
openpoly/ Python backend
โโโ sections/ โ pluggable strategy sections (the main extension point)
โ โโโ _base.py ยท section contract / registry / contract-test (framework โ edit with care)
โ โโโ entry/ exit/ ยท trade-decision sections
โ โโโ analyzer/ ยท signal analysis (e.g. LLM)
โ โโโ embedding/ ยท text โ vector
โ โโโ news_source/ ยท โ section impl (โ openpoly/news/)
โ โโโ market_source/ ยท โ section impl (โ openpoly/markets/)
โ โโโ database/ ยท โ section impl (โ openpoly/db/)
โโโ user_sections/ โ drop your own section impls here (gitignored, runs locally)
โโโ api/ FastAPI routes
โโโ db/ SQLite engine + stores (โ sections/database/)
โโโ news/ markets/ domain logic (โ sections/*_source/)
โโโ execution/ wallet/ order dispatch + signing
โโโ portfolio/ runtime/ position store + orchestrator/monitors
โโโ llm/ embedding/ LLM client + embedding model
frontend/src/sections/ canvas UI, mirrors openpoly/sections/ by name
docs/architecture/ design decisions
docs/deploy/ deployment models (default same-machine + geoblock split)
tests/ pytest suite
Two naming gotchas worth internalizing: openpoly/db/ (the SQLite engine) is not sections/database/ (a swappable database section), and openpoly/news/ ยท markets/ (domain logic) are not sections/newssource/ ยท marketsource/ (section impls).
Extending it
Strategy work happens in sections. To add your own, drop a class implementing the section contract (SECTIONTYPE, SECTIONVERSION, REQUIRES, Config, run) into openpoly/user_sections/ โ the registry discovers it at startup. That directory is gitignored, so your private strategies stay local. Full contract: docs/architecture/02-strategy-sections.md.
Ethos
- MIT licensed โ open source is a mindset, not a future milestone.
- Published and maintained by KoNananachan โ this public repo is the canonical
- Default paper mode โ live trading requires explicit opt-in.
- Zero hardcoded secrets โ everything via
*_refindirection (env / keychain). - Cross-platform โ Linux / macOS first.
License
MIT ยฉ 2026 KoNananachan and openPoly contributors. No warranty โ see DISCLAIMER.
