docs: daily sync Polymarket docs 2026-06-24 - refresh 145 updated files

This commit is contained in:
GLaDOS
2026-06-24 14:13:08 +02:00
parent 2468130bc8
commit ac2466d988
145 changed files with 517 additions and 190 deletions
+2
View File
@@ -76,6 +76,7 @@ The following countries are restricted from placing orders on Polymarket. Countr
| PL | Poland | Close-only | | PL | Poland | Close-only |
| RU | Russia | Blocked | | RU | Russia | Blocked |
| SG | Singapore | Close-only | | SG | Singapore | Close-only |
| SK | Slovakia | Blocked |
| SO | Somalia | Blocked | | SO | Somalia | Blocked |
| SS | South Sudan | Blocked | | SS | South Sudan | Blocked |
| SD | Sudan | Blocked | | SD | Sudan | Blocked |
@@ -97,6 +98,7 @@ In addition to fully blocked countries, the following specific regions within ot
| Country | Region | Region Code | | Country | Region | Region Code |
| ------------ | ------- | ----------- | | ------------ | ------- | ----------- |
| Canada (CA) | Ontario | ON | | Canada (CA) | Ontario | ON |
| Canada (CA) | Quebec | QC |
| Ukraine (UA) | Crimea | 43 | | Ukraine (UA) | Crimea | 43 |
| Ukraine (UA) | Donetsk | 14 | | Ukraine (UA) | Donetsk | 14 |
| Ukraine (UA) | Luhansk | 09 | | Ukraine (UA) | Luhansk | 09 |
+169 -22
View File
@@ -16,8 +16,8 @@ title: Quoter Gateway
description: >- description: >-
Authenticated quoter channel. Send the `auth` message as the first message Authenticated quoter channel. Send the `auth` message as the first message
within 30 seconds. The gateway broadcasts active RFQ requests, accepts signed within 30 seconds. The gateway broadcasts active RFQ requests, accepts signed
quotes and cancellations, issues last-look confirmation requests, and streams quotes and cancellations, issues last-look confirmation requests, streams
execution updates. execution updates, and sends confirmed trade broadcasts.
servers: servers:
- id: production - id: production
protocol: wss protocol: wss
@@ -34,7 +34,7 @@ operations:
description: Authenticate the connection (send as the first message) description: Authenticate the connection (send as the first message)
type: receive type: receive
messages: messages:
- &ref_16 - &ref_17
id: auth id: auth
contentType: application/json contentType: application/json
payload: payload:
@@ -180,7 +180,7 @@ operations:
description: Gateway response to the auth message description: Gateway response to the auth message
type: send type: send
messages: messages:
- &ref_20 - &ref_21
id: authResponse id: authResponse
contentType: application/json contentType: application/json
payload: payload:
@@ -247,7 +247,7 @@ operations:
description: Broadcast of an active RFQ request to quote description: Broadcast of an active RFQ request to quote
type: send type: send
messages: messages:
- &ref_21 - &ref_22
id: rfqRequest id: rfqRequest
contentType: application/json contentType: application/json
payload: payload:
@@ -446,7 +446,7 @@ operations:
description: Submit a signed maker quote before the submission deadline description: Submit a signed maker quote before the submission deadline
type: receive type: receive
messages: messages:
- &ref_17 - &ref_18
id: rfqQuote id: rfqQuote
contentType: application/json contentType: application/json
payload: payload:
@@ -660,7 +660,7 @@ operations:
description: Returns the server-generated quote ID description: Returns the server-generated quote ID
type: send type: send
messages: messages:
- &ref_22 - &ref_23
id: ackRfqQuote id: ackRfqQuote
contentType: application/json contentType: application/json
payload: payload:
@@ -720,7 +720,7 @@ operations:
description: Cancel an active maker quote before it is selected description: Cancel an active maker quote before it is selected
type: receive type: receive
messages: messages:
- &ref_18 - &ref_19
id: rfqQuoteCancel id: rfqQuoteCancel
contentType: application/json contentType: application/json
payload: payload:
@@ -800,7 +800,7 @@ operations:
description: Confirms quote cancellation description: Confirms quote cancellation
type: send type: send
messages: messages:
- &ref_23 - &ref_24
id: ackRfqQuoteCancel id: ackRfqQuoteCancel
contentType: application/json contentType: application/json
payload: payload:
@@ -858,7 +858,7 @@ operations:
description: Last-look confirmation request for a selected quote description: Last-look confirmation request for a selected quote
type: send type: send
messages: messages:
- &ref_24 - &ref_25
id: rfqConfirmationRequest id: rfqConfirmationRequest
contentType: application/json contentType: application/json
payload: payload:
@@ -1041,7 +1041,7 @@ operations:
description: Confirm or decline a selected quote during last look description: Confirm or decline a selected quote during last look
type: receive type: receive
messages: messages:
- &ref_19 - &ref_20
id: rfqConfirmationResponse id: rfqConfirmationResponse
contentType: application/json contentType: application/json
payload: payload:
@@ -1117,7 +1117,7 @@ operations:
description: Confirms the maker's last-look response description: Confirms the maker's last-look response
type: send type: send
messages: messages:
- &ref_25 - &ref_26
id: ackRfqConfirmationResponse id: ackRfqConfirmationResponse
contentType: application/json contentType: application/json
payload: payload:
@@ -1189,7 +1189,7 @@ operations:
description: Execution progress for selected makers description: Execution progress for selected makers
type: send type: send
messages: messages:
- &ref_26 - &ref_27
id: rfqExecutionUpdate id: rfqExecutionUpdate
contentType: application/json contentType: application/json
payload: payload:
@@ -1265,12 +1265,157 @@ operations:
bindings: [] bindings: []
extensions: *ref_0 extensions: *ref_0
- &ref_15 - &ref_15
id: receiveTradeBroadcast
title: Trade Broadcast
description: Confirmed Combo RFQ trade broadcast
type: send
messages:
- &ref_28
id: rfqTrade
contentType: application/json
payload:
- name: RFQ_TRADE
description: Confirmed Combo RFQ trade broadcast
type: object
properties:
- name: type
type: string
description: RFQ_TRADE
required: true
- name: rfq_id
type: string
description: RFQ ID for deduplication and reconciliation.
required: true
- name: requester_id
type: string
description: Opaque public ID for the RFQ source.
required: true
- name: condition_id
type: string
description: Derived combinatorial condition ID.
required: true
- name: leg_position_ids
type: array
description: Canonical leg position IDs in the combo.
required: true
properties:
- name: item
type: string
required: false
- name: direction
type: string
description: Requester trade direction.
enumValues:
- BUY
- SELL
required: true
- name: side
type: string
description: Combinatorial position side. Currently only YES is supported.
enumValues:
- 'YES'
- 'NO'
required: true
- name: price_e6
type: string
description: Accepted blended price in six-decimal fixed-point units.
required: true
- name: size_e6
type: string
description: Matched Combo share size in six-decimal fixed-point units.
required: true
- name: executed_at
type: integer
description: Execution timestamp in Unix milliseconds.
required: true
headers: []
jsonPayloadSchema:
type: object
description: >-
Confirmed Combo RFQ trade broadcast. Excludes maker identity and
per-maker fill allocations.
required:
- type
- rfq_id
- requester_id
- condition_id
- leg_position_ids
- direction
- side
- price_e6
- size_e6
- executed_at
properties:
type:
type: string
const: RFQ_TRADE
x-parser-schema-id: <anonymous-schema-75>
rfq_id:
type: string
description: RFQ ID for deduplication and reconciliation.
x-parser-schema-id: <anonymous-schema-76>
requester_id:
type: string
description: Opaque public ID for the RFQ source.
x-parser-schema-id: <anonymous-schema-77>
condition_id:
type: string
description: Derived combinatorial condition ID.
x-parser-schema-id: <anonymous-schema-78>
leg_position_ids:
type: array
description: Canonical leg position IDs in the combo.
items:
type: string
x-parser-schema-id: <anonymous-schema-80>
x-parser-schema-id: <anonymous-schema-79>
direction: *ref_2
side: *ref_3
price_e6:
type: string
description: Accepted blended price in six-decimal fixed-point units.
x-parser-schema-id: <anonymous-schema-81>
size_e6:
type: string
description: Matched Combo share size in six-decimal fixed-point units.
x-parser-schema-id: <anonymous-schema-82>
executed_at:
type: integer
format: int64
description: Execution timestamp in Unix milliseconds.
x-parser-schema-id: <anonymous-schema-83>
x-parser-schema-id: RfqTrade
title: RFQ_TRADE
description: Confirmed Combo RFQ trade broadcast
example: |-
{
"type": "RFQ_TRADE",
"rfq_id": "rfq_<id>",
"requester_id": "req_<public_id>",
"condition_id": "0x<condition_id>",
"leg_position_ids": [
"<leg_position_id_1>",
"<leg_position_id_2>"
],
"direction": "BUY",
"side": "YES",
"price_e6": "125000",
"size_e6": "800000",
"executed_at": 1780854786039
}
bindings: []
extensions:
- id: x-parser-unique-object-id
value: rfqTrade
bindings: []
extensions: *ref_0
- &ref_16
id: receiveError id: receiveError
title: Error title: Error
description: Sent when a command fails validation or cannot be applied description: Sent when a command fails validation or cannot be applied
type: send type: send
messages: messages:
- &ref_27 - &ref_29
id: rfqError id: rfqError
contentType: application/json contentType: application/json
payload: payload:
@@ -1343,19 +1488,19 @@ operations:
type: type:
type: string type: string
const: RFQ_ERROR const: RFQ_ERROR
x-parser-schema-id: <anonymous-schema-75> x-parser-schema-id: <anonymous-schema-84>
request_type: request_type:
type: string type: string
description: Inbound command that failed, when parsed. description: Inbound command that failed, when parsed.
x-parser-schema-id: <anonymous-schema-76> x-parser-schema-id: <anonymous-schema-85>
rfq_id: rfq_id:
type: string type: string
description: RFQ ID, when present on the failed command. description: RFQ ID, when present on the failed command.
x-parser-schema-id: <anonymous-schema-77> x-parser-schema-id: <anonymous-schema-86>
quote_id: quote_id:
type: string type: string
description: Quote ID, when present on the failed command. description: Quote ID, when present on the failed command.
x-parser-schema-id: <anonymous-schema-78> x-parser-schema-id: <anonymous-schema-87>
code: code:
type: string type: string
description: Stable machine-readable error code. description: Stable machine-readable error code.
@@ -1388,11 +1533,11 @@ operations:
- UNAUTHENTICATED - UNAUTHENTICATED
- UNAUTHORIZED_ROLE - UNAUTHORIZED_ROLE
- UNKNOWN_RFQ - UNKNOWN_RFQ
x-parser-schema-id: <anonymous-schema-79> x-parser-schema-id: <anonymous-schema-88>
error: error:
type: string type: string
description: Human-readable error detail for logging and debugging. description: Human-readable error detail for logging and debugging.
x-parser-schema-id: <anonymous-schema-80> x-parser-schema-id: <anonymous-schema-89>
x-parser-schema-id: RfqError x-parser-schema-id: RfqError
title: RFQ_ERROR title: RFQ_ERROR
description: Sent when a command fails validation or cannot be applied description: Sent when a command fails validation or cannot be applied
@@ -1424,13 +1569,13 @@ receiveOperations:
- *ref_13 - *ref_13
- *ref_14 - *ref_14
- *ref_15 - *ref_15
sendMessages:
- *ref_16 - *ref_16
sendMessages:
- *ref_17 - *ref_17
- *ref_18 - *ref_18
- *ref_19 - *ref_19
receiveMessages:
- *ref_20 - *ref_20
receiveMessages:
- *ref_21 - *ref_21
- *ref_22 - *ref_22
- *ref_23 - *ref_23
@@ -1438,6 +1583,8 @@ receiveMessages:
- *ref_25 - *ref_25
- *ref_26 - *ref_26
- *ref_27 - *ref_27
- *ref_28
- *ref_29
extensions: extensions:
- id: x-parser-unique-object-id - id: x-parser-unique-object-id
value: quoter value: quoter
+5
View File
@@ -1102,6 +1102,11 @@ Secure clients expose the API credentials created for the authenticated session.
## Changelog ## Changelog
### `0.1.0b9`
* RFQ quoter sessions now emit typed `RfqTradeEvent` events for confirmed Combos fills.
* RFQ rejection errors now expose `error_id` values and parse `INVALID_SIGNATURE` and `INTERNAL_ERROR` codes.
### `0.1.0b8` ### `0.1.0b8`
* Added `parent_event_id` to `Event` so child events can link back to their parent event. * Added `parent_event_id` to `Event` so child events can link back to their parent event.
+5
View File
@@ -1103,6 +1103,11 @@ Secure clients expose the API credentials created for the authenticated session.
## Changelog ## Changelog
### `0.1.0-beta.8`
* RFQ quoter sessions now emit typed `trade` events for confirmed Combos fills.
* RFQ rejection errors now expose `errorId` values and parse `INVALID_SIGNATURE` and `INTERNAL_ERROR` codes.
### `0.1.0-beta.7` ### `0.1.0-beta.7`
* Added `parentEventId` to `Event` so child events can link back to their parent event. * Added `parentEventId` to `Event` so child events can link back to their parent event.
+2
View File
@@ -76,6 +76,7 @@ The following countries are restricted from placing orders on Polymarket. Countr
| PL | Poland | Close-only | | PL | Poland | Close-only |
| RU | Russia | Blocked | | RU | Russia | Blocked |
| SG | Singapore | Close-only | | SG | Singapore | Close-only |
| SK | Slovakia | Blocked |
| SO | Somalia | Blocked | | SO | Somalia | Blocked |
| SS | South Sudan | Blocked | | SS | South Sudan | Blocked |
| SD | Sudan | Blocked | | SD | Sudan | Blocked |
@@ -97,6 +98,7 @@ In addition to fully blocked countries, the following specific regions within ot
| Country | Region | Region Code | | Country | Region | Region Code |
| ------------ | ------- | ----------- | | ------------ | ------- | ----------- |
| Canada (CA) | Ontario | ON | | Canada (CA) | Ontario | ON |
| Canada (CA) | Quebec | QC |
| Ukraine (UA) | Crimea | 43 | | Ukraine (UA) | Crimea | 43 |
| Ukraine (UA) | Donetsk | 14 | | Ukraine (UA) | Donetsk | 14 |
| Ukraine (UA) | Luhansk | 09 | | Ukraine (UA) | Luhansk | 09 |
File diff suppressed because one or more lines are too long
+164
View File
@@ -45,6 +45,7 @@ sequenceDiagram
RFQ->>Execution: Execute accepted Combo RFQ->>Execution: Execute accepted Combo
Execution-->>Requester: Send execution update Execution-->>Requester: Send execution update
Execution-->>Quoter: Send execution update Execution-->>Quoter: Send execution update
RFQ-->>Quoter: Broadcast confirmed trade
``` ```
1. **User creates an unsigned Request** for a Combo price. 1. **User creates an unsigned Request** for a Combo price.
@@ -58,6 +59,7 @@ sequenceDiagram
8. **RFQ system executes the accepted Combo**. 8. **RFQ system executes the accepted Combo**.
9. **User receives execution updates**. 9. **User receives execution updates**.
10. **Market maker receives execution updates**. 10. **Market maker receives execution updates**.
11. **Connected market makers receive confirmed trade broadcasts**.
<Note> <Note>
Combo position IDs are complementary to CLOB token IDs. A user can trade the Combo position IDs are complementary to CLOB token IDs. A user can trade the
@@ -3125,6 +3127,168 @@ outcomes in your own systems.
</Tab> </Tab>
</Tabs> </Tabs>
## Listen to Trade Broadcasts
Confirmed trade broadcasts tell connected market makers when any Combo RFQ trade
has completed successfully. Use them to build a public trade tape, update risk,
or reconcile market activity that was filled by another maker.
Trade broadcasts are best-effort and may be replayed after reconnects. Deduplicate
them by RFQ ID: `rfqId` in TypeScript or `rfq_id` in Python and raw WebSocket
messages.
<Tabs>
<Tab title="TypeScript">
<Steps>
<Step title="Switch on the Event Type">
First, switch on `event.type` to handle trade broadcasts from the same session
stream.
```ts theme={null}
switch (event.type) {
case "trade":
// event: RfqTradeEvent
handleTrade(event);
break;
// …
}
```
</Step>
<Step title="Inspect the Trade">
Then, inspect the confirmed trade before storing or applying it. Trade broadcasts
exclude maker identity and per-maker fill allocations.
```ts theme={null}
type RfqTradeEvent = {
type: "trade";
rfqId: RfqId;
requesterId: RfqRequestorPublicId;
conditionId: ComboConditionId;
legPositionIds: PositionId[];
direction: RfqDirection;
side: RfqSide.Yes;
price: DecimalString;
size: DecimalString;
executedAt: EpochMilliseconds;
};
```
`price` is the accepted blended price in pUSD per YES Combo share. `size` is the
matched Combo share size. Both values are normalized decimal strings.
</Step>
<Step title="Store the Trade">
Finally, persist the trade by RFQ ID and execution timestamp for downstream
reconciliation.
```ts theme={null}
function handleTrade(event: RfqTradeEvent) {
storeComboTrade({
rfqId: event.rfqId,
conditionId: event.conditionId,
legPositionIds: event.legPositionIds,
requesterId: event.requesterId,
price: event.price,
size: event.size,
executedAt: event.executedAt,
});
}
```
</Step>
</Steps>
</Tab>
<Tab title="Python">
<Steps>
<Step title="Check Event Type">
First, use `isinstance(...)` to handle trade broadcasts from the same session
stream.
```python theme={null}
from polymarket import RfqTradeEvent
async for event in session:
if isinstance(event, RfqTradeEvent):
handle_trade(event)
```
</Step>
<Step title="Inspect the Trade">
Then, inspect the confirmed trade before storing or applying it. Trade broadcasts
exclude maker identity and per-maker fill allocations.
```python theme={null}
from decimal import Decimal
class RfqTradeEvent:
type: "trade"
rfq_id: RfqId
requester_id: RfqRequestorPublicId
condition_id: ComboConditionId
leg_position_ids: tuple[PositionId, ...]
direction: RfqDirection
side: RfqSide
price: Decimal
size: Decimal
executed_at: int
```
`price` is the accepted blended price in pUSD per YES Combo share. `size` is the
matched Combo share size. Both values are `Decimal` instances.
</Step>
<Step title="Store the Trade">
Finally, persist the trade by RFQ ID and execution timestamp for downstream
reconciliation.
```python theme={null}
from polymarket import RfqTradeEvent
def handle_trade(event: RfqTradeEvent) -> None:
store_combo_trade(
rfq_id=event.rfq_id,
condition_id=event.condition_id,
leg_position_ids=event.leg_position_ids,
requester_id=event.requester_id,
price=event.price,
size=event.size,
executed_at=event.executed_at,
)
```
</Step>
</Steps>
</Tab>
<Tab title="API">
Listen for `RFQ_TRADE` messages on the RFQ WebSocket after Combo executions are
confirmed. These messages are sent to authenticated quoter sessions and exclude
maker identity and per-maker fill allocations.
```json theme={null}
{
"type": "RFQ_TRADE",
"rfq_id": "<rfq_id>",
"requester_id": "<requester_id>",
"condition_id": "<combo_condition_id>",
"leg_position_ids": ["<leg_position_id_1>", "<leg_position_id_2>"],
"direction": "BUY",
"side": "YES",
"price_e6": "125000",
"size_e6": "800000",
"executed_at": 1780854786039
}
```
`price_e6` is the accepted blended price in 6-decimal base units, and `size_e6`
is the matched Combo share size in 6-decimal base units.
</Tab>
</Tabs>
## Handle Errors ## Handle Errors
In this section, we will talk you through how to handle errors with the RFQ system. In this section, we will talk you through how to handle errors with the RFQ system.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+2
View File
@@ -76,6 +76,7 @@ The following countries are restricted from placing orders on Polymarket. Countr
| PL | Poland | Close-only | | PL | Poland | Close-only |
| RU | Russia | Blocked | | RU | Russia | Blocked |
| SG | Singapore | Close-only | | SG | Singapore | Close-only |
| SK | Slovakia | Blocked |
| SO | Somalia | Blocked | | SO | Somalia | Blocked |
| SS | South Sudan | Blocked | | SS | South Sudan | Blocked |
| SD | Sudan | Blocked | | SD | Sudan | Blocked |
@@ -97,6 +98,7 @@ In addition to fully blocked countries, the following specific regions within ot
| Country | Region | Region Code | | Country | Region | Region Code |
| ------------ | ------- | ----------- | | ------------ | ------- | ----------- |
| Canada (CA) | Ontario | ON | | Canada (CA) | Ontario | ON |
| Canada (CA) | Quebec | QC |
| Ukraine (UA) | Crimea | 43 | | Ukraine (UA) | Crimea | 43 |
| Ukraine (UA) | Donetsk | 14 | | Ukraine (UA) | Donetsk | 14 |
| Ukraine (UA) | Luhansk | 09 | | Ukraine (UA) | Luhansk | 09 |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long