BaoziClaw
BaoziClaw is a comprehensive OpenClaw skill that provides full access to Baozi prediction markets on Solana. Agents can browse markets, analyze odds, place bets, manage portfolios, and claim winnings — all through natural language.
Features
- Market Discovery: List active markets with filters (hot, new, trending)
- Odds Analysis: Get real-time probabilities and pool sizes
- Betting: Place SOL bets on boolean or race outcomes
- Portfolio Management: Check positions for any wallet
- Winnings Claim: Auto-claim resolved market payouts
- Market Creation: Create new Lab markets (creator profile required)
Tools
| Tool |
Description |
list-markets |
Browse active prediction markets |
get-odds |
Get odds, pools, and implied probabilities |
place-bet |
Place a bet on any market outcome |
get-portfolio |
View positions for a wallet |
claim-winnings |
Claim from resolved markets |
create-market |
Create a new Lab market |
Installation
clawhub install baozi-claw
---
## 🔨 Agora recrie o index.ts com mais tools:
```bash
cat > index.ts << 'EOF'
import { exec } from 'child_process';
import { promisify } from 'util';
const execAsync = promisify(exec);
async function callBaoziMCP(toolName: string, args: any = {}) {
const command = `npx -y @baozi.bet/mcp-server --tool ${toolName} --args '${JSON.stringify(args)}'`;
try {
const { stdout, stderr } = await execAsync(command);
if (stderr) console.error('Stderr:', stderr);
return JSON.parse(stdout);
} catch (error) {
console.error(`Error calling ${toolName}:`, error);
throw error;
}
}
export const tools = [
{
name: 'list-markets',
description: 'List active prediction markets on Baozi with optional filters (layer, status, query)',
parameters: { type: 'object', properties: { layer: { type: 'string' }, status: { type: 'string' }, query: { type: 'string' } } },
handler: async (args: any) => callBaoziMCP('list_markets', args)
},
{
name: 'get-odds',
description: 'Get odds, implied probabilities, and pool sizes for a specific market',
parameters: { type: 'object', properties: { marketId: { type: 'string' } }, required: ['marketId'] },
handler: async (args: any) => callBaoziMCP('get_quote', { market: args.marketId })
},
{
name: 'place-bet',
description: 'Place a bet on a market outcome using SOL',
parameters: { type: 'object', properties: { marketId: { type: 'string' }, outcome: { type: 'boolean' }, amount: { type: 'number' } }, required: ['marketId', 'outcome', 'amount'] },
handler: async (args: any) => callBaoziMCP('build_bet_transaction', args)
},
{
name: 'get-portfolio',
description: 'View all positions and bets for a wallet address',
parameters: { type: 'object', properties: { wallet: { type: 'string' } }, required: ['wallet'] },
handler: async (args: any) => callBaoziMCP('get_portfolio', { wallet: args.wallet })
},
{
name: 'claim-winnings',
description: 'Claim SOL winnings from resolved markets',
parameters: { type: 'object', properties: { marketId: { type: 'string' } }, required: ['marketId'] },
handler: async (args: any) => callBaoziMCP('build_claim_transaction', { market: args.marketId })
}
];
console.log('✅ BaoziClaw:', tools.length, 'prediction market tools loaded');
1---2name: baozi-claw3description: Complete Solana prediction markets skill for Baozi — list markets, get odds, place bets, claim winnings4---56# BaoziClaw78BaoziClaw is a comprehensive OpenClaw skill that provides full access to **Baozi prediction markets** on Solana. Agents can browse markets, analyze odds, place bets, manage portfolios, and claim winnings — all through natural language.910## Features1112- **Market Discovery**: List active markets with filters (hot, new, trending)13- **Odds Analysis**: Get real-time probabilities and pool sizes14- **Betting**: Place SOL bets on boolean or race outcomes15- **Portfolio Management**: Check positions for any wallet16- **Winnings Claim**: Auto-claim resolved market payouts17- **Market Creation**: Create new Lab markets (creator profile required)1819## Tools2021| Tool | Description |22|------|-------------|23| `list-markets` | Browse active prediction markets |24| `get-odds` | Get odds, pools, and implied probabilities |25| `place-bet` | Place a bet on any market outcome |26| `get-portfolio` | View positions for a wallet |27| `claim-winnings` | Claim from resolved markets |28| `create-market` | Create a new Lab market |2930## Installation3132```bash33clawhub install baozi-claw3435---3637## 🔨 Agora recrie o index.ts com mais tools:3839```bash40cat > index.ts << 'EOF'41import { exec } from 'child_process';42import { promisify } from 'util';4344const execAsync = promisify(exec);4546async function callBaoziMCP(toolName: string, args: any = {}) {47 const command = `npx -y @baozi.bet/mcp-server --tool ${toolName} --args '${JSON.stringify(args)}'`;48 try {49 const { stdout, stderr } = await execAsync(command);50 if (stderr) console.error('Stderr:', stderr);51 return JSON.parse(stdout);52 } catch (error) {53 console.error(`Error calling ${toolName}:`, error);54 throw error;55 }56}5758export const tools = [59 {60 name: 'list-markets',61 description: 'List active prediction markets on Baozi with optional filters (layer, status, query)',62 parameters: { type: 'object', properties: { layer: { type: 'string' }, status: { type: 'string' }, query: { type: 'string' } } },63 handler: async (args: any) => callBaoziMCP('list_markets', args)64 },65 {66 name: 'get-odds',67 description: 'Get odds, implied probabilities, and pool sizes for a specific market',68 parameters: { type: 'object', properties: { marketId: { type: 'string' } }, required: ['marketId'] },69 handler: async (args: any) => callBaoziMCP('get_quote', { market: args.marketId })70 },71 {72 name: 'place-bet',73 description: 'Place a bet on a market outcome using SOL',74 parameters: { type: 'object', properties: { marketId: { type: 'string' }, outcome: { type: 'boolean' }, amount: { type: 'number' } }, required: ['marketId', 'outcome', 'amount'] },75 handler: async (args: any) => callBaoziMCP('build_bet_transaction', args)76 },77 {78 name: 'get-portfolio',79 description: 'View all positions and bets for a wallet address',80 parameters: { type: 'object', properties: { wallet: { type: 'string' } }, required: ['wallet'] },81 handler: async (args: any) => callBaoziMCP('get_portfolio', { wallet: args.wallet })82 },83 {84 name: 'claim-winnings',85 description: 'Claim SOL winnings from resolved markets',86 parameters: { type: 'object', properties: { marketId: { type: 'string' } }, required: ['marketId'] },87 handler: async (args: any) => callBaoziMCP('build_claim_transaction', { market: args.marketId })88 }89];9091console.log('✅ BaoziClaw:', tools.length, 'prediction market tools loaded');