RealFlow.so

Live prices over SSE

GET /v1/prices/stream opens a long-lived text/event-stream connection. We push a price event every time a new swap touches one of your subscribed mints, plus a comment-only heartbeat every ~15 seconds so intermediaries don't reap the connection as idle.

Subscribe

Specify mints with the tokens query param — comma-separated:

curl -N \
  -H "X-API-Key: $REALFLOW_API_KEY" \
  "https://api.realflow.so/v1/prices/stream?tokens=So111...,EPjFW..."

Wire format

Each price event:

event: price
id: 1730500000000
data: {"mint":"EPjFW...","price_usd":"1.0001","ts":1730500000000}

  • mint — SPL mint address.
  • price_usd — decimal string; parse with Decimal if you care about sub-cent precision.
  • ts — epoch milliseconds at which the price was derived.
  • id — same epoch-ms; clients should track the most recent one and pass it back as Last-Event-ID on reconnect.

Heartbeats

A comment-only line (: keepalive\n\n) is emitted every ~15s. EventSource clients ignore comments — they exist purely to keep proxies and load balancers from closing the connection.

Plan limits

  • Concurrent SSE connections per key — enforced via the key's sse_connections_max. Excess attempts → 429 rate_limited.
  • Mints per connection — enforced via max_tokens_per_sse_conn. Exceeding → 400 validation_failed.

Reconnect handling

SSE clients reconnect automatically (per the spec). When they do, they include Last-Event-ID; we use that to resume from the last event you saw, so you don't miss prices during transient drops or our blue/green deploys.

Pricing

During launch, per-message cost is 0 credits — you only pay for the connection slot (counted against your plan's sse_connections_max). The current per-message cost is visible at /docs/rate-limits and via GET /v1/meta/credit-costs.