Skip to main content
Reference for Protocol Buffer messages, fields, and enumerations used in the gRPC 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.

Instrument Settlement

Read an instrument’s final settlement price, including after termination. Requires the read:marketdata scope and the existing gRPC authentication.

SettlementService

Package: polymarket.us.settlement.v1.

Request Fields

An empty symbol or one beginning with / or ! returns InvalidArgument. An unknown or unpublished symbol returns NotFound.

Response Fields

The latest record controls the result, so later reads can reflect corrections. A known instrument without a final settlement returns success with stats absent; absence is distinct from a present zero price. Service failures return an error.

Python Usage

Use the authenticated channel and metadata from the gRPC overview, and set symbol to the instrument to read.
REST equivalent: GET /v1/instruments/{symbol}/settlement, using the same token and scope.

Order Entry Streaming

OrderEntryAPI Service

Python Usage

Subscription Request Fields

Response Processing

RFQ Events Streaming

The proto bundle includes RFQAPI.GetRFQTrades and StreamRFQEventsResponse.rfq_trade (field 15). See RFQ trade history and the RFQ event stream for usage.

ComboAPI and RFQAPI Services

Request Fields

StreamRFQEventsRequest is currently empty.

RFQ Price Tick

RFQ includes optional double tick_size = 14 (JSON tickSize): the instrument’s minimum price increment in dollars. In Python, check rfq.HasField("tick_size"). If absent, use GetCombos with rfq.symbol; zero is not a valid tick.

RFQ Combo Legs

RFQ.combo_legs preserves the component order and sides captured at RFQ creation:
settlement_price is the raw YES/LONG settlement normalized to [0,1]. It is not inverted for SELL legs. Optional presence distinguishes an unavailable settlement from a present zero.

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

DAY orders do not automatically cancel at 5pm during trade day rolls.The Exchange team is working on improving the DAY order types performance. While the Exchange makes improvement, DAY orders will not automatically cancel at 5pm during trade day rolls. Please use GTD orders with the desired timestamp. GTD orders will remain functional with the good-til-time specified.

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