GET /v1/stream/orders
Filter parameters
Apply filters to receive only the events relevant to your strategy. Omit a parameter to receive all values for that dimension.Output formats
The stream supports two formats. Choose based on your throughput and parsing needs.- Compact array (default)
- JSON (?format=json)
The default format serializes each transaction as a nested array. It is more compact and faster to transmit than equivalent JSON objects — ideal for high-frequency feeds.The array positions map as follows:
Use the parser utilities to convert the compact array into a structured object.
Parsing the compact format
The SDK parsers convert a raw compact array into the same shape as the JSON format response. Here is the complete parser code for both languages:- Default (Compact Format): After running the compact array through the SDK’s parser, the output uses camelCase for top-level fields and specific order fields (such as
txHash,takerOrder,tokenId, andfeeRateBps). - JSON Format (
?format=json): The raw API returns a structured object using snake_case for all fields (such astx_hash,taker_order,token_id, andfee_rate_bps).
- Parsed Compact Object Shape (camelCase)
- Raw JSON Object Shape (snake_case)
Connect and process events
1
Instantiate the client
Create a
PolyEdgeClient with your API key. The SDK handles authentication via the X-PolyEdge-Key header on every request.2
Open the stream
Call
streamOrders() / stream_orders() with your filters. The Node.js SDK uses eventsource-client which auto-reconnects on dropped connections.3
Process each event
Each yielded
order object is already parsed by the SDK. Access order.market, order.takerOrder, and order.makerOrders directly.4
Handle disconnections
The Node.js SDK auto-reconnects via
eventsource-client. In Python, wrap your loop in a try/except and re-enter the loop to reconnect.reconnect.py
The SSE event name sent by the PolyEdge API is
order. The SDK already filters on this event name for you, so non-order events (heartbeats, etc.) are silently dropped.