Skip to main content
GET
Reports, for each chain you ask about, the time of the most recent indexed swap (its block time) and how far behind now that is. Use it to decide whether data is fresh enough before relying on it, or to monitor ChainQuery from your own alerting.
This endpoint lives at the host root, not under /api/v1: https://api.example.com/health/last-swaps. Whether it is reachable on the public host is still being confirmed. If you get a 404 there, the route is not exposed yet.

How it works

For each chain in chains:
  1. Find the newest indexed swap from the last lookbackMinutes.
  2. If there is none, the chain is stale, with lastSwapAt and lagMinutes set to null.
  3. Otherwise lagMinutes is the time since that swap, in minutes rounded to one decimal. The chain is stale if lagMinutes is greater than toleranceMinutes, otherwise ok.
ok is true only when every chain is ok. When any chain is stale, the endpoint answers 503 with the full report in details, so a plain HTTP status check is enough for uptime monitors. Chain ids are not checked against the supported chains. An id ChainQuery doesn’t index simply has no swaps and is reported as stale.
Quiet chains can go several minutes without a swap. Raise toleranceMinutes (and lookbackMinutes, which must be at least as large) for chains with low activity to avoid false alarms.

Query parameters

string
required
Comma-separated chain ids, each with or without the evm: prefix: 1,8453 or evm:1,evm:8453. At least one id; each must be a positive integer.
number
default:"5"
Maximum lag, in minutes, for a chain to count as ok. Must be greater than 0; decimals are allowed.
number
default:"15"
How far back, in minutes, to look for the latest swap. Must be greater than 0 and greater than or equal to toleranceMinutes.

Response

"success"
success when every chain is fresh. When any chain is stale the response is a 503 error instead; see Errors.
LastSwapsOutput

Errors