GET /v1/stream/prices
Stream real-time price updates for tracked tokens via SSE.
Request
http
GET /v1/stream/prices?tokens=SOL,WBTC,ETH
x-api-key: YOUR_API_KEYBrowser-native EventSource cannot set custom headers. For browser clients, use ?apiKey=YOUR_API_KEY instead.
Query parameters
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
tokens | string | No | all tracked tokens | Comma-separated tracked token symbols |
includeOptimistic | boolean | No | false | Include optimistic pre-confirmation price updates |
dedupThreshold | number | No | server default | Client-side override for price dedup sensitivity |
When tokens is omitted, the stream subscribes to every tracked token and sends an initial snapshot on connect.
Events
| Event | Description |
|---|---|
ready | Stream accepted; sent immediately on connect |
price | Token price update |
heartbeat | Connection keepalive |
Example payload
text
event: price
data: {"token":"SOL","priceUsd":80.31,"bestBid":80.07,"bestAsk":80.54,"bestBidPool":"BmXV...","bestAskPool":"Ahho...","bestBidDex":"orca-whirlpool","bestAskDex":"orca-whirlpool","bestBidFeeBps":1,"bestAskFeeBps":1,"poolCacheAgeMs":150,"confidence":"confirmed","poolCount":31,"timestamp":1712000000000,"route":"direct","change24h":-1.42}Confidence model
confidence | Meaning |
|---|---|
optimistic | Pre-confirmation predicted state, usually the lowest-latency update |
confirmed | Price derived from confirmed observed pool state |
Optimistic prices are usually followed quickly by the matching confirmed price. Consumers that need strict consistency can ignore optimistic.
Example
bash
curl -N -H "x-api-key: YOUR_API_KEY" \
"https://api.venum.dev/v1/stream/prices?tokens=SOL,WBTC"
# Browser/EventSource fallback
curl -N \
"https://api.venum.dev/v1/stream/prices?tokens=SOL,WBTC&apiKey=YOUR_API_KEY"Errors
| Status | Description |
|---|---|
400 | No valid tokens |
401 | Missing or invalid API key |
429 | SSE connection limit exceeded |
Rate Limit
Counts against the SSE streams connection limit in Plans & Rate Limits.
