predictfun-mcp
MCP (Model Context Protocol) server that gives AI agents structured access to Predict.fun — a prediction market protocol on BNB Chain with $1.5B+ volume and yield-bearing mechanics via Venus Protocol. Indexes data from three subgraphs: orderbook activity, position lifecycle, and yield mechanics.
README
Predict.fun Subgraphs
<a href="https://glama.ai/mcp/servers/PaulieB14/predictfun-mcp"> <img width="380" height="200" src="https://glama.ai/mcp/servers/PaulieB14/predictfun-mcp/badge" /> </a>
A suite of three subgraphs indexing Predict.fun — a prediction market protocol on BNB Chain (Polymarket fork) with $1.7B+ volume and novel yield-bearing mechanics via Venus Protocol.
Subgraphs
1. predictfun-orderbook
Indexes orderbook activity across all CTF and NegRisk exchanges.
Entities: Markets, Orderbooks, OrderFilled/Matched/Cancelled events, Fee tracking, Account stats, NegRisk markets, TradeData timeseries with hourly/daily aggregations
Contracts:
| Contract | Address |
|---|---|
| CTFExchange (Non-Yield) | 0x8BC070BEdAB741406F4B1Eb65A72bee27894B689 |
| CTFExchange (Yield) | 0x6bEb5a40C032AFc305961162d8204CDA16DECFa5 |
| NegRiskCtfExchange (Non-Yield) | 0x365fb81bd4A24D6303cd2F19c349dE6894D8d58A |
| NegRiskCtfExchange (Yield) | 0x8A289d458f5a134bA40015085A8F50Ffb681B41d |
| NegRiskAdapter (Non-Yield) | 0xc3Cf7c252f65E0d8D88537dF96569AE94a7F1A6E |
| NegRiskAdapter (Yield) | 0x41dCe1A4B8FB5e6327701750aF6231B7CD0B2A40 |
| + 4 Fee Module contracts |
2. predictfun-positions
Indexes position lifecycle — splits, merges, redemptions, and open interest tracking.
Entities: Conditions, UserPositions, MarketOpenInterest, Split/Merge/Redemption events, NegRisk conversions, TransferSingle events
Contracts:
| Contract | Address |
|---|---|
| ConditionalTokens (Non-Yield) | 0x22DA1810B194ca018378464a58f6Ac2B10C9d244 |
| ConditionalTokens (Yield) | 0x9400F8Ad57e9e0F352345935d6D3175975eb1d9F |
| NegRisk ConditionalTokens (Yield) | 0xF64b0b318AAf83BD9071110af24D24445719A07F |
| NegRiskAdapter (Non-Yield) | 0xc3Cf7c252f65E0d8D88537dF96569AE94a7F1A6E |
| NegRiskAdapter (Yield) | 0x41dCe1A4B8FB5e6327701750aF6231B7CD0B2A40 |
| NegRiskOperator (Yield) | 0xBB7250101e0e3611D7e136fFE73Bc24b98E3e175 |
| NegRiskOperator (Non-Yield) | 0x56020F5024641d577Cb54032aF70a23a986ECfFD |
3. predictfun-yield
Indexes Predict.fun's novel yield-bearing mechanics — Venus Protocol integration, reward distributions, and UMA oracle resolution.
Entities: TokenMappings (underlying/vToken pairs), YieldClaims, VTokenMints, RewardRounds, OracleRequests/Proposals/Settlements
Contracts:
| Contract | Address |
|---|---|
| YieldBearingConditionalTokens | 0x9400F8Ad57e9e0F352345935d6D3175975eb1d9F |
| RewardDistributor | 0x14e3a0a4aB4e4Fa60FC6b4aCce200afAD9233ecE |
| UMA Optimistic Oracle | 0x76F4632032d3E16fE15e06DDB60b53C67BCE17a0 |
Architecture
predict.fun (BNB Chain)
├── predictfun-orderbook ── Fills, matches, fees, market registration
├── predictfun-positions ── Splits, merges, redemptions, open interest
└── predictfun-yield ── Venus yield, reward claims, oracle resolution
All subgraphs share:
- Network: BSC (BNB Smart Chain)
- Collateral: USDT (18 decimals)
- Start Block: 64,817,753
- Spec Version: 1.3.0
Best Practices Applied
Bytes!IDs everywhere (cheaper thanString!)@entity(immutable: true)on all event logs@derivedFromfor reverse lookups (no redundant storage)- No
eth_calls(events only) indexerHints: prune: autofor storage efficiencynonFatalErrorsfeature enabledconcatI32(logIndex)for unique event IDs
MCP Server
An MCP (Model Context Protocol) server that gives AI agents structured access to all three subgraphs.
Setup
-
Get a Graph API key from Subgraph Studio (docs)
-
Add to your Claude Code config (
~/.claude/settings.json):
{
"mcpServers": {
"predictfun": {
"command": "npx",
"args": ["predictfun-mcp"],
"env": {
"GRAPH_API_KEY": "your-api-key-here"
}
}
}
}
Subgraph IDs are built in. Queries go through The Graph Gateway and are billed to your API key.
Tools (14)
Data Tools
| Tool | Description |
|---|---|
get_platform_stats |
Full platform overview — volume, OI, yield, sync status |
get_top_markets |
Rank markets by volume, open interest, or trade count |
get_market_details |
Deep dive: OI, resolution, top holders, orderbook stats |
get_trader_profile |
Full P&L: trades, positions, payouts, yield rewards |
get_recent_activity |
Latest trades, splits, merges, redemptions, or yield claims |
get_yield_overview |
Venus Protocol deposits, redemptions, yield stats |
get_whale_positions |
Largest holders with % of market OI |
get_leaderboard |
Top traders by volume, payouts, or trade count |
get_resolved_markets |
Recently settled markets with outcomes |
query_subgraph |
Custom GraphQL against any subgraph |
Meta-Tools (agent reasoning layer)
| Tool | Description |
|---|---|
find_trader_persona |
Classify a trader into archetypes: whale accumulator, yield farmer, arbitrageur, early mover, resolution sniper |
scan_trader_personas |
Find traders matching a specific behavioral archetype across the platform |
tag_market_structure |
Tag a market by resolution latency, liquidity profile, oracle type, and tail-risk indicators |
scan_markets_by_structure |
Find markets by structural filter: resolution speed, liquidity depth, oracle type, OI concentration, tail risk |
Meta-tools return structured JSON so agents can reason programmatically over trader behavior and market quality — not just raw volume and OI.
Prompts (9)
Pre-built workflows: platform_overview, analyze_trader, market_deep_dive, yield_analysis, whale_alert, market_scanner, custom_query_examples, trader_persona_analysis, market_quality_scan
Subgraph Development
cd predictfun-<subgraph>
npm install
npx graph codegen
npx graph build
npx graph deploy predictfun-<subgraph> --version-label v0.0.1
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。