opportunity
Find and execute cross-platform arbitrage opportunities across prediction markets
What this skill does
# 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](https://arxiv.org/abs/2508.03474) which found **$40M+ in realized arbitrage** on Polymarket.
## Opportunity Types
| Type | Description | Example |
|------|-------------|---------|
| **Internal** | YES + NO < $1 on same platform | Buy both for guaranteed profit |
| **Cross-Platform** | Same market priced differently | Buy low on A, sell high on B |
| **Combinatorial** | Logical violations (P(A) > P(B) when A implies B) | Trump > Republican |
| **Edge** | Market 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:
| Factor | Weight | Description |
|--------|--------|-------------|
| Edge % | 35% | Raw arbitrage spread |
| Liquidity | 25% | Available volume |
| Confidence | 25% | Match quality |
| Execution | 15% | 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-defRelated in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.