Reference
Live events
The Server-Sent Events stream.
The API pushes changes as Server-Sent Events on one route, so a page can stay live without polling.
sh
curl -N https://api-production-bab49449.up.railway.app/v1/events
curl -N "https://api-production-bab49449.up.railway.app/v1/events?mint=<mint>"With mint, the stream carries only that flare's events; without it, every flare's. In a browser, new EventSource(url) reads it, and the contract client's eventsUrl(mint?) builds the URL.
Messages
Each message's SSE event name is its type, and its data is the whole object as JSON, type included. Every message has an id.
| Event | When | Fields |
|---|---|---|
ready | First on every connection. | status: The same as GET /health: ready, waiting or fixture. |
resync | After a reconnect that sent Last-Event-ID, or when the client fell 500 events behind. Nothing is replayed: read the snapshots again. | reason: reconnected or behind. |
trade | Each trade the indexer records, on the curve or the CPMM pool. | trade: A Trade. |
coin | A new launch, or a flare whose price, progress, phase or treasury moved. | coin: A Coin. |
attention | Each flare scored at an epoch close. | mint: The flare. epoch: The epoch just closed. score: Its score, 0 to 1000. rank: Its rank, or null. |
The trade and coin events carry a whole Trade or Coin, so a client can apply them without another read.
Connecting and catching up
- The first message on every connection is
ready, with the same status asGET /health. - Nothing is replayed. A client that reconnects with
Last-Event-IDgetsresyncwith reasonreconnected; a client that falls 500 events behind has its queue replaced by oneresyncwith reasonbehind. On either, read the snapshots you show again. - When nothing happens for 15 seconds, the server sends a comment line (
: keepalive) so proxies keep the stream open.
events
event: ready
data: {"type":"ready","status":"fixture"}
id: 1795764664572