"orders") streams real-time trade events from Polymarket. By default, you receive confirmed events - trades that have been mined on-chain. Covers both V1 and V2 Polymarket contracts.
Want even earlier signals? Pending trade events deliver trades 3–5 seconds before confirmation by decoding transactions from the Polygon mempool. Use
status: "all" to receive both.V1 vs V2: Every
order_filled event has a version field (1 or 2). V2 trades add builder and metadata fields (bytes32 hex, currently zero). fee_refund events are V1-only - V2 emits net fees directly on order_filled (no refund flow). See the V2 Migration Guide.Event Types
order_filled
Field Reference
Maker vs Taker emissions
A singlematchOrders transaction emits multiple order_filled events - one per maker matched, plus one synthetic taker-aggregate emission summarizing the taker’s overall fill. The role field tells you which one you’re looking at:
Pending events set
role directly from the maker/taker builder; confirmed events derive it from the chain log (taker == exchange contract ⇒ "taker", else "maker"). Empirically the two agree 100%, so you can dedupe pending → confirmed by tx_hash + order_hash regardless of role.fee_refund
fee_refund events are emitted for V1 trades only. V2 has no refund flow - the net fee is emitted directly on order_filled at match time.Understanding Fee Refunds
Polymarket implements a maker fee rebate program. Here’s how it works:1
Trade executes
An
order_filled event arrives with a fee field representing the gross fee charged.2
Rebate processes
A
fee_refund event for the same order_hash arrives 2–5ms later (same block, usually same tx). Rarely up to 50ms.3
Calculate net fee
The maker’s actual net fee is
fee_refund.fee_charged (or equivalently order_filled.fee - fee_refund.refund).If you don’t need exact fee accounting, you can ignore
fee_refund events. The fee field on order_filled is directionally correct for most purposes. Fee refunds are only necessary for precise PnL tracking or cost basis accounting.