agentCLAWHUBUnverified

Create Prediction Markets 1.0.0

Create, trade, and settle prediction markets on Base with any ERC20 collateral. Use when building prediction market infrastructure, running contests, crowdsourcing probability estimates, adding utility to tokens, or tapping into true information finance via market-based forecasting. Skill: Create Prediction Markets 1.0.0 Owner: tariqsumatri82 Summary: Create, trade, and settle prediction markets on Base with any ERC20 collateral. Use when building prediction market infrastructure, running contests, crowdsourcing probability estimates, adding utility to tokens, or tapping into true information finance via market-based forecasting. Tags: latest:1.0.0 Version history: v1.0.0 | 2026-02-08T11:53:46.4

OpenClaw

Rank

62

Safety

84

Downloads

725

Updated

Apr 15, 2026

Version

1.0.0

Source

CLAWHUB

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 725 downloads reported by the source. Last updated 4/15/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Public facts

Every fact links back to the source it came from.

Vendor
Clawhubvendor · observed Apr 15, 2026
Protocol compatibility
OpenClawcompatibility · observed Apr 15, 2026
Adoption signal
725 downloadsadoption · observed Apr 15, 2026
Latest release
1.0.0release · observed Feb 8, 2026
Handshake status
UNKNOWNsecurity

Install and run

Setup complexity: low.

clawhub skill install kn70jfw8xqy0vmfwfvk7brkz1180r73s:create-prediction-markets-1-0-0
  1. Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.
  2. Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-tariqsumatri82-create-prediction-markets-1-0-0/snapshot"

Documentation

CLAWHUB

21,619 characters of source documentation, loaded on request.

Extracted files

5 files captured from the source.

SKILL.md

---
name: pnp-markets
description: Create, trade, and settle prediction markets on Base with any ERC20 collateral. Use when building prediction market infrastructure, running contests, crowdsourcing probability estimates, adding utility to tokens, or tapping into true information finance via market-based forecasting.
---

# PNP Markets

Create and manage prediction markets on Base Mainnet with any ERC20 collateral token.

## Quick Decision

```
Need prediction markets?
├─ Create market     → npx ts-node scripts/create-market.ts --help
├─ Trade (buy/sell)  → npx ts-node scripts/trade.ts --help
├─ Settle market     → npx ts-node scripts/settle.ts --help
└─ Redeem winnings   → npx ts-node scripts/redeem.ts --help
```

## Environment

```bash
export PRIVATE_KEY=<wallet_private_key>    # Required
export RPC_URL=<base_rpc_endpoint>         # Optional (defaults to public RPC)
```

For production, use a dedicated RPC (Alchemy, QuickNode) to avoid rate limits.

## Scripts

Run any script with `--help` first to see all options.

### Create Market

```bash
npx ts-node scripts/create-market.ts \
  --question "Will ETH reach $10k by Dec 2025?" \
  --duration 168 \
  --liquidity 100
```

Options: `--collateral <USDC|WETH|address>`, `--decimals <n>`

### Trade

```bash
# Buy YES tokens
npx ts-node scripts/trade.ts --buy --condition 0x... --outcome YES --amount 10

# Sell NO tokens  
npx ts-node scripts/trade.ts --sell --condition 0x... --outcome NO --amount 5 --decimals 18

# View prices only
npx ts-node scripts/trade.ts --info --condition 0x...
```

### Settle

```bash
# Settle as YES winner
npx ts-node scripts/settle.ts --condition 0x... --outcome YES

# Check status
npx ts-node scripts/settle.ts --status --condition 0x...
```

### Redeem

```bash
npx ts-node scripts/redeem.ts --condition 0x...
```

## Programmatic Usage

```typescript
import { PNPClient } from "pnp-evm";
import { ethers } from "ethers";

const client = new PNPClient({
  rpcUrl: process.env.RPC_URL || "https://mainnet.base.org",
  privateKey: process.env.PRIVATE_KEY!,
});

// Create market
const { conditionId } = await client.market.createMarket({
  question: "Will X happen?",
  endTime: Math.floor(Date.now() / 1000) + 86400 * 7,
  initialLiquidity: ethers.parseUnits("100", 6).toString(),
});

// Trade
await client.trading.buy(conditionId, ethers.parseUnits("10", 6), "YES");

// Settle (after endTime)
const tokenId = await client.trading.getTokenId(conditionId, "YES");
await client.market.settleMarket(conditionId, tokenId);

// Redeem
await client.redemption.redeem(conditionId);
```

## Collateral Tokens

Use any ERC20. Common Base Mainnet tokens:

| Token | Address | Decimals |
|-------|---------|----------|
| USDC | `0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913` | 6 |
| WETH | `0x4200000000000000000000000000000000000006` | 18 |
| cbETH | `0x2Ae3F1Ec7F1F5012CFEab0185bfc7aa3cf0DEc22` | 18 |

Custom tokens add utility—holders can participate in your markets.

## ERC20 Approvals

Before interacti

_meta.json

{
  "ownerId": "kn70jfw8xqy0vmfwfvk7brkz1180r73s",
  "slug": "create-prediction-markets-1-0-0",
  "version": "1.0.0",
  "publishedAt": 1770551626417
}

references/api-reference.md

# PNP SDK API Reference

Complete API documentation for the PNP Protocol SDK.

## Installation

```bash
npm install pnp-evm ethers
```

## PNPClient

Main entry point for all operations.

```typescript
import { PNPClient } from "pnp-evm";

const client = new PNPClient({
  rpcUrl: string,           // RPC endpoint (defaults to Base mainnet)
  privateKey: string,       // Wallet private key
  contractAddresses?: {     // Optional custom addresses
    marketFactory: string,
    usdcToken: string,
    feeManager: string,
  }
});
```

## Market Module (`client.market`)

### createMarket(params)

Create a new prediction market.

```typescript
const { conditionId, hash, receipt } = await client.market.createMarket({
  question: string,           // Prediction question
  endTime: number,            // Unix timestamp when trading ends
  initialLiquidity: string,   // Amount in wei
  collateralToken?: string,   // ERC20 address (defaults to USDC)
});
```

**Returns:**
- `conditionId`: Unique market identifier
- `hash`: Transaction hash
- `receipt`: Full transaction receipt

### getMarketInfo(conditionId)

Get market details.

```typescript
const info = await client.market.getMarketInfo(conditionId);
// Returns:
// {
//   question: string,
//   endTime: string,
//   isCreated: boolean,
//   isSettled: boolean,
//   reserve: string,
//   collateral: string,
//   winningToken: string
// }
```

### getMarketPrices(conditionId)

Get current YES/NO token prices.

```typescript
const prices = await client.market.getMarketPrices(conditionId);
// Returns:
// {
//   yesPrice: string,        // e.g., "0.65"
//   noPrice: string,         // e.g., "0.35"
//   yesPricePercent: string, // e.g., "65.00%"
//   noPricePercent: string,  // e.g., "35.00%"
//   yesPriceRaw: string,
//   noPriceRaw: string
// }
```

### settleMarket(conditionId, winningTokenId)

Settle a market with the winning outcome. Only callable by market creator after end time.

```typescript
const winningTokenId = await client.trading.getTokenId(conditionId, "YES");
const result = await client.market.settleMarket(conditionId, winningTokenId);
```

## Trading Module (`client.trading`)

### getTokenId(conditionId, outcome)

Get the token ID for a specific outcome.

```typescript
const yesTokenId = await client.trading.getTokenId(conditionId, "YES");
const noTokenId = await client.trading.getTokenId(conditionId, "NO");
```

### buy(conditionId, amount, outcome, minTokensOut?)

Buy outcome tokens with collateral.

```typescript
import { ethers } from "ethers";

const amount = ethers.parseUnits("10", 6); // 10 USDC
const minTokensOut = 0n; // Slippage protection (0 = no limit)

const result = await client.trading.buy(
  conditionId,
  amount,
  "YES",        // or "NO"
  minTokensOut
);
```

**Parameters:**
- `conditionId`: Market identifier
- `amount`: Collateral amount in wei
- `outcome`: "YES" or "NO"
- `minTokensOut`: Minimum tokens to receive (slippage protection)

### sell(conditionId, amount, outcome, 

references/examples.md

# PNP Markets - Complete Examples

## Full Market Lifecycle

```typescript
import { PNPClient } from "pnp-evm";
import { ethers } from "ethers";

async function fullLifecycle() {
  const client = new PNPClient({
    rpcUrl: process.env.RPC_URL || "https://mainnet.base.org",
    privateKey: process.env.PRIVATE_KEY!,
  });

  // 1. CREATE MARKET
  console.log("Creating market...");
  const { conditionId, hash } = await client.market.createMarket({
    question: "Will our community reach 1000 members this month?",
    endTime: Math.floor(Date.now() / 1000) + 86400 * 7,
    initialLiquidity: ethers.parseUnits("50", 6).toString(),
  });
  console.log("Market created:", conditionId);

  // 2. CHECK PRICES
  const prices = await client.market.getMarketPrices(conditionId!);
  console.log("YES:", prices.yesPricePercent);
  console.log("NO:", prices.noPricePercent);

  // 3. BUY TOKENS
  const buyAmount = ethers.parseUnits("10", 6);
  await client.trading.buy(conditionId!, buyAmount, "YES");
  console.log("Bought YES tokens");

  // 4. SELL TOKENS (partial)
  const sellAmount = ethers.parseUnits("2", 18);
  await client.trading.sell(conditionId!, sellAmount, "YES");
  console.log("Sold some YES tokens");

  // 5. SETTLE (after endTime)
  const winningTokenId = await client.trading.getTokenId(conditionId!, "YES");
  await client.market.settleMarket(conditionId!, winningTokenId);
  console.log("Market settled as YES");

  // 6. REDEEM
  await client.redemption.redeem(conditionId!);
  console.log("Winnings redeemed");
}
```

## Custom Token Collateral

```typescript
import { PNPClient } from "pnp-evm";
import { ethers } from "ethers";

async function customTokenMarket() {
  const client = new PNPClient({
    rpcUrl: process.env.RPC_URL || "https://mainnet.base.org",
    privateKey: process.env.PRIVATE_KEY!,
  });

  const MY_TOKEN = "0xYourTokenAddress";
  const TOKEN_DECIMALS = 18;

  const { conditionId } = await client.market.createMarket({
    question: "Will our DAO pass Proposal #42?",
    endTime: Math.floor(Date.now() / 1000) + 86400 * 14,
    initialLiquidity: ethers.parseUnits("10000", TOKEN_DECIMALS).toString(),
    collateralToken: MY_TOKEN,
  });

  console.log("Market with custom token:", conditionId);
}
```

## Market Monitoring

```typescript
import { PNPClient } from "pnp-evm";

async function monitorMarket(conditionId: string) {
  const client = new PNPClient({
    rpcUrl: process.env.RPC_URL || "https://mainnet.base.org",
    privateKey: process.env.PRIVATE_KEY!,
  });

  const info = await client.market.getMarketInfo(conditionId);
  const prices = await client.market.getMarketPrices(conditionId);
  const isSettled = await client.redemption.isResolved(conditionId);

  return {
    question: info.question,
    endTime: new Date(parseInt(info.endTime) * 1000),
    yesPrice: prices.yesPricePercent,
    noPrice: prices.noPricePercent,
    reserve: info.reserve,
    isSettled,
  };
}
```

## Batch Market Creation

```typescript
import { PNPClien

references/use-cases.md

# PNP Markets Use Cases

Prediction markets are versatile infrastructure. Here are key use cases for AI agents.

## 1. True Information Finance

Aggregate collective intelligence into probability estimates. Market prices reveal crowd beliefs about uncertain events.

```typescript
// Create market to discover sentiment probability
await client.market.createMarket({
  question: "Will positive sentiment about Project X exceed 70% this week?",
  endTime: Math.floor(Date.now() / 1000) + 86400 * 7,
  initialLiquidity: ethers.parseUnits("100", 6).toString(),
});
```

**Applications:**
- Crowdsource probability estimates on uncertain events
- Discover collective beliefs about future outcomes
- Gather market-based forecasts for decision making

## 2. Token Utility & Engagement

Use your project's token as collateral to drive utility and engagement.

```typescript
const MY_TOKEN = "0xYourTokenContractAddress";

await client.market.createMarket({
  question: "Will we ship v2.0 by end of month?",
  endTime: Math.floor(Date.now() / 1000) + 86400 * 30,
  initialLiquidity: ethers.parseUnits("1000", 18).toString(),
  collateralToken: MY_TOKEN,
});
```

**Benefits:**
- Create immediate utility for token holders
- Drive engagement through prediction participation
- Align community incentives with project outcomes

## 3. Contests & Competitions

Run prediction contests where participants compete by trading on outcomes.

```typescript
await client.market.createMarket({
  question: "Which feature will get the most community votes: A, B, or C?",
  endTime: Math.floor(Date.now() / 1000) + 86400 * 7,
  initialLiquidity: ethers.parseUnits("50", 6).toString(),
});
```

**Applications:**
- Community prediction competitions
- Gamified governance decisions
- Tournament-style events

## 4. Automated Market Making

Create markets programmatically based on data feeds or events.

```typescript
async function createTrendingMarket(topic: string) {
  const question = `Will "${topic}" remain trending for 24 hours?`;
  
  return await client.market.createMarket({
    question,
    endTime: Math.floor(Date.now() / 1000) + 86400,
    initialLiquidity: ethers.parseUnits("25", 6).toString(),
  });
}

// Create markets based on trending topics
for (const topic of trendingTopics) {
  await createTrendingMarket(topic);
}
```

## 5. Conditional Decision Markets

Create markets to inform decisions based on predicted outcomes.

```typescript
// Market to inform product decision
await client.market.createMarket({
  question: "If we launch Feature X, will DAU increase by >20% in 30 days?",
  endTime: Math.floor(Date.now() / 1000) + 86400 * 45,
  initialLiquidity: ethers.parseUnits("200", 6).toString(),
});
```

## 6. Event-Driven Markets

Create markets around specific events with known resolution dates.

```typescript
// Sports, elections, product launches, etc.
await client.market.createMarket({
  question: "Will Company X announce earnings above $5B on Q4 call?",
  endTime: earningsCallTimest
Github ReposUpdated 3h agoRank 70

AionUi

Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!

MCPOPENCLAW
Github ReposUpdated 6mo agoRank 70

activepieces

AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents

OPENCLAW
Github ReposUpdated 6mo agoRank 70

cherry-studio

AI productivity studio with smart chat, autonomous agents, and 300+ assistants.

MCPOPENCLAW
Github ReposUpdated 7mo agoRank 70

CopilotKit

The Frontend for Agents & Generative UI. React + Angular

OPENCLAW

Machine-readable data

The same record, as JSON, for agents and crawlers.

{
  "facts": [
    {
      "factKey": "vendor",
      "category": "vendor",
      "label": "Vendor",
      "value": "Clawhub",
      "href": "https://clawhub.ai/tariqsumatri82/create-prediction-markets-1-0-0",
      "sourceUrl": "https://clawhub.ai/tariqsumatri82/create-prediction-markets-1-0-0",
      "sourceType": "profile",
      "confidence": "medium",
      "observedAt": "2026-04-15T00:45:39.800Z",
      "isPublic": true
    },
    {
      "factKey": "protocols",
      "category": "compatibility",
      "label": "Protocol compatibility",
      "value": "OpenClaw",
      "href": "https://www.xpersona.co/api/v1/agents/clawhub-tariqsumatri82-create-prediction-markets-1-0-0/contract",
      "sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-tariqsumatri82-create-prediction-markets-1-0-0/contract",
      "sourceType": "contract",
      "confidence": "medium",
      "observedAt": "2026-04-15T00:45:39.800Z",
      "isPublic": true
    },
    {
      "factKey": "traction",
      "category": "adoption",
      "label": "Adoption signal",
      "value": "725 downloads",
      "href": "https://clawhub.ai/tariqsumatri82/create-prediction-markets-1-0-0",
      "sourceUrl": "https://clawhub.ai/tariqsumatri82/create-prediction-markets-1-0-0",
      "sourceType": "profile",
      "confidence": "medium",
      "observedAt": "2026-04-15T00:45:39.800Z",
      "isPublic": true
    },
    {
      "factKey": "latest_release",
      "category": "release",
      "label": "Latest release",
      "value": "1.0.0",
      "href": "https://clawhub.ai/tariqsumatri82/create-prediction-markets-1-0-0",
      "sourceUrl": "https://clawhub.ai/tariqsumatri82/create-prediction-markets-1-0-0",
      "sourceType": "release",
      "confidence": "medium",
      "observedAt": "2026-02-08T11:53:46.417Z",
      "isPublic": true
    },
    {
      "factKey": "handshake_status",
      "category": "security",
      "label": "Handshake status",
      "value": "UNKNOWN",
      "href": "https://www.xpersona.co/api/v1/agents/clawhub-tariqsumatri82-create-prediction-markets-1-0-0/trust",
      "sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-tariqsumatri82-create-prediction-markets-1-0-0/trust",
      "sourceType": "trust",
      "confidence": "medium",
      "observedAt": null,
      "isPublic": true
    }
  ],
  "events": [
    {
      "eventType": "release",
      "title": "Release 1.0.0",
      "description": "- Initial release of pnp-markets. - Create, trade, settle, and redeem prediction markets on Base Mainnet using any ERC20 collateral. - Command line scripts and programmatic SDK usage for full market lifecycle management. - Supports custom and common tokens (USDC, WETH, cbETH) with standard ERC20 approvals. - Includes troubleshooting tips and documentation references for rapid onboarding.",
      "href": "https://clawhub.ai/tariqsumatri82/create-prediction-markets-1-0-0",
      "sourceUrl": "https://clawhub.ai/tariqsumatri82/create-prediction-markets-1-0-0",
      "sourceType": "release",
      "confidence": "medium",
      "observedAt": "2026-02-08T11:53:46.417Z",
      "isPublic": true
    }
  ]
}

Record generated Oct 9, 2026.

Sponsored

Ads related to Create Prediction Markets 1.0.0 and adjacent AI workflows.