Skip to main content
Complete reference documentation for all Protocol Buffer messages, fields, and enumerations used in the gRPC streaming API.

Available Services

The Polymarket Exchange API exposes the following gRPC services:

Obtaining Proto Files

Download Proto Files

Get the complete Protocol Buffer definitions to generate client libraries in any language
Use the downloaded definitions as the client contract. Do not make client startup depend on gRPC reflection, whose availability can differ by environment.

Generating Python Client Code

After downloading the proto files, generate Python code:
This generates:
  • *_pb2.py - Message and enum definitions
  • *_pb2_grpc.py - Service stubs

Market Data Streaming

MarketDataSubscriptionAPI Service

Python Usage

Request Fields

Response Fields

Instrument State Tracking: The state field is optional. Use ListInstruments to get and cache the initial state, then subscribe to the instrument state change subscription for real-time state updates.

Order Entry Streaming

OrderEntryAPI Service

Python Usage

Subscription Request Fields

Response Processing

RFQ Events Streaming

Upcoming - beta access required. RFQ events are part of the upcoming RFQ API beta. Reach out to institutional@polymarket.us to join the beta test.

ComboAPI and RFQAPI Services

Request Fields

StreamRFQEventsRequest is currently empty.

Response Events

Each StreamRFQEventsResponse has one event payload: For request/response field detail and a Python example, see RFQ Events Streaming.

Funding Streaming

FundingAPI Service

CreateBalanceLedgerSubscriptionRequest

For full request/response field detail and a Python example, see Balance Ledger Streaming.

Enumerations

Side

OrderType

TimeInForce

OrderState

ExecutionType

InstrumentState

Primary State Flow

Exception States

Other Possible States

LedgerEntryType

Used by CreateBalanceLedgerSubscription and the Balance Ledger REST endpoints. Only the allowed values are returned to clients; suppressed values are filtered server-side.

Allowed

Suppressed (internal — never returned to clients)

Requesting a suppressed value in entry_types returns Aborted (HTTP 409).

Price Representation

All prices are int64 values. Divide by the instrument’s price_scale to get the decimal value.

Next Steps

Market Data Stream

Learn about market data streaming

Order Stream

Learn about order streaming

Error Handling

Handle errors and reconnections