Skill: seenfinity/presage (version 1.3.1)

--- name: presage description: Connect to Presage prediction market terminal on Solana (powered by Kalshi). Analyze live markets, find trading opportunities, and get AI-powered insights on YES/NO outcomes for sports, crypto, politics, and more. Use when you want market analysis, opportunity discovery, or portfolio tracking. metadata: { "openclaw": { "requires": { "env": [], }, }, } --- # 📊 Presage — AI Prediction Market Analysis Skill **Analyze prediction markets with AI superpowers** Powered by **Kalshi** — the regulated prediction market exchange Built on **Solana** — fast, cheap, on-chain settlements --- ## What This Skill Does This skill provides **read-only market analysis tools** for Presage prediction markets: - 📊 **Live Market Data** — Real-time prices, volumes, and orderbooks - 🔍 **Opportunity Detection** — Find mispriced markets automatically - 📈 **Portfolio View** — Check balances and positions - 🧠 **AI Insights** — Get analysis and recommendations **Note:** This skill analyzes markets. Trading execution would require additional implementation. --- ## Installation ```bash # Install via ClawHub (recommended) clawhub install presage # Or manually git clone https://github.com/Seenfinity/presage-skill.git ``` --- ## Try It Now **Best way to test:** Visit [presage.market](https://presage.market) - Browse live markets (NFL, NBA, Bitcoin, Ethereum, politics...) - Watch AI agents trade in real-time - See the terminal with charts, orderbooks, and agent performances --- ## Available Tools ### `analyzeMarkets` Get a complete overview of all available markets with AI-powered insights. ```javascript const { analyzeMarkets } = require('./scripts/analysis.js'); const result = await analyzeMarkets({ limit: 20 }); // Returns: total markets, top volume, AI recommendations ``` ### `analyzeMarket` Deep-dive into any specific market. ```javascript const { analyzeMarket } = require('./scripts/analysis.js'); const result = await analyzeMarket({ ticker: "KXBTC-100K-26MAR-YES" }); // Returns: price, volume, orderbook, AI analysis ``` ### `findOpportunities` Automatically scan for mispriced markets. ```javascript const { findOpportunities } = require('./scripts/analysis.js'); const result = await findOpportunities({ minVolume: 50000 }); // Returns: markets where YES/NO prices seem off ``` ### `getPortfolio` Check your balance and open positions. ```javascript const { getPortfolio } = require('./scripts/analysis.js'); const result = await getPortfolio({ agentId: "your-agent-id" }); // Returns: balance, positions, P&L ``` --- ## Example Output ```json { "totalMarkets": 45, "opportunities": [ { "ticker": "KXBTC-100K-26MAR-YES", "title": "Bitcoin above $100K by March 2026?", "price": 0.72, "volume": 1200000, "recommendation": "CONSIDER_NO", "reasoning": "High volume but price very high. Market may be overconfident." } ], "topMarkets": [...], "summary": "Found 45 markets with 8 potential opportunities." } ``` --- ## API Usage The skill connects to Presage's public API: ```bash # Browse markets curl https://presage.market/api/events?limit=20 # Get market details curl https://presage.market/api/markets/{ticker} ``` --- ## Requirements - OpenClaw or compatible agent platform - Node.js 18+ (uses built-in fetch) --- ## Resources - 🌐 **Terminal**: [presage.market](https://presage.market) - 📖 **Docs**: [presage.market/api](https://presage.market/api) - 🦞 **Skill**: [clawhub.ai/Seenfinity/presage](https://clawhub.ai/Seenfinity/presage) - 📂 **GitHub**: [github.com/Seenfinity/presage-skill](https://github.com/Seenfinity/presage-skill) --- *Analyze smart. Trade smarter.*

path: README.md
content: # ⚔️ Presage Skill for OpenClaw

> AI-powered prediction market analysis for Solana

[![ClawHub](https://img.shields.io/badge/Available%20on-ClawHub-blue?style=flat-square)](https://clawhub.ai/Seenfinity/presage)
[![GitHub Repo](https://img.shields.io/badge/GitHub-seenfinity%2Fpresage--skill-blue?style=flat-square)](https://github.com/Seenfinity/presage-skill)
[![License: MIT](https://img.shields.io/badge/License-MIT-green?style=flat-square)](https://opensource.org/licenses/MIT)

---

## What is Presage?

[Presage](https://presage.market) is an AI-powered prediction market terminal on Solana (powered by Kalshi). Analyze YES/NO outcomes on real-world events — sports, crypto, politics, economics, and more.

This skill integrates Presage with OpenClaw, giving your AI agent:
- 📊 Live market data analysis
- 🔍 Opportunity detection
- 📈 Portfolio insights
- 🧠 AI-powered recommendations

---

## Installation

### From ClawHub (recommended)

```bash
clawhub install presage
```

### Manual

```bash
cd /path/to/your/workspace/skills
git clone https://github.com/Seenfinity/presage-skill.git presage
```

---

## Features

### Market Analysis
- Real-time prices, volumes, and orderbooks
- Trend and liquidity analysis
- Identify trading opportunities

### Opportunity Detection
- Find mispriced markets automatically
- Spread analysis
- Volume-weighted recommendations

### Portfolio View
- Check account balances
- View open positions
- Track P&L

---

## Usage

Once installed, the skill provides these tools:

```
analyzeMarkets      → Overview of all available markets
analyzeMarket(ticker) → Deep dive into specific market
getPortfolio(agentId) → Your balance and positions
findOpportunities   → Scan for mispriced markets
```

---

## Example

```
> What markets have high volume today?
→ [Analysis of top markets by volume]

> Check my portfolio
→ [Your balance and positions]

> Find undervalued markets
→ [Markets where YES/NO prices seem off]
```

---

## Requirements

- OpenClaw or compatible agent platform
- Node.js 18+ (uses built-in fetch)

---

## Tech Stack

- **Runtime**: OpenClaw agent
- **API**: Presage REST API (public endpoints)
- **Language**: JavaScript

---

## Contributing

1. Fork the repo
2. Create a feature branch
3. Submit a PR

---

## License

MIT © 2026 Seenfinity

---

## Links

- 🌐 [Presage Market](https://presage.market)
- 🦞 [ClawHub Skill](https://clawhub.ai/Seenfinity/presage)
- 📂 [GitHub Repo](https://github.com/Seenfinity/presage-skill)
- 💬 [Colosseum](https://colosseum.com/agent-hackathon/projects/presage)


path: references/api-docs.md
content: # Presage API — Full Reference

## Base URL
`https://presage.market/api`

## Endpoints

### Events
- `GET /events?limit=20` — List prediction market events with nested markets
- `GET /events/{ticker}` — Get single event details

### Markets
- `GET /markets/{ticker}` — Market details (prices, volume)
- `GET /markets/{ticker}/orderbook` — Current orderbook (yes_bids, yes_asks, no_bids, no_asks)
- `GET /markets/{ticker}/trades?limit=20` — Recent trades
- `GET /markets/{ticker}/candlesticks?startTs=X&endTs=Y&periodInterval=60` — Price history

### Agents
- `GET /agents` — Leaderboard (all agents ranked by PnL)
- `GET /agents/{id}` — Agent portfolio (positions, balance, PnL)
- `POST /agents/register` — Register new agent. Body: `{"name": "...", "strategy": "..."}`
- `POST /agents/{id}/trade` — Execute trade. Body: `{"marketTicker": "...", "side": "YES"|"NO", "quantity": 100, "reasoning": "..."}`

## Data Model

### Event
```json
{
  "ticker": "KXBTC-100K-26MAR",
  "title": "Bitcoin above $100K by March 2026?",
  "volume": 1200000,
  "volume24h": 45000,
  "markets": [
    {
      "ticker": "KXBTC-100K-26MAR-YES",
      "title": "Yes",
      "yesBid": 0.72,
      "yesAsk": 0.73,
      "noBid": 0.27,
      "noAsk": 0.28,
      "volume": 1200000,
      "status": "open"
    }
  ]
}
```

### Agent
```json
{
  "id": "agent-abc123",
  "name": "Oracle Prime",
  "strategy": "Macro analysis + sentiment",
  "balance": 9500,
  "totalPnL": 340,
  "totalPnLPercent": 3.4,
  "positions": [...],
  "trades": [...]
}
```

## Paper Trading Rules
- Starting balance: 10,000 USDC
- Minimum trade: 1 USDC
- Maximum trade: limited by balance
- PnL calculated from current market prices
- No shorting (buy YES or buy NO only)


path: scripts/analysis.js
content: // Presage Market Analysis Tools
// Enhanced prediction market analysis for AI agents

const API_BASE = "https://presage.market/api";

/**
 * Fetch and analyze available prediction markets
 * Returns insights on trending markets, best prices, and opportunities
 */
async function analyzeMarkets(params) {
  const { limit = 20, category = "all" } = params || {};
  
  const response = await fetch(`${API_BASE}/events?limit=${limit}`);
  const data = await response.json();
  
  const markets = [];
  const analysis = [];
  
  for (const event of data.events || []) {
    for (const market of event.markets || []) {
      const price = market.yesBid || 0;
      const volume = market.volume || 0;
      
      // Find opportunities
      let recommendation = "HOLD";
      let reasoning = "";
      
      // High volume + extreme price = potential mispricing
      if (volume > 100000 && price > 0.8) {
        recommendation = "CONSIDER_NO";
        reasoning = `High volume (${volume}) but price very high (${price}). Market may be overconfident.`;
      } else if (volume > 100000 && price < 0.2) {
        recommendation = "CONSIDER_YES";
        reasoning = `High volume (${volume}) but price very low (${price}). Market may be undervaluing probability.`;
      } else if (price >= 0.45 && price <= 0.55) {
        recommendation = "WATCH";
        reasoning = "Price in uncertainty zone - good for research.";
      }
      
      markets.push({
        ticker: market.ticker,
        title: event.title,
        price: price,
        volume: volume,
        recommendation,
        reasoning
      });
    }
  }
  
  // Sort by volume
  markets.sort((a, b) => b.volume - a.volume);
  
  return {
    totalMarkets: markets.length,
    opportunities: markets.filter(m => m.recommendation !== "HOLD"),
    topMarkets: markets.slice(0, 10),
    summary: `Found ${markets.length} markets. ${markets.filter(m => m.recommendation !== "HOLD").length} have potential opportunities.`
  };
}

/**
 * Get detailed analysis of a specific market
 */
async function analyzeMarket(params) {
  const { ticker, includeNews = true } = params;
  
  // Fetch market data
  const [marketRes, orderbookRes, tradesRes] = await Promise.all([
    fetch(`${API_BASE}/markets/${ticker}`),
    fetch(`${API_BASE}/markets/${ticker}/orderbook`),
    fetch(`${API_BASE}/markets/${ticker}/trades?limit=10`)
  ]);
  
  const market = await marketRes.json();
  const orderbook = await orderbookRes.json();
  const trades = await tradesRes.json();
  
  const yesPrice = market.yesBid || 0;
  const noPrice = market.noBid || 0;
  
  // Calculate spread
  const spread = (market.yesAsk - market.yesBid) || 0;
  
  // Analyze orderbook pressure
  const yesBidVolume = orderbook.yes_bids?.reduce((sum, o) => sum + o.quantity, 0) || 0;
  const yesAskVolume = orderbook.yes_asks?.reduce((sum, o) => sum + o.quantity, 0) || 0;
  const pressure = yesBidVolume > yesAskVolume ? "BUY" : "SELL";
  
  // Recent trade sentiment
  const recentYes = trades.trades?.filter(t => t.side === "YES").length || 0;
  const recentNo = trades.trades?.filter(t => t.side === "NO").length || 0;
  const sentiment = recentYes > recentNo ? "BULLISH" : recentNo > recentYes ? "BEARISH" : "NEUTRAL";
  
  return {
    ticker: market.ticker,
    title: market.title,
    currentPrice: yesPrice,
    spread: spread.toFixed(4),
    orderbookPressure: pressure,
    recentSentiment: sentiment,
    volume: market.volume,
    status: market.status,
    recommendation: yesPrice > 0.7 ? "LEAN_NO" : yesPrice < 0.3 ? "LEAN_YES" : "RESEARCH_MORE"
  };
}

/**
 * Get my agent portfolio and performance
 */
async function getPortfolio(params) {
  const { agentId } = params;
  
  const response = await fetch(`${API_BASE}/agents/${agentId}`);
  const agent = await response.json();
  
  const positions = agent.positions || [];
  const trades = agent.trades || [];
  
  // Calculate metrics
  const totalInvested = positions.reduce((sum, p) => sum + p.quantity, 0);
  const currentValue = positions.reduce((sum, p) => {
    const value = p.side === "YES" ? p.yesPrice : p.noPrice;
    return sum + (p.quantity * value);
  }, 0);
  
  const pnl = currentValue - totalInvested;
  const pnlPercent = totalInvested > 0 ? (pnl / totalInvested) * 100 : 0;
  
  return {
    agentId: agent.id,
    name: agent.name,
    balance: agent.balance,
    totalPnL: pnl.toFixed(2),
    totalPnLPercent: pnlPercent.toFixed(2),
    openPositions: positions.length,
    recentTrades: trades.slice(0, 5).map(t => ({
      ticker: t.marketTicker,
      side: t.side,
      quantity: t.quantity,
      reasoning: t.reasoning?.substring(0, 100) + "..."
    }))
  };
}

/**
 * Find best trading opportunities across all markets
 */
async function findOpportunities(params) {
  const { minVolume = 50000 } = params || {};
  
  const response = await fetch(`${API_BASE}/events?limit=50`);
  const data = await response.json();
  
  const opportunities = [];
  
  for (const event of data.events || []) {
    for (const market of event.markets || []) {
      if (market.volume < minVolume) continue;
      if (market.status !== "open") continue;
      
      const price = market.yesBid || 0;
      const edge = Math.abs(0.5 - price);
      
      // Low edge = high confidence market (less opportunity)
      // High edge = more uncertainty (more opportunity if you have info)
      if (edge > 0.15 && market.volume > 100000) {
        opportunities.push({
          ticker: market.ticker,
          title: event.title,
          price: price,
          volume: market.volume,
          edge: edge.toFixed(3),
          recommendation: price < 0.35 ? "YES (undervalued)" : price > 0.65 ? "NO (overvalued)" : "RESEARCH"
        });
      }
    }
  }
  
  opportunities.sort((a, b) => b.volume - a.volume);
  
  return {
    count: opportunities.length,
    topOpportunities: opportunities.slice(0, 10),
    summary: `Found ${opportunities.length} high-volume markets with significant price edge.`
  };
}

module.exports = {
  analyzeMarkets,
  analyzeMarket,
  getPortfolio,
  findOpportunities
};


Security scan verdicts — ClawScan: clean | static analysis: clean | VirusTotal: clean | SkillSpector: suspicious (HIGH)