Polymarket Profile 标志

Polymarket Profile

社区
runesleo
polymarket-profile

Polymarket 地址分析工具:输入任意 0x 地址,即可获取完整交易档案,包括盈亏(PnL)、胜率、持仓、类别细分和热门交易。所有数据均来自公共 API,无需本地数据库。

Add to TypingMind

概览

发布者runesleo
代码仓库polymarket-toolkit
技能名称polymarket-profile
星标数
200
复刻数
26
附带文件
仅含指令
许可协议MIT
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 指令自成一体

    模型所需的一切都包含在指令中,无需同步额外文件。

  • 开源

    由 runesleo 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Polymarket Profile AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/runesleo/polymarket-toolkit/tree/ai/link-probpocket-20260817/skills/polymarket-profile
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/runesleo/polymarket-toolkit.git /tmp/polymarket-toolkit
mkdir -p .claude/skills
cp -r /tmp/polymarket-toolkit/skills/polymarket-profile .claude/skills/polymarket-profile
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Polymarket Profile,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Polymarket Profile。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Polymarket Profile 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

Polymarket Address Profile

Generate a complete trading profile for any Polymarket address. All data comes from public APIs in real-time — no local database or API key required.

Trigger

User provides a Polymarket identity and wants analysis, profile, or trading overview.

Input Resolution

The skill requires a 0x proxy wallet address. Users may provide:

Input TypeExampleHow to handle
0x address0x63ce3421...Use directly
Profile URLpolymarket.com/profile/Theo4Extract username from URL, then resolve via leaderboard lookup (see below)
UsernameTheo4Resolve via leaderboard lookup (see below)

When user provides a username or URL (not 0x address)

Step 1: Try leaderboard lookup — Search lb-api.polymarket.com/profit to resolve username → address.

bash
# Paginate through the leaderboard searching for the username
# Start with offset=0, increment by 500 until found or no more results
curl -s "https://lb-api.polymarket.com/profit?window=all&limit=500&offset=0"

Response is an array of objects with name, pseudonym, and proxyWallet fields. Search for a case-insensitive match on name or pseudonym.

  • Found → use the proxyWallet as the 0x address, continue to Step 1 of execution
  • Not found after 3 pages (1500 users) → the account is likely unranked, fall back to Step 2

Step 2: Manual fallback (only if leaderboard lookup fails)

"This username isn't in the Polymarket leaderboard (only ranked users can be auto-resolved). You can find the 0x address by:

  1. Open the profile page on Polymarket
  2. Click the address/wallet icon near the username — it copies the 0x address
  3. Or check the browser URL — some profile pages show the address"

NOTE: Leaderboard lookup covers all users with a PnL ranking (tens of thousands). Only very new or inactive accounts with zero trading history won't be found.

API Endpoints

All endpoints are public, no authentication needed.

EndpointBase URLPurpose
LB APIhttps://lb-api.polymarket.comPnL, volume, rankings
Data APIhttps://data-api.polymarket.comPositions, activity, trades
CLOB APIhttps://clob.polymarket.comOrderbook, market prices
Gamma APIhttps://gamma-api.polymarket.comMarket metadata, events, categories

Execution Steps

Run steps 1-4 in parallel where possible to minimize latency.

Step 1: PnL Snapshot

bash
curl -s "https://lb-api.polymarket.com/profit?window=all&address={ADDRESS}"

Response is an array. Extract [0].amount for total PnL, [0].name for username.

NOTE: lb-api only returns amount (total PnL). It does NOT return invested/numTrades/numWins. Those must be computed from positions (Step 2) and activity (Step 3).

Also fetch time-windowed PnL for trend:

bash
curl -s "https://lb-api.polymarket.com/profit?window=7d&address={ADDRESS}"
curl -s "https://lb-api.polymarket.com/profit?window=30d&address={ADDRESS}"

Step 2: Current Positions

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

Paginate with offset parameter: if response returns exactly 100 records, fetch next page with offset=100, offset=200, etc. until fewer than 100 returned.

Each position object contains:

FieldDescription
titleMarket question
outcome"Yes" or "No"
sizeNumber of shares held
avgPriceAverage entry price
curPriceCurrent market price
initialValueTotal cost (size × avgPrice)
currentValueCurrent value (size × curPrice)
cashPnlRealized + unrealized PnL
percentPnlPnL as percentage
totalBoughtTotal shares ever bought
realizedPnlPnL from closed portions
redeemableCan claim settlement winnings
endDateMarket expiry date
eventSlugEvent identifier for Gamma API

Extract:

  • Number of open positions: redeemable == false AND currentValue > 0
  • Largest position by currentValue
  • Total portfolio value: sum of currentValue for open positions

Win Rate Calculation

Classify positions into three buckets:

BucketConditionMeaning
Wonredeemable == true AND currentValue > 0Market settled in user's favor, awaiting redemption
Lostredeemable == true AND currentValue == 0Market settled against user
Openredeemable == false AND currentValue > 0Market not yet settled

Win Rate = Won / (Won + Lost)

IMPORTANT: Do NOT use cashPnl > 0 to determine wins. Winning positions have currentValue > 0 (shares worth $1) even if cashPnl appears negative due to partial sells. The redeemable flag is the definitive settlement indicator.

Fallback: When Positions Are Empty or Incomplete

For inactive accounts, the positions API may return very few records (settled positions get cleaned up). If Won + Lost < 3, fall back to activity-based estimation:

  1. From activity, group all REDEEM records by slug (market)
  2. From activity, group all TRADE records by slug
  3. Markets with REDEEM volume > 0 → Won
  4. Markets with TRADE volume > 0 but no REDEEM → Lost (invested but no payout)
  5. Label Win Rate as "estimated from activity" when using this fallback

Step 3: Activity History

bash
curl -s "https://data-api.polymarket.com/activity?user={ADDRESS}&limit=500"

IMPORTANT: You MUST paginate to get complete data. Large accounts have 10,000+ records. 500 records is NOT enough for an accurate profile.

Activity Pagination (REQUIRED)

Loop:
  1. First request: /activity?user={ADDRESS}&limit=500
  2. Get `timestamp` of the LAST record in the response
  3. Next request: /activity?user={ADDRESS}&limit=500&end={last_timestamp}
  4. Repeat until response returns fewer than 500 records (= last page)
  5. Merge all results

Inform user of progress for large accounts: "Fetching activity... page X (Y records so far)"

Each activity object contains: type, size, usdcSize, price, side, title, slug, timestamp, outcome.

Classify by type field:

TypeWhat it means
TRADEBought or sold shares (check side field: "BUY" or "SELL")
SPLITCreated YES+NO pairs from USDC (market-neutral entry)
MERGECombined YES+NO back to USDC (exit / arbitrage capture)
REDEEMClaimed winnings after market settlement
CONVERSIONConverted between YES/NO (special market operation)
REBATEFee rebate from maker orders

Count and sum usdcSize for each type. Also track unique markets (slug) for diversity analysis.

Step 4: Market Categories

For each position, fetch market metadata via Gamma API using the eventSlug from positions:

bash
curl -s "https://gamma-api.polymarket.com/events?slug={eventSlug}"

Or batch multiple slugs. Each event has a category field and a tags array (each tag has a label field).

Category Mapping

Gamma API categories are legacy naming. Map to Polymarket's frontend categories:

Gamma category / tag labelDisplay Category
Sports, NBA Playoffs, Chess, Esports, any sports team nameSports
Crypto, NFTs, Bitcoin, EthereumCrypto
US-current-affairs, Elections, any president/congress/party keywordPolitics
Ukraine & Russia, Iran, any war/military/invasion keywordGeopolitics
Business, any GDP/oil/fed/rate keywordFinance
Pop-Culture, Art, CoronavirusCulture
temperature/weather/celsius keyword in titleWeather
AI/tech/SpaceX keyword in titleTech
Musk/tweet keyword in titleMusk/Tweets
No matchOther

Priority: Use Gamma category field first. If it's missing or too generic (All), fall back to tag labels. If still unclear, infer from market title keywords.

NOTE: Gamma API may return empty [] for old/settled markets. This is expected — fall back to keyword inference from market titles in activity data.

Optimization: Collect all unique eventSlug values from positions first, then batch fetch from Gamma (avoid one API call per position). Group by slug to avoid duplicates.

Compute the percentage distribution by volume invested.

Step 5: Strategy Pattern Detection

Analyze data from Steps 1-4 to classify the address into a trading pattern. Use multiple dimensions — no single metric is sufficient.

Dimensions to compute

From activity data:

  • trade_count: total TRADE records
  • split_count / split_volume: SPLIT records and USDC volume
  • merge_count / merge_volume: MERGE records and USDC volume
  • redeem_volume: total REDEEM volume
  • unique_markets: number of distinct slug values
  • avg_trade_size: total trade volume / trade count
  • trade_frequency: trade count / active days (first to last timestamp)

From positions data:

  • open_count: open positions (not redeemable)
  • settled_count: won + lost
  • concentration: top 3 positions as % of total invested
Pattern Classification

Evaluate in this order (first match wins):

PatternConditionsDescription
SPLIT Arbitragesplit_volume > trade_volume × 0.2 AND merge_volume > 0Enters via SPLIT (creates YES+NO pairs), sells one side or MERGEs back. Capital-efficient, market-neutral entry.
Market Makertrade_count > 500 AND unique_markets < 15 AND avg_trade_size < $20High-frequency small trades concentrated in few markets. Provides liquidity, earns spread.
Whale / Concentratedconcentration > 60% AND unique_markets < 10Heavy capital in a few markets. High-conviction directional bets.
Diversifiedunique_markets > 50Spread across many markets. Portfolio approach, lower per-market risk.
Small Tradertrade_count < 50 AND total_invested < $500Limited activity. New or casual user.
MixedNone of the aboveCombination of strategies, no dominant pattern.
Output format
🎯 Strategy Pattern: {pattern_name}
   {1-2 sentence explanation based on actual numbers}
   Key metrics: {trade_count} trades across {unique_markets} markets, avg ${avg_trade_size}/trade

Do NOT reveal specific thresholds used for classification. Just state the pattern name and explain it in plain language using the trader's actual data.

Step 6: Top Trades

From positions data (not activity), use cashPnl field for settled positions:

  • Top 5 Wins: Settled positions with highest positive cashPnl
  • Top 5 Losses: Settled positions with most negative cashPnl

For each: market title, outcome (Yes/No), entry price (avgPrice), PnL amount.

NOTE: cashPnl from positions is approximate (affected by partial sells). This is acceptable for v0.1. Do NOT attempt to match individual BUY→SELL/REDEEM from activity — that requires complex logic and is not worth the accuracy gain for a profile overview.

Fallback: When Positions Data Is Sparse

If positions API returns very few settled records, estimate Top Trades from activity:

  1. Group TRADE records by slug, sum usdcSize per market (= total invested)
  2. Group REDEEM records by slug, sum usdcSize per market (= total payout)
  3. PnL per market ≈ REDEEM volume - TRADE BUY volume
  4. Sort by PnL for top wins/losses. Label as "estimated from activity".

Step 7: Assemble Profile

Output the complete profile in this format:

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  Polymarket Profile: {ADDRESS_SHORT}
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

📊 Overview
  Address:    {ADDRESS}
  Total PnL:  ${totalProfit} (invested ${invested})
  Win Rate:   {wins}/{total} ({winRate})
  7d PnL:     ${pnl_7d}
  30d PnL:    ${pnl_30d}

📈 Current Positions ({count})
  Largest:    {market_name} — {direction} ${size} @ ${avg_price}
  Portfolio:  ${total_value}

  | # | Market | Direction | Size | Avg Price | Current | PnL |
  |---|--------|-----------|------|-----------|---------|-----|
  | 1 | ...    | YES/NO    | $xx  | $0.xx     | $0.xx   | +$x |
  ...

📂 Category Distribution
  | Category | Positions | Volume | % |
  |----------|-----------|--------|---|
  | Crypto   | 12        | $5,000 | 45% |
  | Politics | 5         | $2,000 | 22% |
  ...

📋 Activity Summary
  | Type       | Count | Volume |
  |------------|-------|--------|
  | TRADE BUY  | xxx   | $xxx   |
  | TRADE SELL | xxx   | $xxx   |
  | SPLIT      | xxx   | $xxx   |
  | MERGE      | xxx   | $xxx   |
  | REDEEM     | xxx   | $xxx   |

🏆 Top Wins
  1. {market} — {direction} +${pnl} (entry ${price} → ${exit})
  2. ...
  3. ...

💀 Top Losses
  1. {market} — {direction} -${pnl} (entry ${price} → ${exit})
  2. ...
  3. ...

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  Generated: {timestamp} | Data: Polymarket Public APIs
  Powered by Leo Labs — leolabs.me
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Important Notes

  • PnL from lb-api is the ground truth. Use it as the primary source. Position-level cashPnl may differ due to SPLIT/MERGE accounting.
  • Activity pagination: use end timestamp, never offset. Do NOT deduplicate — same txHash with multiple records means multiple fills in one transaction.
  • Always paginate ALL activity records. Partial data produces inaccurate profiles. Show pagination progress to the user (e.g. "Fetching activity... page 5, 2500 records so far").
  • Category mapping: use eventSlug from positions to query Gamma API. Category comes from the event's tags or category field. If Gamma is slow, infer from market title keywords (BTC/ETH/crypto → Crypto, Trump/election → Politics, NBA/FIFA → Sports, temperature/weather → Weather).
  • All monetary values in USD, round to 2 decimal places.
  • Address format: APIs accept both checksummed and lowercase. Normalize to lowercase.
  • lb-api may require proxy in some regions. data-api and gamma-api work globally.
  • Rate limits: No documented limits, but keep requests reasonable (<10 concurrent). Add 500ms delay between sequential pagination calls. If a request returns empty or non-JSON, retry once after 2 seconds.
  • lb-api 7d/30d: May return empty array [] for inactive accounts. Display as "N/A" instead of $0.

常见问题

Polymarket Profile AI 技能有什么作用?

Polymarket 地址分析工具:输入任意 0x 地址,即可获取完整交易档案,包括盈亏(PnL)、胜率、持仓、类别细分和热门交易。所有数据均来自公共 API,无需本地数据库。

为什么在 TypingMind 中使用 Polymarket Profile?

因为您只需安装一次,就能搭配任何模型使用。Polymarket Profile 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Polymarket Profile?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/runesleo/polymarket-toolkit/tree/ai/link-probpocket-20260817/skills/polymarket-profile。TypingMind 会读取其中的 SKILL.md,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Polymarket Profile?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Polymarket Profile 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Polymarket Profile 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Polymarket Profile AI 技能免费吗?

是的。runesleo 已在 GitHub 上根据 MIT 许可证发布了该技能。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇