Create, trade, and settle prediction markets on Base with any ERC20 collateral. Use when building prediction market infrastructure, running contests, crowdsourcing probability estimates, adding utility to tokens, or tapping into true information finance via market-based forecasting.
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install create-prediction-markets或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install create-prediction-markets⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/create-prediction-markets/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: pnp-markets description: Create, trade, and settle prediction markets on Base with any ERC20 collateral. Use when building prediction market infrastructure, running contests, crowdsourcing probability estimates, adding utility to tokens, or tapping into true information finance via market-based forecasting. ---
Create and manage prediction markets on Base Mainnet with any ERC20 collateral token.
Need prediction markets?
├─ Create market → npx ts-node scripts/create-market.ts --help
├─ Trade (buy/sell) → npx ts-node scripts/trade.ts --help
├─ Settle market → npx ts-node scripts/settle.ts --help
└─ Redeem winnings → npx ts-node scripts/redeem.ts --help
export PRIVATE_KEY=<wallet_private_key> # Required
export RPC_URL=<base_rpc_endpoint> # Optional (defaults to public RPC)
For production, use a dedicated RPC (Alchemy, QuickNode) to avoid rate limits.
Run any script with --help first to see all options.
npx ts-node scripts/create-market.ts \
--question "Will ETH reach $10k by Dec 2025?" \
--duration 168 \
--liquidity 100
Options: --collateral , --decimals
# Buy YES tokens
npx ts-node scripts/trade.ts --buy --condition 0x... --outcome YES --amount 10
# Sell NO tokens
npx ts-node scripts/trade.ts --sell --condition 0x... --outcome NO --amount 5 --decimals 18
# View prices only
npx ts-node scripts/trade.ts --info --condition 0x...
# Settle as YES winner
npx ts-node scripts/settle.ts --condition 0x... --outcome YES
# Check status
npx ts-node scripts/settle.ts --status --condition 0x...
npx ts-node scripts/redeem.ts --condition 0x...
import { PNPClient } from "pnp-evm";
import { ethers } from "ethers";
const client = new PNPClient({
rpcUrl: process.env.RPC_URL || "https://mainnet.base.org",
privateKey: process.env.PRIVATE_KEY!,
});
// Create market
const { conditionId } = await client.market.createMarket({
question: "Will X happen?",
endTime: Math.floor(Date.now() / 1000) + 86400 * 7,
initialLiquidity: ethers.parseUnits("100", 6).toString(),
});
// Trade
await client.trading.buy(conditionId, ethers.parseUnits("10", 6), "YES");
// Settle (after endTime)
const tokenId = await client.trading.getTokenId(conditionId, "YES");
await client.market.settleMarket(conditionId, tokenId);
// Redeem
await client.redemption.redeem(conditionId);
Use any ERC20. Common Base Mainnet tokens:
| Token | Address | Decimals | |-------|---------|----------| | USDC | 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 | 6 | | WETH | 0x4200000000000000000000000000000000000006 | 18 | | cbETH | 0x2Ae3F1Ec7F1F5012CFEab0185bfc7aa3cf0DEc22 | 18 |
Custom tokens add utility—holders can participate in your markets.
Before interacting with PNP contracts, you must approve them to spend your collateral tokens. This is standard for all EVM dApps.
type(uint256).max approvals (standard EVM pattern) so you only approve once per tokenThe approval transaction must be confirmed on-chain before the main transaction executes. If you see:
ERC20: transfer amount exceeds allowance
This means the approval hasn't been mined yet. Simply wait a few seconds and retry—the approval will be confirmed and subsequent attempts will succeed.
For maximum security-conscious users, you can manually set specific approval amounts, but this requires an approval transaction before each interaction.
| Contract | Address | |----------|---------| | PNP Factory | 0x5E5abF8a083a8E0c2fBf5193E711A61B1797e15A | | Fee Manager | 0x6f1BffB36aC53671C9a409A0118cA6fee2b2b462 |
The pAMM virtual liquidity model ensures smooth trading even with minimal initial liquidity.
The approval transaction hasn't been confirmed yet. Wait 5-10 seconds and retry.
The market creation transaction may have failed or is still pending. Verify on BaseScan that your transaction was confirmed successfully.
The public Base RPC has rate limits. Use a dedicated RPC provider:
export RPC_URL=https://base-mainnet.g.alchemy.com/v2/YOUR_KEY
Base Mainnet can occasionally have congestion. Check gas prices and consider increasing if needed.
安装 permissionless prediction markets 后,可以对 AI 说这些话来触发它
Help me get started with permissionless prediction markets
Explains what permissionless prediction markets does, walks through the setup, and runs a quick demo based on your current project
Use permissionless prediction markets to create, trade, and settle prediction markets on Base with any ERC20...
Invokes permissionless prediction markets with the right parameters and returns the result directly in the conversation
What can I do with permissionless prediction markets in my finance & investment workflow?
Lists the top use cases for permissionless prediction markets, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/create-prediction-markets/ 目录(个人级,所有项目可用),或 .claude/skills/create-prediction-markets/(项目级)。重启 AI 客户端后,用 /create-prediction-markets 主动调用,或让 AI 根据上下文自动发现并使用。
permissionless prediction markets 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
permissionless prediction markets 可免费安装使用。请查阅仓库了解许可证信息。
Create, trade, and settle prediction markets on Base with any ERC20 collateral. Use when building prediction market infrastructure, running contests, crowdsourcing probability estimates, adding utility to tokens, or tapping into true information finance via market-based forecasting.
Automate my finance & investment tasks using permissionless prediction markets
Identifies repetitive steps in your workflow and sets up permissionless prediction markets to handle them automatically
permissionless prediction markets 属于「Finance & Investment」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。