Pages: 7
URL: llms-txt#deployment-and-additional-information
Contents:
Source: https://docs.polymarket.com/developers/CTF/deployment-resources
The CTF contract is deployed (and verified) at the following addresses:
| Network | Deployed Address |
|---|---|
| Polygon Mainnet | 0x4D97DCd97eC945f40cF65F87097ACe5EA0476045 |
| Polygon Mainnet | 0x4bFb41d5B3570DeFd03C39a9A4D8dE6Bd8B8982E |
Polymarket provides code samples in both Python and TypeScript for interacting with our smart chain contracts. You will need an RPC endpoint to access the blockchain, and you'll be responsible for paying gas fees when executing these RPC/function calls. Please ensure you're using the correct example for your wallet type (Safe Wallet vs Proxy Wallet) when implementing.
URL: llms-txt#gamma-structure
Source: https://docs.polymarket.com/developers/gamma-markets-api/gamma-structure
Gamma provides some organizational models. These include events, and markets. The most fundamental element is always markets and the other models simply provide additional organization.
URL: llms-txt#real-time-data-socket
Contents:
Source: https://docs.polymarket.com/developers/RTDS/RTDS-overview
The Polymarket Real-Time Data Socket (RTDS) is a WebSocket-based streaming service that provides real-time updates for various Polymarket data streams. The service allows clients to subscribe to multiple data feeds simultaneously and receive live updates as events occur on the platform.
Polymarket provides a Typescript client for interacting with this streaming service. Download and view it's documentation here
wss://ws-live-data.polymarket.comThe RTDS supports two types of authentication depending on the subscription type:
CLOB Authentication: Required for certain trading-related subscriptions
key: API keysecret: API secretpassphrase: API passphraseGamma Authentication: Required for user-specific data
address: User wallet addressThe WebSocket connection supports:
Although this connection technically supports additional activity and subscription types, they are not fully supported at this time. Users are free to use them but there may be some unexpected behavior.
The RTDS currently supports the following subscription types:
All messages received from the WebSocket follow this structure:
topic: The subscription topic (e.g., "crypto_prices", "comments", "activity")type: The message type/event (e.g., "update", "reaction_created", "orders_matched")timestamp: Unix timestamp in millisecondspayload: Event-specific data objectTo subscribe to data streams, send a JSON message with this structure:
To unsubscribe from data streams, send a similar message with "action": "unsubscribe".
Examples:
Example 1 (unknown):
* `topic`: The subscription topic (e.g., "crypto\_prices", "comments", "activity")
* `type`: The message type/event (e.g., "update", "reaction\_created", "orders\_matched")
* `timestamp`: Unix timestamp in milliseconds
* `payload`: Event-specific data object
## Subscription Management
### Subscribe to Topics
To subscribe to data streams, send a JSON message with this structure:
URL: llms-txt#rtds-crypto-prices
Contents:
crypto_prices)
crypto_prices_chainlink)
Source: https://docs.polymarket.com/developers/RTDS/RTDS-crypto-prices
Polymarket provides a Typescript client for interacting with this streaming service. Download and view it's documentation here
The crypto prices subscription provides real-time updates for cryptocurrency price data from two different sources:
crypto_prices): Real-time price data from Binance exchangecrypto_prices_chainlink): Price data from Chainlink oracle networksBoth streams deliver current market prices for various cryptocurrency trading pairs, but use different symbol formats and subscription structures.
crypto_prices)crypto_pricesupdatesolusdt, btcusdt)To subscribe to specific cryptocurrency symbols, include a filters parameter:
crypto_prices_chainlink)crypto_prices_chainlink* (all types)eth/usd, btc/usd)To subscribe to specific cryptocurrency symbols, include a JSON filters parameter:
When subscribed to Binance crypto prices (crypto_prices), you'll receive messages with the following structure:
When subscribed to Chainlink crypto prices (crypto_prices_chainlink), you'll receive messages with the following structure:
| Field | Type | Description |
|---|---|---|
symbol |
string | Trading pair symbol Binance: lowercase concatenated (e.g., "solusdt", "btcusdt") Chainlink: slash-separated (e.g., "eth/usd", "btc/usd") |
timestamp |
number | Price timestamp in Unix milliseconds |
value |
number | Current price value in the quote currency |
The Binance source supports various cryptocurrency trading pairs using lowercase concatenated format:
btcusdt - Bitcoin to USDTethusdt - Ethereum to USDTsolusdt - Solana to USDTxrpusdt - XRP to USDTThe Chainlink source supports cryptocurrency trading pairs using slash-separated format:
btc/usd - Bitcoin to USDeth/usd - Ethereum to USDsol/usd - Solana to USDxrp/usd - XRP to USD
Price updates are sent as market prices change
The timestamp in the payload represents when the price was recorded
The outer timestamp represents when the message was sent via WebSocket
No authentication is required for crypto price data
Examples:
Example 1 (unknown):
### With Symbol Filter
To subscribe to specific cryptocurrency symbols, include a filters parameter:
Example 2 (unknown):
## Chainlink Source (`crypto_prices_chainlink`)
### Subscription Details
* **Topic**: `crypto_prices_chainlink`
* **Type**: `*` (all types)
* **Authentication**: Not required
* **Filters**: Optional (JSON object with symbol specification)
* **Symbol Format**: Slash-separated pairs (e.g., `eth/usd`, `btc/usd`)
### Subscription Message
Example 3 (unknown):
### With Symbol Filter
To subscribe to specific cryptocurrency symbols, include a JSON filters parameter:
Example 4 (unknown):
## Message Format
### Binance Source Message Format
When subscribed to Binance crypto prices (`crypto_prices`), you'll receive messages with the following structure:
URL: llms-txt#rtds-comments
Contents:
Source: https://docs.polymarket.com/developers/RTDS/RTDS-comments
Polymarket provides a Typescript client for interacting with this streaming service. Download and view it's documentation here
The comments subscription provides real-time updates for comment-related events on the Polymarket platform. This includes new comments being created, as well as other comment interactions like reactions and replies.
commentscomment_created (and potentially other comment event types like reaction_created)When subscribed to comments, you'll receive messages with the following structure:
Triggered when a user creates a new comment on an event or in reply to another comment.
Triggered when a comment is removed or deleted.
Triggered when a user adds a reaction to an existing comment.
Triggered when a reaction is removed from a comment.
| Field | Type | Description |
|---|---|---|
body |
string | The text content of the comment |
createdAt |
string | ISO 8601 timestamp when the comment was created |
id |
string | Unique identifier for this comment |
parentCommentID |
string | ID of the parent comment if this is a reply (null for top-level comments) |
parentEntityID |
number | ID of the parent entity (event, market, etc.) |
parentEntityType |
string | Type of parent entity (e.g., "Event", "Market") |
profile |
object | Profile information of the user who created the comment |
reactionCount |
number | Current number of reactions on this comment |
replyAddress |
string | Polygon address for replies (may be different from userAddress) |
reportCount |
number | Current number of reports on this comment |
userAddress |
string | Polygon address of the user who created the comment |
| Field | Type | Description |
|---|---|---|
baseAddress |
string | User profile address |
displayUsernamePublic |
boolean | Whether the username should be displayed publicly |
name |
string | User's display name |
proxyWallet |
string | Proxy wallet address used for transactions |
pseudonym |
string | Generated pseudonym for the user |
The following parent entity types are supported:
Event - Comments on prediction eventsMarket - Comments on specific marketsComments support nested threading:
parentCommentID is null or emptyparentCommentID contains the ID of the parent commentAll comments are associated with a parentEntityID and parentEntityType
Real-time comment feed displays
Discussion thread monitoring
Community sentiment analysis
Comments include reactionCount and reportCount
Comment body contains the full text content
The createdAt timestamp uses ISO 8601 format with timezone information
The outer timestamp field represents when the WebSocket message was sent
User profiles include both primary addresses and proxy wallet addresses
Examples:
Example 1 (unknown):
## Message Format
When subscribed to comments, you'll receive messages with the following structure:
Example 2 (unknown):
## Message Types
### comment\_created
Triggered when a user creates a new comment on an event or in reply to another comment.
### comment\_removed
Triggered when a comment is removed or deleted.
### reaction\_created
Triggered when a user adds a reaction to an existing comment.
### reaction\_removed
Triggered when a reaction is removed from a comment.
## Payload Fields
| Field | Type | Description |
| ------------------ | ------ | ------------------------------------------------------------------------- |
| `body` | string | The text content of the comment |
| `createdAt` | string | ISO 8601 timestamp when the comment was created |
| `id` | string | Unique identifier for this comment |
| `parentCommentID` | string | ID of the parent comment if this is a reply (null for top-level comments) |
| `parentEntityID` | number | ID of the parent entity (event, market, etc.) |
| `parentEntityType` | string | Type of parent entity (e.g., "Event", "Market") |
| `profile` | object | Profile information of the user who created the comment |
| `reactionCount` | number | Current number of reactions on this comment |
| `replyAddress` | string | Polygon address for replies (may be different from userAddress) |
| `reportCount` | number | Current number of reports on this comment |
| `userAddress` | string | Polygon address of the user who created the comment |
### Profile Object Fields
| Field | Type | Description |
| ----------------------- | ------- | ------------------------------------------------- |
| `baseAddress` | string | User profile address |
| `displayUsernamePublic` | boolean | Whether the username should be displayed publicly |
| `name` | string | User's display name |
| `proxyWallet` | string | Proxy wallet address used for transactions |
| `pseudonym` | string | Generated pseudonym for the user |
## Parent Entity Types
The following parent entity types are supported:
* `Event` - Comments on prediction events
* `Market` - Comments on specific markets
* Additional entity types may be available
## Example Messages
### New Comment Created
Example 3 (unknown):
### Reply to Existing Comment
URL: llms-txt#uma-optimistic-oracle-integration
Contents:
Polymarket leverages UMA's Optimistic Oracle (OO) to resolve arbitrary questions, permissionlessly. From UMA's docs:
"UMA's Optimistic Oracle allows contracts to quickly request and receive data information ... The Optimistic Oracle acts as a generalized escalation game between contracts that initiate a price request and UMA's dispute resolution system known as the Data Verification Mechanism (DVM). Prices proposed by the Optimistic Oracle will not be sent to the DVM unless it is disputed. If a dispute is raised, a request is sent to the DVM. All contracts built on UMA use the DVM as a backstop to resolve disputes. Disputes sent to the DVM will be resolved within a few days -- after UMA tokenholders vote on what the correct outcome should have been."
To allow CTF markets to be resolved via the OO, Polymarket developed a custom adapter contract called UmaCtfAdapter that provides a way for the two contract systems to interface.
Recent versions (v2+) of the UmaCtfAdapter also include a bulletin board feature that allows market creators to issue "clarifications". Questions that allow updates will include the sentence in their ancillary data:
"Updates made by the question creator via the bulletin board on 0x6A5D0222186C0FceA7547534cC13c3CFd9b7b6A4F74 should be considered. In summary, clarifications that do not impact the question's intent should be considered."
Where the transaction reference outlining what outlining should be considered.
Initiate - Binary CTF markets are initialized via the UmaCtfAdapter's initialize() function. This stores the question parameters on the contract, prepares the CTF and requests a price for a question from the OO. It returns a questionID that is also used to reference on the UmaCtfAdapter. The caller provides:
ancillaryData - data used to resolve a question (i.e the question + clarifications)rewardToken - ERC20 token address used for payment of rewards and feesreward - Reward amount offered to a successful proposer. The caller must have set allowance so that the contract can pull this reward in.proposalBond - Bond required to be posted by OO proposers/disputers. If 0, the default OO bond is used.liveness - UMA liveness period in seconds. If 0, the default liveness period is used.Propose Price - Anyone can then propose a price to the question on the OO. To do this they must post the proposalBond. The liveness period begins after a price is proposed.
Dispute - Anyone that disagrees with the proposed price has the opportunity to dispute the price by posting a counter bond via the OO, this proposed will now be escalated to the DVM for a voter-wide vote.
When the first proposed price is disputed for a questionID on the adapter, a callback is made and posted as the reward for this new proposal. This means a second questionID, making a new questionID to the OO (the reward is returned before the callback is made and posted as the reward for this new proposal). This allows for a second round of resolution, and correspondingly a second dispute is required for it to go to the DVM. The thinking behind this is to doubles the cost of a potential griefing vector (two disputes are required just one) and also allows far-fetched (incorrect) first price proposals to not delay the resolution. As such there are two possible flows:
| Network | Address |
|---|---|
| Polygon Mainnet | 0x2F5e3684cb1F318ec51b00Edba38d79Ac2c0aA9d |
| Network | Address |
|---|---|
| Polygon Mainnet | 0x6A9D0222186C0FceA7547534cC13c3CFd9b7b6A4F74 |
| Network | Address |
|---|---|
| Polygon Mainnet | 0xC8B122858a4EF82C2d4eE2E6A276C719e692995130 |
URL: llms-txt#resolution
Source: https://docs.polymarket.com/developers/resolution/UMA