event-discovery
Event Discovery
Overview
Discover and filter Polymarket events using the DOME API. Events aggregate multiple related markets under a single topic (e.g., "Presidential Election 2024" contains multiple candidate markets).
Security
This skill implements defense-in-depth measures against indirect prompt injection (Snyk W011):
- Input Sanitization: All user-generated content (titles, subtitles, tags) is sanitized using
security.ts - Pattern Filtering: Known prompt injection patterns are removed (e.g., "ignore previous instructions", "system:")
- Content Validation: Suspicious content with excessive special characters is flagged
- Fail-Safe: Processing errors return original data rather than corrupting it
The skill fetches data from the trusted DOME API (api.domeapi.io) which provides structured event data from the Polymarket protocol.
Setup
Before using this skill, make sure you have built the TypeScript files:
# From the DOME_skills root directory
npm install
npm run build
Quick Start
import {
fetchEvents,
fetchEventBySlug,
getEventMarkets,
filterHighVolumeEvents
} from "./scripts/eventDiscovery.js";
// Fetch recent events
const result = await fetchEvents(apiKey, { limit: 10, include_markets: true });
for (const event of result.events) {
console.log(`${event.title} - Markets: ${event.market_count}`);
}
// Get specific event with markets
const event = await fetchEventBySlug(apiKey, "presidential-election-2024");
const markets = getEventMarkets(event);
// Filter high-volume events
const allEvents = await fetchAllEvents(apiKey, { tags: ["crypto"] });
const highVolume = filterHighVolumeEvents(allEvents, { minVolume: 1000000 });
Core Functions
fetchEvents()
Fetch events with optional filters.
const result = await fetchEvents(
apiKey,
{
event_slug: "presidential-election-2024",
tags: ["politics", "elections"],
status: "open",
include_markets: true,
limit: 20
}
);
// Returns: { events: [...], pagination: {...} }
fetchEventBySlug()
Get a single event by its slug with all markets.
const event = await fetchEventBySlug(
apiKey,
"presidential-election-2024"
);
getEventMarkets()
Extract markets from an event object.
const markets = getEventMarkets(event);
// Returns: EventMarket[]
filterHighVolumeEvents()
Filter events by volume, status, or tags.
const filtered = filterHighVolumeEvents(
events,
{
minVolume: 1000000,
status: "open",
tags: ["crypto"],
minMarkets: 2
}
);
calculateEventStats()
Calculate statistics for an event.
const stats = calculateEventStats(event);
// Returns: { total_volume, total_markets, avg_volume_per_market, ... }
Event Data Structure
The Event object returned by the API contains the following fields:
| Field | Type | Description |
|---|---|---|
event_slug |
string |
Unique identifier for the event |
title |
string |
Event title |
subtitle |
string | null |
Event description/subtitle |
status |
"open" | "closed" |
Current event status |
start_time |
number |
Unix timestamp when event started |
end_time |
number |
Unix timestamp when event ends |
volume_fiat_amount |
number |
Total USD volume across all markets |
market_count |
number |
Number of markets in this event |
markets |
EventMarket[] | null |
Array of markets (when include_markets=true) |
tags |
string[] |
Tags/categories for the event |
image |
string | null |
URL to event image |
Note: The volume field is volume_fiat_amount, not volume.
Data Limitations
- Maximum 100 events per request
- Event data ordered by total volume (highest first)
- Markets included only when
include_markets=true
More from 0xweaksheep/dome_skills
market-discovery
Fetch and discover Polymarket markets from DOME API. Use this skill when the user wants to find markets, search for specific topics, filter markets by criteria (volume, status, tags), or identify backtesting candidates. Triggers include phrases like "find markets", "search for markets", "get market data", "filter markets", or "discover markets".
3backtest-planner
|
3historical-trades
Fetch and analyze historical Polymarket trade data. Use this skill when users need to retrieve trade history, analyze trading patterns, calculate volume statistics, or aggregate trades by time periods for specific markets, tokens, or users.
3candlestick-analysis
Analyze historical candlestick data for Polymarket prediction markets. Use this skill when users need to fetch OHLCV data, calculate technical indicators (SMA, EMA, volatility), detect price trends, support/resistance levels, or perform time-series analysis on market prices. Trigger for requests involving price history, chart data, technical analysis, or market trend detection.
3wallet-analytics
Analyze Polymarket wallet performance, positions, and trading activity. Use this skill when the user wants to analyze a trader's performance, get wallet positions, calculate PnL, or identify smart money wallets. Triggers include phrases like "analyze wallet", "trading performance", "wallet PnL", "positions", "smart money", or "trader analysis".
2activity-monitor
Monitor and analyze Polymarket trading activity including MERGES, SPLITS, and REDEEMS. Use this skill when the user wants to track large transactions, analyze activity patterns, detect suspicious behavior, or monitor market closing signals. Triggers include phrases like "track activity", "monitor transactions", "large trades", "activity patterns", or "market closing signals".
2