Stream prices (WebSocket)
The Hermes WebSocket protocol. Open the socket with a GET upgrade, then send JSON text
messages:
{"type":"subscribe","ids":[…],"verbose":false,"binary":false,"ignore_invalid_price_ids":false}is answered{"type":"response","status":"success"}, then the last value of each feed and every later update arrive as{"type":"price_update","price_feed":{…}}.{"type":"unsubscribe","ids":[…]}is answered the same way.- A malformed message, an unknown type, an unknown or malformed ID, or more than 500 IDs is
answered
{"type":"response","status":"error","error":"…"}; the socket stays open.
IDs travel in the message body, so a subscription is not bound by the URL length: this is the way to follow more than 200 feeds on one connection.
verbose adds metadata to each price_feed, binary adds an empty vaa.
allow_out_of_order is accepted and changes nothing. The server pings every 30 seconds and
closes the socket after 24 hours (1000), when the client sends more than 5 messages per second
with a burst of 20 or stops reading (1008), and when it restarts (1001). A message is at most
64 KiB.
Query Parameters
Update cadence of the SSE stream and the WebSocket. A fixed-rate channel sends a feed at most once per tick, only when it changed. fixed_rate@50ms is refused. Validated and ignored on the other routes.
"fixed_rate@1000ms"Value in
- "real_time"
- "fixed_rate@200ms"
- "fixed_rate@1000ms"
Response Body
text/plain
text/plain
text/plain
curl -X GET "https://example.com/ws"Prices over an interval GET
Updates from `publish_time` to `publish_time + interval`, inclusive, one `PriceUpdate` per second, oldest first. `ema_price` equals `price` on historical routes. At most 100 distinct feeds, which keeps the URL under the edge's length limit.
Latest prices (v1) GET
Unknown IDs always answer 404 here; `ignore_invalid_price_ids` is validated but has no effect. Send at most 200 IDs per request; longer URLs are rejected before they reach Astra. For more feeds, use several requests or subscribe over WebSocket, where IDs travel in the message body.