polymarket-brier

Brier score calculator for Polymarket addresses—measures forecasting accuracy independent of profit/loss, helping distinguish technically skilled forecasters from market makers and arbitrageurs.

Last repository push
GitHub Stars
205
Forks
26
Issues / PRs
1

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "polymarket-brier" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-687ee252f38ffdfd192465368466fe480e6cd209ce2840c0e753285d6d2166b2. Verify the upstream source and version against https://github.com/runesleo/polymarket-toolkit before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

github.com

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Brier score calculator for Polymarket addresses—measures forecasting accuracy independent of profit/loss, helping distinguish technically skilled forecasters from market makers and arbitrageurs.

0 Downloads

Introduction source: third_party · runesleo · 0.2.0 Reference

SkillPi interpretation

Tasks
Brier Score calculator for Polymarket addresses — measures prediction accuracy independent of PnL. Separates skilled predictors from market makers and arbitrageurs.
Inputs and outputs
Same as polymarket-profile — accepts 0x address, username, or profile URL.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: polymarket-brier
description: Brier Score calculator for Polymarket addresses — measures prediction accuracy independent of PnL. Separates skilled predictors from market makers and arbitrageurs.
allowed-tools: Bash(curl:*) Read Write Edit
metadata: {"version":"0.2.0","openclaw":{"skillKey":"polymarket-brier","homepage":"https://leolabs.me","requires":{"anyBins":["curl"]}}}

Polymarket Brier Score

Calculate prediction accuracy for any Polymarket address. Brier Score measures how close a trader's positions were to the actual outcomes — independent of PnL, position size, or trading strategy.

Why Brier Score?

PnL tells you who made money. Brier Score tells you who predicted correctly.

  • High PnL + Poor Brier → Market maker or arbitrageur (earns spread, not predictions)
  • Low PnL + Good Brier → Accurate predictor with small positions or conservative sizing
  • High PnL + Good Brier → Skilled predictor who also sizes well — the real signal

Trigger

User asks about prediction accuracy, Brier score, prediction quality, forecasting skill, or "how accurate is this trader".

Background

The Brier Score is a standard metric in forecasting (used by Metaculus, Good Judgment Project, etc.).

Formula: BS = (1/N) × Σ(forecast_probability - actual_outcome)²

  • 0.0 = perfect prediction (always right with 100% confidence)
  • 0.25 = no skill (equivalent to random 50/50 guessing)
  • 0.5+ = worse than random

Lower is better.

Input

Same as polymarket-profile — accepts 0x address, username, or profile URL.

Execution

Step 1: Fetch Settled Positions

curl -s "https://data-api.polymarket.com/positions?user={ADDRESS}&sizeThreshold=0&limit=100&offset=0"

Paginate until all positions are fetched (same as polymarket-profile).

Filter to settled positions only: redeemable == true.

For each settled position, extract:

  • outcome: "Yes" or "No" — the side the trader held
  • avgPrice: the trader's average entry price = their implied probability forecast
  • currentValue > 0: whether the market resolved in their favor (won) or not (lost)

Step 2: Determine Actual Outcome

For each settled position:

  • If currentValue > 0 (won): the outcome the trader bet on did happen → actual = 1
  • If currentValue == 0 (lost): the outcome the trader bet on did not happen → actual = 0

Step 3: Calculate Brier Score

For each settled position:

forecast = avgPrice  (what they paid = their implied probability)
squared_error = (forecast - actual)²

Then:

brier_score = sum(squared_error) / count(settled_positions)

Step 4: Calculate Calibration Breakdown (Optional, if ≥20 settled positions)

Group positions into probability buckets by avgPrice:

Bucket Range Meaning
High confidence 0.80-0.99 "Very likely to happen"
Moderate 0.60-0.79 "Probably happens"
Coin flip 0.40-0.59 "Could go either way"
Contrarian 0.01-0.39 "Betting against the crowd"

For each bucket:

  • Count positions
  • Average forecast probability
  • Actual win rate (% that resolved in their favor)
  • A well-calibrated trader's win rate should be close to their average forecast

Step 5: Output

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  Brier Score: {ADDRESS_SHORT}
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

📊 Prediction Accuracy
  Brier Score:      {score} ({rating})
  Settled Markets:  {count}
  Correct:          {wins}/{total} ({win_rate}%)

📐 Calibration
  | Confidence | Positions | Avg Forecast | Actual Win% | Gap |
  |------------|-----------|-------------|-------------|-----|
  | High       | 12        | 87%         | 83%         | -4% |
  | Moderate   | 8         | 68%         | 62%         | -6% |
  | Coin flip  | 5         | 52%         | 60%         | +8% |
  | Contrarian | 3         | 28%         | 33%         | +5% |

💡 Interpretation
  {1-2 sentence plain language summary}

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  Generated: {timestamp} | Data: Polymarket Public APIs
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Rating Scale

Brier Score Rating Meaning
0.00-0.10 Excellent Top-tier forecaster
0.10-0.15 Good Consistently better than chance
0.15-0.20 Average Some skill, room to improve
0.20-0.25 Poor Barely better than guessing
0.25+ No skill Worse than a coin flip

Notes

  • Brier Score requires settled positions. Accounts with mostly open positions will have a small sample size — flag this: "Based on N settled markets. Score reliability increases with more data."
  • If fewer than 5 settled positions, output: "Not enough settled data for a meaningful Brier Score."
  • avgPrice is used as the probability forecast. This is a simplification — traders who DCA (buy at multiple prices) will have a blended avgPrice. Acceptable for v0.2.
  • SPLIT positions should be excluded from Brier calculation. SPLIT is a market-neutral operation (buy both sides), not a directional prediction. Identify via polymarket-profile's activity data if available, otherwise include all positions with a note.
  • This score is independent of position size. A $10 bet and a $10,000 bet on the same market at the same price contribute equally. This is intentional — we're measuring prediction skill, not bankroll management.

Version history

  1. v0.7.0 GitHub ↗
    Original release notes

    ## v0.7 — MCP server for AI agents The toolkit's read-only CLI is now available as [Model Context Protocol](https://modelcontextprotocol.io) tools: [`mcp/`](https://github.com/runesleo/polymarket-toolkit/tree/main/mcp) · [docs/mcp.md](https://github.com/runesleo/polymarket-toolkit/blob/main/docs/mcp.md) - **10 read-only tools** for Claude / Codex / Cursor / any MCP client: `pm_profile`, `pm_activity`, `pm_brier`, `pm_pnl_check`, `pm_scan`, `pm_updown`, `pm_leaderboard`, `pm_redeem_watchdog`, `pm_v2_check`, `pm_rate_limits` - **The CLI is the contract**: every tool shells out to `pm` (argv array, no shell) — the server can do exactly what the read-only CLI can do, nothing more - **Hardened**: allowlist input validation (SDK layer + independent handler re-validation), pinned activity paging, 2MB subprocess output cap, spawn concurrency limit, 60s timeout - **No trading over MCP** — order placement stays in the separate opt-in `executor/` package, human-wired only - **npm packaging**: `npx -y polymarket-toolkit-mcp` one-liner (bundled dist, Node >=20) — npm listing goes live once published Setup: ```bash claude mcp add polymarket-toolkit -- npx -y polymarket-toolkit-mcp ``` (or from source: `cd mcp && npm install && npm start`)

  2. v0.6.0 GitHub ↗
    Original release notes

    ## v0.6 — Opt-in executor sub-package The core stays **zero-dependency, read-only, key-free**. Order execution now lives in an isolated, opt-in sub-package: [`executor/`](https://github.com/runesleo/polymarket-toolkit/tree/main/executor) · [docs/executor.md](https://github.com/runesleo/polymarket-toolkit/blob/main/docs/executor.md) ### Executor - CLOB V2 limit orders (GTC/GTD) via `@polymarket/clob-client-v2`, isolated deps — never imported by the core - **Safety ladder**: narrow façade (raw client not exposed) · dry-run by default (`EXECUTOR_LIVE=1` to post) · full canonical-field re-validation + notional cap recomputed at the boundary (`EXECUTOR_MAX_USD`, default $10) · fail-closed credential validation with redacted errors · live-call console redaction (the underlying client logs auth headers on HTTP errors) - Builder attribution end-to-end: default / override / opt-out, resolved once per instance; dry-run preview matches live behavior. Disclosure: [docs/builder-attribution.md](https://github.com/runesleo/polymarket-toolkit/blob/main/docs/builder-attribution.md) ### Core fix - `src/builder.ts`: a malformed `POLY_BUILDER_CODE` override now **disables** attribution instead of silently falling back to the author's default ### Verification - 51 tests green (root 23 + executor 28), both typechecks clean - 3-round adversarial code review before ship

  3. v0.5.0 GitHub ↗
    Original release notes

    ## Polymarket Toolkit v0.5.0 **For builders who run code** — CLI, TypeScript helpers, and AI skills over public Polymarket APIs. No API keys. No signing. ### Highlights - **`pm` CLI** — `profile`, `activity`, `scan`, `updown`, `v2-check`, `lb`, `pnl-check`, `limits`, `brier`, `redeem`, `markets` - **Activity ~4000 row cap warnings** — duplicate-page detection so truncated history is not mistaken for complete data - **V2 CTF FAQ** + read-only `pm v2-check` — split/merge infra alignment diagnostics (not execution) - **Validation templates** — handoff, backtest, paper, live-gate, platform runbook - **Bilingual README** — [README.zh.md](./README.zh.md) - **Builder attribution helper** — `src/builder.ts` for future executor paths (read-only tools unchanged) ### Quick try ```bash git clone https://github.com/runesleo/polymarket-toolkit.git && cd polymarket-toolkit ./bin/pm profile 0x63ce342161250d705dc0b16df89036c8e5f9ba9a ``` Node 22+ recommended. ### Boundaries This release does **not** sign transactions or run merge/split/redeem on your wallet. For audit-grade PnL use `skills/polymarket-pnl`. For normal redemption use the official Polymarket app. Full notes: [README.md](https://github.com/runesleo/polymarket-toolkit/blob/main/README.md)

  4. v0.4.0 GitHub ↗
    Original release notes

    **One-liner:** pUSD-era redeem observability for AI agents. No keys required. After Polymarket's pUSD redemption flow shipped, normal users redeem in-app. Agents still need a status lane: which wallet has redeemable value, which condition still surfaces as `redeemable=true` in the Data API, whether a low-cash strategy account needs attention. v0.4 adds three small helpers to fill that gap — read-only, zero-dep, no signing. ## New helpers (`src/index.ts`) - `fetchRedeemablePositionsPage(user, opts)` — Data API `/positions?redeemable=true` - `summarizeRedeemablePositions(rows)` — group by `conditionId`, sum `currentValue` (losing rows correctly contribute `$0`, not their `size`; negative values clamp to `0`) - `resolveRedeemMode({ mode, lowWatermark })` — returns `"watchdog"` or `"low_watermark"`. Intentionally no `"active"` value: this toolkit never executes a redeem, so an active label belongs in your own wallet system. ## New artifacts - `examples/15-redeem-watchdog.ts` — copy-paste demo - `docs/cookbook.md §11` — bilingual recipe (EN + ZH localized rewrite) - `tests/redeem_watchdog.test.ts` — 9 tests covering pure functions, network URL assembly, and the regression points caught during review ## Safety boundary This release **only reads public APIs**. It does not redeem tokens, sign Safe transactions, call relayers, move funds, or require private keys. The official Polymarket app remains the right place for normal user redemption. ## Review trail This release went through two rounds of independent Codex review: - **Round 1** caught `currentValue || size` falsely inflating losing redeemable rows: a demo wallet with three losing tokens (`size > 0`, `currentValue = 0`) was reporting `$1.84` payable, when the real payable amount is `$0`. Fixed by replacing the `||` fallback with a `currentValue == null` null-check. - **Round 2** caught a missing `>= 0` clamp on negative `currentValue`. Fixed by clamping at the summary level. Tests went from 2 → 9. Full review trail visible in PR #10 and commits `9f89557` + `64f9d15`. ## Tests - `npm test` — 9/9 pass - `tsc --noEmit` — clean - Example 15 smoke against demo wallet `0x63ce342161250d705dc0b16df89036c8e5f9ba9a` returns `estimatedRedeemableValue: 0` (was falsely `$1.84` before the fix) ## Quickstart ```bash npx tsx examples/15-redeem-watchdog.ts <proxy_wallet> [low_watermark] ```

Current listing version

0.2.0

Verify the source revision ↗

Safety and assessment details

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value85/100

Highlights

  • 提供 Polymarket 地址的预测准确性评估,解决区分真实预测能力与套利行为的核心需求
  • 使用标准 Brier Score 指标,具有学术和实际应用基础
  • 针对预测市场参与者的高价值工具
Trigger Precision88/100

Highlights

  • 触发词覆盖完整,包括 prediction accuracy、Brier score、forecasting skill 等变体
  • 边界清晰,不易与其他 Skill 重叠
Structure and Standards92/100

Areas to improve

  • 缺少 When to Use 显式章节 Reported severity: Minor

    文档结构完整但缺少显式的 When to Use 章节标题

    Recommendation: 建议添加 When to Use 章节以符合标准模板

Highlights

  • 执行步骤清晰(Step 1-5),包含完整的数据获取、处理和输出流程
  • 提供详细的输出格式示例和评分标准
  • frontmatter 完整,包含必要的元数据信息
Execution Reliability87/100

Highlights

  • 使用 Polymarket 官方 API,数据源可靠
  • 考虑了多种边界情况(样本量不足、SPLIT 位置、分页处理)
  • 参数设计合理,过滤条件正确
Evidence Verifiability (mean of the first four)88/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

These common operations were not identified in the main document. This does not mean no permissions or risks exist.

Domains or addresses referenced in the document

These addresses may be documentation links or examples, not an approved network allowlist. Verify actual destinations and outgoing data before use.

  • data-api.polymarket.com
  • leolabs.me

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.