interface WorldIndex { uncertainty: number; geopolitical: number; momentum: number; activity: number; } interface TraditionalMarket { symbol: string; price: number; changePct: number; } interface ActionableEdge { title: string; ticker: string; venue: string; marketPrice: number; thesisPrice: number; edge: number; executableEdge: number; direction: string; spread: number; liquidityScore: string; edgeAgeHours?: number; absorption?: string; } interface Mover { title: string; ticker: string; price: number; delta: number; venue: string; volume24h?: number; } interface StableAnchor { title: string; ticker: string; price: number; } interface ContagionHighlight { trigger: string; lagging: string; gap: number; } interface Divergence { description: string; implication?: string; } interface WorldState { index: WorldIndex; regimeSummary: string; traditional: TraditionalMarket[]; actionableEdges: ActionableEdge[]; movers: Mover[]; stableAnchors: StableAnchor[]; contagionHighlights: ContagionHighlight[]; divergences: Divergence[]; deltaWindow: string; generatedAt: string; marketCount?: number; } interface IndexComponents { medianSpread: number; avgSpread: number; spreadP90: number; totalDepth: number; tickersTracked: number; geoMovers: number; geoAvgDelta: number; totalChanges24h: number; priceUpCount: number; priceDownCount: number; } interface UncertaintyIndex { uncertainty: number; geopolitical: number; momentum: number; activity: number; components: IndexComponents; timestamp: string; history?: Array<{ hour: string; uncertainty: number; geopolitical: number; momentum: number; activity: number; }>; } interface Edge { ticker: string; venue: string; title: string; status: string; marketPrice: number; thesisPrice: number; edge: number; executableEdge: number; direction: string; confidence: number; liquidityScore: string; spread: number; expiresAt: string | null; volume24h: number; bidDepthUsd: number; askDepthUsd: number; reasoning: string; causalPath: string[]; edgeDiscoveredAt: string | null; edgeAgeHours: number | null; priceAtDiscovery: number | null; marketAbsorption: number | null; feeAssumption: { venue: string; takerFeeBps: number; feeModel: string; } | null; tickerAlt: Record | null; thesisSlug: string; thesisTitle: string; } interface EdgesResponse { edges: Edge[]; count: number; priceUnit: string; generatedAt: string; } interface OrderbookLevel { price: number; size: number; } interface MarketDetail { ticker: string; venue: 'kalshi' | 'polymarket'; title: string; description?: string; price: number; bestBid?: number; bestAsk?: number; spread?: number; volume: number; volume24h?: number; openInterest?: number; status: string; closeTime?: string; liquidityScore?: string; bidLevels?: OrderbookLevel[]; askLevels?: OrderbookLevel[]; } interface WorldDelta { from: string; to: string; changes: string[]; markdown: string; latencyMs?: number; } interface PredictionMarketConfig { baseUrl?: string; apiKey?: string; timeout?: number; } declare class PredictionMarketClient { private base; private apiKey?; private timeout; constructor(config?: PredictionMarketConfig); private fetch; private fetchText; /** * Get the full world state — what's happening right now across 30,000+ prediction markets. * Returns structured data: uncertainty index, regime summary, actionable edges, * market movers, stable anchors, contagion signals, and divergences. * * ~800 tokens. Refreshes every 15 minutes. */ world(options?: { format?: 'json' | 'markdown'; }): Promise; /** * Get incremental world state changes since a given time. * ~30-50 tokens vs 800 for full state. * * @param since - Relative ("1h", "6h", "24h") or ISO timestamp. Omit for last change. */ delta(since?: string): Promise; /** * SimpleFunctions Uncertainty Index — four real-time signals derived from * orderbook spreads and price movements across all tracked markets. * * - uncertainty (0-100): spread-based consensus measure * - geopolitical (0-100): price velocity in geo markets * - momentum (-1 to +1): directional bias * - activity (0-100): normalized trading activity */ index(options?: { history?: boolean; }): Promise; /** * Actionable edges — prediction markets where thesis-implied price * diverges from market price, after accounting for spread and fees. */ edges(): Promise; /** * Get detailed data for a specific prediction market by ticker. * Works with Kalshi tickers (e.g. "KXINX-26DEC31-B4500"), * Polymarket condition IDs, numeric IDs, or slugs. * * @param depth - Include full orderbook (top 5 levels each side) */ market(ticker: string, options?: { depth?: boolean; }): Promise; /** * Batch query multiple markets at once (max 20). */ markets(tickers: string[], options?: { depth?: boolean; }): Promise; /** * Search prediction markets by topic. */ search(query: string): Promise<{ topic: string; summary: string; markets: any[]; }>; } /** * Get the full world state in one call. Zero config needed. * * ```ts * import { world } from 'prediction-market-context' * const state = await world() * console.log(state.index.uncertainty) // 0-100 * console.log(state.regimeSummary) // "Risk-off regime..." * ``` */ declare function world(): Promise; declare function world(options: { format: 'markdown'; }): Promise; declare function world(options: { format: 'json'; }): Promise; /** * Get the uncertainty index — four numbers that summarize * global prediction market sentiment right now. * * ```ts * import { index } from 'prediction-market-context' * const { uncertainty, geopolitical, momentum, activity } = await index() * ``` */ declare function index(options?: { history?: boolean; }): Promise; /** * Get actionable edges — markets where thesis price diverges from market price. * * ```ts * import { edges } from 'prediction-market-context' * const { edges: list } = await edges() * for (const e of list) { * console.log(`${e.title}: ${e.executableEdge}c edge`) * } * ``` */ declare function edges(): Promise; /** * Get detailed data for a specific prediction market. * * ```ts * import { market } from 'prediction-market-context' * const m = await market('KXINX-26DEC31-B4500', { depth: true }) * console.log(`${m.title}: ${m.price}c, spread ${m.spread}c`) * ``` */ declare function market(ticker: string, options?: { depth?: boolean; }): Promise; /** * Get incremental world state changes. * * ```ts * import { delta } from 'prediction-market-context' * const d = await delta('1h') * console.log(d.changes) // ["- SPY: $523.10→$524.20 (+0.2%)", ...] * ``` */ declare function delta(since?: string): Promise; export { type ActionableEdge, type ContagionHighlight, type Divergence, type Edge, type EdgesResponse, type IndexComponents, type MarketDetail, type Mover, type OrderbookLevel, PredictionMarketClient, type PredictionMarketConfig, type StableAnchor, type TraditionalMarket, type UncertaintyIndex, type WorldDelta, type WorldIndex, type WorldState, delta, edges, index, market, world };