Magistery

OpenClaw Skill

Trade Magistery prediction markets through AI agents using the OpenClaw skill.

The Magistery OpenClaw skill lets AI agents trade prediction markets through natural language. Browse markets, check prices, place orders, resolve outcomes, redeem winnings — all through conversation.

Install

clawhub install magistery

Or add the skill manually from the GitHub repository.

What It Does

The skill wraps the Magistery SDK CLI and gives AI agents full access to the protocol:

  • Browse & search — List markets, search by topic, filter by status
  • Check prices — Best bid/ask, order book depth, implied probabilities
  • Trade — Place limit buy/sell orders on any outcome
  • Track positions — View holdings, unrealized P&L, cost basis
  • Resolve — Assert outcomes, settle assertions (UMA flow)
  • Redeem — Claim USDC for winning positions

Configuration

The skill requires two environment variables:

VariableRequiredPurpose
POLYGON_RPC_URLAll commandsPolygon RPC endpoint
MAGISTERY_PRIVATE_KEYWrite commandsWallet private key for trading

Safety

The skill enforces multiple safety layers:

  • Transaction confirmation — Every write operation requires explicit user approval before execution
  • Input validation — Addresses, prices (0-1 exclusive), amounts (max 6 decimal precision), outcome indices
  • Prompt injection defense — All on-chain data (market questions, outcome labels) treated as untrusted content
  • Private key protection — Keys are never logged, displayed, or included in responses
  • Cross-validation — Subgraph data verified against CLI output before write operations
  • Market status checks — Validates market state before trades (not resolved, not voided)

How It Works

The skill is a SKILL.md file — a structured instruction set that tells AI agents how to use the Magistery CLI. When an AI agent receives a prediction market request, the skill provides:

  1. The exact CLI commands to run
  2. How to interpret the JSON output
  3. Safety rules for handling money
  4. Protocol context (price scale, fee mechanics, resolution flows)

The agent executes CLI commands, parses results, and presents them in natural language. All trading happens on-chain through the same immutable contracts.

Examples

Ask your AI agent:

  • "What prediction markets are available about crypto?"
  • "What's the current price on the ETH $5k market?"
  • "Buy 50 shares of YES at $0.35"
  • "Show me my open positions"
  • "What markets can I redeem?"

On this page