export { Client, DataApiConfig, DataApiError, GraduatedTokensParams, GraduatingTokensParams, RateLimitError, RequestOptions, TokenOverviewParams, ValidationError } from './data-api.mjs'; import { EventEmitter } from 'events'; import { EnrichedStreamOptions, PnlV2Identity, WhaleMinVolume, TradeIdentity, WalletBalanceUpdate, LiquidityUpdate, TokenStatsTotal, TokenStats, DcaStreamEvent, DcaOpenedEvent, DcaFilledEvent, DcaClosedEvent, DcaDepositEvent, DcaWithdrawEvent, DcaCollectedFeeEvent, DcaPositionEvent, TokenInfo, PoolInfo, TokenEvents, TokenRisk, ProcessedEvent, ProcessedStats } from './interfaces.mjs'; export { AthPrice, BundlerWallet, BundlersCategory, BundlersChartData, BundlersChartResponse, BundlersResponse, ChartDataParams, ChartResponse, CreditsResponse, DcaDirection, DcaErrorResponse, DcaListParams, DcaOrder, DcaOrderRaw, DcaOrderSnapshot, DcaOrderStatus, DcaOrderStatusFilter, DcaOrdersListResponse, DcaPagination, DcaPairResponse, DcaPricesMap, DcaProgram, DcaProgramParams, DcaProgramsResponse, DcaSort, DcaSummary, DcaToken, DcaTokenFlowResponse, DcaTokenOrdersResponse, DcaTokenUser, DcaTokenUsersResponse, DcaTransactionEvent, DcaWalletResponse, DeployerParams, DeployerToken, DeployerTokensResponse, DevHolding, EnrichedTokenPnl, EnrichedTrade, EventsParams, FirstBuyTransaction, FirstBuyerData, Holder, HolderChartData, HoldersChartResponse, InsidersChartData, InsidersChartResponse, KolMinVolume, KolTokenTradesParams, KolTradesParams, Launchpad, LaunchpadLiquidity, LighthouseMarket, LighthouseMarketStats, LighthouseResponse, LighthouseTimeframeStats, LiquidityEvent, LiquidityTokenAmount, MeteoraCurve, MeteoraCurveLiquidity, MetricWithChange, MultiPriceResponse, MultiTokensResponse, OHLCVData, PaginatedHolder, PaginatedTokenHoldersResponse, PnLData, PnLResponse, PnLSummary, PnlMode, PnlV2BatchParams, PnlV2BatchPositionPairsResponse, PnlV2BatchTokenPositionsResponse, PnlV2BatchWalletPositionsResponse, PnlV2BatchWalletSummariesResponse, PnlV2BatchWalletSummary, PnlV2Block, PnlV2ChartPoint, PnlV2DayTrader, PnlV2DayTraderWithIdentity, PnlV2Holder, PnlV2IdentityBot, PnlV2IdentityDeveloper, PnlV2IdentityExchange, PnlV2IdentityHacker, PnlV2IdentityPool, PnlV2IdentitySns, PnlV2IdentitySpamDusting, PnlV2KOLByDateParams, PnlV2KOLByDateResponse, PnlV2KOLCalendarDayData, PnlV2KOLCalendarParams, PnlV2KOLCalendarResponse, PnlV2KOLLeaderboardParams, PnlV2KOLLeaderboardResponse, PnlV2KOLPeriodParams, PnlV2KOLPeriodResponse, PnlV2Pagination, PnlV2PeriodTrader, PnlV2PeriodTraderWithIdentity, PnlV2PnlAdjustments, PnlV2Position, PnlV2PositionWithWallet, PnlV2Snapshot, PnlV2Summary, PnlV2TokenFirstBuyersParams, PnlV2TokenMeta, PnlV2TokenScopedPnl, PnlV2TokenScopedPositionWithWallet, PnlV2TokenTradersParams, PnlV2TokenTradersResponse, PnlV2Top90dTrader, PnlV2TopTradersParams, PnlV2TopTradersResponse, PnlV2Trader, PnlV2TraderWithIdentity, PnlV2WalletChartParams, PnlV2WalletChartResponse, PnlV2WalletHighlightsResponse, PnlV2WalletHistoryParams, PnlV2WalletHistoryResponse, PnlV2WalletLifetimePnl, PnlV2WalletOverviewParams, PnlV2WalletOverviewResponse, PnlV2WalletPerformanceDay, PnlV2WalletPerformanceParams, PnlV2WalletPerformanceResponse, PnlV2WalletPositionsParams, PnlV2WalletPositionsResponse, PnlV2WalletQueued, PnlV2WalletRiskResponse, PnlV2WalletTokenPositionParams, PnlV2WalletTokenPositionResponse, PriceChange, PriceChangeData, PriceChangePercentage, PriceChanges, PriceData, PriceHistoryData, PriceRangeData, PriceTimestampData, RiskCategory, RiskFees, RiskWallet, RiskWalletWire, SearchParams, SearchResponse, SearchResult, SideSplitMetric, SnipersChartData, SnipersChartResponse, SubscriptionResponse, TimeframeStats, TokenDetailResponse, TokenHoldersResponse, TokenOverview, TokenPnLResponse, TokenPoolTxns, TokenRiskFactor, TokenSecurity, TokenValuePair, TopHolder, TopTrader, TopTradersResponse, Trade, TradeEvent, TradeEventFor, TradeEvents, TradeHistoryResponse, TradeMetadata, TradeMetadataToken, TradeParams, TradeTokenInfo, TradeTransaction, TradesResponse, WalletBasicResponse, WalletChartDataPoint, WalletChartPnLPeriod, WalletChartResponse, WalletResponse, WalletTokenData, WalletTokenDetail, WalletTrade, WalletTradesResponse, WhaleKolTokenMetaSide, WhaleKolTrade, WhaleKolTradesResponse, WhaleTradesParams } from './interfaces.mjs'; /** * Prediction Markets Datastream types — aligned with datastream/pm-*.json (Beta). * Room `data` is flat: envelope fields sit beside event-specific fields. * Delivery is at-least-once; deduplicate with `sourceId` or `tradeId`. */ type PmExchange = 'kalshi' | 'polymarket'; type PmChannel = 'prices' | 'trades' | 'orderbook' | 'quotes' | 'volume' | 'market_lifecycle' | 'resolution'; type PmPriceKind = 'mid' | 'last' | 'display'; /** Shared envelope fields on every `pm:*` room message. */ interface PmRealtimeEnvelope { /** Event kind (trade, price, orderbook_snapshot, quote, crypto_price, …). */ type: string; channel: PmChannel; exchange: PmExchange; marketId: string; /** Unix epoch milliseconds. */ timestamp: number; eventId?: string; seriesId?: string; category?: string; sport?: string; /** Exchange/source idempotency key (omit when empty). */ sourceId?: string; [key: string]: unknown; } interface PmPriceLevel { price: number; size: number; } interface PmQuoteLevel { side?: string; size?: number; sizeUnit?: string; avgPrice?: number; worstPrice?: number; filledSize?: number; cost?: number; unfilledSize?: number; fullyFilled?: boolean; levelsConsumed?: number; [key: string]: unknown; } interface PmTradeFields { tradeId: string; price?: number; yesPrice?: number; noPrice?: number; quantity?: number; count?: number; side?: string; takerSide?: string; createdAt?: string; transactionHash?: string; /** price × quantity in USD. Used for `pm:trades:significant` (threshold $25). */ notionalUsd?: number; eventId?: string; eventTicker?: string; eventSlug?: string; eventTitle?: string; groupItemTitle?: string; outcomeLabel?: string; outcomeIndex?: number; image?: string; [key: string]: unknown; } interface PmPriceFields { price?: number; displayPrice?: number; priceKind?: PmPriceKind; yesPrice?: number; noPrice?: number; bestBid?: number; bestAsk?: number; midpoint?: number; lastTradePrice?: number; spread?: number; tokenId?: string; [key: string]: unknown; } interface PmQuoteFields { tokenId?: string; bestBid?: number; bestAsk?: number; midpoint?: number; displayPrice?: number; lastTradePrice?: number; buy?: PmQuoteLevel[]; sell?: PmQuoteLevel[]; [key: string]: unknown; } interface PmOrderbookFields { sequence?: number; bids?: PmPriceLevel[]; asks?: PmPriceLevel[]; changes?: Array>; [key: string]: unknown; } interface PmVolumeFields { volume?: number; marketVolume?: number; delta?: number; eventId?: string; tokenId?: string; [key: string]: unknown; } /** Chainlink underlying USD tick delivered by `pm:crypto:{asset}[:prices]`. */ interface PmCryptoPriceFields { type: 'crypto_price'; channel: 'prices'; exchange: 'polymarket'; category: 'crypto'; symbol: string; pair: string; asset: string; value: number; source: string; [key: string]: unknown; } interface PmMarketLifecycleFields { status: string; previousStatus?: string; title?: string; eventId?: string; seriesId?: string; category?: string; [key: string]: unknown; } interface PmResolutionFields { status?: string; result?: string; winningOutcome?: string; settlementPrice?: number; resolvedAt?: string; [key: string]: unknown; } /** Flat trade room message. */ type PmTradeUpdate = PmRealtimeEnvelope & PmTradeFields; /** Flat price room message. */ type PmPriceUpdate = PmRealtimeEnvelope & PmPriceFields; /** Flat quote room message. */ type PmQuoteUpdate = PmRealtimeEnvelope & PmQuoteFields; /** Flat orderbook room message. */ type PmOrderbookUpdate = PmRealtimeEnvelope & PmOrderbookFields; /** Flat volume room message. */ type PmVolumeUpdate = PmRealtimeEnvelope & PmVolumeFields; /** Flat Chainlink underlying crypto-price message. */ type PmCryptoPriceUpdate = PmRealtimeEnvelope & PmCryptoPriceFields; /** Flat market lifecycle room message. */ type PmMarketLifecycleUpdate = PmRealtimeEnvelope & PmMarketLifecycleFields; /** Flat resolution room message. */ type PmResolutionUpdate = PmRealtimeEnvelope & PmResolutionFields; /** Any prediction-markets room payload. */ type PmStreamUpdate = PmTradeUpdate | PmPriceUpdate | PmQuoteUpdate | PmOrderbookUpdate | PmVolumeUpdate | PmCryptoPriceUpdate | PmMarketLifecycleUpdate | PmResolutionUpdate | PmRealtimeEnvelope; /** Lowercase a room segment (exchange, market id, event id, etc.). */ declare function pmRoomSegment(value: string): string; /** * Room types for the WebSocket data stream */ declare enum DatastreamRoom { LATEST = "latest", PRICE_BY_TOKEN = "price-by-token", PRICE_BY_POOL = "price", TOKEN_TRANSACTIONS = "transaction", WALLET_TRANSACTIONS = "wallet", GRADUATING = "graduating", GRADUATED = "graduated", CURVE_PERCENTAGE = "curve", METADATA = "metadata", HOLDERS = "holders", TOKEN_CHANGES = "token", POOL_CHANGES = "pool", SNIPERS = "sniper", INSIDERS = "insider", BUNDLERS = "bundlers", VOLUME_POOL = "volume:pool", VOLUME_TOKEN = "volume:token", PNL_WALLET = "pnl", PNL_WALLET_SUMMARY = "pnl:summary", DCA_JUPITER = "dca:jupiter", DCA_JUPITER_OPENED = "dca:jupiter:opened", DCA_JUPITER_FILLED = "dca:jupiter:filled", DCA_JUPITER_CLOSED = "dca:jupiter:closed", DCA_JUPITER_DEPOSIT = "dca:jupiter:deposit", DCA_JUPITER_WITHDRAW = "dca:jupiter:withdraw", DCA_JUPITER_COLLECTED_FEE = "dca:jupiter:collected_fee", DCA_JUPITER_POSITION = "dca:jupiter:position" } /** * Configuration for the Datastream client */ interface DatastreamConfig { /** * WebSocket URL for the data stream found on your Dashboard. */ wsUrl: string; /** * Whether to automatically reconnect on disconnect * @default true */ autoReconnect?: boolean; /** * Initial reconnect delay in milliseconds * @default 2500 */ reconnectDelay?: number; /** * Maximum reconnect delay in milliseconds * @default 4500 */ reconnectDelayMax?: number; /** * Randomization factor for reconnect delay * @default 0.5 */ randomizationFactor?: number; /** * Whether to run WebSocket connections in a Web Worker * @default false */ useWorker?: boolean; /** * Custom worker script URL (optional) * If not provided, will use inline worker */ workerUrl?: string; } interface SubscribeResponse { room: string; /** * Register a listener for this subscription * @param callback Function to handle incoming data * @returns Object with unsubscribe method */ on(callback: (data: T) => void): { unsubscribe: () => void; }; } /** * Token subscription methods interface */ interface TokenSubscriptionMethods { /** * Subscribe to all pool updates for this token (default) */ on(callback: (data: PoolUpdate) => void): { unsubscribe: () => void; }; room: string; /** * Subscribe to all pool updates for this token */ all(): SubscribeResponse; /** * Subscribe to primary pool updates for this token */ primary(): SubscribeResponse; /** * Subscribe to dev/creator related events for this token */ dev: DevSubscriptionMethods; /** * Subscribe to top 10 holders updates for this token */ top10(): SubscribeResponse; /** * Subscribe to platform and network fees for this token */ fees(): SubscribeResponse; } /** * Wallet balance subscription methods interface */ interface WalletBalanceSubscriptionMethods { /** * Subscribe to all balance updates for the wallet */ balance(): SubscribeResponse; /** * Subscribe to specific token balance updates for the wallet */ tokenBalance(tokenAddress: string): SubscribeResponse; } /** * Dev-related subscription methods interface */ interface DevSubscriptionMethods { /** * Subscribe to developer/creator holding updates for the token */ holding(): SubscribeResponse; } /** * Subscription methods for the Datastream client */ declare class SubscriptionMethods { private ds; price: PriceSubscriptions; tx: TransactionSubscriptions; liquidity: LiquiditySubscriptions; stats: StatsSubscriptions; volume: VolumeSubscriptions; pnl: PnlSubscriptions; dca: DcaSubscriptions; pm: PredictionMarketsSubscriptions; constructor(datastream: Datastream); /** * Subscribe to latest tokens and pools */ latest(): SubscribeResponse; /** * Subscribe to graduating tokens * @param marketCapThresholdSOL Optional market cap threshold in SOL */ graduating(marketCapThresholdSOL?: number): SubscribeResponse; /** * Subscribe to tokens reaching a specific curve percentage for a market * @param market The market type: 'launchpad', 'pumpfun', 'boop', or 'meteora-curve' * @param percentage The curve percentage threshold (e.g., 30, 50, 75) * @returns Subscription response with curve percentage updates */ curvePercentage(market: 'launchpad' | 'pumpfun' | 'boop' | 'meteora-curve', percentage: number): SubscribeResponse; /** * Subscribe to graduated tokens */ graduated(): SubscribeResponse; /** * Subscribe to token metadata updates * @param tokenAddress The token address */ metadata(tokenAddress: string): SubscribeResponse; /** * Subscribe to holder count updates for a token * @param tokenAddress The token address */ holders(tokenAddress: string): SubscribeResponse; /** * Subscribe to token-related events (all pools, primary pool, dev events, or top holders) * * @example * // For all pool updates: * datastream.subscribe.token('address').all().on(callback) * // Or using shorthand: * datastream.subscribe.token('address').on(callback) * * // For primary pool updates only: * datastream.subscribe.token('address').primary().on(callback) * * // For dev holding updates: * datastream.subscribe.token('address').dev.holding().on(callback) * * // For top 10 holders updates: * datastream.subscribe.token('address').top10().on(callback) * * @param tokenAddress The token address */ token(tokenAddress: string): TokenSubscriptionMethods; /** * Subscribe to pool changes * @param poolId The pool address */ pool(poolId: string): SubscribeResponse; /** * Subscribe to sniper updates for a token * @param tokenAddress The token address */ snipers(tokenAddress: string): SubscribeResponse; /** * Subscribe to insider updates for a token * @param tokenAddress The token address */ insiders(tokenAddress: string): SubscribeResponse; /** * Subscribe to bundler updates for a token * @param tokenAddress The token address */ bundlers(tokenAddress: string): SubscribeResponse; /** * Subscribe to wallet balance updates * * @example * // For all balance updates: * datastream.subscribe.wallet('address').balance().on(callback) * * // For specific token balance: * datastream.subscribe.wallet('address').tokenBalance('token').on(callback) * * @param walletAddress The wallet address */ wallet(walletAddress: string): WalletBalanceSubscriptionMethods; } /** * Stats-related subscription methods */ declare class StatsSubscriptions { private ds; total: StatsTotalSubscriptions; constructor(datastream: Datastream); /** * Subscribe to live stats updates for a token across all timeframes * @param tokenAddress The token address * @returns Subscription response with stats updates */ token(tokenAddress: string): SubscribeResponse; /** * Subscribe to live stats updates for a specific pool across all timeframes * @param poolId The pool address * @returns Subscription response with stats updates */ pool(poolId: string): SubscribeResponse; } /** * Total stats room subscription methods */ declare class StatsTotalSubscriptions { private ds; constructor(datastream: Datastream); /** * Subscribe to total stats updates for a token * Room: stats:token:{tokenAddress}:total * * Note: this room emits the stats object directly. */ token(tokenAddress: string): SubscribeResponse; /** * Subscribe to total stats updates for a pool * Room: stats:pool:{poolId}:total * * Note: this room emits the stats object directly. */ pool(poolId: string): SubscribeResponse; } /** * Volume-related subscription methods */ declare class VolumeSubscriptions { private ds; constructor(datastream: Datastream); /** * Subscribe to USD volume aggregated per pool (flushed every ~50ms) * Room: volume:pool:{poolAddress} */ pool(poolAddress: string): SubscribeResponse; /** * Subscribe to USD volume aggregated per token (cross-pool deduplicated, flushed every ~50ms) * Room: volume:token:{tokenAddress} */ token(tokenAddress: string): SubscribeResponse; } /** * PnL-related subscription methods */ declare class PnlSubscriptions { private ds; constructor(datastream: Datastream); /** * Subscribe to trade and balance updates for a specific wallet+token position * Room: pnl:{walletAddress}:{tokenAddress} */ position(walletAddress: string, tokenAddress: string): SubscribeResponse; /** * Subscribe to trade and balance updates for all token positions in a wallet * Room: pnl:{walletAddress} */ wallet(walletAddress: string): SubscribeResponse; /** * Subscribe to aggregated wallet summary updates * Room: pnl:{walletAddress}:summary */ summary(walletAddress: string): SubscribeResponse; } /** * Jupiter DCA (recurring orders) subscription methods. * * Each DCA event is delivered to the global room (`dca:jupiter`), the matching * event-type room (e.g. `dca:jupiter:filled`), and any scoped rooms that apply * (token buyers/sellers, wallet, or specific DCA address). */ declare class DcaSubscriptions { private ds; constructor(datastream: Datastream); /** All Jupiter DCA events (transactions and position snapshots). */ all(): SubscribeResponse; /** New DCA opened events. */ opened(): SubscribeResponse; /** Cycle fill events. */ filled(): SubscribeResponse; /** DCA closed events. */ closed(): SubscribeResponse; /** Deposit events. */ deposit(): SubscribeResponse; /** Withdraw events. */ withdraw(): SubscribeResponse; /** Fee collection events. */ collectedFee(): SubscribeResponse; /** Live DCA account snapshots (no transaction signature). */ position(): SubscribeResponse; /** * All DCA events for a given token (input or output). * Returns helpers `.buyers()` and `.sellers()` to scope to direction. */ token(mint: string): { buyers(): SubscribeResponse; sellers(): SubscribeResponse; }; /** All DCA events for a wallet owner. */ wallet(walletAddress: string): SubscribeResponse; /** All DCA events for a specific DCA account address. */ order(dcaAddress: string): SubscribeResponse; } /** * Prediction Markets (`pm:*`) subscription helpers. * * Room segments are lowercased. Polymarket market rooms require decimal CLOB token IDs. * Delivery is at-least-once — deduplicate with `sourceId` or `tradeId`. */ declare class PredictionMarketsSubscriptions { private ds; constructor(datastream: Datastream); /** Every non-market-state realtime event (`pm:all`). */ all(): SubscribeResponse; /** Full trade tape across Kalshi and Polymarket (`pm:trades`). */ trades(): SubscribeResponse; /** Trades with notionalUsd ≥ $25 (`pm:trades:significant`). */ significantTrades(): SubscribeResponse; /** Global market lifecycle events (`pm:market_lifecycle`). */ marketLifecycle(): SubscribeResponse; /** Global resolution events (`pm:resolution`). */ resolution(): SubscribeResponse; /** Exchange-scoped non-state feed (`pm:{exchange}`). */ exchange(exchange: PmExchange): { /** `pm:{exchange}` */ all(): SubscribeResponse; /** `pm:{exchange}:trades` */ trades(): SubscribeResponse; /** `pm:{exchange}:market_lifecycle` */ marketLifecycle(): SubscribeResponse; /** `pm:{exchange}:resolution` */ resolution(): SubscribeResponse; /** `pm:{exchange}:type:{eventType}` */ type(eventType: string): SubscribeResponse; }; /** Market-scoped rooms (`pm:market:{exchange}:{marketId}[:channel]`). */ market(exchange: PmExchange, marketId: string): { all(): SubscribeResponse; trades(): SubscribeResponse; prices(): SubscribeResponse; quotes(): SubscribeResponse; orderbook(): SubscribeResponse; volume(): SubscribeResponse; marketLifecycle(): SubscribeResponse; resolution(): SubscribeResponse; }; /** Event-scoped rooms (`pm:event:{exchange}:{eventId}[:trades|:volume]`). */ event(exchange: PmExchange, eventId: string): { all(): SubscribeResponse; trades(): SubscribeResponse; volume(): SubscribeResponse; }; /** Events of one type across exchanges (`pm:type:{eventType}`). */ type(eventType: string): SubscribeResponse; /** Category-scoped feed (`pm:category:{category}`). */ category(category: string): SubscribeResponse; /** Series-scoped feed (`pm:series:{exchange}:{seriesId}`). */ series(exchange: PmExchange, seriesId: string): SubscribeResponse; /** Status-scoped lifecycle feed (`pm:status:{status}`). */ status(status: string): SubscribeResponse; /** Sport-scoped feed (`pm:sport:{sport}`). */ sport(sport: string): SubscribeResponse; /** Crypto underlying rooms (`pm:crypto:{asset}` / `:prices`). */ crypto(asset: string): { all(): SubscribeResponse; prices(): SubscribeResponse; }; } declare class PriceSubscriptions { private ds; constructor(datastream: Datastream); /** * Subscribe to aggregated price updates for a token across all pools * Provides median, average, min, max prices and top pools by liquidity * @param tokenAddress The token address */ aggregated(tokenAddress: string): SubscribeResponse; /** * @deprecated Use aggregated() instead for better price data across all pools * Subscribe to price updates for a token's primary/largest pool * @param tokenAddress The token address */ token(tokenAddress: string): SubscribeResponse; /** * Subscribe to all price updates for a token across all pools * @param tokenAddress The token address */ allPoolsForToken(tokenAddress: string): SubscribeResponse; /** * Subscribe to price updates for a specific pool * @param poolId The pool address */ pool(poolId: string): SubscribeResponse; } /** * Wallet transaction subscription methods interface (under .tx namespace) */ interface WalletTransactionSubscriptionMethods { /** * Subscribe to wallet transactions (default) */ on(callback: (data: T) => void): { unsubscribe: () => void; }; room: string; /** * Explicitly subscribe to wallet transactions */ transactions(): SubscribeResponse; /** * @deprecated Use datastream.subscribe.wallet('address').balance() instead * This method will be removed in a future version */ balance(): SubscribeResponse; /** * @deprecated Use datastream.subscribe.wallet('address').tokenBalance('token') instead * This method will be removed in a future version */ tokenBalance(tokenAddress: string): SubscribeResponse; } /** Live LP events. Multiple actions may share a signature, pool and wallet. */ declare class LiquiditySubscriptions { private ds; constructor(ds: Datastream); token(mint: string, options?: EnrichedStreamOptions): SubscribeResponse; tokenPool(mint: string, pool: string, options?: EnrichedStreamOptions): SubscribeResponse; tokenPoolWallet(mint: string, pool: string, wallet: string, options?: EnrichedStreamOptions): SubscribeResponse; pool(pool: string, options?: EnrichedStreamOptions): SubscribeResponse; wallet(wallet: string, options?: EnrichedStreamOptions): SubscribeResponse; } /** * Transaction-related subscription methods */ declare class TransactionSubscriptions { private ds; constructor(datastream: Datastream); /** * Subscribe to transactions for a token across all pools * @param tokenAddress The token address */ token(tokenAddress: string, options: EnrichedStreamOptions | undefined): SubscribeResponse; token(tokenAddress: string): SubscribeResponse; /** * Subscribe to transactions for a specific token and pool * @param tokenAddress The token address * @param poolId The pool address */ pool(tokenAddress: string, poolId: string, options: EnrichedStreamOptions | undefined): SubscribeResponse; pool(tokenAddress: string, poolId: string): SubscribeResponse; /** * Subscribe to transactions for a specific token, pool, and wallet * Room: `transaction:{tokenAddress}:{poolId}:{walletAddress}` */ poolWallet(tokenAddress: string, poolId: string, walletAddress: string, options: EnrichedStreamOptions | undefined): SubscribeResponse; poolWallet(tokenAddress: string, poolId: string, walletAddress: string): SubscribeResponse; /** * Subscribe to cumulative high-volume (whale) trades. * A trade is published to every room whose tier it meets. * @param minVolume USD threshold: `1000` | `2500` | `5000` | `10000` */ whale(minVolume: WhaleMinVolume | undefined, options: EnrichedStreamOptions): SubscribeResponse; whale(minVolume?: WhaleMinVolume): SubscribeResponse; /** * Subscribe to all KOL roster trades (no $1k floor). * Optional volume tier rooms use the same cumulative thresholds as whale rooms. */ kol(minVolume: WhaleMinVolume | undefined, options: EnrichedStreamOptions): SubscribeResponse; kol(minVolume?: WhaleMinVolume): SubscribeResponse; /** * Subscribe to wallet transactions * * @example * // Subscribe to wallet transactions (default): * datastream.subscribe.tx.wallet('address').on(callback) * * // Subscribe to wallet transactions (explicit): * datastream.subscribe.tx.wallet('address').transactions().on(callback) * * @param walletAddress The wallet address */ wallet(walletAddress: string, options: EnrichedStreamOptions | undefined): WalletTransactionSubscriptionMethods; wallet(walletAddress: string): WalletTransactionSubscriptionMethods; } /** * WebSocket service for real-time data streaming from Solana Tracker */ declare class Datastream extends EventEmitter { subscribe: SubscriptionMethods; private wsUrl; private socket; private transactionSocket; private reconnectAttempts; private reconnectDelay; private reconnectDelayMax; private randomizationFactor; private subscribedRooms; private transactions; private autoReconnect; private isConnecting; private useWorker; private worker; private workerUrl?; /** * Creates a new Datastream client for real-time Solana Tracker data * @param config Configuration options */ constructor(config: DatastreamConfig); /** * Connects to the WebSocket server * @returns Promise that resolves when connected */ connect(): Promise; /** * Connects using Web Worker * @returns Promise that resolves when connected */ private connectWithWorker; /** * Sets up worker event listeners */ private setupWorkerListeners; /** * Deduplicate transaction payloads (object or single-item / multi-item arrays). * Returns `undefined` when every item was already seen. */ private dedupeTransactionPayload; /** * Handles messages from worker */ private handleWorkerMessage; private getWorkerCode; /** * Creates a WebSocket connection * @param type Socket type ('main' or 'transaction') * @returns Promise that resolves when connected */ private createSocket; /** * Sets up WebSocket event listeners * @param socket The WebSocket connection * @param type Socket type ('main' or 'transaction') */ private setupSocketListeners; /** * Disconnects from the WebSocket server */ disconnect(): void; /** * Handles reconnection to the WebSocket server */ private reconnect; /** * Subscribes to a data room * @param room The room name to join * @returns Response with room name and on() method for listening * @internal Used by SubscriptionMethods */ _subscribe(room: string): SubscribeResponse; on(event: string | symbol, listener: (...args: any[]) => void): this; once(event: string | symbol, listener: (...args: any[]) => void): this; off(event: string | symbol, listener: (...args: any[]) => void): this; removeListener(event: string | symbol, listener: (...args: any[]) => void): this; removeAllListeners(event?: string | symbol): this; listeners(event: string | symbol): Function[]; /** * Unsubscribes from a data room * @param room The room name to leave * @returns Reference to this instance for chaining */ unsubscribe(room: string): Datastream; /** * Resubscribes to all previously subscribed rooms after reconnection */ private resubscribeToRooms; /** * Get the current connection status * @returns True if connected, false otherwise */ isConnected(): boolean; } interface TokenDetailWebsocket { token: TokenInfo; pools: PoolInfo[]; events: TokenEvents; risk: TokenRisk; } interface CurvePercentageUpdate { token: TokenInfo; pools: PoolInfo[]; events: TokenEvents; risk: TokenRisk; } interface TokenTransaction { tx: string; amount: number; priceUsd: number; volume: number; solVolume: number; type: 'buy' | 'sell'; wallet: string; time: number; program: string; token: { from: { name: string; symbol: string; image?: string; decimals: number; amount: number; address: string; price?: { usd: number; }; marketCap?: { usd: number; }; [key: string]: any; }; to: { name: string; symbol: string; image?: string; decimals: number; amount: number; address: string; price?: { usd: number; }; marketCap?: { usd: number; }; [key: string]: any; }; }; } /** Opt-in identity payload, preserving the legacy TokenTransaction key set. */ interface EnrichedTokenTransaction extends TokenTransaction { identity?: PnlV2Identity | null; identityStatus?: 'partial'; } /** Token side on whale/KOL rooms, where metadata can be absent or null. */ interface WhaleKolTransactionTokenSide { name?: string | null; symbol?: string | null; image?: string | null; decimals?: number; amount: number; address: string; price?: { usd: number | null; }; marketCap?: { usd: number | null; }; [key: string]: any; } /** * Exact whale/KOL Datastream payload. Kept separate so the legacy * `TokenTransaction` contract remains source-compatible with 0.3.x. */ interface WhaleKolTransaction extends Omit { priceUsd: number | null; identity?: TradeIdentity; token: { from: WhaleKolTransactionTokenSide; to: WhaleKolTransactionTokenSide; }; } /** The opt-in :enriched whale/KOL payload can have a null or richer identity. */ interface EnrichedWhaleKolTransaction extends Omit { identity?: PnlV2Identity | null; identityStatus?: 'partial'; } interface PriceUpdate { price: number; price_quote: number; pool: string; token: string; time: number; } interface LaunchpadLiquidity { amount: number; usd: number; } interface Launchpad { name: string; url: string; logo: string; baseLiquidity: LaunchpadLiquidity; quoteLiquidity: LaunchpadLiquidity; } interface MeteoraCurveLiquidity { base?: number; quote?: number; usd: number; } interface MeteoraCurve { baseLiquidity: MeteoraCurveLiquidity; quoteLiquidity: MeteoraCurveLiquidity; fee: number; name?: string; url?: string; logo?: string; } interface PoolUpdate { liquidity: { quote: number; usd: number; }; price: { quote: number; usd: number; }; tokenSupply: number; lpBurn: number; tokenAddress: string; marketCap: { quote: number; usd: number; }; decimals: number; security: { freezeAuthority: string | null; mintAuthority: string | null; }; quoteToken: string; market: string; deployer?: string; lastUpdated: number; createdAt?: number; poolId: string; curvePercentage?: number; curve?: string; txns?: { buys: number; total: number; volume: number; sells: number; volume24h: number; }; bundleId?: string; launchpad?: Launchpad; meteoraCurve?: MeteoraCurve; raydium?: { baseLiquidity: number; quoteLiquidity: number; }; heaven?: { baseLiquidity: number; quoteLiquidity: number; is_migrated: boolean; migrationTime?: number; }; } interface HolderUpdate { total: number; } /** Opt-in identity payload, preserving the legacy WalletTransaction key set. */ interface EnrichedWalletTransaction extends WalletTransaction { identity?: PnlV2Identity | null; identityStatus?: 'partial'; } interface WalletTransaction { tx: string; type: 'buy' | 'sell'; wallet: string; time: number; price: { quote: number; usd: number; }; volume: { usd: number; sol: number; }; program: string; pools: string[]; from: { address: string; amount: number; token: { name: string; symbol: string; image?: string; decimals: number; amount: number; address: string; price?: { usd: number; }; marketCap?: { usd: number; }; [key: string]: any; }; }; to: { address: string; amount: number; token: { name: string; symbol: string; image?: string; decimals: number; amount: number; address: string; price?: { usd: number; }; marketCap?: { usd: number; }; [key: string]: any; }; }; } interface TokenMetadata { name: string; symbol: string; mint: string; uri?: string; decimals: number; hasFileMetaData?: boolean; createdOn?: string; description?: string; image?: string; showName?: boolean; twitter?: string; telegram?: string; website?: string; strictSocials?: { twitter?: string; telegram?: string; website?: string; }; } interface SniperInsiderUpdate { wallet: string; amount: string; tokenAmount: number; percentage: number; previousAmount: number; previousPercentage: number; totalSniperPercentage: number; totalInsiderPercentage: number; } interface DevHoldingUpdate { token: string; creator: string; amount: string; percentage: number; previousPercentage: number; timestamp: number; } /** * Individual holder information in top 10 */ interface TopHolder { address: string; amount: string; percentage: number; } /** * Top 10 holders update data */ interface Top10HoldersUpdate { token: string; holders: TopHolder[]; totalPercentage: number; previousPercentage: number | null; timestamp: number; } interface Fees { photon?: number; bloom?: number; bullx?: number; axiom?: number; vector?: number; jito?: number; '0slot'?: number; 'helius-sender'?: number; nextblock?: number; trojan?: number; soltradingbot?: number; maestro?: number; padre?: number; network?: number; totalTrading: number; totalTips: number; total: number; [key: string]: number | undefined; } interface TransactionFees { photon?: number; bloom?: number; bullx?: number; axiom?: number; vector?: number; jito?: number; '0slot'?: number; 'helius-sender'?: number; nextblock?: number; trojan?: number; soltradingbot?: number; maestro?: number; padre?: number; network?: number; [key: string]: number | undefined; } interface FeesUpdate { total: Fees; fees: TransactionFees; tx: string; time: number; } interface AggregatedPriceUpdate { token: string; timestamp: number; price: number; pool: string; aggregated: { median: number; average: number; min: number; max: number; poolCount: number; }; topPools: Array<{ poolId: string; price: number; liquidity: number; market: string; }>; } interface VolumePoolUpdate { pool: string; token: string; volume: number; txCount: number; timestamp: number; } interface VolumeTokenUpdate { token: string; volume: number; txCount: number; timestamp: number; } /** * Real-time bundler wallet update data */ interface BundlerUpdate { /** Bundler wallet address */ wallet: string; /** Raw token amount as string */ amount: string; /** Current token amount held */ tokenAmount: number; /** Previous token amount held */ previousAmount: number; /** Amount bought by this bundler */ boughtAmount: number; /** Percentage of supply bought by this bundler */ boughtPercentage: number; /** Current percentage of total supply */ percentage: number; /** Previous percentage of total supply */ previousPercentage: number; /** Total percentage held by all bundlers for this token */ totalBundlerPercentage: number; } interface PnlTradeUpdate { type: 'tradeUpdate'; wallet: string; token: string; averageBuyAmountUsd: number | null; averageSellAmountUsd: number | null; avgCostPerToken: number | null; buyCount: number; currentBalance: number | null; currentPrice: number | null; currentValue: number | null; firstBuyTime: number | null; firstTradeTime: number | null; holdingCostBasis: number | null; lastBuyTime: number | null; lastTradeTime: number | null; proceeds: number | null; realizedPnl: number | null; sellCount: number; soldCostBasis: number | null; totalBought: number | null; totalBuyUsd: number | null; totalSellUsd: number | null; totalSold: number | null; totalTransactions: number; unrealizedPnl: number | null; } interface PnlBalanceUpdate { type: 'balanceUpdate'; wallet: string; token: string; avgCostPerToken: number | null; currentBalance: number | null; currentPrice: number | null; currentValue: number | null; holdingCostBasis: number | null; unrealizedPnl: number | null; } interface PnlPriceUpdate { type: 'priceUpdate'; wallet: string; token: string; currentBalance: number | null; currentPrice: number | null; currentValue: number | null; holdingCostBasis: number | null; unrealizedPnl: number | null; } type PnlPositionUpdate = PnlTradeUpdate | PnlBalanceUpdate | PnlPriceUpdate; interface PnlWalletPosition { token: string; avgCostPerToken: number | null; currentBalance: number | null; currentPrice: number | null; currentValue: number | null; holdingCostBasis: number | null; unrealizedPnl: number | null; } interface PnlWalletUpdate { averages: { buy: number | null; sell: number | null; }; counts: { buys: number; sells: number; tokensHeldEver: number; tokensTraded: number; trades: number; }; invested: number | null; openPositions: { cost: number | null; value: number | null; }; pnl: { realized: number | null; total: number | null; unrealized: number | null; }; proceeds: number | null; roi: number | null; timing: { firstTrade: number | null; lastTrade: number | null; }; } /** * Prediction Markets REST types — aligned with prediction-markets/openapi.json (Beta). * Response bodies use camelCase; query parameters generally use snake_case on the wire. */ /** Lifecycle phase for a crypto up/down window. */ type CryptoUpDownPhase = "upcoming" | "live" | "determining" | "resolved"; type Exchange = "polymarket" | "kalshi"; type MarketKind = "binary" | "categorical" | "combo"; type MarketLegSide = "yes" | "no"; type MarketStatus = "active" | "closed_pending_resolution" | "resolved" | "inactive"; type PositionStatus = "active" | "closed" | "closed_pending_resolution" | "resolved_won" | "resolved_lost" | "resolved" | "redeemed"; type PricingMode = "orderbook" | "rfq"; /** Standard API error response envelope. */ interface ApiErrorBody { /** HTTP status code (duplicated for convenience). */ code: number; error: string; /** Stable machine-readable code: RATE_LIMITED, SERVICE_BUSY, BAD_REQUEST, NOT_FOUND, INTERNAL. */ errorCode?: string | null; } /** OHLCV series for one market in a batch candlesticks response. */ interface BatchCandlestickSeries { data: Array; exchange: Exchange; ticker: string; } /** Batch candlesticks response. */ interface BatchCandlesticksResponse { series: Array; } /** Single entry in a batch event lookup. */ interface BatchEventResult { event?: UnifiedEvent | null; requestedId: string; } /** Batch event lookup response. */ interface BatchEventsResponse { notFound: Array; results: Array; } /** Single entry in a batch market lookup (1:1 with requested id). */ interface BatchMarketResult { market?: UnifiedMarket | null; requestedId: string; } interface BatchMarketsBody { exchange?: string | null; /** Market ids (max 100). Meaning depends on `lookup_by` / exchange defaults. */ ids: Array; /** Lookup strategy: `asset_id`, `condition_id`, `ticker`, or `slug`. */ lookupBy?: string | null; } /** Batch market lookup response with per-id mapping. */ interface BatchMarketsResponse { notFound: Array; results: Array; } /** Browse hub bootstrap response. */ interface BrowseHubResponse { categories: Array; exchangeStatus: Record; recentTrades: TradesEnrichedResponse; stats: CombinedStats; trending: PaginatedMarkets; } /** A single OHLCV candlestick bar. */ interface Candlestick { close: number; exchange: string; high: number; low: number; open: number; periodInterval: string; ticker: string; /** Start of the candle period (ISO-8601 or unix seconds). */ timestamp: string; tradeCount: number; volume: number; } /** A market category (derived from exchange data). */ interface Category { /** Source exchange for this category grouping. */ exchange: Exchange; /** Category icon URL when available (Kalshi structured icon / Polymarket event icon). */ icon?: string | null; /** Representative image URL (often a high-volume event image in the category). */ image?: string | null; /** Number of markets in this category. */ marketCount: number; /** Category slug/name (e.g., "PRES", "KXBTC", "crypto", "politics"). */ slug: string; /** Total volume across all markets in this category. */ totalVolume: number; } /** Combined platform statistics across exchanges. */ interface CombinedStats { kalshi: PlatformStats; polymarket: PlatformStats; totalMarkets: number; totalTrades: number; totalVolumeUsd: number; volume24hUsd: number; } interface ComboMarketGroup { id: string; label: string; lines: Array; period?: string | null; section: string; } interface ComboMarketLine { line?: number | null; marketId: string; marketType: string; selections: Array; status: string; title: string; } interface ComboSelection { label: string; outcomeIndex: number; price: number; selectable: boolean; tokenId?: string | null; } /** Bundled crypto page payload for one event. */ interface CryptoEventResponse { crypto: CryptoUpDown; eventId: string; history?: Array; price?: CryptoPriceSnapshot | null; slug?: string | null; windows?: Array; } /** One underlying-price point for the window chart. */ interface CryptoPricePoint { /** Unix epoch milliseconds. */ timestamp: number; value: number; } /** Open/close oracle snapshot from Polymarket `/api/crypto/crypto-price`. */ interface CryptoPriceSnapshot { cached?: boolean; closePrice?: number | null; completed: boolean; incomplete: boolean; openPrice?: number | null; timestamp?: number | null; } /** Sibling window in the same crypto series (for the interval strip). */ interface CryptoSeriesWindow { closed: boolean; eventId: string; finalPrice?: number | null; percentChange?: number | null; priceToBeat?: number | null; /** `up` / `down` when resolved. */ result?: string | null; slug: string; title: string; url?: string | null; windowEnd?: string | null; windowStart?: string | null; } /** Wallet performance aggregated across supported Polymarket crypto events. */ interface CryptoTrader { address: string; buyCount: number; buyVolumeUsd: number; /** Mark-to-market P&L: sale proceeds + current positions − buys − fees. */ estimatedPnlUsd: number; exchange: Exchange; lastTradeAt?: string | null; marketsTraded: number; rank: number; returnPct: number; sellCount: number; sellVolumeUsd: number; totalTrades: number; totalVolumeUsd: number; username?: string | null; } /** Typed crypto up/down metadata attached to matching Polymarket events. */ interface CryptoUpDown { /** Asset key (btc, eth, …). */ asset: string; /** Closing / final oracle price when known. */ finalPrice?: number | null; /** Human interval (`5m`, `15m`, `1h`, `4h`, `1d`). */ interval: string; /** Derived UI phase. */ phase: CryptoUpDownPhase; /** Opening reference price ("Price to Beat"). */ priceToBeat?: number | null; /** Resolution source URL (typically Chainlink). */ resolutionSource?: string | null; /** Resolved direction when known (`up` / `down`). */ result?: string | null; /** Gamma series slug (`btc-up-or-down-5m`). */ seriesSlug?: string | null; /** Series display title (`BTC Up or Down 5m`). */ seriesTitle?: string | null; /** Chainlink / Polymarket symbol (BTC, ETH, …). */ symbol: string; /** Polymarket crypto API variant (`fiveminute`, `hourly`, …). */ variant: string; /** Window close (ISO-8601). */ windowEnd?: string | null; /** Window open (ISO-8601). Price to Beat is the oracle price at this instant. */ windowStart?: string | null; } /** Provenance for market-data responses. */ interface DataProvenance { /** True when the value is derived/estimated rather than authoritative. */ estimated: boolean; /** Local index timestamp when known. */ indexedAt?: string | null; /** Serving source: `indexed`, `upstream`, `unavailable`. */ source: string; /** Upstream/source event timestamp when known. */ sourceUpdatedAt?: string | null; /** True when the payload is older than the freshness SLO. */ stale: boolean; /** Why the payload is missing or incomplete. */ unavailableReason?: string | null; } /** One market's candle series within a grouped Polymarket event. */ interface EventCandlestickSeries { /** OHLCV bars for this market's primary Yes outcome. */ candles: Array; /** Polymarket Gamma numeric market id. */ gammaMarketId?: string | null; /** Short label within the parent event (e.g. "USA", "France"). */ groupItemTitle?: string | null; /** Polymarket condition_id or internal market id used for chart queries. */ marketId: string; /** Market status: "active", "closed", or "inactive". */ status: string; /** Full market question/title. */ title: string; } /** Multi-series OHLCV for a Polymarket grouped event (e.g. World Cup Winner options). */ interface EventCandlesticksResponse { /** Polymarket Gamma event id (numeric string). */ eventId: string; /** URL slug for the parent event. */ eventSlug?: string | null; exchange: Exchange; nextCursor?: string | null; /** Candle period: 1m, 1h, or 1d. */ periodInterval: string; /** One series per market in the group. */ series: Array; /** Parent event title. */ title: string; } /** PnL rolled up by Gamma event for a wallet. */ interface EventPnlSummary { eventId: string; eventSlug?: string | null; eventTitle?: string | null; marketsTraded: number; openPositions: number; positions: Array; realizedPnlUsd: number; totalPnlUsd: number; unrealizedPnlUsd: number; } /** Lightweight event summary embedded on trade feeds. */ interface EventSummary { category?: string | null; id: string; image?: string | null; slug?: string | null; title: string; } interface ExchangeStatusResponse { exchangeActive: boolean; exchanges: Array; tradingActive: boolean; } /** Unified typeahead search across markets, events, and Polymarket traders. */ interface GlobalSearchResponse { /** Ranked event matches (no nested markets). */ events: Array; /** Ranked market matches. */ markets: Array; /** Normalized search query. */ query: string; /** Ranked Polymarket trader matches (Kalshi has no public wallet identities). */ traders?: Array; } /** A single holder/trader with position size. */ interface HolderResponse { /** Wallet address. */ address: string; /** Total buy volume (USD). */ buyVolumeUsd: number; /** Net token position (positive = long). */ netTokens: number; /** Total sell volume (USD). */ sellVolumeUsd: number; /** Number of trades. */ tradeCount: number; } /** Real-time market snapshot (current bid/ask/last price). */ type LiveMarketData = DataProvenance & { /** Current best ask price (0.0–1.0). */ ask?: number | null; /** Current best bid price (0.0–1.0). */ bid?: number | null; /** Source exchange. */ exchange: Exchange; /** Last trade price (0.0–1.0). */ lastPrice?: number | null; /** Available liquidity (if known). */ liquidity?: number | null; /** Market identifier. */ marketId: string; /** Open interest (if known). */ openInterest?: number | null; /** Market status. */ status: string; /** ISO-8601 snapshot timestamp. */ timestamp: string; /** Total volume. */ volume: number; }; interface MarketLeg { eventDate?: string | null; /** Exclusion/conflict group for mutually exclusive legs. */ exclusionGroup?: string | null; label: string; /** Per-leg lifecycle: open, suspended, settled, void. */ lifecycleStatus?: string | null; /** Official exchange leg/position identifier when available. */ officialLegId?: string | null; /** Exchange-native position/outcome id for this leg. */ positionId?: string | null; side: MarketLegSide; sport?: string | null; underlyingMarketId?: string | null; underlyingTitle?: string | null; } /** Size-aware fill quote from walking the live orderbook (VWAP). */ type MarketQuoteResponse = DataProvenance & { /** Volume-weighted average fill price (0–1). */ avgPrice?: number | null; bestAsk?: number | null; bestBid?: number | null; /** USD notional filled (`filledSize * avgPrice` when fully in shares). */ cost: number; /** Polymarket UI chance (mid vs last-trade rule). */ displayPrice?: number | null; exchange: Exchange; /** Shares filled. */ filledSize: number; fullyFilled: boolean; levelsConsumed: number; marketId: string; midpoint?: number | null; requestedSize: number; /** `buy` walks asks; `sell` walks bids. */ side: string; /** `shares` or `usd`. */ sizeUnit: string; timestamp: string; /** CLOB token / outcome id used for the book walk when applicable. */ tokenId?: string | null; unfilledSize: number; /** Worst (farthest) price touched while filling. */ worstPrice?: number | null; }; /** Bundled market detail for the market detail page. */ interface MarketSnapshotResponse { market: UnifiedMarket; midpoint?: MidpointResponse | null; openInterest?: OpenInterestResponse | null; orderbook?: OrderbookSnapshot | null; price?: PriceSnapshot | null; recentTrades?: PaginatedTrades | null; related?: Array | null; spread?: SpreadResponse | null; } /** Aggregate trade stats for a market (used when individual trader data is unavailable, e.g. Kalshi). */ interface MarketTradeSummary { /** Source exchange. */ exchange: Exchange; /** Market identifier. */ marketId: string; /** Contracts traded on the "no" / sell side. */ noContracts: number; /** Note: individual trader data unavailable for this exchange. */ note?: string | null; /** Total contracts/tokens traded. */ totalContracts: number; /** Total trades executed. */ totalTrades: number; /** Contracts traded on the "yes" / buy side. */ yesContracts: number; } /** A single trader's aggregated activity on a market. */ interface MarketTrader { /** Trader wallet address. */ address: string; /** Number of buy trades. */ buyCount: number; /** Total volume bought (USD). */ buyVolumeUsd: number; /** Source exchange. */ exchange: Exchange; /** Current marked value of this trader's outcome tokens for the market. */ positionValueUsd: number; /** FIFO profit/loss already locked in by sales or settlement on this market. */ realizedPnlUsd: number; /** Total market P&L divided by lifetime buy cost, as a percentage. */ returnPct: number; /** Number of sell trades. */ sellCount: number; /** Total volume sold (USD). */ sellVolumeUsd: number; /** Realized plus unrealized market-specific profit/loss. */ totalPnlUsd: number; /** Total trade count. */ totalTrades: number; /** Combined buy + sell volume (USD). */ totalVolumeUsd: number; /** Mark-to-market profit/loss for currently held outcome tokens on this market. */ unrealizedPnlUsd: number; /** Public Polymarket @username, when the trader has one. */ username?: string | null; } /** Midpoint price for a market. */ type MidpointResponse = DataProvenance & { exchange: Exchange; marketId: string; midpoint?: number | null; timestamp: string; }; /** Aggregated open interest for a market. */ type OpenInterestResponse = DataProvenance & { exchange: Exchange; marketId: string; /** Authoritative open interest when the exchange publishes it. */ openInterest?: number | null; /** Total number of trades (activity proxy, not OI). */ totalTrades: number; /** Total token volume traded (activity proxy, not OI). */ totalVolumeTokens: number; /** Unique addresses that have traded this market (activity proxy, not OI). */ uniqueHolders: number; }; /** Orderbook snapshot for a market. */ type OrderbookSnapshot = DataProvenance & { /** Best ask levels. */ asks: Array; /** Best bid levels. */ bids: Array; /** Source exchange. */ exchange: Exchange; /** Market identifier. */ marketId: string; /** Mid-price: (best_bid + best_ask) / 2. */ midpoint?: number | null; /** Spread: best ask - best bid. */ spread?: number | null; /** ISO-8601 timestamp of the snapshot. */ timestamp: string; }; interface PaginatedCandlesticks { count: number; cursor?: string | null; data: Array; hasMore: boolean; } interface PaginatedCryptoTraders { count: number; cursor?: string | null; data: Array; hasMore: boolean; } interface PaginatedEvents { count: number; cursor?: string | null; data: Array; hasMore: boolean; } interface PaginatedMarketTraders { count: number; cursor?: string | null; data: Array; hasMore: boolean; } interface PaginatedMarkets { count: number; cursor?: string | null; data: Array; hasMore: boolean; } interface PaginatedPnlLeaderboard { count: number; cursor?: string | null; data: Array; hasMore: boolean; } interface PaginatedSeries { count: number; cursor?: string | null; data: Array; hasMore: boolean; } interface PaginatedTraders { count: number; cursor?: string | null; data: Array; hasMore: boolean; } interface PaginatedTrades { count: number; cursor?: string | null; data: Array; hasMore: boolean; } interface PaginatedWalletPositions { count: number; cursor?: string | null; data: Array; hasMore: boolean; } interface PlatformStats { activeMarkets: number; exchange: Exchange; totalMarkets: number; totalTrades: number; totalVolumeUsd: number; uniqueTraders: number; volume24hUsd: number; } /** Leaderboard row for top wallet PnL. */ interface PnlLeaderboardEntry { address: string; exchange: Exchange; lastTradeAt?: string | null; marketsTraded: number; openPositions: number; rank: number; realizedPnlUsd: number; totalPnlUsd: number; totalVolumeUsd: number; unrealizedPnlUsd: number; username?: string | null; } /** Total portfolio value for a wallet. */ interface PortfolioValueResponse { address: string; /** Spendable Polymarket collateral balance (pUSD + USDC.e) in the wallet. */ cashBalanceUsd?: number; exchange: Exchange; /** Backward-compatible name for the authoritative active-position count. */ openPositionCount: number; /** Mark-to-market value of open / redeemable outcome tokens only. */ positionsValueUsd?: number; /** ISO-8601 timestamp. */ timestamp: string; /** Positions mark value + spendable collateral (pUSD / USDC.e). */ totalValueUsd: number; } /** A single price level in an orderbook. */ interface PriceLevel { /** Price (0.0–1.0 probability). */ price: number; /** Quantity available at this price. */ size: number; } /** Current price snapshot for a market. */ type PriceSnapshot = DataProvenance & { /** Best ask price. */ ask?: number | null; /** Best bid price. */ bid?: number | null; /** 24h price change as decimal (-0.05 = -5%). */ change24h?: number | null; exchange: Exchange; /** Last traded price. */ lastTradePrice?: number | null; marketId: string; /** Display price (0.0–1.0). For Polymarket this is the UI chance: mid when spread ≤ 10¢, else last trade. */ price?: number | null; /** ISO-8601 timestamp. */ timestamp: string; /** 24h volume. */ volume24h?: number | null; }; /** Markets matched across exchanges for the same real-world event. */ interface RelatedMarkets { /** Category of the matched event. */ category?: string | null; /** The matched markets from different exchanges. */ markets: Array; /** Descriptive title for the matched group. */ title: string; } /** A series groups related markets together (similar to Kalshi events). */ interface SeriesInfo { /** Source exchange. */ exchange: Exchange; /** Number of markets in this series. */ marketCount: number; /** Sample market title for context. */ sampleTitle: string; /** Series slug identifier. */ slug: string; /** Total volume across all markets. */ totalVolume: number; } /** A sport category from Polymarket. */ interface SportInfo { /** Source exchange for this sports taxonomy entry. */ exchange?: Exchange; id: string; image?: string | null; resolutionSource?: string | null; seriesId?: string | null; sport: string; tags: Array; } /** Spread for a market. */ type SpreadResponse = DataProvenance & { ask?: number | null; bid?: number | null; exchange: Exchange; marketId: string; spread?: number | null; timestamp: string; }; /** Polymarket trader search hit (profile + leaderboard stats when available). */ interface TraderSearchHit { address: string; displayName?: string | null; exchange: Exchange; lastTradeAt?: string | null; marketsTraded: number; /** Relevance tier: 0 exact, 1 prefix, 2 substring, 3 fuzzy. */ matchTier?: number | null; openPositions: number; profileImage?: string | null; realizedPnlUsd: number; totalPnlUsd: number; totalVolumeUsd: number; unrealizedPnlUsd: number; username?: string | null; xUsername?: string | null; } /** Trade feed with optional embedded market/event context. */ interface TradesEnrichedResponse { count: number; cursor?: string | null; data: Array; events?: { [key: string]: EventSummary; } | null; hasMore: boolean; markets?: { [key: string]: UnifiedMarket; } | null; } /** A cross-exchange event grouping related markets (Kalshi event_ticker or Polymarket Gamma event). Polymarket grouped/negRisk events expose `image`, `icon`, `description`, `tags`, and nested markets with `groupItemTitle`. Kalshi events expose `image`, `description`, and `kalshi` metadata. */ interface UnifiedEvent { /** Category/tag. */ category?: string | null; /** Whether clients may build combos from this event's selections. */ comboEnabled?: boolean; /** Structured groups/lines/options for a combo-builder UI. */ comboGroups?: Array; /** Gamma createdAt timestamp. */ createdAt?: string | null; cryptoUpDown?: CryptoUpDown | null; /** Long-form description (Polymarket only). */ description?: string | null; /** ISO-8601 end date. */ endDate?: string | null; /** Source exchange. */ exchange: Exchange; /** Event icon URL (Polymarket only). */ icon?: string | null; /** Event identifier. */ id: string; /** Event image URL (Polymarket only). */ image?: string | null; /** Number of markets in this event. */ marketCount: number; /** Event product shape. Combo-builder events expose `comboGroups`. */ marketKind: MarketKind; /** Markets belonging to this event (if expanded). */ markets?: Array | null; /** True for multi-outcome negRisk groups (Polymarket only). */ negRisk?: boolean | null; /** Open interest (Polymarket only). */ openInterest?: number | null; /** Resolution source URL/text (Polymarket only). */ resolutionSource?: string | null; /** Slug for URL. */ slug?: string | null; /** ISO-8601 start date. */ startDate?: string | null; /** Gamma tag objects (JSON array). */ tags?: unknown; /** Gamma ticker slug (Polymarket only). */ ticker?: string | null; /** Event title. */ title: string; /** Gamma updatedAt timestamp. */ updatedAt?: string | null; /** URL to event. */ url?: string | null; /** Total volume across all markets in event. */ volume?: number | null; /** Rolling 24h volume across event markets (Polymarket only). */ volume24h?: number | null; } /** A single market in normalized form. Polymarket markets in grouped events include `eventId`, `eventSlug`, `groupItemTitle`, `description`, `image`, and `icon`. Kalshi markets include `eventTicker` and optional `kalshi` metadata. */ interface UnifiedMarket { /** Category/tag for this market. */ category?: string | null; /** Polymarket CLOB outcome token IDs, ordered to match `outcomes`. Use these IDs for `pm:market:polymarket:{tokenId}:*` realtime rooms. */ clobTokenIds?: Array; /** ISO-8601 market close / expiry time. */ closeDate?: string | null; /** Official multivariate/collection id when present. */ collectionId?: string | null; /** Whether this market can be selected as one leg in a combo builder. */ comboEligible?: boolean; /** UI grouping key for combo builders. */ comboGroup?: string | null; /** ISO-8601 creation time. */ createdAt?: string | null; /** Long-form market description (Polymarket Gamma). */ description?: string | null; /** Polymarket Gamma event id (numeric string, e.g. "30615"). */ eventId?: string | null; /** Polymarket event slug (e.g. "world-cup-winner"). */ eventSlug?: string | null; /** Kalshi event_ticker for grouping related markets. */ eventTicker?: string | null; /** Canonical parent event title (distinct from the child market/group title). */ eventTitle?: string | null; /** Source exchange. */ exchange: Exchange; /** Polymarket Gamma numeric market id (distinct from condition_id). */ gammaMarketId?: string | null; /** Label within a grouped Polymarket event (e.g. "France"). */ groupItemTitle?: string | null; /** Whether the indexed orderbook currently has executable depth. */ hasDepth: boolean; /** Market icon URL (Polymarket Gamma). */ icon?: string | null; /** Unique identifier within its exchange (ticker for Kalshi, condition_id for Polymarket). */ id: string; /** Market image URL (Polymarket Gamma). */ image?: string | null; /** Whether the market can currently accept orders or RFQs. */ isTradable: boolean; /** Number of component markets in a combo. */ legCount?: number; /** Structured combo legs. Empty for ordinary markets. */ legs?: Array; /** Numeric spread/total threshold where applicable. */ line?: number | null; /** Available liquidity (Polymarket only). */ liquidity?: number | null; /** Product shape. Kalshi multivariate/parlay products are `combo`. */ marketKind: MarketKind; /** Materialization state for prebuilt/multivariate contracts. */ materializationState?: string | null; /** Open interest in contracts (Kalshi only). */ openInterest?: number | null; /** Selected outcome index when this market was resolved by outcome-token asset ID. */ outcomeIndex?: number | null; /** Selected outcome label when this market was resolved by outcome-token asset ID. */ outcomeLabel?: string | null; /** Possible outcomes with current prices (0.0–1.0 probability). */ outcomes: Array; /** Parent multivariate event URL for combo products. */ parentEventUrl?: string | null; /** Price discovery mechanism. */ pricingMode: PricingMode; /** Original exchange title when the API supplies a normalized display title. */ rawTitle?: string | null; /** Machine series ticker supplied by Kalshi. */ seriesTicker?: string | null; /** Canonical series title when supplied by the exchange. */ seriesTitle?: string | null; /** Settlement semantics for combo products. */ settlementRule?: string | null; /** URL-safe slug (Kalshi: lowercase ticker, Polymarket: slug field). */ slug: string; /** Exchange-native sports market type (moneyline, totals, spread, etc.). */ sportsMarketType?: string | null; /** Market status: "active", "closed", "settled". */ status: string; /** Normalized discovery tags. */ tags?: Array; /** Raw Kalshi ticker. `id` remains the cross-exchange identifier. */ ticker?: string | null; /** Human-readable title/question. */ title: string; /** Rolling 24-hour trade count from the indexed tape (when available). */ tradeCount24h?: number | null; /** Direct link to the market on its native platform. */ url?: string | null; /** Total all-time volume (USD). */ volume: number; /** Rolling 24-hour volume (USD, if available). */ volume24h?: number | null; } /** A single binary or multi-category outcome with a price. */ interface UnifiedOutcome { /** Outcome label (Yes/No, or custom e.g. country name in grouped markets). */ label: string; /** Current probability (0.0–1.0). */ price: number; } /** A single trade in normalized form. */ interface UnifiedTrade { /** Official Kalshi count_fp string (lossless contract quantity). */ countFp?: string | null; /** Parent event id (Polymarket Gamma id / Kalshi event_ticker). */ eventId?: string | null; /** Parent event slug when available. */ eventSlug?: string | null; /** Canonical parent event title. */ eventTitle?: string | null; exchange: Exchange; /** Label within a grouped event (for example, "Spain"). */ groupItemTitle?: string | null; /** Trade ID (Kalshi: trade_id, Polymarket: tx_hash:log_index). */ id: string; /** Market or event image URL for feed cards. */ image?: string | null; /** True for Polymarket combinatorial (combo) outcomes. */ isCombo?: boolean | null; /** Market identifier (Kalshi ticker or Polymarket asset_id). */ marketId: string; /** Kalshi no-leg reference price (same as `price` when side is no). */ noPrice?: number | null; /** Official Kalshi no_price_dollars string (lossless). */ noPriceDollars?: string | null; /** Direct outcome index for this traded outcome token. */ outcomeIndex?: number | null; /** Direct outcome label for this traded outcome token. */ outcomeLabel?: string | null; /** Execution price for the taker outcome (0.0–1.0). */ price: number; /** Number of contracts / quantity. */ quantity: number; /** Quantity in hundredths of a contract (Kalshi v2). */ quantityE2?: number | null; /** Taker outcome: "yes" or "no" (Kalshi and Polymarket per-market), "buy"/"sell" (Polymarket global without enrichment). */ side: string; /** Unix timestamp in milliseconds. */ timestampMs: number; /** Wallet that initiated the trade (Polymarket taker; Kalshi is anonymous). */ traderAddress?: string | null; /** Public Polymarket username for `traderAddress`; null for anonymous/private profiles. */ traderUsername?: string | null; /** Transaction hash (Polymarket only). */ txHash?: string | null; /** Kalshi yes-leg reference price (same as `price` when side is yes). */ yesPrice?: number | null; /** Official Kalshi yes_price_dollars string (lossless). */ yesPriceDollars?: string | null; /** Price in millionths of a dollar (Kalshi v2). */ yesPriceE6?: number | null; } /** Wallet PnL grouped by event. */ interface WalletEventPnlResponse { address: string; costMethod: string; events: Array; exchange: Exchange; realizedPnlUsd: number; totalPnlUsd: number; unrealizedPnlUsd: number; } /** Wallet overview bundle response. */ interface WalletOverviewResponse { address: string; pnl: WalletPnlSummary; positions: PaginatedWalletPositions; recentTrades: TradesEnrichedResponse; value: PortfolioValueResponse; } interface WalletPnlChartPoint { portfolioValueUsd: number; realizedPnlUsd: number; /** Bucket start as Unix milliseconds. */ timestamp: number; totalPnlUsd: number; unrealizedPnlUsd: number; } interface WalletPnlChartResponse { address: string; /** First available bucket as Unix milliseconds. */ dataStartAt?: number | null; points: Array; /** `1h`, `1d`, `1w`, or `1mo`. */ resolution: string; } /** Wallet-level PnL summary across all positions. */ interface WalletPnlSummary { activePositionCount: number; /** The wallet address. */ address: string; /** Cost basis method (`fifo`). */ costMethod: string; /** Exchange (Polymarket on-chain; Kalshi has no public wallet addresses). */ exchange: Exchange; heldTokenPositionCount: number; /** Number of distinct markets traded. */ marketsTraded: number; /** Number of positions currently open (net_tokens > 0). */ openPositions: number; /** Individual position details. */ positions: Array; /** Sum of realized PnL across all closed/partially-closed positions. */ realizedPnlUsd: number; redeemablePositionCount: number; resolvedPositionCount: number; /** Total USDC spent across all positions. */ totalInvestedUsd: number; /** Net PnL (realized + unrealized). */ totalPnlUsd: number; /** Total USDC received from sells. */ totalProceedsUsd: number; /** Sum of unrealized PnL for open positions (where current price is known). */ unrealizedPnlUsd: number; } /** A single position (holding) in a prediction market outcome token. */ interface WalletPosition { /** The outcome token's asset ID. */ assetId: string; /** Average cost basis per token (0.0–1.0 probability scale). */ avgCostBasis: number; /** Number of buy fills. */ buyCount: number; /** Cost basis method used (`fifo`). */ costMethod?: string | null; /** Current market price for this outcome (0.0–1.0). */ currentPrice?: number | null; /** Parent Gamma event id when known. */ eventId?: string | null; /** Parent Gamma event slug when known. */ eventSlug?: string | null; /** Parent event title when known. */ eventTitle?: string | null; /** Exchange this position is on. */ exchange: Exchange; /** ISO-8601 first trade time. */ firstTradeAt: string; groupItemTitle?: string | null; isActive: boolean; isRedeemable: boolean; isRedeemed: boolean; isResolved: boolean; /** ISO-8601 last trade time. */ lastTradeAt: string; /** Authoritative current or final settlement mark. */ markPrice?: number | null; /** Polymarket condition id when resolved. */ marketId?: string | null; marketStatus: MarketStatus; /** Human-readable market title/question (if we can resolve it). */ marketTitle?: string | null; /** Net tokens held (positive = long, negative = short / oversold). */ netTokens: number; outcomeIndex?: number | null; outcomeLabel?: string | null; positionStatus: PositionStatus; /** Value of remaining tokens at the authoritative mark. */ positionValueUsd?: number | null; /** Realized FIFO PnL, including final settlement PnL once resolved. */ realizedPnlUsd: number; /** Unsettled cost basis; zero after authoritative market settlement. */ remainingCostBasisUsd?: number | null; /** True once the outcome has an authoritative settlement value. */ resolved: boolean; /** Return on remaining FIFO cost basis. */ returnPct?: number | null; /** Number of sell fills. */ sellCount: number; /** Shares economically settled at the final payout (resolved positions only). */ settledTokens?: number | null; /** Final payout value of the remaining shares when resolved. */ settlementValueUsd?: number | null; /** Total USDC spent acquiring this position. */ totalCostUsd: number; /** Total USDC received from partial sells. */ totalProceedsUsd: number; /** Unrealized PnL for unresolved positions; zero after authoritative settlement. */ unrealizedPnlUsd?: number | null; } /** Wallet activity feed item (schema not fully specified in OpenAPI). */ type AccountActivityItem = Record; /** Exchange schedule payload (schema not fully specified in OpenAPI). */ type ExchangeScheduleResponse = Record; /** Milestones payload (schema not fully specified in OpenAPI). */ type MilestonesResponse = Record; /** Query params for GET /v1/accounts/{address}/activity */ interface PmGetAccountActivityParams { /** Max results (default 50, max 200) */ limit?: number; /** Block number cursor */ cursor?: string; /** Optional filter: fill, transfer_in, transfer_out, split, merge, redeem, fee, reward */ activity_type?: string; } /** Query params for GET /v1/accounts/{address}/overview */ interface PmGetAccountOverviewParams { /** Bypass Redis and exercise the exact ClickHouse serving path */ fresh?: boolean; } /** Query params for GET /v1/accounts/{address}/pnl */ interface PmGetAccountPnlParams { /** Rolling window in days such as 7, 30, or 90 (omit for all-time) */ period_days?: number; /** Bypass Redis; ClickHouse serving path remains exact and bounded */ fresh?: boolean; } /** Query params for GET /v1/accounts/{address}/pnl/chart */ interface PmGetAccountPnlChartParams { /** 1h/hourly, 1d/daily, 1w/weekly, or 1mo/monthly (default 1d) */ resolution?: string; /** Inclusive Unix milliseconds */ from?: number; /** Inclusive Unix milliseconds */ to?: number; /** Maximum points (default 500, max 5000) */ limit?: number; } /** Query params for GET /v1/accounts/{address}/trades */ interface PmGetAccountTradesParams { /** Max results (default 100, max 1000) */ limit?: number; /** Block number cursor */ cursor?: string; } /** Query params for GET /v1/browse */ interface PmGetBrowseHubParams { /** kalshi, polymarket, or poly */ exchange?: string; /** Max trending markets (default 12, max 50) */ trending_limit?: number; /** Max recent trades (default 40, max 100) */ trades_limit?: number; /** Embed markets/events on recent trades (default true) */ include_trade_markets?: boolean; } /** Query params for GET /v1/categories */ interface PmGetCategoriesParams { /** kalshi, polymarket, or poly */ exchange?: string; /** Max results (default 50, max 200) */ limit?: number; } /** Query params for GET /v1/crypto/events */ interface PmGetCryptoEventsParams { /** Asset key: btc, eth, sol, xrp, doge, bnb, hype (required unless seriesSlug is set) */ asset?: string; /** Window interval: 5m (default), 15m, 1h/hourly, 4h, 1d/daily, 1w/weekly */ interval?: string; /** Gamma series slug override, e.g. btc-up-or-down-hourly or bitcoin-up-or-down-weekly */ seriesSlug?: string; /** Max results (default 50, max 100) */ limit?: number; /** Pagination offset cursor */ cursor?: string; /** Window start order: desc (default) or asc */ order?: string; } /** Query params for GET /v1/crypto/price */ interface PmGetCryptoPriceParams { /** BTC, ETH, SOL, XRP, DOGE, BNB, HYPE */ symbol: string; /** Window open (ISO-8601) */ eventStartTime: string; /** Window close (ISO-8601) */ endDate: string; /** fiveminute (default), fifteenminute, hourly, fourhour, daily */ variant?: string; } /** Query params for GET /v1/crypto/price-history */ interface PmGetCryptoPriceHistoryParams { /** BTC, ETH, SOL, XRP, DOGE, BNB, HYPE */ symbol: string; /** Window open (ISO-8601) */ eventStartTime: string; /** Window close (ISO-8601) */ endDate: string; /** fiveminute (default), fifteenminute, hourly, fourhour, daily */ variant?: string; } /** Query params for GET /v1/crypto/traders */ interface PmGetCryptoTradersParams { /** Max results (default 50, max 200) */ limit?: number; /** Pagination offset cursor */ cursor?: string; /** Minimum crypto-event trades per wallet (default 5) */ minTrades?: number; } /** Query params for GET /v1/events */ interface PmGetEventsParams { /** Filter: kalshi, polymarket, or poly */ exchange?: string; /** active, closed, or all */ status?: string; /** Topic/tag/category filter (e.g. Sports, crypto, politics) */ topic?: string; /** Alias for topic */ tag?: string; /** Alias for topic */ category?: string; /** Product shape filter; use combo for combo-builder events (alias: marketKind) */ market_kind?: string; /** volume (default) or marketCount */ sort?: string; /** asc or desc (default desc) */ order?: string; /** Max results (default 100, max 500) */ limit?: number; /** Pagination cursor from previous response */ cursor?: string; /** When true, include top markets per event for chance/leader bars */ include_markets?: boolean; } /** Query params for GET /v1/events/batch */ interface PmGetEventsBatchParams { /** Required comma-separated event ids (Kalshi event_ticker, Polymarket id, POLY-…, or slug) */ ids: string; /** kalshi, polymarket, or poly */ exchange?: string; } /** Query params for GET /v1/events/{event_id} */ interface PmGetEventParams { /** Force exchange lookup; auto-detect if omitted */ exchange?: string; } /** Query params for GET /v1/events/{event_id}/candlesticks */ interface PmGetEventCandlesticksParams { /** Force exchange lookup; auto-detect if omitted */ exchange?: string; /** 1m, 1h, or 1d (default 1h) */ period_interval?: string; /** Range start (unix s or ms) */ start_ts?: string; /** Range end */ end_ts?: string; /** Max candles per series (default 200, max 2000) */ limit?: number; /** Pagination cursor for older bars */ cursor?: string; /** Market filter: all (default), active, closed, or inactive */ status?: string; } /** Query params for GET /v1/events/{event_id}/crypto */ interface PmGetEventCryptoParams { /** Force exchange; default auto */ exchange?: string; /** Max sibling windows (default 24, max 48) */ windows_limit?: number; /** Include chart points (default true) */ include_history?: boolean; } /** Query params for GET /v1/events/{event_id}/holders */ interface PmGetEventHoldersParams { /** Force exchange; default auto (Polymarket) */ exchange?: string; /** Max results (default 25, max 100) */ limit?: number; } /** Query params for GET /v1/events/{event_id}/leaderboard/pnl */ interface PmGetEventPnlLeaderboardParams { /** polymarket */ exchange?: string; /** Max results (default 50, max 200) */ limit?: number; } /** Query params for GET /v1/events/{event_id}/traders */ interface PmGetEventTradersParams { /** Force exchange; default auto (Polymarket) */ exchange?: string; /** Max results (default 50, max 200) */ limit?: number; /** Pagination offset cursor */ cursor?: string; } /** Query params for GET /v1/leaderboard/pnl */ interface PmGetPnlLeaderboardParams { /** polymarket only (Kalshi has no public wallets) */ exchange?: string; /** Max results (default 100, max 500) */ limit?: number; /** Pagination offset cursor */ cursor?: string; /** totalPnl (default), realizedPnl, volume */ sort?: string; } /** Query params for GET /v1/leaderboard/traders */ interface PmGetTraderLeaderboardParams { /** Max results (default 100, max 500) */ limit?: number; /** Pagination offset cursor */ cursor?: string; } /** Query params for GET /v1/live_data */ interface PmGetLiveDataParams { /** Required comma-separated tickers (max 50) */ tickers: string; /** kalshi, polymarket, or poly */ exchange?: string; } /** Query params for GET /v1/markets */ interface PmGetMarketsParams { /** kalshi, polymarket, or poly */ exchange?: string; /** active, closed, or all */ status?: string; /** Kalshi event ticker filter */ event_ticker?: string; /** Category/tag slug filter */ tag?: string; /** Alias for tag */ category?: string; /** Minimum volume in USD */ min_volume?: number; /** volume, volume24h, liquidity, openInterest, createdAt */ sort?: string; /** asc or desc */ order?: string; /** Max results (default 100, max 500) */ limit?: number; /** Pagination cursor */ cursor?: string; /** Include Kalshi combo/multivariate markets (default false) */ includeCombos?: boolean; /** Product filter: binary, categorical, or combo (comma-separated) */ marketKind?: string; } /** Query params for GET /v1/markets/batch */ interface PmGetMarketsBatchParams { /** Required comma-separated ids (max 100) */ ids: string; /** kalshi, polymarket, or poly (required with lookup_by) */ exchange?: string; /** asset_id, condition_id, ticker, or slug (requires exchange) */ lookup_by?: string; } /** Query params for GET /v1/markets/books */ interface PmGetMarketBooksParams { /** Required comma-separated tickers (max 25) */ tickers: string; /** kalshi, polymarket, or poly */ exchange?: string; } /** Query params for GET /v1/markets/candlesticks/batch */ interface PmGetCandlesticksBatchParams { /** Required comma-separated tickers / condition ids (max 25) */ tickers: string; /** kalshi, polymarket, or poly */ exchange?: string; /** 1m, 1h, or 1d (default 1h) */ period_interval?: string; /** Max candles per series (default 200, max 2000) */ limit?: number; } /** Query params for GET /v1/markets/new */ interface PmGetNewMarketsParams { /** kalshi, polymarket, or poly */ exchange?: string; /** Max results (default 50, max 200) */ limit?: number; /** Pagination cursor */ cursor?: string; /** Include Kalshi combo/multivariate markets (default false) */ includeCombos?: boolean; /** Product filter: binary, categorical, or combo (comma-separated) */ marketKind?: string; } /** Query params for GET /v1/markets/search */ interface PmSearchMarketsParams { /** Required search query (min 2 characters) */ q: string; /** kalshi, polymarket, or poly */ exchange?: string; /** active, closed, or all (default active) */ status?: string; /** Category filter */ category?: string; /** Minimum volume USD */ min_volume?: number; /** Maximum volume USD */ max_volume?: number; /** relevance (default), volume, volume24h, liquidity, openInterest, createdAt */ sort?: string; /** asc or desc (ignored for relevance) */ order?: string; /** Max results (default 20, max 50) */ limit?: number; /** Opaque keyset cursor from a previous response (not a numeric offset) */ cursor?: string; /** Include Kalshi combo/multivariate markets (default false) */ includeCombos?: boolean; /** Product filter: binary, categorical, or combo (comma-separated) */ marketKind?: string; } /** Query params for GET /v1/markets/slug/{slug} */ interface PmGetMarketBySlugParams { /** kalshi, polymarket, or poly */ exchange?: string; } /** Query params for GET /v1/markets/slug/{slug}/snapshot */ interface PmGetMarketSnapshotBySlugParams { /** kalshi, polymarket, or poly */ exchange?: string; /** Comma-separated sections: price,midpoint,spread,oi,orderbook,trades,related — or all (default price,midpoint) */ include?: string; /** Max recent trades when include has trades (default 50, max 200) */ trades_limit?: number; /** Orderbook levels per side (default 10, max 50) */ orderbook_depth?: number; /** Max related markets (default 10, max 50) */ related_limit?: number; } /** Query params for GET /v1/markets/trades */ interface PmGetGlobalTradesParams { /** kalshi, polymarket, or poly */ exchange?: string; /** Optional market filter */ ticker?: string; /** Min timestamp (ISO-8601 or unix) */ min_ts?: string; /** Max timestamp (ISO-8601 or unix) */ max_ts?: string; /** Minimum trade notional in USD (price × quantity) */ min_volume?: number; /** Maximum trade notional in USD (price × quantity) */ max_volume?: number; /** Max results (default 100, max 1000) */ limit?: number; /** Pagination cursor */ cursor?: string; /** Embed resolved markets and parent events (default true) */ include_markets?: boolean; } /** Query params for GET /v1/markets/trending */ interface PmGetTrendingMarketsParams { /** kalshi, polymarket, or poly */ exchange?: string; /** Max results (default 50, max 200) */ limit?: number; /** Pagination cursor */ cursor?: string; /** Include Kalshi combo/multivariate markets (default false) */ includeCombos?: boolean; /** Product filter: binary, categorical, or combo (comma-separated) */ marketKind?: string; } /** Query params for GET /v1/markets/{ticker} */ interface PmGetMarketParams { /** Force exchange; auto-detect if omitted */ exchange?: string; } /** Query params for GET /v1/markets/{ticker}/candlesticks */ interface PmGetMarketCandlesticksParams { /** kalshi, polymarket, or poly */ exchange?: string; /** Candle period (default 1h) */ period_interval?: string; /** Start timestamp */ start_ts?: string; /** End timestamp */ end_ts?: string; /** Max candles (default 200, max 2000) */ limit?: number; /** Pagination cursor (overrides start_ts) */ cursor?: string; } /** Query params for GET /v1/markets/{ticker}/holders */ interface PmGetMarketHoldersParams { /** Must be polymarket */ exchange?: string; /** Max results (default 25, max 100) */ limit?: number; } /** Query params for GET /v1/markets/{ticker}/midpoint */ interface PmGetMarketMidpointParams { /** kalshi, polymarket, or poly */ exchange?: string; } /** Query params for GET /v1/markets/{ticker}/oi */ interface PmGetMarketOpenInterestParams { /** kalshi, polymarket, or poly */ exchange?: string; } /** Query params for GET /v1/markets/{ticker}/orderbook */ interface PmGetMarketOrderbookParams { /** Auto-detect if omitted */ exchange?: string; } /** Query params for GET /v1/markets/{ticker}/price */ interface PmGetMarketPriceParams { /** kalshi, polymarket, or poly */ exchange?: string; } /** Query params for GET /v1/markets/{ticker}/quote */ interface PmGetMarketQuoteParams { /** kalshi, polymarket, or poly */ exchange?: string; /** buy (default) or sell */ side?: string; /** Stake size (default 100) */ size?: number; /** shares (default) or usd (alias: sizeUnit) */ size_unit?: string; /** Polymarket: yes/no or CLOB token id */ outcome?: string; } /** Query params for GET /v1/markets/{ticker}/related */ interface PmGetRelatedMarketsParams { /** Source exchange hint */ exchange?: string; /** Max results (default 10, max 50) */ limit?: number; } /** Query params for GET /v1/markets/{ticker}/snapshot */ interface PmGetMarketSnapshotParams { /** Force exchange; auto-detect if omitted */ exchange?: string; /** Comma-separated sections: price,midpoint,spread,oi,orderbook,trades,related — or all (default price,midpoint) */ include?: string; /** Max recent trades when include has trades (default 50, max 200) */ trades_limit?: number; /** Orderbook levels per side (default 10, max 50) */ orderbook_depth?: number; /** Max related markets (default 10, max 50) */ related_limit?: number; } /** Query params for GET /v1/markets/{ticker}/spread */ interface PmGetMarketSpreadParams { /** kalshi, polymarket, or poly */ exchange?: string; } /** Query params for GET /v1/markets/{ticker}/traders */ interface PmGetMarketTradersParams { /** kalshi, polymarket, or poly */ exchange?: string; /** Max results (default 50, max 200) */ limit?: number; /** Pagination cursor (Polymarket only) */ cursor?: string; } /** Query params for GET /v1/markets/{ticker}/trades */ interface PmGetMarketTradesParams { /** kalshi, polymarket, or poly */ exchange?: string; /** Minimum trade notional in USD (price × quantity) */ min_volume?: number; /** Maximum trade notional in USD (price × quantity) */ max_volume?: number; /** Max results (default 100, max 1000) */ limit?: number; /** Kalshi: RFC3339 timestamp; Polymarket: block number */ cursor?: string; } /** Query params for GET /v1/milestones */ interface PmGetMilestonesParams { /** kalshi, polymarket, or omit for both */ exchange?: string; /** Optional sport/category filter */ sport?: string; /** Max results (default 50) */ limit?: number; } /** Query params for GET /v1/search */ interface PmSearchParams { /** Required search query (min 2 characters) */ q: string; /** kalshi, polymarket, or poly */ exchange?: string; /** active, closed, or all (default active) */ status?: string; /** Max markets (default 12, max 30); events capped at 10; traders capped at 8 */ limit?: number; } /** Query params for GET /v1/series */ interface PmGetSeriesParams { /** Max results (default 50, max 200) */ limit?: number; /** Pagination offset cursor */ cursor?: string; } /** Query params for GET /v1/sports */ interface PmGetSportsParams { /** Max results (default 50, max 200) */ limit?: number; } /** Query params for GET /v1/traders/search */ interface PmSearchTradersParams { /** Required search query (min 2 characters) */ q: string; /** Max results (default 20, max 50) */ limit?: number; /** Opaque keyset cursor from a previous response */ cursor?: string; /** relevance (default), volume, or pnl */ sort?: string; } interface PredictionMarketsConfig { /** Your API key from solanatracker.io (same Data API key). */ apiKey: string; /** Optional base URL override. Defaults to the public beta host. */ baseUrl?: string; } /** * Read-only Prediction Markets API client (Kalshi + Polymarket beta). * Base URL: `https://prediction-market-api.solanatracker.io` */ declare class PredictionMarketsClient { private apiKey; private baseUrl; constructor(config: PredictionMarketsConfig); private buildQueryString; private request; /** Wallet activity feed (Polymarket) — `GET /v1/accounts/{address}/activity` */ getAccountActivity(address: string, params?: PmGetAccountActivityParams): Promise; /** Closed or resolved positions (Polymarket) — `GET /v1/accounts/{address}/closed-positions` */ getAccountClosedPositions(address: string): Promise; /** Canonical wallet overview (Polymarket) — `GET /v1/accounts/{address}/overview` */ getAccountOverview(address: string, params?: PmGetAccountOverviewParams): Promise; /** Wallet PnL summary (Polymarket, FIFO) — `GET /v1/accounts/{address}/pnl` */ getAccountPnl(address: string, params?: PmGetAccountPnlParams): Promise; /** Fast authoritative wallet PnL chart — `GET /v1/accounts/{address}/pnl/chart` */ getAccountPnlChart(address: string, params?: PmGetAccountPnlChartParams): Promise; /** Wallet PnL by event (Polymarket, FIFO) — `GET /v1/accounts/{address}/pnl/events` */ getAccountPnlEvents(address: string): Promise; /** Open positions (Polymarket) — `GET /v1/accounts/{address}/positions` */ getAccountPositions(address: string): Promise; /** Wallet trade history (Polymarket) — `GET /v1/accounts/{address}/trades` */ getAccountTrades(address: string, params?: PmGetAccountTradesParams): Promise; /** Portfolio value (Polymarket) — `GET /v1/accounts/{address}/value` */ getAccountValue(address: string): Promise; /** Browse hub bootstrap — `GET /v1/browse` */ getBrowseHub(params?: PmGetBrowseHubParams): Promise; /** List market categories — `GET /v1/categories` */ getCategories(params?: PmGetCategoriesParams): Promise>; /** List crypto up/down series events — `GET /v1/crypto/events` */ getCryptoEvents(params?: PmGetCryptoEventsParams): Promise; /** Crypto window open/close oracle price — `GET /v1/crypto/price` */ getCryptoPrice(params: PmGetCryptoPriceParams): Promise; /** Underlying crypto price chart series — `GET /v1/crypto/price-history` */ getCryptoPriceHistory(params: PmGetCryptoPriceHistoryParams): Promise>; /** Top traders across crypto events — `GET /v1/crypto/traders` */ getCryptoTraders(params?: PmGetCryptoTradersParams): Promise; /** List grouped events — `GET /v1/events` */ getEvents(params?: PmGetEventsParams): Promise; /** Batch fetch events by id — `GET /v1/events/batch` */ getEventsBatch(params: PmGetEventsBatchParams): Promise; /** Get grouped event with nested markets — `GET /v1/events/{event_id}` */ getEvent(eventId: string, params?: PmGetEventParams): Promise; /** Multi-series OHLCV for grouped Polymarket event — `GET /v1/events/{event_id}/candlesticks` */ getEventCandlesticks(eventId: string, params?: PmGetEventCandlesticksParams): Promise; /** Crypto up/down page bundle — `GET /v1/events/{event_id}/crypto` */ getEventCrypto(eventId: string, params?: PmGetEventCryptoParams): Promise; /** Top holders for an event — `GET /v1/events/{event_id}/holders` */ getEventHolders(eventId: string, params?: PmGetEventHoldersParams): Promise>; /** Top wallets by FIFO PnL on an event — `GET /v1/events/{event_id}/leaderboard/pnl` */ getEventPnlLeaderboard(eventId: string, params?: PmGetEventPnlLeaderboardParams): Promise; /** Top traders for an event — `GET /v1/events/{event_id}/traders` */ getEventTraders(eventId: string, params?: PmGetEventTradersParams): Promise; /** Exchange trading schedule — `GET /v1/exchange/schedule` */ getExchangeSchedule(): Promise; /** Exchange connectivity status — `GET /v1/exchange/status` */ getExchangeStatus(): Promise; /** Top wallets by FIFO PnL — `GET /v1/leaderboard/pnl` */ getPnlLeaderboard(params?: PmGetPnlLeaderboardParams): Promise; /** Top Polymarket traders by cumulative volume — `GET /v1/leaderboard/traders` */ getTraderLeaderboard(params?: PmGetTraderLeaderboardParams): Promise; /** Live market snapshots — `GET /v1/live_data` */ getLiveData(params: PmGetLiveDataParams): Promise>; /** List markets — `GET /v1/markets` */ getMarkets(params?: PmGetMarketsParams): Promise; /** Batch fetch markets by id — `GET /v1/markets/batch` */ getMarketsBatch(params: PmGetMarketsBatchParams): Promise; /** Batch fetch markets by id (POST body) — `POST /v1/markets/batch` */ postMarketsBatch(body: BatchMarketsBody): Promise; /** Batch fetch orderbooks — `GET /v1/markets/books` */ getMarketBooks(params: PmGetMarketBooksParams): Promise>; /** Batch fetch candlesticks — `GET /v1/markets/candlesticks/batch` */ getCandlesticksBatch(params: PmGetCandlesticksBatchParams): Promise; /** Newest markets — `GET /v1/markets/new` */ getNewMarkets(params?: PmGetNewMarketsParams): Promise; /** Search markets — `GET /v1/markets/search` */ searchMarkets(params: PmSearchMarketsParams): Promise; /** Get market by slug — `GET /v1/markets/slug/{slug}` */ getMarketBySlug(slug: string, params?: PmGetMarketBySlugParams): Promise; /** Bundled market snapshot by slug — `GET /v1/markets/slug/{slug}/snapshot` */ getMarketSnapshotBySlug(slug: string, params?: PmGetMarketSnapshotBySlugParams): Promise; /** Global trade feed — `GET /v1/markets/trades` */ getGlobalTrades(params?: PmGetGlobalTradesParams): Promise; /** Trending markets by 24h volume and trade count — `GET /v1/markets/trending` */ getTrendingMarkets(params?: PmGetTrendingMarketsParams): Promise; /** Get market by ticker or condition id — `GET /v1/markets/{ticker}` */ getMarket(ticker: string, params?: PmGetMarketParams): Promise; /** OHLCV candlesticks — `GET /v1/markets/{ticker}/candlesticks` */ getMarketCandlesticks(ticker: string, params?: PmGetMarketCandlesticksParams): Promise; /** Top holders (Polymarket only) — `GET /v1/markets/{ticker}/holders` */ getMarketHolders(ticker: string, params?: PmGetMarketHoldersParams): Promise>; /** Midpoint price — `GET /v1/markets/{ticker}/midpoint` */ getMarketMidpoint(ticker: string, params?: PmGetMarketMidpointParams): Promise; /** Open interest and holder stats — `GET /v1/markets/{ticker}/oi` */ getMarketOpenInterest(ticker: string, params?: PmGetMarketOpenInterestParams): Promise; /** Orderbook snapshot — `GET /v1/markets/{ticker}/orderbook` */ getMarketOrderbook(ticker: string, params?: PmGetMarketOrderbookParams): Promise; /** Current price snapshot — `GET /v1/markets/{ticker}/price` */ getMarketPrice(ticker: string, params?: PmGetMarketPriceParams): Promise; /** Size-aware VWAP quote (walk the book) — `GET /v1/markets/{ticker}/quote` */ getMarketQuote(ticker: string, params?: PmGetMarketQuoteParams): Promise; /** Related markets on other exchange — `GET /v1/markets/{ticker}/related` */ getRelatedMarkets(ticker: string, params?: PmGetRelatedMarketsParams): Promise>; /** Bundled market snapshot — `GET /v1/markets/{ticker}/snapshot` */ getMarketSnapshot(ticker: string, params?: PmGetMarketSnapshotParams): Promise; /** Bid-ask spread — `GET /v1/markets/{ticker}/spread` */ getMarketSpread(ticker: string, params?: PmGetMarketSpreadParams): Promise; /** Top traders on a market by total P&L — `GET /v1/markets/{ticker}/traders` */ getMarketTraders(ticker: string, params?: PmGetMarketTradersParams): Promise; /** Exchange-aware return types, including Kalshi aggregate statistics. */ getMarketTradersByExchange(ticker: string, params: PmGetMarketTradersParams & { exchange: 'polymarket' | 'poly'; }): Promise; getMarketTradersByExchange(ticker: string, params: PmGetMarketTradersParams & { exchange: 'kalshi'; }): Promise; getMarketTradersByExchange(ticker: string, params?: PmGetMarketTradersParams): Promise; /** Market trade history — `GET /v1/markets/{ticker}/trades` */ getMarketTrades(ticker: string, params?: PmGetMarketTradesParams): Promise; /** Event/sports milestones — `GET /v1/milestones` */ getMilestones(params?: PmGetMilestonesParams): Promise; /** Unified typeahead search (markets + events) — `GET /v1/search` */ search(params: PmSearchParams): Promise; /** List market series (Kalshi) — `GET /v1/series` */ getSeries(params?: PmGetSeriesParams): Promise; /** List Polymarket sports categories — `GET /v1/sports` */ getSports(params?: PmGetSportsParams): Promise>; /** Combined platform statistics — `GET /v1/stats` */ getCombinedStats(): Promise; /** Per-exchange statistics — `GET /v1/stats/{exchange}` */ getExchangeStats(exchange: string): Promise; /** Search Polymarket traders — `GET /v1/traders/search` */ searchTraders(params: PmSearchTradersParams): Promise; } /** * Decode binary data into events array * @param binaryData The binary data to decode * @returns Array of decoded events */ declare function decodeBinaryEvents(binaryData: ArrayBuffer | Uint8Array): ProcessedEvent[]; /** * Process events synchronously * @param binaryData Binary data or decoded events array * @returns Processed statistics by timeframe */ declare function processEvents(binaryData: ArrayBuffer | Uint8Array | ProcessedEvent[]): ProcessedStats; /** * Process events asynchronously in chunks * @param binaryData Binary data or decoded events array * @param onProgress Optional progress callback * @returns Processed statistics by timeframe */ declare function processEventsAsync(binaryData: ArrayBuffer | Uint8Array | ProcessedEvent[], onProgress?: (progress: number) => void): Promise; export { type AccountActivityItem, type ApiErrorBody, type BatchCandlestickSeries, type BatchCandlesticksResponse, type BatchEventResult, type BatchEventsResponse, type BatchMarketResult, type BatchMarketsBody, type BatchMarketsResponse, type BrowseHubResponse, type BundlerUpdate, type Candlestick, type Category, type CombinedStats, type ComboMarketGroup, type ComboMarketLine, type ComboSelection, type CryptoEventResponse, type CryptoPricePoint, type CryptoPriceSnapshot, type CryptoSeriesWindow, type CryptoTrader, type CryptoUpDown, type CryptoUpDownPhase, type DataProvenance, Datastream, type DatastreamConfig, DatastreamRoom, DcaClosedEvent, DcaCollectedFeeEvent, DcaDepositEvent, DcaFilledEvent, DcaOpenedEvent, DcaPositionEvent, DcaStreamEvent, DcaWithdrawEvent, EnrichedStreamOptions, type EnrichedTokenTransaction, type EnrichedWalletTransaction, type EnrichedWhaleKolTransaction, type EventCandlestickSeries, type EventCandlesticksResponse, type EventPnlSummary, type EventSummary, type Exchange, type ExchangeScheduleResponse, type ExchangeStatusResponse, type GlobalSearchResponse, type HolderResponse, type HolderUpdate, LiquidityUpdate, type LiveMarketData, type MarketKind, type MarketLeg, type MarketLegSide, type MarketQuoteResponse, type MarketSnapshotResponse, type MarketStatus, type MarketTradeSummary, type MarketTrader, type MidpointResponse, type MilestonesResponse, type OpenInterestResponse, type OrderbookSnapshot, type PaginatedCandlesticks, type PaginatedCryptoTraders, type PaginatedEvents, type PaginatedMarketTraders, type PaginatedMarkets, type PaginatedPnlLeaderboard, type PaginatedSeries, type PaginatedTraders, type PaginatedTrades, type PaginatedWalletPositions, type PlatformStats, type PmChannel, type PmCryptoPriceFields, type PmCryptoPriceUpdate, type PmExchange, type PmGetAccountActivityParams, type PmGetAccountOverviewParams, type PmGetAccountPnlChartParams, type PmGetAccountPnlParams, type PmGetAccountTradesParams, type PmGetBrowseHubParams, type PmGetCandlesticksBatchParams, type PmGetCategoriesParams, type PmGetCryptoEventsParams, type PmGetCryptoPriceHistoryParams, type PmGetCryptoPriceParams, type PmGetCryptoTradersParams, type PmGetEventCandlesticksParams, type PmGetEventCryptoParams, type PmGetEventHoldersParams, type PmGetEventParams, type PmGetEventPnlLeaderboardParams, type PmGetEventTradersParams, type PmGetEventsBatchParams, type PmGetEventsParams, type PmGetGlobalTradesParams, type PmGetLiveDataParams, type PmGetMarketBooksParams, type PmGetMarketBySlugParams, type PmGetMarketCandlesticksParams, type PmGetMarketHoldersParams, type PmGetMarketMidpointParams, type PmGetMarketOpenInterestParams, type PmGetMarketOrderbookParams, type PmGetMarketParams, type PmGetMarketPriceParams, type PmGetMarketQuoteParams, type PmGetMarketSnapshotBySlugParams, type PmGetMarketSnapshotParams, type PmGetMarketSpreadParams, type PmGetMarketTradersParams, type PmGetMarketTradesParams, type PmGetMarketsBatchParams, type PmGetMarketsParams, type PmGetMilestonesParams, type PmGetNewMarketsParams, type PmGetPnlLeaderboardParams, type PmGetRelatedMarketsParams, type PmGetSeriesParams, type PmGetSportsParams, type PmGetTraderLeaderboardParams, type PmGetTrendingMarketsParams, type PmMarketLifecycleFields, type PmMarketLifecycleUpdate, type PmOrderbookFields, type PmOrderbookUpdate, type PmPriceFields, type PmPriceKind, type PmPriceLevel, type PmPriceUpdate, type PmQuoteFields, type PmQuoteLevel, type PmQuoteUpdate, type PmRealtimeEnvelope, type PmResolutionFields, type PmResolutionUpdate, type PmSearchMarketsParams, type PmSearchParams, type PmSearchTradersParams, type PmStreamUpdate, type PmTradeFields, type PmTradeUpdate, type PmVolumeFields, type PmVolumeUpdate, type PnlBalanceUpdate, type PnlLeaderboardEntry, type PnlPositionUpdate, type PnlPriceUpdate, type PnlTradeUpdate, PnlV2Identity, type PnlWalletPosition, type PnlWalletUpdate, PoolInfo, type PoolUpdate, type PortfolioValueResponse, type PositionStatus, PredictionMarketsClient, type PredictionMarketsConfig, type PriceLevel, type PriceSnapshot, type PriceUpdate, type PricingMode, ProcessedEvent, ProcessedStats, type RelatedMarkets, type SeriesInfo, type SportInfo, type SpreadResponse, TokenEvents, TokenInfo, type TokenMetadata, TokenRisk, TokenStats, TokenStatsTotal, type TokenTransaction, TradeIdentity, type TraderSearchHit, type TradesEnrichedResponse, type UnifiedEvent, type UnifiedMarket, type UnifiedOutcome, type UnifiedTrade, type VolumePoolUpdate, type VolumeTokenUpdate, WalletBalanceUpdate, type WalletEventPnlResponse, type WalletOverviewResponse, type WalletPnlChartPoint, type WalletPnlChartResponse, type WalletPnlSummary, type WalletPosition, type WalletTransaction, type WhaleKolTransaction, type WhaleKolTransactionTokenSide, WhaleMinVolume, decodeBinaryEvents, pmRoomSegment, processEvents, processEventsAsync };