Skip to content

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_KEY

Browser-native EventSource cannot set custom headers. For browser clients, use ?apiKey=YOUR_API_KEY instead.

Query parameters

FieldTypeRequiredDefaultDescription
tokensstringNoall tracked tokensComma-separated tracked token symbols
includeOptimisticbooleanNofalseInclude optimistic pre-confirmation price updates
dedupThresholdnumberNoserver defaultClient-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

EventDescription
readyStream accepted; sent immediately on connect
priceToken price update
heartbeatConnection 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

confidenceMeaning
optimisticPre-confirmation predicted state, usually the lowest-latency update
confirmedPrice 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

StatusDescription
400No valid tokens
401Missing or invalid API key
429SSE connection limit exceeded

Rate Limit

Counts against the SSE streams connection limit in Plans & Rate Limits.