polymarket-brier

Polymarket 地址的布赖尔分数计算器——用于衡量预测准确性,与盈亏无关,帮助区分技术娴熟的预测者与做市商和套利者。

仓库最近推送
GitHub Stars
205
Forks
26
Issues / PRs
1

安装方式

先用 Prompt 核对来源与依赖。也可下载安装包。

用 AI 助手安装

复制提示词,让助手先核对固定版本和依赖。

查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "polymarket-brier":https://skillpi.com/zh/skills/deepskill-687ee252f38ffdfd192465368466fe480e6cd209ce2840c0e753285d6d2166b2。安装前核对上游来源和版本:https://github.com/runesleo/polymarket-toolkit。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。

来源与配置

github.com

配置方式待核实

请查看原始来源中的适用工具、依赖和权限要求。

安装实测待补充

Polymarket 地址的布赖尔分数计算器——用于衡量预测准确性,与盈亏无关,帮助区分技术娴熟的预测者与做市商和套利者。

0 下载

介绍来源: third_party · runesleo · 0.2.0 参考来源

SkillPi 解读

能完成的任务
翻译待完成,请参阅来源文档。
输入和输出
翻译待完成,请参阅来源文档。
实测状态
未测试

文件浏览

在原站浏览文件 ↗

原始 SKILL.md

打开原文 ↗
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.

版本历史

  1. v0.7.0 GitHub ↗
    原版更新说明

    ## 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 ↗
    原版更新说明

    ## 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 ↗
    原版更新说明

    ## 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 ↗
    原版更新说明

    **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] ```

当前收录版本

0.2.0

核对来源版本 ↗

安全与评测信息

质量评测

满分100 · 来自 SkillPi LAB 实验室的评测报告。

场景价值85/100

亮点

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

亮点

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

待提升项

  • 缺少 When to Use 显式章节 原报告严重程度:轻微

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

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

亮点

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

亮点

  • 使用 Polymarket 官方 API,数据源可靠
  • 考虑了多种边界情况(样本量不足、SPLIT 位置、分页处理)
  • 参数设计合理,过滤条件正确
证据可验 (前四项均值)88/100

取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。

正文静态检测

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

正文未命中当前规则。

分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。

权限与使用前检查

根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。

未从主文档识别到上述常见操作,不能据此判断无需权限或没有风险。

文档引用的域名或地址

这些地址可能用于文档链接或示例,不是已批准的联网清单。使用前核对实际目的地及发送的数据。

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

本站展示提示不会授予权限。涉及文件改动、密钥、外部发送或费用时,仍由你使用的工具按需确认。

安全评级与访问范围

safe · 静态证据核验,不代表运行安全保证。

使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。