Arbitrage logo

Arbitrage

CommunityPopular
alsk1992
arbitrage

Automated cross-platform arbitrage detection and monitoring

Overview

Publisheralsk1992
RepositoryCloddsBot
Skill namearbitrage
Stars
2.8K
Forks
336
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 Arbitrage 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.
  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/arbitrage .claude/skills/arbitrage
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Arbitrage 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 Arbitrage 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 Arbitrage 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.

Arbitrage Service - Complete API Reference

Automated detection and monitoring of arbitrage opportunities across prediction market platforms.

Supported Platforms

  • Polymarket
  • Kalshi
  • Manifold
  • Metaculus
  • PredictIt
  • Drift
  • Betfair
  • Smarkets

Chat Commands

Monitoring Control

/arb start                                  # Start arbitrage monitoring
/arb stop                                   # Stop monitoring
/arb status                                 # Check monitoring status
/arb config --interval 60                   # Set check interval (seconds)

Manual Scanning

/arb check                                  # Run one-time scan
/arb check "election"                       # Scan with keyword
/arb check --platforms poly,kalshi          # Specific platforms

Market Comparison

/arb compare <market-a> <market-b>          # Compare two specific markets
/arb compare poly:12345 kalshi:TRUMP        # By platform:id

View Opportunities

/arb opportunities                          # List current opportunities
/arb opportunities --min-spread 2           # Min 2% spread
/arb opportunities --format table           # Table format
/arb opportunities --format detailed        # Detailed view

Market Linking

/arb link <market-a> <market-b>             # Manually link markets
/arb unlink <market-a> <market-b>           # Remove link
/arb links                                  # View all links
/arb auto-match                             # Auto-detect matches

Statistics

/arb stats                                  # Arbitrage statistics
/arb stats --period 7d                      # Last 7 days
/arb history                                # Historical opportunities

TypeScript API Reference

Create Arbitrage Service

typescript
import { createArbitrageService } from 'clodds/arbitrage';

const arbService = createArbitrageService({
  platforms: ['polymarket', 'kalshi', 'manifold', 'betfair'],

  checkIntervalMs: 30000,    // Check every 30 seconds
  minSpread: 0.5,            // 0.5% minimum spread
  minLiquidity: 100,         // $100 minimum

  // Platform credentials
  polymarket: { apiKey, apiSecret, passphrase },
  kalshi: { apiKey },
});

Start/Stop Monitoring

typescript
// Start continuous monitoring
await arbService.start();

// Event handlers
arbService.on('arbitrage', (opp) => {
  console.log(`⚖️ Arbitrage found!`);
  console.log(`  ${opp.marketA.platform}: ${opp.marketA.price}`);
  console.log(`  ${opp.marketB.platform}: ${opp.marketB.price}`);
  console.log(`  Spread: ${opp.spread.toFixed(2)}%`);
});

arbService.on('arbitrageExpired', (opp) => {
  console.log(`Arbitrage expired: ${opp.id}`);
});

// Check status
const isRunning = arbService.isRunning();

// Stop monitoring
await arbService.stop();

One-Time Check

typescript
// Run a single scan
const opportunities = await arbService.checkArbitrage({
  query: 'trump',
  platforms: ['polymarket', 'kalshi'],
  minSpread: 1,
});

for (const opp of opportunities) {
  console.log(`${opp.question}`);
  console.log(`  Buy on ${opp.buyPlatform} @ ${opp.buyPrice}`);
  console.log(`  Sell on ${opp.sellPlatform} @ ${opp.sellPrice}`);
  console.log(`  Spread: ${opp.spread.toFixed(2)}%`);
}

Compare Specific Markets

typescript
// Compare two specific markets
const comparison = await arbService.compareMarkets(
  { platform: 'polymarket', id: 'market-123' },
  { platform: 'kalshi', id: 'TRUMP-WIN' }
);

if (comparison.hasArbitrage) {
  console.log(`Arbitrage exists!`);
  console.log(`  Buy ${comparison.buySide} on ${comparison.buyPlatform}`);
  console.log(`  Sell ${comparison.sellSide} on ${comparison.sellPlatform}`);
  console.log(`  Spread: ${comparison.spread.toFixed(2)}%`);
} else {
  console.log(`No arbitrage. Price difference: ${comparison.priceDiff.toFixed(2)}%`);
}

Market Linking

typescript
// Add a manual match
await arbService.addMatch(
  { platform: 'polymarket', id: 'market-123', question: 'Will Trump win?' },
  { platform: 'kalshi', id: 'TRUMP-WIN', question: 'Trump wins 2024' }
);

// Remove a match
await arbService.removeMatch('polymarket:market-123', 'kalshi:TRUMP-WIN');

// Auto-detect matches using question similarity
const autoMatches = await arbService.autoMatchMarkets({
  minSimilarity: 0.85,
});

console.log(`Found ${autoMatches.length} auto-matches`);

Get Opportunities

typescript
// Get current opportunities
const opportunities = await arbService.getOpportunities({
  minSpread: 1,
  sortBy: 'spread',  // 'spread' | 'liquidity' | 'confidence'
});

// Format for display
const formatted = await arbService.formatOpportunities(opportunities);
console.log(formatted);

Statistics

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

console.log(`Total opportunities: ${stats.totalOpportunities}`);
console.log(`Avg spread: ${stats.avgSpread.toFixed(2)}%`);
console.log(`Max spread seen: ${stats.maxSpread.toFixed(2)}%`);
console.log(`By platform pair:`);
for (const [pair, count] of Object.entries(stats.byPlatformPair)) {
  console.log(`  ${pair}: ${count}`);
}

Arbitrage Types Detected

1. Cross-Platform Price Difference

Market: "Trump wins 2024"
Polymarket YES: 52¢
Kalshi YES: 55¢

Strategy: Buy Polymarket YES, Sell Kalshi YES
Spread: 3¢ (5.8%)

2. Internal Arbitrage (Rebalancing)

Market: "Will X happen?"
YES: 45¢
NO: 52¢
Total: 97¢

Strategy: Buy both YES and NO
Guaranteed profit: 3¢ per $1

3. Inverse Markets

Market A: "Trump wins" = 55¢
Market B: "Trump loses" = 48¢
Total: 103¢ (should be 100¢)

Strategy: Sell both, pocket 3¢

Configuration

typescript
arbService.configure({
  // Scanning
  checkIntervalMs: 30000,
  batchSize: 50,

  // Filtering
  minSpread: 0.5,
  minLiquidity: 100,
  minConfidence: 0.7,

  // Matching
  autoMatchEnabled: true,
  minMatchSimilarity: 0.85,

  // Alerts
  alertOnNewArb: true,
  alertThreshold: 2,  // Alert on 2%+ spreads
});

Best Practices

  1. Verify matches manually - Auto-matching can have false positives
  2. Check liquidity - Ensure you can actually execute
  3. Account for fees - Platform fees reduce spreads
  4. Move fast - Arbitrage disappears quickly
  5. Use limit orders - Avoid slippage
  6. Track all outcomes - Build performance data

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 Arbitrage AI skill do?

Automated cross-platform arbitrage detection and monitoring

Why use Arbitrage on TypingMind?

Because you install it once and use it with any model. Arbitrage 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 Arbitrage in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/alsk1992/CloddsBot/tree/main/src/skills/bundled/arbitrage. 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 Arbitrage?

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 Arbitrage?

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

Is the Arbitrage 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 👇