Stay close to the market.
Subscribe to market activity with server-sent events on your assigned stream service.
Connect to a market stream
/markets/:slug/streamSSEThe stream service uses a separate base URL from REST. Market streams publish an initial snapshot, new trades, and keepalive events. Replace example-market with a slug returned by discovery.
curl --no-buffer --fail-with-body \
-H "Accept: text/event-stream" \
"$IMPLYRA_STREAM_URL/markets/example-market/stream"The JavaScript example requires a deployment that allows your browser origin and the requested stream. EventSource cannot send custom authorization headers; use the access mechanism supplied during onboarding.
Market stream events
Listen to named events with addEventListener. A generic onmessage handler alone does not consume events that have an explicit event name.
initSnapshotInitial market data after connecting. Handle this separately from incremental trade events.
tradeTradeA trading activity update for the subscribed market.
keepaliveEvery 15 secondsMaintains the market stream connection during quiet periods.
Available stream routes
GET /trades/streamsystem · tradeGlobal enriched trades with a minimum trade value of $100.
GET /smart-money/public/streamsystem · tradePublic smart-money trade activity.
GET /top-trader-signals/streamsystem · backfill · signalTop-trader signals. Supports since, minSharpe, minWinRate, minPnl, and traderTier filters. Backfill payloads are arrays.
GET /wallets/stream?ticket=…system · tradeUser-specific tracked-wallet activity. Requires an authenticated session or a short-lived stream ticket.
Wallet stream tickets
Authenticated wallet integrations can request a ticket with POST /wallets/stream-ticket. The stream service accepts its klarity_access_token session cookie or a request header of the same name for this operation. That session is separate from REST deployment access.
The response is an object with a ticket string. Connect to /wallets/stream?ticket=... within 30 seconds. Tickets are single-use; obtain a new ticket before reconnecting a ticket-based wallet stream.
Plan for reconnects
Close streams when a view is no longer active, and limit the number of simultaneous connections. On reconnect, refresh the relevant REST snapshot if your interface needs to reconcile missed activity.
Do not assume exactly-once delivery or universal replay. The top-trader signal stream supports a since parameter for backfill; other streams have their own event and recovery behavior.