PredictClaw is the predict.fun-native OpenClaw skill for browsing markets, checking wallet readiness, viewing funding guidance, withdrawing funds, placing buys, inspecting positions, and scanning hedge opportunities.
PredictClaw's version source of truth is the repository-root pyproject.toml. When checking GitHub or packaging metadata, use this repository root directly.
bash
clawhub install predictclaw
cd ~/.openclaw/skills/predictclaw
uv sync
cp template.env .env
The installed skill directory ~/.openclaw/skills/predictclaw is the only canonical user config root. In OpenClaw manifests and examples, this same installed path may appear as {baseDir}. Any repository checkout or workspace copy is a development-only artifact, not a user config root.
~/.openclaw/skills/predictclaw/bash
cd {baseDir} && uv sync
cd {baseDir} && cp template.env .env
PredictClaw only reads standard environment variables. The supported, tested inputs are:
export PREDICT_ENV=testnet~/.openclaw/skills/predictclaw/.env file, auto-loaded by scripts/predictclaw.py when present; in manifests and examples, that same installed path may appear as {baseDir}If 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 now declares the external runtime and conditionally used env surfaces so ClawHub users can review them before installation. The mode-specific requirements are still documented below and enforced by the runtime config validator; not every listed variable is required at the same time.
Choose the mode first, then show only the minimum fields for that mode.
read-only
PREDICT_ENV, PREDICT_WALLET_MODE, and PREDICT_API_KEY for mainnet reads.eoa
PREDICT_ENV, PREDICT_WALLET_MODE=eoa, PREDICT_API_KEY, PREDICT_EOA_PRIVATE_KEY.predict-account + ERC_MANDATED_*
PREDICT_ENV, PREDICT_WALLET_MODE=predict-account, PREDICT_API_KEY, PREDICT_ACCOUNT_ADDRESS, PREDICT_PRIVY_PRIVATE_KEY, ERC_MANDATED_MCP_COMMAND, ERC_MANDATED_CHAIN_ID, ERC_MANDATED_VAULT_ADDRESS, optional ERC_MANDATED_CONTRACT_VERSION.mandated-vault bootstrap path, then return to overlay.mandated-vault
PREDICT_ENV, PREDICT_WALLET_MODE=mandated-vault, PREDICT_API_KEY, PREDICT_EOA_PRIVATE_KEY, ERC_MANDATED_MCP_COMMAND, ERC_MANDATED_CHAIN_ID.Advanced authority / executor / bootstrap private keys are follow-up fields, not default first-screen requirements. Only surface them when the selected workflow really executes vault-side actions. Do not treat the full derivation tuple as the primary first-step answer for overlay onboarding when the user already has a deployed vault.
uv sync in the installed skill directory.template.env -> secret-free local fixture bootstraptemplate.readonly.env -> live read-only market readstemplate.eoa.env -> direct private-key tradingtemplate.predict-account.env -> recommended funded-trading path (Predict Account trades, Vault can fund it)template.mandated-vault.env -> recommended governance/control-plane path for advanced pure vault workflows.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
wallet status requires signer configuration. For read-only, start with markets trending or market <id> --json instead.
mainnet market reads require PREDICT_API_KEY. Non-mainnet usage remains explicit-only and is no longer the packaged default.
test-fixture only knows the bundled local market IDs ( 123, 456, 789, 101, 202). Switch to the live read-only template before querying a real production market ID.
predict-account + ERC_MANDATED_*.mandated-vault instead.mandated-vault as a co-equal default for trading because it still fails closed on buy / positions / hedge flows.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 status --json
Canonical user-facing templates now include:
template.predict-account.envtemplate.predict-account-vault.envtemplate.mandated-vault.env remains only as the internal/bootstrap compatibility template.
The snippets below are .env examples. Put them in {baseDir}/.env or export the same names in your shell.
The installed skill directory ~/.openclaw/skills/predictclaw remains the only canonical user config root; {baseDir} is just the manifest/example placeholder for that installed path.
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.
Do not lead with the full env matrix when a user only asks how to configure the skill. Ask for the mode first, then show only the minimum fields for that mode.
dotenv
PREDICT_ENV=test-fixture
PREDICT_WALLET_MODE=read-only
Use this for secret-free CLI verification and local market browsing only. It does not hit the live API.
dotenv
PREDICT_ENV=mainnet
PREDICT_WALLET_MODE=read-only
PREDICT_API_KEY=YOUR_PREDICT_API_KEY
Use the live templates as mainnet-first examples.
dotenv
PREDICT_ENV=mainnet
PREDICT_WALLET_MODE=eoa
PREDICT_API_BASE_URL=https://api.predict.fun
PREDICT_API_KEY=YOUR_PREDICT_API_KEY
PREDICT_EOA_PRIVATE_KEY=0xYOUR_EOA_PRIVATE_KEY
dotenv
PREDICT_ENV=mainnet
PREDICT_WALLET_MODE=predict-account
PREDICT_API_BASE_URL=https://api.predict.fun
PREDICT_API_KEY=YOUR_PREDICT_API_KEY
PREDICT_ACCOUNT_ADDRESS=0xYOUR_PREDICT_ACCOUNT
PREDICT_PRIVY_PRIVATE_KEY=0xYOUR_PRIVY_EXPORTED_KEY
The user-facing advanced mode is predict-account + vault, not a standalone mandated-vault mode.
Use the canonical template:
dotenv
PREDICT_ENV=mainnet
PREDICT_API_BASE_URL=https://api.predict.fun
PREDICT_API_KEY=YOUR_PREDICT_API_KEY
PREDICT_WALLET_MODE=predict-account
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=56
If the vault does not exist yet, run the bootstrap helper first.
mandated-vault)#The older mandated-vault path remains only as the internal/bootstrap compatibility subflow used to create or prepare a vault before returning to predict-account + vault.
dotenv
PREDICT_ENV=mainnet
PREDICT_API_BASE_URL=https://api.predict.fun
PREDICT_API_KEY=YOUR_PREDICT_API_KEY
PREDICT_WALLET_MODE=mandated-vault
PREDICT_EOA_PRIVATE_KEY=0xYOUR_EOA_PRIVATE_KEY
ERC_MANDATED_MCP_COMMAND=erc-mandated-mcp
ERC_MANDATED_CHAIN_ID=56
PredictClaw uses the fixed product factory 0x6eFC613Ece5D95e4a7b69B4EddD332CeeCbb61c6, previews first, requires explicit confirmation, and backfills .env with the deployed vault address and resolved values.
On --confirm, PredictClaw automatically enables the MCP broadcast gate for that subprocess and bridges the bootstrap signer key. The standard flow does not require manually setting ERC_MANDATED_ENABLE_BROADCAST=1 or ERC_MANDATED_BOOTSTRAP_PRIVATE_KEY, but it no longer auto-edits .env.
Preview first:
bash
cd {baseDir} && uv run python scripts/predictclaw.py wallet bootstrap-vault --json
Confirm and broadcast:
bash
cd {baseDir} && uv run python scripts/predictclaw.py wallet bootstrap-vault --confirm --json
If you intentionally need the internal bootstrap path directly, the following compatibility variants remain:
dotenv
PREDICT_ENV=mainnet
PREDICT_API_BASE_URL=https://api.predict.fun
PREDICT_API_KEY=YOUR_PREDICT_API_KEY
PREDICT_WALLET_MODE=mandated-vault
ERC_MANDATED_VAULT_ADDRESS=0xYOUR_DEPLOYED_VAULT
ERC_MANDATED_MCP_COMMAND=erc-mandated-mcp
ERC_MANDATED_CHAIN_ID=56
dotenv
PREDICT_ENV=mainnet
PREDICT_API_BASE_URL=https://api.predict.fun
PREDICT_API_KEY=YOUR_PREDICT_API_KEY
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=56
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. This advanced/manual path can still expose manual-only create-vault preparation guidance when you intentionally stay on the manual route.
For advanced overrides, ERC_MANDATED_BOOTSTRAP_PRIVATE_KEY can replace the default bootstrap signer resolution and ERC_MANDATED_ENABLE_BROADCAST can explicitly force the execute-mode gate on or off. In the standard --confirm path, PredictClaw auto-bridges both values to the MCP subprocess for you.
dotenv
PREDICT_ENV=mainnet
PREDICT_API_BASE_URL=https://api.predict.fun
PREDICT_API_KEY=YOUR_PREDICT_API_KEY
PREDICT_WALLET_MODE=predict-account
PREDICT_ACCOUNT_ADDRESS=0xYOUR_PREDICT_ACCOUNT
PREDICT_PRIVY_PRIVATE_KEY=0xYOUR_PRIVY_EXPORTED_KEY
ERC_MANDATED_VAULT_ADDRESS=0xYOUR_DEPLOYED_VAULT
ERC_MANDATED_MCP_COMMAND=erc-mandated-mcp
ERC_MANDATED_CONTRACT_VERSION=v0.3.0-agent-contract
ERC_MANDATED_CHAIN_ID=56
Ask first: Do you already have a vault?
ERC_MANDATED_VAULT_ADDRESS and let PredictClaw resolve the remaining vault metadata where possible.mandated-vault bootstrap path, then return to overlay.Only if automatic resolution fails should you manually add advanced vault metadata such as ERC_MANDATED_VAULT_ASSET_ADDRESS, ERC_MANDATED_VAULT_AUTHORITY, or authority/executor private keys.
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 a vault yet, the recommended answer is to deploy or redeploy one first with the pure mandated-vault bootstrap flow. 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) remains available as an advanced/manual path rather than the default first step.
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.
PredictClaw exposes four user-facing modes.
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.predict-account + vault — user-facing advanced route where Predict Account remains the trading identity and Vault acts as the advanced funding source.predict-account + vault, the default user-facing answer is the Vault deposit flow.wallet deposit --json / wallet status --json therefore distinguish the default funding entry ( manualTopUpAddress / fundingAddress) from the trading identity ( predictAccountAddress, tradingIdentityAddress).predict-account without the vault overlay.test-fixture or mainnet.mainnet market reads require PREDICT_API_KEY.read-only is browse-only. Start with markets ..., not signer-backed wallet or trade commands.wallet status requires signer configuration.eoa requires PREDICT_EOA_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 default funding entry for the active signer mode.wallet bootstrap-vault is the helper used during predict-account + vault onboarding when a vault still needs to be created or prepared.wallet redeem-vault --preview --json inspects vault-share redeemability before any real redeem flow is attempted.redeemableNow, blockingReason, and contractError fields, including contract errors such as ERC4626ExceededMaxRedeem.wallet withdraw performs safety validation before any transfer logic.mandated-vault remains only as an internal/bootstrap compatibility path and is not a standalone user mode.ERC_MANDATED_FUNDING_* amount caps.predict-account + ERC_MANDATED_* overlay, wallet status / wallet deposit expose manualTopUpAddress, tradingIdentityAddress, orchestrationVaultAddress, and vault-to-predict-account funding semantics while Predict Account remains the trade identity.vaultAuthority, vaultExecutor, bootstrapSigner, allowedTokenAddresses, and allowedRecipients so OpenClaw can reason about configured permissions.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; in overlay mode the default path is an explicit ERC_MANDATED_VAULT_ADDRESS, with asset/authority metadata resolved automatically where possible and only escalated to manual fields when that resolution fails.cd {baseDir} && uv run python scripts/predictclaw.py setup mandated-mcp..env.erc-mandated-mcp runtime yourself, then set ERC_MANDATED_MCP_COMMAND manually.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 bootstrap-vault --json
cd {baseDir} && uv run python scripts/predictclaw.py wallet bootstrap-vault --confirm --json
cd {baseDir} && uv run python scripts/predictclaw.py wallet redeem-vault --share-token 0x4a88c1c95d0f59ee87c3286ed23e9dcdf4cf08d7 --holder 0x7df0ba782D85B93266b595d496088ABFAc823950 --all --preview --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 bootstrap-vault --json
cd {baseDir} && uv run python scripts/predictclaw.py wallet bootstrap-vault --confirm --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 mainnet in code; template.env intentionally bootstraps test-fixture; accepted values are mainnet, testnet, or test-fixture``PREDICT_WALLET_MODEExplicit mode override: read-only, eoa, predict-account, or mandated-vault``PREDICT_API_BASE_URLOptional REST base override; packaged live templates pin this to https://api.predict.fun, while leaving it empty uses the env-specific defaultPREDICT_API_KEYMainnet-authenticated predict.fun API access; required for mainnet market reads and tradingPREDICT_EOA_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_ADDRESSProduct default factory for pure bootstrap and manual derivation override; current default is 0x6eFC613Ece5D95e4a7b69B4EddD332CeeCbb61c6``ERC_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_BOOTSTRAP_PRIVATE_KEYOptional execute-mode bootstrap signer override; when unset, PredictClaw falls back to PREDICT_EOA_PRIVATE_KEY, then ERC_MANDATED_AUTHORITY_PRIVATE_KEY``ERC_MANDATED_ENABLE_BROADCASTOptional execute-mode MCP gate override; wallet bootstrap-vault --confirm auto-bridges this to 1 unless you explicitly override itERC_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
predict-account + ERC_MANDATED_*.mandated-vault is an advanced explicit opt-in mode. Treat it as a separate control-plane path, not a co-equal answer for Predict Account trading.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 bootstrap-vault --json is preview-only, requires explicit confirmation before broadcast, and backfills .env after a confirmed deployment.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.