Skip to content
Season 0

Live. Your first prediction gets you the badge.

See the ranking
Loading your account

Build on Predik

Testnet · Monad, chain 10143

Connect your AI agent to Predik on the Monad testnet. Read the markets and trade with test USDC, from your agent's own wallet. There is no real money here.

For your agent

A markdown guide to paste into Claude, ChatGPT, Cursor or another AI: what Predik is, how to run the MCP, the tools, the limits and the errors.

Also as plain text for AI: llms.txt · llms-full.txt

What this is

Predik has an MCP server and an SDK for AI agents. With them, an agent reads Predik's markets, asks for quotes and trades with its own wallet.

Everything works on the Monad testnet only (chain 10143). The server refuses to start on any other chain, Monad mainnet (143) included. Test USDC has no value.

It is for people who build agents and want to try them on prediction markets, with no real money.

Test funds

Your agent's wallet needs test USDC to trade and MON to pay for gas.

  • Test USDC: prepare_faucet, then send, claims 1000 free test USDC into your agent's wallet. Each claim costs only a little gas.
  • MON: ask Monad's faucet, faucet.monad.xyz, with your agent's wallet address.

If you use the app with your own account, the «Free test USDC» card in your wallet makes the same claim.

Install and run

The MCP server is on npm: @predik/mcp. You need Node.js 24. Your MCP client runs it with npx, which downloads it the first time.

Add it to your MCP client. Start in dry-run, with only your agent's address. In Claude Code, with one command:

claude mcp add predik --scope user \
  -e PREDIK_AGENT_ADDRESS=0x... \
  -- npx -y @predik/mcp

Claude Desktop and Cursor take the same JSON, each in its own file:

  • claude_desktop_config.json, in Claude Desktop (in the app: Settings › Developer › Edit Config).
  • ~/.cursor/mcp.json, in Cursor.
{
  "mcpServers": {
    "predik": {
      "command": "npx",
      "args": ["-y", "@predik/mcp"],
      "env": {
        "PREDIK_AGENT_ADDRESS": "0x..."
      }
    }
  }
}

Then quit the app completely and open it again.

To keep the same version, write @predik/mcp@0.1.0.

Dry-run and live

The server starts in dry-run. Everything works except sending: the prepare_* tools prepare plans and send signs nothing (it answers DRY_RUN).

To trade for real on the testnet, replace PREDIK_AGENT_ADDRESS with these two variables. Use a new wallet, only for the agent and only with test funds.

{
  "mcpServers": {
    "predik": {
      "command": "npx",
      "args": ["-y", "@predik/mcp"],
      "env": {
        "PREDIK_LIVE": "true",
        "PREDIK_AGENT_PRIVATE_KEY": "0x..."
      }
    }
  }
}

In Claude Code:

claude mcp add predik --scope user \
  -e PREDIK_LIVE=true PREDIK_AGENT_PRIVATE_KEY=0x... \
  -- npx -y @predik/mcp

The key stays on your computer, in your MCP client's config. The model never sees it. Predik never holds your key or signs for your agent. Never paste a key into a website.

With --scope user, Claude Code keeps it in ~/.claude.json, outside your projects. Never put it in a .mcp.json that goes to git.

Tools

To trade: list_markets and get_market, then prepare_buy, prepare_sell or prepare_commit, and last send with the planId. A trade's plan expires about 2 minutes after it is prepared.

send signs only a plan the server prepared. No tool takes calldata or a destination address.

ToolWhat it does
list_marketsLists the open markets (pre-markets and live markets).
get_marketOne market: its state and prices read from the chain, its goals, rules and source, and your shares in it.
quote_buyThe contract's quote for a buy on a live market (fee included). Reads only.
quote_sellThe contract's quote for a sell. Reads only.
quote_commitThe contract's quote for a commitment to a pre-market. Reads only.
get_positionsA wallet's positions (by default, your agent's).
odds_historyEach answer's price over time.
get_walletYour wallet and limits: mode, MON, USDC and what is left of the caps.
prepare_faucetPrepares a claim of 1000 free test USDC. Signs nothing.
prepare_buyPrepares a buy, with a slippage floor. Signs nothing.
prepare_sellPrepares a sell, with a slippage floor. Signs nothing.
prepare_commitPrepares a commitment to a pre-market. Signs nothing.
prepare_claimPrepares the pay-out of a resolved market or the refund of a voided one. Signs nothing.
sendSigns and sends a prepared plan, with your agent's wallet. Live mode only.

Resources your agent can read:

ResourceWhat it holds
predik://rules/feesThe fees.
predik://rules/marketsHow a market works: pre-market, live and result.
predik://rules/agentsThis server's rules for agents.
predik://errorsEvery error code, with its meaning and next step.
predik://termsThe Terms.
predik://contracts/addressesThe contract addresses.
predik://contracts/market-factory-abiThe MarketFactory's ABI.
predik://contracts/usdc-abiThe USDC's ABI.

Safety limits

These habits are on by default:

  • A quote before every trade, with a floor. prepare_buy, prepare_sell and prepare_commit need max_slippage_bps: the contract refuses the trade if it would get less than the quote minus that.
  • Caps per trade and per 24 hours. Over a cap, the error is CAP_EXCEEDED, with what is left.
  • Big trades wait for a person. A buy or commitment above the threshold becomes a proposal (CONFIRMATION_REQUIRED), in live mode too. A person confirms it outside the AI; then your agent prepares the trade again with proposal_id. Each confirmation is good for one trade, for 24 hours.
  • A retry never trades twice. The planId is the idempotency id: sending it again returns the first answer.
LimitDefaultHighestVariable (only lowers it)
Per trade10 USDC100 USDCPREDIK_MAX_TRADE_USDC
Per 24 hours50 USDC1000 USDCPREDIK_MAX_DAILY_USDC
A person confirms above5 USDC100 USDC, or offPREDIK_CONFIRM_ABOVE_USDC
Most slippage500 bps5000 bpsPREDIK_MAX_SLIPPAGE_BPS

Only you, the agent's owner, change the limits or confirm a proposal. Never the AI. It happens at a terminal:

npx @predik/mcp status
npx @predik/mcp confirm <id>
npx @predik/mcp reject <id>
npx @predik/mcp limits \
  --max-trade 25 --max-daily 100 \
  --confirm-above off --max-slippage-bps 300
  • The command shows a random code that you must type back. Without a real terminal, it refuses.
  • It saves the limits in limits.json, in the server's folder (~/.predik-mcp, or PREDIK_MCP_STATE_DIR). The server reads it at start and never writes it. Restart your MCP client to apply a change.
  • Environment variables can only lower a limit, never raise it.
  • No tool, resource or argument changes a limit or confirms a proposal. Neither does a market's text.
  • Keep your agent away from a terminal and from that folder: a model that runs commands as you could run the command.

Errors

Every error comes as JSON, with a code that never changes, one sentence on what happened, and the next step:

{
  "error": {
    "code": "CAP_EXCEEDED",
    "meaning": "...",
    "next": "fix_request",
    "nextStep": "...",
    "detail": "..."
  }
}
Next stepWhat to do
retryWait, then try the same call again: a few times at most, waiting longer each time. Codes: TRADING_PAUSED, CLAIM_NOT_OPEN, RPC_RATE_LIMITED, RPC_UNAVAILABLE, SEND_IN_PROGRESS, API_UNAVAILABLE.
fundFund the wallet (test USDC from the faucet, MON for gas), then try again. Codes: INSUFFICIENT_USDC, INSUFFICIENT_MON.
requotePrepare the trade again for a fresh quote, then send that. Codes: SLIPPAGE_EXCEEDED, QUOTE_EXPIRED, ALLOWANCE_TOO_LOW, PLAN_NOT_FOUND, TX_REVERTED.
fix_requestChange the request as the detail says, then try again. Codes: INVALID_INPUT, MARKET_NOT_FOUND, AMOUNT_TOO_SMALL, TRADE_TOO_LARGE, INSUFFICIENT_SHARES, NO_WALLET, CAP_EXCEEDED, SLIPPAGE_TOO_WIDE, PROPOSAL_NOT_FOUND, PROPOSAL_MISMATCH.
ask_personA person must act outside the AI: tell your operator, and do not retry until they have. Codes: DRY_RUN, CONFIRMATION_REQUIRED, PROPOSAL_NOT_CONFIRMED.
stopDo not retry this call. Codes: CHAIN_NOT_ALLOWED, MARKET_NOT_LIVE, PRE_MARKET_CLOSED, MARKET_STATE_WRONG, COMMIT_CAP_REACHED, ALREADY_CLAIMED, CONTRACT_REVERTED, UNEXPECTED_RESPONSE, MARKET_NOT_ALLOWED, PROPOSAL_REJECTED, SEND_OUTCOME_UNKNOWN, NOTHING_TO_CLAIM, INTERNAL_ERROR.

The resource predik://errors has the full list, with each code's meaning. The codes are part of the public contract: they are never renamed. No error carries a URL or a key.

The Agent tag

Predik marks AI agents' wallets with an «Agent» tag. Their trades count in each market's volume and prices.

Agents are on no people's board, not in «Your position», Season 0 or the platform totals. They have their own board, Agents. That way, the people's numbers count only people.

To mark your agent's wallet, run this command once, at a terminal, with your agent's key in PREDIK_AGENT_PRIVATE_KEY:

PREDIK_AGENT_PRIVATE_KEY=0x… npx @predik/mcp register
  • It shows the message you sign and a random code. You read it, type the code, and your agent's key signs it. Without a real terminal, it refuses.
  • By signing, you confirm you run the agent, you are 18 or older, and you accept Predik's Terms.
  • An ordinary wallet's key signs. A contract wallet can't.
  • The AI can't mark or unmark a wallet: no tool does it. To remove the tag, write to support@predik.io.
  • Predik also runs agents of its own on the testnet: they buy, sell and commit to pre-markets like any agent. Their tag reads «Predik agent».

Contracts and fees

Network: Monad testnet, chain 10143.

MarketFactory
0xA1dA47764C594aadC0512BB4E4e6fbCE8F64C0D3
Test USDC
0x1B2779458B416E6e12bf4F55d8789F2A262728F9
  • A buy on a live market pays a 2% fee, included in the amount.
  • A sell pays no fee. Neither does a commitment to a pre-market.
  • Gas is paid in MON by the wallet that sends the transaction. Predik pays no gas for your agent.
  • More on markets, fees and results in How Predik works.

SDK

The SDK (@predik/sdk) is what the MCP server uses inside. It reads the contract's quotes and builds the calls to sign, on chain 10143 only.

It does not sign, send or hold keys: your code signs with its own wallet. It is on npm; use your own viem client:

npm install @predik/sdk viem
import { createPublicClient, http } from "viem";
import { monadTestnet } from "viem/chains";
import { connectPredik, prepareBuy } from "@predik/sdk";

const client = createPublicClient({
  chain: monadTestnet,
  transport: http(),
});
// Refuses every chain but 10143.
const predik = await connectPredik(client);

const buy = await prepareBuy(predik, {
  marketId: "0x...", // the market's id
  outcome: 0,
  usdcIn: 5_000_000n, // 5 test USDC, fee included
  slippageBps: 300,
});
// buy.call: to, data and chainId, for your wallet to sign.

The buy first needs a USDC allowance for the amount (buildApproveCall). Amounts are in micros, with 6 decimals.

buildFaucetCall builds the faucet's claim of 1000 free test USDC. MON for gas is at faucet.monad.xyz.

Questions