Opportunity logo

Opportunity

CommunityPopular
alsk1992
opportunity

Find and execute cross-platform arbitrage opportunities across prediction markets

Overview

Publisheralsk1992
RepositoryCloddsBot
Skill nameopportunity
Stars
3K
Forks
353
Bundled files
1
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 1 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by alsk1992 on GitHub. Read the source before you install it.

Installation

Install the Opportunity AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/alsk1992/CloddsBot/tree/main/src/skills/bundled/opportunity
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/alsk1992/CloddsBot.git /tmp/CloddsBot
mkdir -p .claude/skills
cp -r /tmp/CloddsBot/src/skills/bundled/opportunity .claude/skills/opportunity
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Opportunity in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Opportunity on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Opportunity is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Opportunity Finder - Complete API Reference

Discover and execute cross-platform arbitrage opportunities across Polymarket, Kalshi, Betfair, Smarkets, Manifold, Metaculus, PredictIt, and Drift.

Based on arXiv:2508.03474 which found $40M+ in realized arbitrage on Polymarket.

Opportunity Types

TypeDescriptionExample
InternalYES + NO < $1 on same platformBuy both for guaranteed profit
Cross-PlatformSame market priced differentlyBuy low on A, sell high on B
CombinatorialLogical violations (P(A) > P(B) when A implies B)Trump > Republican
EdgeMarket vs external model (538, polls)Market 45%, model 52%

Chat Commands

Scanning

/opportunities scan                         # Scan all platforms for opportunities
/opportunities scan "trump"                 # Scan with keyword filter
/opportunities scan --min-edge 2            # Min 2% edge
/opportunities scan --min-liquidity 1000    # Min $1000 liquidity

/opportunities active                       # View active opportunities
/opportunities active --sort edge           # Sort by edge size
/opportunities active --sort liquidity      # Sort by liquidity

Real-Time Monitoring

/opportunities realtime start               # Start continuous scanning
/opportunities realtime stop                # Stop scanning
/opportunities realtime status              # Check monitoring status
/opportunities realtime config --interval 30 # Set scan interval (seconds)

Market Linking

/opportunities link <market-a> <market-b>   # Manually link equivalent markets
/opportunities unlink <market-a> <market-b> # Remove link
/opportunities links                        # View all linked markets
/opportunities auto-match                   # Run auto-matching algorithm

Execution

/opportunities execute <id>                 # Execute an opportunity
/opportunities execute <id> --size 100      # Execute with $100 size
/opportunities mark-taken <id>              # Mark as taken (manual)
/opportunities record-outcome <id> <pnl>    # Record P&L outcome

Analytics

/opportunities stats                        # Performance statistics
/opportunities stats --period 7d            # Last 7 days
/opportunities history                      # Past opportunities
/opportunities by-platform                  # Stats by platform pair
/opportunities by-type                      # Stats by opportunity type

Risk Modeling

/opportunities risk <id>                    # Model execution risk
/opportunities estimate <id>                # Estimate execution costs
/opportunities kelly <id>                   # Calculate Kelly fraction

TypeScript API Reference

Create Opportunity Finder

typescript
import { createOpportunityFinder } from 'clodds/opportunity';

const finder = createOpportunityFinder({
  platforms: ['polymarket', 'kalshi', 'betfair', 'manifold'],

  // Filtering
  minEdge: 0.5,           // 0.5% minimum edge
  minLiquidity: 500,      // $500 minimum liquidity
  minConfidence: 0.7,     // 70% match confidence

  // Real-time
  enableRealtime: true,
  scanIntervalMs: 30000,  // 30 second intervals

  // Credentials
  polymarket: { apiKey, apiSecret, passphrase, privateKey },
  kalshi: { apiKey, privateKey },
});

Scan for Opportunities

typescript
// One-time scan
const opportunities = await finder.scan({
  query: 'election',      // Optional keyword
  minEdge: 1,             // 1% minimum
  minLiquidity: 1000,     // $1000 minimum
  platforms: ['polymarket', 'kalshi'],
});

for (const opp of opportunities) {
  console.log(`${opp.type}: ${opp.description}`);
  console.log(`  Edge: ${opp.edge.toFixed(2)}%`);
  console.log(`  Liquidity: $${opp.liquidity.toLocaleString()}`);
  console.log(`  Confidence: ${(opp.confidence * 100).toFixed(0)}%`);
  console.log(`  Score: ${opp.score}/100`);
  console.log(`  Platforms: ${opp.platforms.join(' ↔ ')}`);
}

Real-Time Monitoring

typescript
// Start real-time scanning
await finder.startRealtime();

// Event handlers
finder.on('opportunity', (opp) => {
  console.log(`🎯 New opportunity: ${opp.description}`);
  console.log(`   Edge: ${opp.edge.toFixed(2)}%`);
});

finder.on('opportunityExpired', (opp) => {
  console.log(`❌ Opportunity expired: ${opp.id}`);
});

finder.on('opportunityUpdated', (opp) => {
  console.log(`📊 Updated: ${opp.id} - Edge now ${opp.edge.toFixed(2)}%`);
});

// Get active opportunities
const active = await finder.getActive();

// Stop monitoring
await finder.stopRealtime();

Market Linking

typescript
// Manually link equivalent markets
await finder.linkMarkets(
  { platform: 'polymarket', id: 'market-123' },
  { platform: 'kalshi', id: 'TRUMP-WIN' }
);

// Auto-match using semantic similarity
const matches = await finder.autoMatchMarkets({
  minSimilarity: 0.85,
  platforms: ['polymarket', 'kalshi'],
});

console.log(`Found ${matches.length} potential matches`);
for (const match of matches) {
  console.log(`${match.marketA.question}`);
  console.log(`  ↔ ${match.marketB.question}`);
  console.log(`  Similarity: ${(match.similarity * 100).toFixed(0)}%`);
}

// Get all links
const links = await finder.getLinks();

Execute Opportunity

typescript
// Execute an opportunity
const result = await finder.execute(opportunityId, {
  size: 100,              // $100 position
  maxSlippage: 0.5,       // 0.5% max slippage
  useProtectedOrders: true,
});

console.log(`Executed: ${result.status}`);
console.log(`  Filled: $${result.filledSize}`);
console.log(`  Avg price: ${result.avgPrice}`);
console.log(`  Fees: $${result.fees}`);

// Mark as taken manually
await finder.markTaken(opportunityId);

// Record outcome
await finder.recordOutcome(opportunityId, {
  pnl: 25.50,
  exitPrice: 0.55,
  exitTimestamp: Date.now(),
});

Analytics

typescript
// Get statistics
const stats = await finder.getAnalytics({
  period: '30d',
});

console.log(`Total opportunities: ${stats.total}`);
console.log(`Taken: ${stats.taken}`);
console.log(`Win rate: ${(stats.winRate * 100).toFixed(1)}%`);
console.log(`Total P&L: $${stats.totalPnl.toLocaleString()}`);
console.log(`Avg edge: ${stats.avgEdge.toFixed(2)}%`);
console.log(`By platform pair:`);
for (const [pair, data] of Object.entries(stats.byPlatformPair)) {
  console.log(`  ${pair}: ${data.count} opps, $${data.pnl} P&L`);
}

Risk Modeling

typescript
// Model execution risk
const risk = await finder.modelRisk(opportunityId);

console.log(`Execution risk:`);
console.log(`  Fill probability: ${(risk.fillProbability * 100).toFixed(0)}%`);
console.log(`  Expected slippage: ${risk.expectedSlippage.toFixed(2)}%`);
console.log(`  Time to fill: ${risk.estimatedTimeToFill}s`);
console.log(`  Counterparty risk: ${risk.counterpartyRisk}`);

// Estimate execution
const estimate = await finder.estimateExecution(opportunityId, {
  size: 500,
});

console.log(`Execution estimate for $500:`);
console.log(`  Expected fill: $${estimate.expectedFill}`);
console.log(`  Expected cost: $${estimate.expectedCost}`);
console.log(`  Net edge after costs: ${estimate.netEdge.toFixed(2)}%`);

Opportunity Scoring

Opportunities are scored 0-100 based on:

FactorWeightDescription
Edge %35%Raw arbitrage spread
Liquidity25%Available volume
Confidence25%Match quality
Execution15%Platform reliability

Penalties

  • Low liquidity (<$1000): -5 points
  • Cross-platform complexity: -3 per platform
  • High slippage (>2%): -5 points
  • Low confidence (<70%): -5 points
  • Near expiry (<24h): -3 points

Semantic Matching

Markets are matched using:

  1. Exact slug match - Platform-specific IDs
  2. Text similarity - Jaccard coefficient
  3. Vector embeddings - Semantic similarity
  4. Manual links - User-defined
typescript
// Configure matching
finder.setMatchingConfig({
  minTextSimilarity: 0.8,
  minEmbeddingSimilarity: 0.85,
  useManualLinksFirst: true,
});

Best Practices

  1. Start with high-confidence matches - 85%+ similarity
  2. Check liquidity - Ensure enough volume to execute
  3. Account for fees - Factor in platform fees
  4. Use protected orders - Avoid slippage
  5. Monitor in real-time - Opportunities disappear fast
  6. Track outcomes - Build performance history

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Opportunity AI skill do?

Find and execute cross-platform arbitrage opportunities across prediction markets

Why use Opportunity on TypingMind?

Because you install it once and use it with any model. Opportunity is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Opportunity in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/alsk1992/CloddsBot/tree/main/src/skills/bundled/opportunity. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Opportunity?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Opportunity?

As many as you like. As long as a model supports skills, you can use Opportunity with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Opportunity AI skill free?

Yes. It is published on GitHub by alsk1992 under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇