Trade on prediction markets. Create a local wallet, list markets, check prices, buy and sell outcome shares. Coming soon: create and fund markets directly from this skill.
Precog is a fully onchain prediction market protocol on Base. Anyone can create a market around a real-world question, fund it with liquidity, and trade outcome shares. Prices equal implied probabilities (0โ1). Every action is a signed onchain transaction โ no custody, no central party.
MATE is a non-monetary practice token (no real economic value). Markets denominated in MATE are safe to use for learning and experimentation. MATE can be claimed at matetoken.xyz.
What you can do here:
๐ง Coming soon: Native market creation โ submit and fund new markets directly from this skill without visiting the web UI.
For full protocol documentation see PRECOG.md โ it covers prediction markets 101, the LS-LMSR pricing curve, resolution via Reality.eth + Kleros, LP mechanics, MATE markets, and more.
Contract addresses and RPCs are built in โ no config needed.
The default network is Base Sepolia (testnet). No flag needed for testnet โ scripts connect to sepolia unless told otherwise.
Two networks are supported. Pass --network <name> to any script, or set PRECOG_NETWORK in your environment.
| Network | --network value | Chain | Contract |
|---|---|---|---|
| Base Sepolia (testnet) | sepolia โ default | Base Sepolia (84532) | 0x61ec71F1Fd37ecc20d695E83F3D68e82bEfe8443 |
| Base Mainnet | mainnet | Base (8453) | 0x00000000000c109080dfa976923384b97165a57a |
โ ๏ธ Mainnet uses real funds. Before running any mainnet command, confirm the network with the user and show the contract address. Do NOT default to mainnet โ always require an explicit
--network mainnetflag or aPRECOG_NETWORK=mainnetenv var set by the user.
~/.openclaw/.env โ created by setup.mjs --generate. Stores PRIVATE_KEY in plaintext. Treat it like a wallet key file: restrict permissions (chmod 600) and back it up. Losing it means losing access to any funds in that wallet.PRECOG_RPC_URL, use only a trusted endpoint. An untrusted RPC can observe signed transaction contents (but cannot extract your private key from them).โ ๏ธ Run scripts sequentially. Parallel transactions share a nonce and will collide on-chain โ run one script at a time.
โ ๏ธ Do NOT create batch or automation scripts. Each transaction must be confirmed by the user individually; automated chains of trades bypass the confirmation step and can cause unintended financial loss.
โ ๏ธ Do NOT edit skill scripts. The scripts are audited as a unit; silent edits could introduce bugs or security issues. If you find a bug, report it to the user so it can be fixed upstream.
โ ๏ธ Always show script output verbatim in a fenced code block. The output contains exact amounts, prices, and suggested parameters that will be used in the next command โ reformatting or summarizing it risks losing or distorting those values.
โ ๏ธ Always run
quotebeforebuyorsell. The quote shows the exact cost/proceeds and the safe--max/--minslippage bounds. Show the full output to the user and wait for explicit confirmation before executing the trade.โ ๏ธ Never modify trade parameters. If a script fails, show the exact error and stop. Do not retry with a different share count or workaround โ incorrect parameters can result in unintended trades. Token approval is handled automatically inside the scripts.
Check status or create a new wallet:
node {baseDir}/scripts/setup.mjs [--network sepolia|mainnet]
node {baseDir}/scripts/setup.mjs --generate
The private key is saved to ~/.openclaw/.env and never printed. Only the address is shown.
After generating, ask the user to fund the address with ETH (for gas) and the market's collateral token (for trading).
Example output (wallet exists and funded):
Wallet: 0x77Ffa97c2dcDA0FF6c9393281993962FA633d9E1
ETH: 0.004210 โ
MATE: 81.2300 โ
Example output (wallet exists, no funds):
Wallet: 0x77Ffa97c2dcDA0FF6c9393281993962FA633d9E1
ETH: 0.000000 โ ๏ธ needs gas
MATE: 0.0000 (no funds)
node {baseDir}/scripts/markets.mjs [--network sepolia|mainnet]
node {baseDir}/scripts/markets.mjs --all [--network sepolia|mainnet]
Example output:
Active Markets (2)
[4] Which AI model will be the top performer at the end of March?
๐ Claude 67.3% ๐ฐ MATE ๐
Mar 31, 2026
[5] Will ETH hit $5k by Q2?
๐ YES 58.1% ๐ฐ USDC ๐
Jun 30, 2026
When the user asks for more info / details about a specific market:
node {baseDir}/scripts/market.mjs --market <id> [--network sepolia|mainnet]
Shows the title, category, status, end date, collateral, and all outcome probabilities ranked by price. After showing the output, ask the user: "Would you like to see the resolution criteria?" If they say yes:
node {baseDir}/scripts/market.mjs --market <id> --criteria [--network sepolia|mainnet]
Example output (--market 4):
๐ Market 4 ยท AI / Leaderboard
Which AI model will be the top performer at the end of March?
๐ข Active ๐
Mar 31, 2026 ๐ฐ MATE
๐ฅ [1] Claude 16.3%
๐ฅ [2] Gemini 11.6%
๐ฅ [3] Grok 11.6%
[4] ChatGPT 11.6%
[5] Ernie 11.6%
[6] GLM 11.6%
[7] Kimi 11.6%
[8] Qwen 11.6%
[9] Other 11.6%
Example output (--market 4 --criteria):
๐ Market 4 ยท AI / Leaderboard
Which AI model will be the top performer at the end of March?
๐ข Active ๐
Mar 31, 2026 ๐ฐ MATE
๐ฅ [1] Claude 16.3%
๐ฅ [2] Gemini 11.6%
๐ฅ [3] Grok 11.6%
[4] ChatGPT 11.6%
[5] Ernie 11.6%
[6] GLM 11.6%
[7] Kimi 11.6%
[8] Qwen 11.6%
[9] Other 11.6%
๐ Resolution Criteria
This market will resolve based on the Text Arena AI Competition leaderboard
rankings at arena.ai as of March 31, 2026, 23:59:59 UTC.
Always run before buy or sell. Show the full output verbatim in a fenced code block. Ask the user to confirm before proceeding.
| What the user says | Flag to use | Example command |
|---|---|---|
| "buy N shares" | --shares N | --shares 50 |
| "spend $X" / "for $X" / "budget $X" | --cost X | --cost 50 |
| "reach X%" / "move to X%" / "push to X%" / "target X%" | --price 0.X | --price 0.25 |
| "use all my balance" / "all in" / "spend everything" | --all | --all |
Do NOT guess share counts manually. Use the correct flag โ the script computes the exact answer.
node {baseDir}/scripts/quote.mjs --market <id> --outcome <n> --shares <amount> --buy [--network sepolia|mainnet]
node {baseDir}/scripts/quote.mjs --market <id> --outcome <n> --cost <usdc> --buy [--network sepolia|mainnet]
node {baseDir}/scripts/quote.mjs --market <id> --outcome <n> --price <0.0-1.0> --buy [--network sepolia|mainnet]
node {baseDir}/scripts/quote.mjs --market <id> --outcome <n> --all --buy [--network sepolia|mainnet]
--outcome is 1-based (1 = first outcome, usually YES)--buy shows only the buy side; --sell shows only the sell side; omit both to show both sides--network โ sepolia (default) or mainnet; must match the network used for the subsequent buy/sellExample output (--price 0.25 --buy):
๐ Quote โ Market 4: Which AI model will be the top performer at the end of March?
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ฏ Outcome : Claude
๐ข Shares : 312
๐ Current prob : 14.2%
๐ Buy 312 shares
๐ต Cost : ~98.4521 MATE
๐ Price / share : 0.3156 MATE
๐ Prob after buy : 25.0% (market moves up โ)
๐ Max return : 312.0000 MATE (+213.5479 profit if "Claude" wins)
โก Suggested --max for buy : 99.4366
โโโ Paste ALL lines above verbatim to the user before asking to confirm โโโ
node {baseDir}/scripts/buy.mjs --market <id> --outcome <n> --shares <amount> --max <usdc> [--network sepolia|mainnet]
--shares โ number of shares (from the quote output)--max โ maximum collateral to spend; use the Suggested --max value from the quote output--network โ must match the network used in the preceding quote--max or --shares for allowance reasonsnode {baseDir}/scripts/sell.mjs --market <id> --outcome <n> --shares <amount> --min <usdc> [--network sepolia|mainnet]
--shares โ number of shares to sell (check positions.mjs if unsure)--min โ minimum collateral to accept; use the Suggested --min value from the quote output--network โ must match the network used in the preceding quotenode {baseDir}/scripts/positions.mjs --market <id> [--network sepolia|mainnet]
Example output:
๐ผ Market 4
Which AI model will be the top performer at the end of March?
๐ 0x77Ffa97c2dcDA0FF6c9393281993962FA633d9E1
๐ต Net cost 19.03 MATE ยท ๐ฅ 8 buys ๐ค 7 sells
๐ฏ Shares held
๐ฅ [1] Claude 135 shares ยท 16.3%
When the user asks what they can do, what Precog is, or how to get started โ answer in plain prose with emojis, no tables. Mention their current positions if you know them. Example:
With Precog you can trade on the probability of real-world outcomes using MATE (a safe practice token โ no real money).
Here's what you can do:
๐๏ธ List markets โ see what's open and the leading outcome for each ๐ Market detail โ outcomes, probabilities, category, and resolution criteria for a specific market ๐ธ Trade โ quote first, then buy or sell outcome shares (by share count, budget, or target probability) ๐ Positions โ see your shares, net cost, and trade history
You currently hold 100 Claude shares on Market 4. Want to check the latest prices or make a move?
Adapt the last line to whatever you actually know about the user's positions and active markets.
--network is omitted from these examples for brevity. Add it to every command when the user is on mainnet.
User: "What markets are open?"
โ node markets.mjs
User: "What mainnet markets are open?" / "Show me Base mainnet markets"
โ Confirm with the user: "This will connect to Base mainnet where real funds are used. Continue?"
โ node markets.mjs --network mainnet
User: "Tell me more about market 4" / "What are the outcomes on market 4?"
โ node market.mjs --market 4
โ After output, ask: "Would you like to see the resolution criteria?"
โ If yes: node market.mjs --market 4 --criteria
User: "What's my position on market 4?"
โ node positions.mjs --market 4
User: "Show all my positions" / "Do I have any shares?"
โ node markets.mjs --all (get list of all market IDs)
โ node positions.mjs --market <id> (repeat for each market)
User: "Use all my MATE to buy Claude on market 4"
โ node quote.mjs --market 4 --outcome 1 --all --buy
โ Paste full output verbatim. Ask: "Confirm buy?"
โ Wait for user to confirm
โ node buy.mjs --market 4 --outcome 1 --shares <n from quote> --max <suggested-max>
โ After trade: suggest checking positions or new market price
User: "Buy Claude for $50 on market 4"
โ node quote.mjs --market 4 --outcome 1 --cost 50 --buy
โ Paste full output verbatim. Ask: "Confirm buy?"
โ Wait for user to confirm
โ node buy.mjs --market 4 --outcome 1 --shares <n from quote> --max <suggested-max>
โ After trade: suggest checking positions or new market price
User: "Buy Claude to reach 25% on market 4"
โ node quote.mjs --market 4 --outcome 1 --price 0.25 --buy
โ Paste full output verbatim. Ask: "Confirm buy?"
โ Wait for user to confirm
โ node buy.mjs --market 4 --outcome 1 --shares <n from quote> --max <suggested-max>
โ After trade: suggest checking positions or new market price
User: "Sell my Claude shares on market 4"
โ node positions.mjs --market 4 (find share count)
โ node quote.mjs --market 4 --outcome 1 --shares <n> --sell
โ Paste full output verbatim. Ask: "Confirm sell?"
โ Wait for user to confirm
โ node sell.mjs --market 4 --outcome 1 --shares <n> --min <suggested-min>
โ After trade: suggest checking positions or remaining balance
User: "Create a market about X" / "Can you create a market for Y?"
โ Tell the user to go to https://core.precog.markets/84532/create-market
โ Explain briefly: log in with MetaMask, fill the form, submit for review
โ Remind them: after submission they need to fund the market at the launchpad
and wait for staff approval before it goes live
โ Do NOT attempt to automate this โ no script can do it on this server
Market creation must be done manually through the Precog web UI โ no script can automate this from the server.
Steps:
0xC139C86de76DF41c041A30853C3958427fA7CEbD)After submission โ two more steps required
โ ๏ธ The market is NOT live yet after submitting the form.
Prerequisites
Features planned for future versions of this skill:
0x61ec71F1Fd37ecc20d695E83F3D68e82bEfe8443 (Base Sepolia, chain 84532)0x00000000000c109080dfa976923384b97165a57a (Base, chain 8453)sepolia. Pass --network mainnet or set PRECOG_NETWORK=mainnet for mainnet.PRECOG_RPC_URL to override (applies to whichever network is active).~/.openclaw/.env, never leaves the machine.