Live Market Data
Trades
Every public print on the markets you watch, in the YES price.
WSSawait stream.watch_trades(market_ids)SDK stream · your process · venue credentials
Self-hosted. Opened from your own process straight to the venue. Nothing here runs on Synpath's servers.
One event per execution. price is the YES price and taker_side is what the aggressor did on the YES leg: buy took YES, sell took NO. A trade on Polymarket's NO token is reported at 1 − price with the side flipped, so every venue reads the same way.
Venues
| Venue | Support | Notes |
|---|---|---|
| Polymarket | Supported | No taker side on the wire; taker_side is null. |
| Kalshi | Supported | With the taker's side. Numbered per subscription, so a missed trade is reported as a gap. |
| Polymarket US | Supported | With the taker's side. |
| Opinion | Supported | On the YES leg, with the taker's side. Splits and merges arrive as venue events. |
Parameters
| Name | Type | Description |
|---|---|---|
market_ids | list[str] | None | Synpath ids. On Kalshi, omit for every market. |
TradeEvent
A public execution.
| Name | Type | Description |
|---|---|---|
venue | string | Which venue the event came from. |
received_at | integer | When this process received it, ms since epoch. |
market_id | string | |
id | string | null | The venue's trade id or transaction hash. |
price | decimal | The YES price. |
amount | decimal | Contracts. |
taker_side | buy | sell | null | On the YES leg, where the venue says. |
timestamp | integer | null |
import asyncio
from synpath import PolymarketMarketStream
stream = PolymarketMarketStream() # no credentials
from synpath import TradeEvent
async def main():
async with stream:
await stream.watch_trades(["polymarket:2252244"])
async for event in stream:
if isinstance(event, TradeEvent):
print(event.timestamp, event.taker_side, event.price, event.amount)
asyncio.run(main())TradeEvent
{
"venue": "polymarket",
"received_at": 1790077592174,
"market_id": "polymarket:2252244",
"id": "0x9f3c…",
"price": "0.42",
"amount": "25",
"taker_side": "buy",
"timestamp": 1789655011496,
"info": {}
}
