Predict.fun 技能,提供 PolyClaw 风格的命令行界面,支持市场查询、钱包充值、交易、持仓管理及对冲操作。
PredictClaw is the predict.fun-native OpenClaw skill for browsing markets, checking wallet readiness, viewing deposit addresses, withdrawing funds, placing buys, inspecting positions, and scanning hedge opportunities.
bash
clawhub install predictclaw
cd ~/.openclaw/skills/predictclaw
uv sync
cp .env.example .env
In packaged installs, the skill base directory is usually ~/.openclaw/skills/predictclaw. In OpenClaw manifests and examples, this same location may appear as {baseDir}.
predict/ folder into ~/.openclaw/skills/predictclaw/bash
cd {baseDir} && uv sync
cd {baseDir} && cp .env.example .env
PredictClaw only reads standard environment variables. The supported, tested inputs are:
export PREDICT_ENV=testnet{baseDir}/.env file, auto-loaded by scripts/predictclaw.py when presentIf both are present, exported environment variables win and .env only fills missing values.
If your OpenClaw host version injects environment variables into the skill process, that also works because PredictClaw receives normal env vars either way. Older docs used skills.entries.predictclaw.env; treat that as a host-version-specific convenience, not the canonical PredictClaw config surface.
The SKILL frontmatter metadata intentionally lists only the universal entry variables: PREDICT_ENV and PREDICT_WALLET_MODE. OpenClaw's runtime metadata is flat rather than mode-aware, so listing every optional signer or vault variable there would incorrectly imply they are all required at the same time. The mode-specific requirements are documented below and enforced by the runtime config validator.
uv sync in the installed skill directory..env.example to .env inside ~/.openclaw/skills/predictclaw/.bash
cd {baseDir} && uv run python scripts/predictclaw.py --help
cd {baseDir} && uv run python scripts/predictclaw.py markets trending
For signer-backed modes, the next verification step is:
bash
cd {baseDir} && uv run python scripts/predictclaw.py wallet status --json
cd {baseDir} && uv run python scripts/predictclaw.py wallet deposit --json
The snippets below are .env examples. Put them in {baseDir}/.env or export the same names in your shell.
OPENROUTER_API_KEY appears in the signer examples only for optional hedge scan / hedge analyze usage. It is not required for market, wallet, or buy flows and is only needed for non-fixture hedge analysis.
dotenv
PREDICT_ENV=test-fixture
PREDICT_WALLET_MODE=read-only
Use this for market browsing only. Switch to eoa, predict-account, or mandated-vault before using wallet or trade subcommands.
dotenv
PREDICT_ENV=testnet
PREDICT_WALLET_MODE=eoa
PREDICT_API_BASE_URL=https://dev.predict.fun
PREDICT_PRIVATE_KEY=0xYOUR_EOA_PRIVATE_KEY
dotenv
PREDICT_ENV=testnet
PREDICT_WALLET_MODE=predict-account
PREDICT_API_BASE_URL=https://dev.predict.fun
PREDICT_ACCOUNT_ADDRESS=0xYOUR_PREDICT_ACCOUNT
PREDICT_PRIVY_PRIVATE_KEY=0xYOUR_PRIVY_EXPORTED_KEY
dotenv
PREDICT_ENV=testnet
PREDICT_WALLET_MODE=mandated-vault
ERC_MANDATED_VAULT_ADDRESS=0xYOUR_DEPLOYED_VAULT
ERC_MANDATED_MCP_COMMAND=erc-mandated-mcp
ERC_MANDATED_CHAIN_ID=97
Add ERC_MANDATED_AUTHORITY_PRIVATE_KEY when your current MCP path needs the single-key preflight signer.
dotenv
PREDICT_ENV=testnet
PREDICT_WALLET_MODE=mandated-vault
ERC_MANDATED_FACTORY_ADDRESS=0xYOUR_FACTORY
ERC_MANDATED_VAULT_ASSET_ADDRESS=0xYOUR_ASSET
ERC_MANDATED_VAULT_NAME=Mandated Vault
ERC_MANDATED_VAULT_SYMBOL=MVLT
ERC_MANDATED_VAULT_AUTHORITY=0xYOUR_AUTHORITY
ERC_MANDATED_VAULT_SALT=0xYOUR_SALT
ERC_MANDATED_MCP_COMMAND=erc-mandated-mcp
ERC_MANDATED_CONTRACT_VERSION=v0.3.0-agent-contract
ERC_MANDATED_CHAIN_ID=97
ERC_MANDATED_EXECUTOR_PRIVATE_KEY is optional. When it is unset, PredictClaw reuses ERC_MANDATED_AUTHORITY_PRIVATE_KEY as the executor signer for the current Preflight MVP contract.
In that path, PredictClaw asks the MCP to predict the vault address and, when the vault is still undeployed, returns create-vault preparation guidance only. It does not auto-broadcast.
dotenv
PREDICT_ENV=testnet
PREDICT_WALLET_MODE=predict-account
PREDICT_API_BASE_URL=https://dev.predict.fun
PREDICT_ACCOUNT_ADDRESS=0xYOUR_PREDICT_ACCOUNT
PREDICT_PRIVY_PRIVATE_KEY=0xYOUR_PRIVY_EXPORTED_KEY
ERC_MANDATED_VAULT_ADDRESS=0xYOUR_DEPLOYED_VAULT
ERC_MANDATED_VAULT_ASSET_ADDRESS=0xYOUR_ASSET
ERC_MANDATED_VAULT_AUTHORITY=0xYOUR_AUTHORITY
ERC_MANDATED_AUTHORITY_PRIVATE_KEY=0xYOUR_VAULT_AUTHORITY_KEY
ERC_MANDATED_MCP_COMMAND=erc-mandated-mcp
ERC_MANDATED_CONTRACT_VERSION=v0.3.0-agent-contract
ERC_MANDATED_CHAIN_ID=97
In the overlay route, Predict Account remains the deposit/trading account while Vault funds the Predict Account through MCP-backed session and asset-transfer planning.
If you do not have an explicit deployed vault address yet, keep the same Predict Account pair and replace ERC_MANDATED_VAULT_ADDRESS with the full derivation tuple: ERC_MANDATED_FACTORY_ADDRESS, ERC_MANDATED_VAULT_ASSET_ADDRESS, ERC_MANDATED_VAULT_NAME, ERC_MANDATED_VAULT_SYMBOL, ERC_MANDATED_VAULT_AUTHORITY, and ERC_MANDATED_VAULT_SALT.
The optional ERC_MANDATED_FUNDING_* envs cap Vault→Predict transfers by per-tx amount, per-window cumulative amount, and window duration. On BSC mainnet USDT, 5U = 5000000000000000000 and 10U = 10000000000000000000.
read-only — browse market data only; no signer-backed wallet actions.eoa — direct signer path for wallet, trade, and funding flows.predict-account — smart-wallet funding/trading path using PREDICT_ACCOUNT_ADDRESS plus PREDICT_PRIVY_PRIVATE_KEY.mandated-vault — advanced explicit opt-in control-plane path for protected vault-only status/deposit flows.test-fixture or testnet.mainnet requires PREDICT_API_KEY.read-only is browse-only. Start with markets ..., not signer-backed wallet or trade commands.eoa requires PREDICT_PRIVATE_KEY and rejects Predict Account or mandated-vault inputs.predict-account requires both PREDICT_ACCOUNT_ADDRESS and PREDICT_PRIVY_PRIVATE_KEY.wallet deposit shows the funding address for the active signer mode.wallet withdraw performs safety validation before any transfer logic.mandated-vault, wallet status and wallet deposit are the intended v1 entry points.predict-account + ERC_MANDATED_* overlay, wallet status / wallet deposit expose vault-to-predict-account funding semantics while Predict Account remains the trade identity.buy can proceed when the Predict Account balance is sufficient; otherwise it returns deterministic funding-required guidance that points to wallet deposit --json.mandated-vault needs a working ERC_MANDATED_MCP_COMMAND; overlay mode also needs ERC_MANDATED_VAULT_ASSET_ADDRESS and ERC_MANDATED_VAULT_AUTHORITY for funding orchestration.OPENROUTER_API_KEY is only required for non-fixture hedge analysis, and fixture mode stays secret-free.bash
cd {baseDir} && uv run python scripts/predictclaw.py --help
cd {baseDir} && uv run python scripts/predictclaw.py wallet status --json
cd {baseDir} && uv run python scripts/predictclaw.py wallet deposit --json
cd {baseDir} && uv run python scripts/predictclaw.py wallet withdraw usdt 1 0xb30741673D351135Cf96564dfD15f8e135f9C310 --json
bash
cd {baseDir} && uv run python scripts/predictclaw.py markets trending
cd {baseDir} && uv run python scripts/predictclaw.py markets search "election"
cd {baseDir} && uv run python scripts/predictclaw.py market 123 --json
cd {baseDir} && uv run python scripts/predictclaw.py wallet status --json
cd {baseDir} && uv run python scripts/predictclaw.py wallet approve --json
cd {baseDir} && uv run python scripts/predictclaw.py wallet deposit --json
cd {baseDir} && uv run python scripts/predictclaw.py wallet withdraw usdt 1 0xb30741673D351135Cf96564dfD15f8e135f9C310 --json
cd {baseDir} && uv run python scripts/predictclaw.py wallet withdraw bnb 0.1 0xb30741673D351135Cf96564dfD15f8e135f9C310 --json
cd {baseDir} && uv run python scripts/predictclaw.py buy 123 YES 25 --json
cd {baseDir} && uv run python scripts/predictclaw.py positions --json
cd {baseDir} && uv run python scripts/predictclaw.py position pos-123-yes --json
cd {baseDir} && uv run python scripts/predictclaw.py hedge scan --query election --json
cd {baseDir} && uv run python scripts/predictclaw.py hedge analyze 101 202 --json
VariablePurposePREDICT_STORAGE_DIRLocal journal and position storagePREDICT_ENVDefaults to testnet; accepted values are testnet, mainnet, or test-fixture``PREDICT_WALLET_MODEExplicit mode override: read-only, eoa, predict-account, or mandated-vault``PREDICT_API_BASE_URLOptional REST base override; leave empty to use the env-specific default ( dev.predict.fun for testnet / test-fixture, api.predict.fun for mainnet)PREDICT_API_KEYMainnet-authenticated predict.fun API accessPREDICT_PRIVATE_KEYEOA trading and funding pathPREDICT_ACCOUNT_ADDRESSPredict Account smart-wallet addressPREDICT_PRIVY_PRIVATE_KEYPrivy-exported signer for Predict Account modeERC_MANDATED_VAULT_ADDRESSExplicit deployed mandated vault addressERC_MANDATED_FACTORY_ADDRESSFactory address used to predict a vault when no explicit vault address is suppliedERC_MANDATED_VAULT_ASSET_ADDRESSERC-4626 asset used in mandated-vault prediction/create preparationERC_MANDATED_VAULT_NAMEVault name used in mandated-vault prediction/create preparationERC_MANDATED_VAULT_SYMBOLVault symbol used in mandated-vault prediction/create preparationERC_MANDATED_VAULT_AUTHORITYAuthority address and create-vault from address for manual preparationERC_MANDATED_VAULT_SALTDeterministic salt used for vault prediction/create preparationERC_MANDATED_AUTHORITY_PRIVATE_KEYPreflight Vault signer key for the current single-key MVP contractERC_MANDATED_EXECUTOR_PRIVATE_KEYOptional dedicated executor signer; falls back to ERC_MANDATED_AUTHORITY_PRIVATE_KEY when unsetERC_MANDATED_MCP_COMMANDMCP launcher command (defaults to erc-mandated-mcp)ERC_MANDATED_CONTRACT_VERSIONPassed through to the mandated-vault MCP clientERC_MANDATED_CHAIN_IDOptional explicit chain selection for the MCP bridgeERC_MANDATED_ALLOWED_ADAPTERS_ROOTOptional 32-byte hex allowedAdaptersRoot used for Vault execution mandates; defaults to 0x11…11 for the current single-key MVP / PoC pathERC_MANDATED_FUNDING_MAX_AMOUNT_PER_TXOptional Vault→Predict funding-policy maxAmountPerTx in raw token unitsERC_MANDATED_FUNDING_MAX_AMOUNT_PER_WINDOWOptional Vault→Predict funding-policy maxAmountPerWindow in raw token unitsERC_MANDATED_FUNDING_WINDOW_SECONDSOptional Vault→Predict funding-policy windowSeconds``OPENROUTER_API_KEYOptional OpenRouter credential; only required for non-fixture hedge analysisPREDICT_MODELOpenRouter model overridePREDICT_SMOKE_ENVEnables the smoke suitePREDICT_SMOKE_API_BASE_URLOptional smoke REST base overridePREDICT_SMOKE_PRIVATE_KEYEnables signer/JWT smoke checksPREDICT_SMOKE_ACCOUNT_ADDRESSPredict Account smoke modePREDICT_SMOKE_PRIVY_PRIVATE_KEYPredict Account smoke signerPREDICT_SMOKE_API_KEYSmoke REST auth
mandated-vault is an advanced explicit opt-in mode. Only enable it when you intentionally want MCP-assisted vault control-plane behavior.predict-account + ERC_MANDATED_* is the recommended advanced trading route when you want Vault to fund the Predict Account while keeping the official Predict Account order model.ERC_MANDATED_VAULT_ADDRESS targets an existing vault directly; otherwise PredictClaw uses the derivation tuple to ask the MCP for the predicted vault address.wallet deposit can return create-vault preparation details ( predictedVault, transaction summary, manual-only) without broadcasting.mandated-vault does not provide predict.fun trading parity. wallet approve, wallet withdraw, buy, positions, position, hedge scan, and hedge analyze fail closed with unsupported-in-mandated-vault-v1.funding-required guidance when buy needs top-up; it does not auto-execute the funding leg in the current local signer context.