Skip to content

Stream new launches

View as Markdown
GET
/v2/stream/pilot/trenches/{chain_id}
curl --request GET \
--url 'https://api.chainmetric.io/v2/stream/pilot/trenches/1?limit=50' \
--header 'Authorization: <Authorization>' \
--header 'Last-Event-ID: 7184150972001'

Opens a server-sent event stream of launch cards for one chain, across all views. Use it for a live launch feed instead of polling GET /v2/pilot/trenches/{chain_id}. The first event is snapshot: {views: {new, curves, graduated, pairs}}, each a list of cards. The stream calls the launches view new, where the REST route calls it launches. Later events are card (a new card, {views, card}), update (a changed card, {views, card}) and remove ({views, pool}). Reconnect with Last-Event-ID to resume after the last event you received; an expired id gets a fresh snapshot.

chain_id
required
integer
Allowed values: 1 56 8453 1399811149

Chain id: 1 Ethereum, 56 BNB Chain, 8453 Base, 1399811149 Solana.

Example

1
limit
integer
default: 50 >= 1 <= 100

Cards per view. Larger values are clamped to 100.

Example

50
Last-Event-ID
string

The id of the last event you received. The stream resumes after it.

Example

7184150972001

A server-sent event stream. Each event has an event: name and a data: line holding one JSON object. Resumable streams also send id: lines: keep the last id and send it as Last-Event-ID when you reconnect. A : keepalive comment arrives every 20 seconds.

Media typetext/event-stream
string

Examples

Exampleframe
event: attached
data: {"subject":"token_trades.1.c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"}
id: 26527763.112.450.0
event: frame
data: {"kind":"token_trades","version":1,"chain_id":1,"address":"c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2","lane":"fast","commitment":"confirmed","seq":7184150972001,"data":{"side":"sell","price_usd":1663.47,"block":26527763,"event_index":450}}
: keepalive

The request is malformed, for example a bad address, an unknown chain or an out-of-range parameter. Do not retry unchanged.

Media typeapplication/json

Every error answer has this shape. error and message carry the same text.

object
error
required

What went wrong. For 5xx answers this is the status text.

string
message
required

The same text as error.

string
statusCode
required

The HTTP status.

integer

Examples

ExampleunknownChain
{
"error": "blockchain: unknown chain: \"ethereum\"",
"message": "blockchain: unknown chain: \"ethereum\"",
"statusCode": 400
}

The key is missing (api key missing), unknown (api key unknown) or revoked (api key revoked). Send Authorization: <key>.

Media typeapplication/json

Every error answer has this shape. error and message carry the same text.

object
error
required

What went wrong. For 5xx answers this is the status text.

string
message
required

The same text as error.

string
statusCode
required

The HTTP status.

integer

Examples

Examplemissing
{
"error": "api key missing",
"message": "api key missing",
"statusCode": 401
}

The chain is not served, or the token or resource is not known.

Media typeapplication/json

Every error answer has this shape. error and message carry the same text.

object
error
required

What went wrong. For 5xx answers this is the status text.

string
message
required

The same text as error.

string
statusCode
required

The HTTP status.

integer

Example generated

{
"error": "example",
"message": "example",
"statusCode": 1
}

The key’s request rate limit is reached. No Retry-After is sent; back off and retry.

Media typeapplication/json

Every error answer has this shape. error and message carry the same text.

object
error
required

What went wrong. For 5xx answers this is the status text.

string
message
required

The same text as error.

string
statusCode
required

The HTTP status.

integer

Examples

Examplelimited
{
"error": "api key rate limit reached",
"message": "api key rate limit reached",
"statusCode": 429
}

The service is busy or catching up. Wait for the Retry-After header’s seconds when present (5 or 10), then retry. Without it, retry with exponential backoff.

Media typeapplication/json

Every error answer has this shape. error and message carry the same text.

object
error
required

What went wrong. For 5xx answers this is the status text.

string
message
required

The same text as error.

string
statusCode
required

The HTTP status.

integer

Examples

Exampleunavailable
{
"error": "Service Unavailable",
"message": "Service Unavailable",
"statusCode": 503
}
Retry-After
integer

Seconds to wait before retrying.