Skip to main content
Subscribe to real-time order updates, execution reports, fills, and cancellations for your trading activity using Python and gRPC.

Service Definition

Service: polymarket.v1.OrderEntryAPI RPC: CreateOrderSubscription Type: Server-side streaming

Request Parameters

CreateOrderSubscriptionRequest

Example Request

Response Messages

The stream returns CreateOrderSubscriptionResponse messages with multiple event types:

Response Fields

1. Heartbeat Messages

Keep-alive messages to confirm connection health.

2. Snapshot Messages

Initial state of all matching orders when subscription starts.

3. Update Messages

Real-time order updates and executions.

Order Message Structure

Core Order Fields

Price Fields:
  • price, avg_px, stop_price are int64 values
  • Divide by the instrument’s price_scale to get decimal prices
  • price_scale is available from instrument metadata via the RefDataAPI

Order States

Order Sides

Order Types

Execution Message Structure

Executions represent order lifecycle events (new, fill, cancel, reject).

Execution Fields

Execution Types

Order Reject Reasons

Complete Example (from order_stream.py)

This example matches the implementation from the Python examples repository:

Sample Output

Order Lifecycle

Typical Order Flow

Cancel Flow

Reject Flow

Next Steps

Proto Reference

Detailed message and field reference

Error Handling

Handle errors and reconnections

Market Data Stream

Stream real-time market data