TypeScript client
Official RTDS TypeScript client (
real-time-data-client).Endpoint
gamma_auth with your wallet address.
Subscribing
Send a JSON message to subscribe to data streams:"action": "unsubscribe".
Subscriptions can be added, removed, and modified without disconnecting. Send PING messages every 5 seconds to maintain the connection.
Only the subscription types documented below are supported.
Message Structure
All messages follow this structure:Crypto Prices
Real-time cryptocurrency price data from two sources: Binance and Chainlink. No authentication required.Binance Source
Subscribe to all symbols:solusdt, btcusdt).
Solana price update:
Chainlink Source
Subscribe to all symbols:eth/usd, btc/usd).
Ethereum price update:
Price Payload Fields
Supported Symbols
Binance Source — lowercase concatenated format:btcusdt— Bitcoin to USDTethusdt— Ethereum to USDTsolusdt— Solana to USDTxrpusdt— XRP to USDT
btc/usd— Bitcoin to USDeth/usd— Ethereum to USDsol/usd— Solana to USDxrp/usd— XRP to USD
Equity Prices
Real-time price data for stocks, ETFs, forex pairs, precious metals, and commodities sourced from Pyth Network. No authentication required. All asset classes stream through a singleequity_prices topic. When you subscribe with a symbol filter, the server sends a historical snapshot (last 2 minutes of data), then continues streaming live updates.
Subscribe
Subscribe to a specific symbol with a JSON filter:type: "*" to receive all message types (live updates and snapshots):
symbol field in payloads is always returned lowercase.
Live Price Update
Apple stock update:Historical Snapshot
On subscribe, the server delivers a backfill of the last 2 minutes of price data. Use thetype field to distinguish: "subscribe" for the initial snapshot vs "update" for live ticks.
Equity Price Payload Fields
Supported Symbols
Stocks:
ETFs:
Forex:
Precious Metals:
Commodities (rolling front-month futures):
Market Hours
When a market session is closed, the stream continues with the last known price andis_carried_forward: true. This lets you distinguish stale prices from live ticks. Update frequency is sub-second (up to 5 per second per feed) during market hours.
Comments
Real-time comment events on the Polymarket platform, including new comments, replies, reactions, and removals. May require Gamma authentication for user-specific data.Subscribe
Message Types
comment_created
Emitted when a user posts a new comment or replies to an existing one.parentCommentID references the parent:
Comment Payload Fields
Profile Object Fields
Comment Hierarchy
Comments support nested threading:- Top-level comments:
parentCommentIDis null or empty - Reply comments:
parentCommentIDcontains the ID of the parent comment - All comments are associated with a
parentEntityIDandparentEntityType(EventorMarket)
Troubleshooting
Connection drops unexpectedly
Connection drops unexpectedly
Send
PING messages every 5 seconds to keep the connection alive. Connection errors will trigger automatic reconnection attempts.Not receiving messages after subscribing
Not receiving messages after subscribing
Verify your subscription message is valid JSON with the correct
action, topic, and type fields. Invalid subscription messages may result in connection closure.Authentication failures
Authentication failures
If subscribing to user-specific streams, ensure your
gamma_auth object includes a valid wallet address. Authentication failures will prevent subscription to protected topics.