{"openapi":"3.1.0","info":{"title":"Squidlor Aggregator API","version":"1.0.0","summary":"Multi-chain read API for Squidlor price aggregators, randomness and event outcomes.","description":"The Squidlor Aggregator API is a public, keyless-first read layer over the Squidlor\non-chain oracle contracts. Every price response is derived from a live RPC read of an\n`Aggregator` contract (its `peek()` median plus each configured source adapter), so a\nvalue returned here is the value a smart contract would have read at the same moment.\n\n## Surfaces\n\n* **Chain-scoped routes** (`/v1/{chain}/…`) are the primary surface. A feed is addressed\n  as `(chain, pair)` with no query strings, which is what the TypeScript SDK, the MCP\n  server and the landing page consume.\n* **Legacy routes** (`/v1/feeds?chainId=…`, `/v1/randomness`, `/v1/events`) are still\n  mounted for backwards compatibility and are marked deprecated. They default to\n  the configured chain when `chainId` is omitted (Arc, `5042002` on testnet).\n\n## Chains\n\n| Slug        | chainId | Notes                                                     |\n|-------------|---------|-----------------------------------------------------------|\n| `arc`       | 5042002 | Arc (Circle's USDC-gas L1), testnet. Crypto + US equity feeds. Mainnet id is published by docs.arc.io. |\n\nAny of the three slugs, or the numeric chainId, may be used for the `chain` path\nparameter. Unknown chains return `404`.\n\n## Caching and freshness\n\nLive on-chain reads are memoised for a short TTL (10s by default) and every cached\nresponse carries `cachedAt`. Timestamps sourced from chain state (`updatedAt`,\n`freshestUpdatedAt`, `requestedAt`, `registeredAt`, …) are **unix seconds**; timestamps\nproduced by the API itself (`cachedAt`, `asOf`, history `ts`) are ISO-8601 strings.\n\n## History\n\n`/history`, `/ohlc` and `/audit` are served from the recorded `feed_rounds` collection\nand are only available when the deployment has MongoDB configured. Without it those\nthree operations return `503`; every live read keeps working.\n","contact":{"name":"Squidlor Engineering","email":"build@squidlor.com","url":"https://build.squidlor.com"},"license":{"name":"MIT","identifier":"MIT"}},"servers":[{"url":"https://api.squidlor.com/aggregator","description":"Production"},{"url":"http://localhost:5010","description":"Local development (default AGGREGATOR_API_PORT)"}],"tags":[{"name":"Feeds","description":"Live price aggregator state: the on-chain median, per-source adapter readings,\nstaleness, and the minimal `value` shape for indexers and dashboards.\n"},{"name":"History","description":"Recorded time series over `feed_rounds` — sampled median history, OHLC candles, and\nthe per-source audit trail (deviations, staleness, adapter errors). Requires the\ndeployment to have `MONGODB_URI` set.\n"},{"name":"Randomness","description":"State of the Squidlor randomness contract (Pyth Entropy backed) and its most recent\nrequests. Served only when the chain has a randomness / event contract configured (RANDOMNESS_ADDRESS, EVENT_AGGREGATOR_ADDRESS); Arc has none at launch, so this returns 404.\n"},{"name":"Events","description":"Event-outcome aggregator: registered yes/no questions, each source's resolution, and\nthe aggregated outcome. Served only when the chain has a randomness / event contract configured (RANDOMNESS_ADDRESS, EVENT_AGGREGATOR_ADDRESS); Arc has none at launch, so this returns 404.\n"},{"name":"Prices","description":"The realtime OFF-CHAIN feed: a median across live venue WebSockets, republished every\nsecond. This is not the value a contract reads — see the `Feeds` tag for that. Use\n`Prices` for charts, tickers and alerts; use `Feeds` for anything that must agree with\non-chain state.\n"},{"name":"Daily","description":"The permanent daily price book: one price per asset per 00:00 UTC boundary, for every\nstreamed token, every tracked stock and every on-chain feed. Unlike the `History` tag —\n60s samples of on-chain pairs, expired after `HISTORY_RETENTION_DAYS` — these rows are\nkept indefinitely and cover off-chain assets too. Every row states its `source` and its\n`offsetMs` from the boundary, so an observation we took at midnight is never confused\nwith a vendor candle backfilled later.\n"},{"name":"Meta","description":"Service discovery and health probes. Not metered and not rate limited."}],"security":[{},{"apiKey":[]},{"apiKeyQuery":[]}],"paths":{"/":{"get":{"operationId":"getServiceInfo","summary":"Service discovery","description":"Human-friendly index of the API: the endpoint list, the supported chain slugs, and\nthe live auth/limit table read straight from the running instance's tier config.\nUseful as a sanity check that you are pointed at the right deployment. Not metered.\n","tags":["Meta"],"security":[],"responses":{"200":{"description":"Discovery document.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceInfo"},"examples":{"default":{"summary":"Production instance","value":{"name":"squidlor-aggregator-api","version":"1.0.0","endpoints":{"GET /health":"service health","GET /v1/feeds?chainId=<chainId>":"list configured aggregators","GET /v1/{chain}/feeds":"chain-scoped feed list (:chain = arc|<chainId>)"},"chains":["arc"],"auth":{"required":false,"note":"No key needed to start. A free key raises your limit and unlocks per-project usage stats.","header":"Authorization: Bearer sq_live_...","queryParam":"apiKey","getKey":"https://build.squidlor.com","limits":{"anonymous":"30/min per IP, 30d history","free":"300/min, 30d history","pro":"3000/min, unlimited history","institutional":"unlimited — build@squidlor.com"}},"openapi":"/openapi.json"}}}}}}}}},"/health":{"get":{"operationId":"getHealth","summary":"Liveness probe","description":"Flat liveness check. Returns `200` as soon as the HTTP server is up; it does not touch RPC or MongoDB.","tags":["Meta"],"security":[],"responses":{"200":{"description":"Service is up.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Health"},"examples":{"default":{"value":{"status":"ok","service":"aggregator-api","env":"production"}}}}}}}}},"/health/metering":{"get":{"operationId":"getMeteringHealth","summary":"Metering subsystem health","description":"Ops view of the metering path: whether API-key auth is configured, whether the\nrate-limit Redis is reachable, how the API-key LRU is performing, and whether usage\ncounters are draining. `degradedRequests` counts requests that were allowed through\nbecause Redis was unavailable.\n","tags":["Meta"],"security":[],"responses":{"200":{"description":"Metering diagnostics.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeteringHealth"},"examples":{"default":{"value":{"status":"ok","configured":{"keyAuth":true,"rateLimit":true,"usage":true},"keyCache":{"size":12,"hits":4820,"misses":31,"lookupFailures":0,"hitRate":0.994},"rateLimiter":{"configured":true,"healthy":true,"degradedRequests":0},"usage":{"pending":3,"flushed":918,"flushErrors":0},"mongo":"connected"}}}}}}}}},"/v1/{chain}/feeds":{"get":{"operationId":"listChainFeeds","summary":"List aggregators on a chain","description":"Summary of every aggregator configured for `chain`, each with its live median,\nhealthy source count and total source count. One RPC round trip per feed, memoised\nfor the cache TTL, so this is the cheapest way to render a dashboard.\n\nA feed whose `peek()` reverted (too few healthy sources) still appears, with\n`peekError` set and `median` omitted. An empty `feeds` array means the deployment\nhas no aggregator addresses configured for that chain.\n","tags":["Feeds"],"parameters":[{"$ref":"#/components/parameters/Chain"}],"responses":{"200":{"description":"Feed summaries for the chain.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/XRateLimitReset"},"X-Squidlor-Tier":{"$ref":"#/components/headers/XSquidlorTier"},"X-Squidlor-Key-Unverified":{"$ref":"#/components/headers/XSquidlorKeyUnverified"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedListResponse"},"examples":{"arc":{"summary":"Arc Testnet (5042002)","value":{"chainId":5042002,"count":2,"feeds":[{"chainId":5042002,"pair":"BTC/USD","aggregator":"0x94800f5Cebb5677F1855e9C9024b1Bc9685b60AF","description":"BTC/USD","median":"63460.28","healthyCount":2,"totalSources":2,"freshestUpdatedAt":1785974400},{"chainId":5042002,"pair":"NVDA/USD","aggregator":"0x7D8E02C7d2Ee80c75EFF199B8AD64522C4a88b91","description":"NVDA/USD","median":"181.44","healthyCount":1,"totalSources":1,"freshestUpdatedAt":1785970800}],"cachedAt":"2026-08-04T12:00:00.000Z"}}}}}},"401":{"$ref":"#/components/responses/InvalidApiKey"},"404":{"$ref":"#/components/responses/ChainNotSupported"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/v1/{chain}/feeds/{pair}":{"get":{"operationId":"getChainFeed","summary":"Full state of one aggregator","description":"Everything the aggregator contract knows about a pair: its metadata (`decimals`,\n`owner`, `selectionMode`, `minHealthySources`, `defaultMaxStaleness`,\n`latestRoundId`), the live aggregate from `peek()`, and one entry per configured\nsource adapter with that adapter's own `latestPrice()` reading.\n\nSource-level failures are reported per source in `sources[].error` rather than\nfailing the request; an aggregate-level failure is reported in `peekError`.\n","tags":["Feeds"],"parameters":[{"$ref":"#/components/parameters/Chain"},{"$ref":"#/components/parameters/Pair"}],"responses":{"200":{"description":"Full aggregator state.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/XRateLimitReset"},"X-Squidlor-Tier":{"$ref":"#/components/headers/XSquidlorTier"},"X-Squidlor-Key-Unverified":{"$ref":"#/components/headers/XSquidlorKeyUnverified"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedDetailResponse"},"examples":{"btcUsdArc":{"summary":"BTC/USD on Arc","value":{"chainId":5042002,"pair":"BTC/USD","aggregator":"0x94800f5Cebb5677F1855e9C9024b1Bc9685b60AF","description":"BTC/USD","decimals":8,"owner":"0x85BEaB2DF9Aa3427382246013f9Fb2047C712765","selectionMode":"MEDIAN","minHealthySources":1,"defaultMaxStaleness":3600,"latestRoundId":"4128","median":"63460.28","medianRaw":"6346028000000","freshestUpdatedAt":1785974400,"healthyCount":2,"sources":[{"index":0,"adapter":"0x2f9A1b6C3d4E5f708192A3b4C5d6E7f809A1b2C3","name":"squidlor:BTC/USD","enabled":true,"maxStaleness":3600,"price":"63460.28","priceRaw":"6346028000000","updatedAt":1785974400,"isStale":false},{"index":1,"adapter":"0x8B7c6D5e4F3a2B1c0D9e8F7a6B5c4D3e2F1a0B9c","name":"pyth:BTC/USD","enabled":true,"maxStaleness":0,"price":"63455.91","priceRaw":"6345591000000","updatedAt":1785974280,"isStale":false}],"cachedAt":"2026-08-04T12:00:00.000Z"}}}}}},"401":{"$ref":"#/components/responses/InvalidApiKey"},"404":{"$ref":"#/components/responses/FeedOrChainNotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/v1/{chain}/feeds/{pair}/value":{"get":{"operationId":"getChainFeedValue","summary":"Latest value only","description":"Minimal payload for callers that just want the number: the median as a decimal\nstring, the raw integer, `decimals`, how many sources were healthy, and the\nfreshest source timestamp. Designed for indexers, cron jobs and non-developer\ndashboards.\n\nIf the aggregator's `peek()` reverts — typically fewer than `minHealthySources`\nfresh sources — this returns `503` with the revert reason rather than a stale or\ninvented price.\n","tags":["Feeds"],"parameters":[{"$ref":"#/components/parameters/Chain"},{"$ref":"#/components/parameters/Pair"}],"responses":{"200":{"description":"Latest aggregate value.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/XRateLimitReset"},"X-Squidlor-Tier":{"$ref":"#/components/headers/XSquidlorTier"},"X-Squidlor-Key-Unverified":{"$ref":"#/components/headers/XSquidlorKeyUnverified"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChainValueResponse"},"examples":{"btcUsdArc":{"summary":"BTC/USD on Arc","value":{"pair":"BTC/USD","chainId":5042002,"value":"63460.28","valueRaw":"6346028000000","decimals":8,"healthyCount":2,"updatedAt":1785974400}}}}}},"401":{"$ref":"#/components/responses/InvalidApiKey"},"404":{"$ref":"#/components/responses/FeedOrChainNotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"description":"The aggregate could not be read on-chain — `peek()` reverted. The body carries\nthe revert reason.\n","headers":{"X-Squidlor-Tier":{"$ref":"#/components/headers/XSquidlorTier"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChainValueUnavailable"},"examples":{"peekReverted":{"value":{"pair":"BTC/USD","chainId":5042002,"error":"execution reverted: NotEnoughHealthySources()"}}}}}}}}},"/v1/{chain}/feeds/{pair}/constituents":{"get":{"operationId":"getChainFeedConstituents","summary":"Off-chain constituent breakdown of an equity feed","description":"For a USD equity pair, returns the on-chain `squidlor:` leg of the aggregator next\nto a **live recomputation** of the same off-chain quote set that relay-pusher\nmedians before it signs (Yahoo, Nasdaq, Finnhub, Twelve Data). The chain stores only\nthe result, so without this the Squidlor leg reads as one opaque source.\n\n`liveOffChainMedian` is what Squidlor *would* publish right now — it is not the\non-chain number and must never be substituted for it or folded into an aggregate.\nThe `warning` field restates this in every response; the gap between the two is the\ndrift of the on-chain print.\n\nOnly USD equity pairs are accepted (`AAPL_USD`, `NVDA_USD`, `TSLA_USD`, …). Crypto\npairs return `400`.\n","tags":["Feeds"],"parameters":[{"$ref":"#/components/parameters/Chain"},{"name":"pair","in":"path","required":true,"description":"USD equity pair in underscore form, e.g. `NVDA_USD`.","schema":{"type":"string","pattern":"^[A-Za-z.]{1,6}_[Uu][Ss][Dd]$"},"example":"NVDA_USD"}],"responses":{"200":{"description":"On-chain leg plus the live off-chain breakdown.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/XRateLimitReset"},"X-Squidlor-Tier":{"$ref":"#/components/headers/XSquidlorTier"},"X-Squidlor-Key-Unverified":{"$ref":"#/components/headers/XSquidlorKeyUnverified"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConstituentsResponse"},"examples":{"nvdaUsd":{"summary":"NVDA/USD on Arc","value":{"chainId":5042002,"pair":"NVDA/USD","onChainSquidlor":{"price":"181.44","updatedAt":1785970800,"ageHours":1,"isStale":false},"symbol":"NVDA","liveOffChainMedian":181.52,"contributors":["yahoo","nasdaq"],"sources":[{"name":"yahoo","price":181.5},{"name":"nasdaq","price":181.54},{"name":"finnhub","error":"no FINNHUB_API_KEY configured"},{"name":"twelvedata","error":"no TWELVEDATA_API_KEY configured"}],"warning":"liveOffChainMedian is what Squidlor WOULD publish if it pushed right now. It is NOT the on-chain squidlor value and NOT part of any on-chain median.","asOf":"2026-08-04T12:00:00.000Z"}}}}}},"400":{"description":"The pair is not a USD equity pair, so it has no constituent breakdown.","headers":{"X-Squidlor-Tier":{"$ref":"#/components/headers/XSquidlorTier"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"notEquity":{"value":{"message":"constituents are only available for USD equity pairs; BTC/USD is not one. Crypto squidlor feeds are medianed from CEX venues (plus the off-chain Arbitrum hub reference) by relay-pusher."}}}}}},"401":{"$ref":"#/components/responses/InvalidApiKey"},"404":{"$ref":"#/components/responses/ChainNotSupported"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/v1/{chain}/feeds/{pair}/history":{"get":{"operationId":"getChainFeedHistory","summary":"Sampled median history","description":"Recorded median series for a feed, oldest-first. Raw samples are returned at the\nrecorder's cadence (60s by default); pass `interval` to downsample by taking the\nlast sample in each bucket.\n\nDefault `limit` is 500 (max 5000) and it always selects the **newest** points in\nrange. `from`/`to` accept unix seconds, unix milliseconds or an ISO-8601 string.\n\nFree and anonymous callers are capped at 30 days of lookback. Rather than erroring,\n`from` is silently clamped and `X-History-Clamped: true` plus\n`X-History-Lookback-Days` are returned — a Pro key removes the cap.\n","tags":["History"],"parameters":[{"$ref":"#/components/parameters/Chain"},{"$ref":"#/components/parameters/Pair"},{"$ref":"#/components/parameters/From"},{"$ref":"#/components/parameters/To"},{"name":"interval","in":"query","required":false,"description":"Downsampling bucket. Omit for raw samples, in which case `interval` echoes back as `raw`.","schema":{"$ref":"#/components/schemas/Interval"}},{"name":"limit","in":"query","required":false,"description":"Maximum points (or buckets) to return, clamped to 1…5000.","schema":{"type":"integer","minimum":1,"maximum":5000,"default":500}}],"responses":{"200":{"description":"Median series, oldest-first.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/XRateLimitReset"},"X-Squidlor-Tier":{"$ref":"#/components/headers/XSquidlorTier"},"X-Squidlor-Key-Unverified":{"$ref":"#/components/headers/XSquidlorKeyUnverified"},"X-History-Clamped":{"$ref":"#/components/headers/XHistoryClamped"},"X-History-Lookback-Days":{"$ref":"#/components/headers/XHistoryLookbackDays"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HistoryResponse"},"examples":{"hourly":{"summary":"Hourly BTC/USD on Arc","value":{"chainId":5042002,"pair":"BTC/USD","interval":"1h","count":3,"points":[{"bucket":"2026-08-04T10:00:00.000Z","ts":"2026-08-04T10:59:00.000Z","median":"63302.11","medianNum":63302.11,"healthyCount":2},{"bucket":"2026-08-04T11:00:00.000Z","ts":"2026-08-04T11:59:00.000Z","median":"63390.04","medianNum":63390.04,"healthyCount":2},{"bucket":"2026-08-04T12:00:00.000Z","ts":"2026-08-04T12:00:00.000Z","median":"63460.28","medianNum":63460.28,"healthyCount":2}]}},"raw":{"summary":"Raw samples (no interval)","value":{"chainId":5042002,"pair":"BTC/USD","interval":"raw","count":2,"points":[{"ts":"2026-08-04T11:59:00.000Z","median":"63451.90","medianNum":63451.9,"healthyCount":2},{"ts":"2026-08-04T12:00:00.000Z","median":"63460.28","medianNum":63460.28,"healthyCount":2}]}}}}}},"400":{"$ref":"#/components/responses/InvalidInterval"},"401":{"$ref":"#/components/responses/InvalidApiKey"},"404":{"$ref":"#/components/responses/ChainNotSupported"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/HistoryDisabled"}}}},"/v1/{chain}/feeds/{pair}/ohlc":{"get":{"operationId":"getChainFeedOhlc","summary":"OHLC candles","description":"Open/high/low/close candles computed over the recorded median samples, oldest-first.\n`samples` is how many recorded rounds fell into the candle, so a low count means a\nthin candle rather than a quiet market.\n\nUnlike `/history`, `interval` has a default of `1h` and is always echoed back.\nDefault `limit` is 300 (max 2000), selecting the newest candles in range. The same\nplan-based lookback clamp applies, reported via `X-History-Clamped` and\n`X-History-Lookback-Days`.\n","tags":["History"],"parameters":[{"$ref":"#/components/parameters/Chain"},{"$ref":"#/components/parameters/Pair"},{"$ref":"#/components/parameters/From"},{"$ref":"#/components/parameters/To"},{"name":"interval","in":"query","required":false,"description":"Candle width.","schema":{"allOf":[{"$ref":"#/components/schemas/Interval"}],"default":"1h"}},{"name":"limit","in":"query","required":false,"description":"Maximum candles to return, clamped to 1…2000.","schema":{"type":"integer","minimum":1,"maximum":2000,"default":300}}],"responses":{"200":{"description":"Candles, oldest-first.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/XRateLimitReset"},"X-Squidlor-Tier":{"$ref":"#/components/headers/XSquidlorTier"},"X-Squidlor-Key-Unverified":{"$ref":"#/components/headers/XSquidlorKeyUnverified"},"X-History-Clamped":{"$ref":"#/components/headers/XHistoryClamped"},"X-History-Lookback-Days":{"$ref":"#/components/headers/XHistoryLookbackDays"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OhlcResponse"},"examples":{"hourly":{"summary":"Hourly BTC/USD candles on Arc","value":{"chainId":5042002,"pair":"BTC/USD","interval":"1h","count":2,"candles":[{"t":"2026-08-04T11:00:00.000Z","open":63310.5,"high":63498.02,"low":63290.77,"close":63451.9,"samples":60},{"t":"2026-08-04T12:00:00.000Z","open":63455.12,"high":63470.4,"low":63440,"close":63460.28,"samples":1}]}}}}}},"400":{"$ref":"#/components/responses/InvalidInterval"},"401":{"$ref":"#/components/responses/InvalidApiKey"},"404":{"$ref":"#/components/responses/ChainNotSupported"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/HistoryDisabled"}}}},"/v1/{chain}/feeds/{pair}/audit":{"get":{"operationId":"getChainFeedAudit","summary":"Per-source audit trail","description":"The oracle audit trail: full recorded rounds, newest-first, each with every source's\nprice at that moment, its staleness flag, its deviation from the median in basis\npoints, and any adapter read error. This is the record you use to answer \"was this\nprint defensible?\".\n\n`flagged` rounds are those the recorder marked as anomalous (deviation above the\nconfigured basis-point threshold, or a peek failure); `flagReasons` says why. Pass\n`flagged=true` to return only those, or `source` to filter each round's `sources`\narray by a case-insensitive substring of the adapter name.\n\nDefault `limit` is 100 (max 1000). On the anonymous and free tiers `from` is clamped\nto the last 30 days, exactly as on `/history` and `/ohlc` — an audit record carries\nits round's median, so an uncapped audit window would be a way to reconstruct the\nhistory that cap bounds. Pro and Institutional are limited only by the recorder's\nretention (90 days by default).\n","tags":["History"],"parameters":[{"$ref":"#/components/parameters/Chain"},{"$ref":"#/components/parameters/Pair"},{"$ref":"#/components/parameters/From"},{"$ref":"#/components/parameters/To"},{"name":"limit","in":"query","required":false,"description":"Maximum rounds to return, clamped to 1…1000.","schema":{"type":"integer","minimum":1,"maximum":1000,"default":100}},{"name":"source","in":"query","required":false,"description":"Case-insensitive substring of a source name. Rounds are still returned in full,\nbut each round's `sources` array is filtered to the matching adapters.\n","schema":{"type":"string"},"example":"pyth"},{"name":"flagged","in":"query","required":false,"description":"Set to the literal string `true` to return only rounds the recorder flagged as anomalous.","schema":{"type":"string","enum":["true"]}}],"responses":{"200":{"description":"Recorded rounds, newest-first.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/XRateLimitReset"},"X-Squidlor-Tier":{"$ref":"#/components/headers/XSquidlorTier"},"X-Squidlor-Key-Unverified":{"$ref":"#/components/headers/XSquidlorKeyUnverified"},"X-History-Clamped":{"$ref":"#/components/headers/XHistoryClamped"},"X-History-Lookback-Days":{"$ref":"#/components/headers/XHistoryLookbackDays"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditResponse"},"examples":{"flagged":{"summary":"A flagged round on BTC/USD","value":{"chainId":5042002,"pair":"BTC/USD","count":1,"rounds":[{"chainId":5042002,"pair":"BTC/USD","ts":"2026-08-04T11:43:00.000Z","decimals":8,"selectionMode":"MEDIAN","median":"63460.28","medianNum":63460.28,"medianRaw":"6346028000000","healthyCount":2,"freshestUpdatedAt":1785973380,"maxAbsDeviationBps":142,"flagged":true,"flagReasons":["deviation 142bps > 100bps on pyth:BTC/USD"],"sources":[{"index":0,"adapter":"0x2f9A1b6C3d4E5f708192A3b4C5d6E7f809A1b2C3","name":"squidlor:BTC/USD","enabled":true,"price":"63460.28","priceNum":63460.28,"updatedAt":1785973380,"isStale":false,"deviationBps":0},{"index":1,"adapter":"0x8B7c6D5e4F3a2B1c0D9e8F7a6B5c4D3e2F1a0B9c","name":"pyth:BTC/USD","enabled":true,"price":"62558.10","priceNum":62558.1,"updatedAt":1785973200,"isStale":false,"deviationBps":142}]}]}}}}}},"401":{"$ref":"#/components/responses/InvalidApiKey"},"404":{"$ref":"#/components/responses/ChainNotSupported"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"},"503":{"$ref":"#/components/responses/HistoryDisabled"}}}},"/v1/{chain}/randomness":{"get":{"operationId":"getChainRandomness","summary":"Randomness contract state","description":"State of the Squidlor randomness contract on `chain`: the Pyth Entropy contract and\nprovider it delegates to, the owner, the current request fee in wei and ether, the\nlifetime request count, and the most recent requests with their fulfilled values.\n\nFulfilled requests carry `randomness` (0x-padded 32-byte hex) and\n`randomnessDecimal` (the same uint256 in base 10); pending ones omit both and have\n`fulfilled: false`.\n\nReturns `404` unless a randomness contract is configured for the chain (none on Arc at launch).\n","tags":["Randomness"],"parameters":[{"$ref":"#/components/parameters/Chain"},{"name":"limit","in":"query","required":false,"description":"How many recent requests to include, clamped to at most 50.","schema":{"type":"integer","minimum":1,"maximum":50,"default":10}}],"responses":{"200":{"description":"Randomness contract state plus recent requests.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/XRateLimitReset"},"X-Squidlor-Tier":{"$ref":"#/components/headers/XSquidlorTier"},"X-Squidlor-Key-Unverified":{"$ref":"#/components/headers/XSquidlorKeyUnverified"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RandomnessResponse"},"examples":{"arc":{"summary":"Arc","value":{"chainId":5042002,"contract":"0x0FC1feC8083a287f4508c76e922757c2A98e7E75","entropy":"0x7698E925FfC29655576D0b361D75Af579e20AdAc","provider":"0x52DeaA1c84233F7bb8C8A45baeDE41091c616506","owner":"0x85BEaB2DF9Aa3427382246013f9Fb2047C712765","feeWei":"105000000000000","feeEth":"0.000105","totalRequests":"128","recentRequests":[{"sequenceNumber":"128","requester":"0x85BEaB2DF9Aa3427382246013f9Fb2047C712765","randomness":"0x2f1b9c8ad4e6f70518293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7e8f","randomnessDecimal":"21276231290618296103131363832566119171172530884108358434107856409231428983951","requestedAt":1785974280,"fulfilledAt":1785974292,"fulfilled":true},{"sequenceNumber":"127","requester":"0x85BEaB2DF9Aa3427382246013f9Fb2047C712765","requestedAt":1785974100,"fulfilled":false}],"cachedAt":"2026-08-04T12:00:00.000Z"}}}}}},"401":{"$ref":"#/components/responses/InvalidApiKey"},"404":{"description":"Either the chain is not supported, or it has no randomness contract configured\n(any chain without the contract configured).\n","headers":{"X-Squidlor-Tier":{"$ref":"#/components/headers/XSquidlorTier"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"notConfigured":{"value":{"message":"randomness not configured on chain 5042002"}},"chainNotSupported":{"value":{"message":"chain not supported: base"}}}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/v1/{chain}/events":{"get":{"operationId":"listChainEvents","summary":"List event-outcome aggregator events","description":"Every question registered with the event resolver, newest-first, together with the\naggregator's configuration (`mode`, `minHealthy`, `sourceCount`), each source's\nresolution for that question, and the aggregated outcome.\n\nEvent ids are discovered by scanning `EventRegistered` logs over the last 10M\nblocks. When `getOutcome()` reverts — typically not enough sources have resolved\nyet — `aggregated.outcome` is `UNRESOLVED` and `aggregated.error` carries the\nrevert reason instead of the call failing.\n\nReturns `404` unless an event aggregator is configured for the chain (none on Arc at launch).\n","tags":["Events"],"parameters":[{"$ref":"#/components/parameters/Chain"}],"responses":{"200":{"description":"Aggregator configuration plus all registered events.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/XRateLimitReset"},"X-Squidlor-Tier":{"$ref":"#/components/headers/XSquidlorTier"},"X-Squidlor-Key-Unverified":{"$ref":"#/components/headers/XSquidlorKeyUnverified"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventsListResponse"},"examples":{"arc":{"summary":"Arc","value":{"chainId":5042002,"aggregator":"0x67ff83c40B0338518B0781466EA3cB092002BbB4","resolver":"0xD79AA11e81c9d3013B30DD71d9cba8977a9518BF","mode":"MAJORITY","minHealthy":1,"sourceCount":2,"events":[{"eventId":"0x9c3f1a7b5d2e48f0a6b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f3","question":"Will BTC close above $60,000 on 2026-08-31?","registeredAt":1785888000,"livenessSeconds":7200,"aggregated":{"outcome":"UNRESOLVED","outcomeCode":0,"resolvedCount":0,"totalEnabled":2,"error":"execution reverted: NotResolved()"},"perSource":[{"sourceIndex":0,"sourceName":"squidlor-resolver","outcome":"UNRESOLVED","outcomeCode":0,"resolved":false,"resolvedAt":0,"enabled":true,"adapter":"0xD79AA11e81c9d3013B30DD71d9cba8977a9518BF"},{"sourceIndex":1,"sourceName":"uma-oo","outcome":"UNRESOLVED","outcomeCode":0,"resolved":false,"resolvedAt":0,"enabled":true,"adapter":"0x3aC1b8E4d5F607182930A4b5C6d7E8f901A2b3C4"}]}],"cachedAt":"2026-08-04T12:00:00.000Z"}}}}}},"401":{"$ref":"#/components/responses/InvalidApiKey"},"404":{"description":"Either the chain is not supported, or it has no event aggregator configured\n(any chain without the contract configured).\n","headers":{"X-Squidlor-Tier":{"$ref":"#/components/headers/XSquidlorTier"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"notConfigured":{"value":{"message":"events not configured on chain 5042002"}},"chainNotSupported":{"value":{"message":"chain not supported: base"}}}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/v1/{chain}/events/{eventId}":{"get":{"operationId":"getChainEvent","summary":"Full state of one event","description":"One registered question with its per-source breakdown and aggregated outcome. The\nevent is looked up case-insensitively within the cached event list, so an id that\nexists on another chain, or is not registered at all, returns `404`.\n","tags":["Events"],"parameters":[{"$ref":"#/components/parameters/Chain"},{"name":"eventId","in":"path","required":true,"description":"0x-prefixed 32-byte hex event id, as emitted by `EventRegistered`.","schema":{"$ref":"#/components/schemas/EventId"}}],"responses":{"200":{"description":"Event state.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/XRateLimitReset"},"X-Squidlor-Tier":{"$ref":"#/components/headers/XSquidlorTier"},"X-Squidlor-Key-Unverified":{"$ref":"#/components/headers/XSquidlorKeyUnverified"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventDetailResponse"},"examples":{"resolved":{"summary":"A resolved event","value":{"eventId":"0x9c3f1a7b5d2e48f0a6b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f3","question":"Will BTC close above $60,000 on 2026-08-31?","registeredAt":1785888000,"livenessSeconds":7200,"aggregated":{"outcome":"YES","outcomeCode":1,"resolvedCount":2,"totalEnabled":2},"perSource":[{"sourceIndex":0,"sourceName":"squidlor-resolver","outcome":"YES","outcomeCode":1,"resolved":true,"resolvedAt":1785974000,"enabled":true,"adapter":"0xD79AA11e81c9d3013B30DD71d9cba8977a9518BF"},{"sourceIndex":1,"sourceName":"uma-oo","outcome":"YES","outcomeCode":1,"resolved":true,"resolvedAt":1785974100,"enabled":true,"adapter":"0x3aC1b8E4d5F607182930A4b5C6d7E8f901A2b3C4"}],"cachedAt":"2026-08-04T12:00:00.000Z"}}}}}},"401":{"$ref":"#/components/responses/InvalidApiKey"},"404":{"description":"The chain is not supported, or no such event is registered on it.","headers":{"X-Squidlor-Tier":{"$ref":"#/components/headers/XSquidlorTier"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"eventNotFound":{"value":{"message":"event not found: 0xdead"}},"chainNotSupported":{"value":{"message":"chain not supported: base"}}}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/v1/feeds":{"get":{"operationId":"listFeedsLegacy","summary":"List aggregators (legacy, query-param chain)","description":"Deprecated. Same payload as `GET /v1/{chain}/feeds`, but the chain comes from the\n`chainId` query parameter and defaults to the configured chain.\n\nPrefer the chain-scoped route: unlike the scoped guard, this route does not 404 on\nan unknown chain — an unconfigured chainId simply yields an empty `feeds` array.\n","tags":["Feeds"],"deprecated":true,"parameters":[{"$ref":"#/components/parameters/ChainIdQuery"}],"responses":{"200":{"description":"Feed summaries for the chain.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/XRateLimitReset"},"X-Squidlor-Tier":{"$ref":"#/components/headers/XSquidlorTier"},"X-Squidlor-Key-Unverified":{"$ref":"#/components/headers/XSquidlorKeyUnverified"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedListResponse"},"examples":{"arc":{"summary":"Default chain (Arc)","value":{"chainId":5042002,"count":1,"feeds":[{"chainId":5042002,"pair":"BTC/USD","aggregator":"0x71aF698Ad533fb0e3f93a68096E1e25b3283f773","description":"BTC/USD","median":"63460.28","healthyCount":3,"totalSources":3,"freshestUpdatedAt":1785974400}],"cachedAt":"2026-08-04T12:00:00.000Z"}}}}}},"400":{"$ref":"#/components/responses/InvalidChainId"},"401":{"$ref":"#/components/responses/InvalidApiKey"},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/UpstreamError"}}}},"/v1/feeds/{pair}":{"get":{"operationId":"getFeedLegacy","summary":"Full state of one aggregator (legacy, query-param chain)","description":"Deprecated. Identical payload to `GET /v1/{chain}/feeds/{pair}`, with the chain\ntaken from `?chainId=` (default: the configured chain). Prefer the chain-scoped route.\n","tags":["Feeds"],"deprecated":true,"parameters":[{"$ref":"#/components/parameters/Pair"},{"$ref":"#/components/parameters/ChainIdQuery"}],"responses":{"200":{"description":"Full aggregator state.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/XRateLimitReset"},"X-Squidlor-Tier":{"$ref":"#/components/headers/XSquidlorTier"},"X-Squidlor-Key-Unverified":{"$ref":"#/components/headers/XSquidlorKeyUnverified"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedDetailResponse"},"examples":{"btcUsdArbitrum":{"summary":"BTC/USD on Arc","value":{"chainId":5042002,"pair":"BTC/USD","aggregator":"0x71aF698Ad533fb0e3f93a68096E1e25b3283f773","description":"BTC/USD","decimals":8,"owner":"0x85BEaB2DF9Aa3427382246013f9Fb2047C712765","selectionMode":"MEDIAN","minHealthySources":2,"defaultMaxStaleness":3600,"latestRoundId":"10412","median":"63460.28","medianRaw":"6346028000000","freshestUpdatedAt":1785974400,"healthyCount":3,"sources":[{"index":0,"adapter":"0x2f9A1b6C3d4E5f708192A3b4C5d6E7f809A1b2C3","name":"chainlink:BTC/USD","enabled":true,"maxStaleness":3600,"price":"63460.28","priceRaw":"6346028000000","updatedAt":1785974400,"isStale":false}],"cachedAt":"2026-08-04T12:00:00.000Z"}}}}}},"400":{"$ref":"#/components/responses/InvalidChainId"},"401":{"$ref":"#/components/responses/InvalidApiKey"},"404":{"description":"No aggregator is configured for that pair on the resolved chain.","headers":{"X-Squidlor-Tier":{"$ref":"#/components/headers/XSquidlorTier"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"feedNotFound":{"value":{"message":"Feed not found: DOGE/USD on chain 5042002"}}}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/UpstreamError"}}}},"/v1/feeds/{pair}/value":{"get":{"operationId":"getFeedValueLegacy","summary":"Latest value only (legacy, query-param chain)","description":"Deprecated. Like `GET /v1/{chain}/feeds/{pair}/value` but keyed off `?chainId=`, and\nwith a slightly richer body: an explicit `ok` boolean, `totalSources`, and the\naggregator's `mode`. The `503` body is also different — it carries `ok: false` plus\nthe healthy/total source counts. Prefer the chain-scoped route.\n","tags":["Feeds"],"deprecated":true,"parameters":[{"$ref":"#/components/parameters/Pair"},{"$ref":"#/components/parameters/ChainIdQuery"}],"responses":{"200":{"description":"Latest aggregate value.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/XRateLimitReset"},"X-Squidlor-Tier":{"$ref":"#/components/headers/XSquidlorTier"},"X-Squidlor-Key-Unverified":{"$ref":"#/components/headers/XSquidlorKeyUnverified"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyValueResponse"},"examples":{"btcUsd":{"summary":"BTC/USD on Arc","value":{"pair":"BTC/USD","chainId":5042002,"ok":true,"value":"63460.28","valueRaw":"6346028000000","decimals":8,"healthyCount":2,"totalSources":2,"updatedAt":1785974400,"mode":"MEDIAN"}}}}}},"400":{"$ref":"#/components/responses/InvalidChainId"},"401":{"$ref":"#/components/responses/InvalidApiKey"},"404":{"description":"No aggregator is configured for that pair on the resolved chain.","headers":{"X-Squidlor-Tier":{"$ref":"#/components/headers/XSquidlorTier"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"feedNotFound":{"value":{"message":"Feed not found: DOGE/USD on chain 5042002"}}}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/UpstreamError"},"503":{"description":"`peek()` reverted on-chain, so there is no aggregate to report.","headers":{"X-Squidlor-Tier":{"$ref":"#/components/headers/XSquidlorTier"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyValueUnavailable"},"examples":{"peekReverted":{"value":{"pair":"BTC/USD","chainId":5042002,"ok":false,"error":"execution reverted: NotEnoughHealthySources()","healthyCount":0,"totalSources":2}}}}}}}}},"/v1/randomness":{"get":{"operationId":"getRandomnessLegacy","summary":"Randomness contract state (legacy, query-param chain)","description":"Deprecated. Same payload as `GET /v1/{chain}/randomness`, with the chain taken from\n`?chainId=` (default: the configured chain). Prefer the chain-scoped route.\n","tags":["Randomness"],"deprecated":true,"parameters":[{"$ref":"#/components/parameters/ChainIdQuery"},{"name":"limit","in":"query","required":false,"description":"How many recent requests to include, clamped to at most 50.","schema":{"type":"integer","minimum":1,"maximum":50,"default":10}}],"responses":{"200":{"description":"Randomness contract state plus recent requests.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/XRateLimitReset"},"X-Squidlor-Tier":{"$ref":"#/components/headers/XSquidlorTier"},"X-Squidlor-Key-Unverified":{"$ref":"#/components/headers/XSquidlorKeyUnverified"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RandomnessResponse"},"examples":{"arc":{"summary":"Arc, no requests yet","value":{"chainId":5042002,"contract":"0x0FC1feC8083a287f4508c76e922757c2A98e7E75","entropy":"0x7698E925FfC29655576D0b361D75Af579e20AdAc","provider":"0x52DeaA1c84233F7bb8C8A45baeDE41091c616506","owner":"0x85BEaB2DF9Aa3427382246013f9Fb2047C712765","feeWei":"105000000000000","feeEth":"0.000105","totalRequests":"0","recentRequests":[],"cachedAt":"2026-08-04T12:00:00.000Z"}}}}}},"401":{"$ref":"#/components/responses/InvalidApiKey"},"404":{"description":"No randomness contract is configured for that chainId.","headers":{"X-Squidlor-Tier":{"$ref":"#/components/headers/XSquidlorTier"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"notConfigured":{"value":{"message":"Randomness contract not configured for chainId 5042002"}}}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/v1/events":{"get":{"operationId":"listEventsLegacy","summary":"List event-outcome events (legacy, query-param chain)","description":"Deprecated. Same payload as `GET /v1/{chain}/events`, with the chain taken from\n`?chainId=` (default: the configured chain). Prefer the chain-scoped route.\n","tags":["Events"],"deprecated":true,"parameters":[{"$ref":"#/components/parameters/ChainIdQuery"}],"responses":{"200":{"description":"Aggregator configuration plus all registered events.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/XRateLimitReset"},"X-Squidlor-Tier":{"$ref":"#/components/headers/XSquidlorTier"},"X-Squidlor-Key-Unverified":{"$ref":"#/components/headers/XSquidlorKeyUnverified"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventsListResponse"},"examples":{"empty":{"summary":"Configured but nothing registered yet","value":{"chainId":5042002,"aggregator":"0x67ff83c40B0338518B0781466EA3cB092002BbB4","resolver":"0xD79AA11e81c9d3013B30DD71d9cba8977a9518BF","mode":"MAJORITY","minHealthy":1,"sourceCount":2,"events":[],"cachedAt":"2026-08-04T12:00:00.000Z"}}}}}},"401":{"$ref":"#/components/responses/InvalidApiKey"},"404":{"description":"No event aggregator is configured for that chainId.","headers":{"X-Squidlor-Tier":{"$ref":"#/components/headers/XSquidlorTier"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"notConfigured":{"value":{"message":"Event aggregator not configured for chainId 5042002"}}}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/v1/events/{eventId}":{"get":{"operationId":"getEventLegacy","summary":"Full state of one event (legacy, query-param chain)","description":"Deprecated. Like `GET /v1/{chain}/events/{eventId}` but keyed off `?chainId=`, with\ntwo differences: the id is normalised (a missing `0x` prefix is added) and validated\nup front, so a malformed id returns `400`; and the body includes `chainId`.\nPrefer the chain-scoped route.\n","tags":["Events"],"deprecated":true,"parameters":[{"name":"eventId","in":"path","required":true,"description":"32-byte hex event id. The `0x` prefix is optional here and will be added for you.","schema":{"type":"string","pattern":"^(0x)?[0-9a-fA-F]{64}$"},"example":"0x9c3f1a7b5d2e48f0a6b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f3"},{"$ref":"#/components/parameters/ChainIdQuery"}],"responses":{"200":{"description":"Event state.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/XRateLimitReset"},"X-Squidlor-Tier":{"$ref":"#/components/headers/XSquidlorTier"},"X-Squidlor-Key-Unverified":{"$ref":"#/components/headers/XSquidlorKeyUnverified"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyEventDetailResponse"},"examples":{"resolved":{"value":{"chainId":5042002,"eventId":"0x9c3f1a7b5d2e48f0a6b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f3","question":"Will BTC close above $60,000 on 2026-08-31?","registeredAt":1785888000,"livenessSeconds":7200,"aggregated":{"outcome":"YES","outcomeCode":1,"resolvedCount":2,"totalEnabled":2},"perSource":[{"sourceIndex":0,"sourceName":"squidlor-resolver","outcome":"YES","outcomeCode":1,"resolved":true,"resolvedAt":1785974000,"enabled":true,"adapter":"0xD79AA11e81c9d3013B30DD71d9cba8977a9518BF"}],"cachedAt":"2026-08-04T12:00:00.000Z"}}}}}},"400":{"description":"The event id is not 32 bytes of hex.","headers":{"X-Squidlor-Tier":{"$ref":"#/components/headers/XSquidlorTier"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"badId":{"value":{"message":"eventId must be 0x-prefixed 32-byte hex"}}}}}},"401":{"$ref":"#/components/responses/InvalidApiKey"},"404":{"description":"No such event is registered on that chain.","headers":{"X-Squidlor-Tier":{"$ref":"#/components/headers/XSquidlorTier"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"notFound":{"value":{"message":"Event not found: 0x9c3f1a7b5d2e48f0a6b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f3 on chain 5042002"}}}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/v1/prices":{"get":{"operationId":"listRealtimePrices","summary":"Realtime off-chain medians (1s cadence)","description":"Latest median for every streamed symbol, republished once a second by the price-stream\nengine. Chain-independent — a market price is not per-chain.\n\nEach entry carries `ageMs` and `stale` so a consumer never has to guess how current a\nnumber is. `venues` exposes the individual venue readings the median was taken over.\n\nThis is NOT the value a smart contract reads. The on-chain value updates on a 0.5%\ndeviation or a 1h heartbeat; use `GET /v1/{chain}/feeds/{pair}` for that.\n","tags":["Prices"],"parameters":[{"name":"symbols","in":"query","required":false,"description":"Comma-separated tickers to filter to, e.g. `BTC,ETH`. Omit for all.","schema":{"type":"string","example":"BTC,ETH"}}],"responses":{"200":{"description":"Latest realtime medians.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceListResponse"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/PriceStreamUnavailable"}}}},"/v1/prices/stream":{"get":{"operationId":"streamRealtimePrices","summary":"Realtime price stream (Server-Sent Events)","description":"`text/event-stream` carrying one `tick` per symbol per second.\n\nEvent types:\n  * `snapshot` — sent once on connect, so a new subscriber renders immediately\n  * `tick` — one `PriceTick` per symbol per second\n  * `event` — `deviation` / `stale` / `recovered`; suppress with `events=false`\n\nA slow consumer has frames dropped rather than queued: on a 1s feed the newest price is\nwhat matters, never a backlog. At most 5 concurrent streams per caller — filter with\n`symbols` rather than opening several connections.\n","tags":["Prices"],"parameters":[{"name":"symbols","in":"query","required":false,"description":"Comma-separated tickers to stream, e.g. `BTC,ETH`. Omit for all.","schema":{"type":"string","example":"BTC,ETH"}},{"name":"events","in":"query","required":false,"description":"Set `false` to receive only `tick` events.","schema":{"type":"string","enum":["true","false"],"default":"true"}}],"responses":{"200":{"description":"An open SSE stream.","content":{"text/event-stream":{"schema":{"type":"string"},"examples":{"stream":{"summary":"First frames after connect","value":"retry: 2000\n\nevent: snapshot\ndata: {\"prices\":[{\"symbol\":\"BTC\",\"price\":64926.08,\"ageMs\":384,\"stale\":false}],\"engineAgeMs\":383}\n\nevent: tick\ndata: {\"symbol\":\"BTC\",\"price\":64926.08,\"priceRaw\":\"6492608000000\",\"decimals\":8,\"ts\":1785958032015,\"seq\":312,\"venues\":{\"coinbase\":64875,\"gate\":64928.9},\"freshestAgeMs\":71}\n"}}}}},"429":{"description":"Rate limited, or too many concurrent streams for this caller\n(`TOO_MANY_STREAMS`).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"$ref":"#/components/responses/PriceStreamUnavailable"}}}},"/v1/prices/{symbol}":{"get":{"operationId":"getRealtimePrice","summary":"Realtime off-chain median for one symbol","tags":["Prices"],"parameters":[{"name":"symbol","in":"path","required":true,"description":"Base ticker, e.g. `BTC`. Not a pair — the quote is always USD.","schema":{"type":"string","example":"BTC"}}],"responses":{"200":{"description":"Latest realtime median for the symbol.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/PriceTick"},{"type":"object","properties":{"ageMs":{"type":"integer","example":335},"stale":{"type":"boolean","example":false},"engineAgeMs":{"type":"integer","nullable":true,"example":341},"asOf":{"type":"string","format":"date-time"}}}]}}}},"404":{"description":"The symbol is not in the realtime feed (`SYMBOL_NOT_STREAMED`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/PriceStreamUnavailable"}}}},"/v1/daily/coverage":{"get":{"operationId":"getDailyCoverage","summary":"What the daily price book holds","description":"Per-class row counts, symbol counts and first/last day, plus days missing from the last\n30 (never counting days before the store's first — those are pre-history, not an outage).\n\nCall this before charting a daily series. A series read returns the rows it has, so a\nrange with gaps looks the same as a shorter range; this endpoint is where the gaps are\nvisible.\n","tags":["Daily"],"responses":{"200":{"description":"Coverage of the daily store.","content":{"application/json":{"schema":{"type":"object","properties":{"classes":{"type":"array","items":{"type":"object","properties":{"assetClass":{"type":"string","enum":["crypto","equity","onchain"]},"rows":{"type":"integer","example":41230},"symbolCount":{"type":"integer","example":203},"firstDay":{"type":"string","example":"2020-01-01"},"lastDay":{"type":"string","example":"2026-08-27"}}}},"recentGaps":{"type":"object","properties":{"window":{"type":"string","example":"2026-07-28..2026-08-27"},"missingDays":{"type":"array","items":{"type":"string","example":"2026-08-19"}}}},"note":{"type":"string"}}}}}},"503":{"$ref":"#/components/responses/DailyUnavailable"}}}},"/v1/daily":{"get":{"operationId":"listDailyPrices","summary":"Every asset at one 00:00 UTC boundary","description":"The whole board for one UTC day. Defaults to the most recent day held rather than today,\nso a call made before tonight's capture does not return an empty result for a boundary\nthat has not happened yet.\n","tags":["Daily"],"parameters":[{"name":"day","in":"query","required":false,"description":"`YYYY-MM-DD`, an ISO timestamp, or a unix time. Defaults to the latest day held.","schema":{"type":"string","example":"2026-08-27"}},{"name":"class","in":"query","required":false,"schema":{"type":"string","enum":["crypto","equity","onchain"]}},{"name":"chain","in":"query","required":false,"description":"For `class=onchain` — `arc` or a chain id.","schema":{"type":"string","example":"arc"}},{"name":"symbols","in":"query","required":false,"description":"Comma-separated tickers to filter to, e.g. `BTC,ETH,NVDA`.","schema":{"type":"string","example":"BTC","ETH":null,"NVDA":null}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":1000,"maximum":5000}}],"responses":{"200":{"description":"Every stored asset at that boundary.","content":{"application/json":{"schema":{"type":"object","properties":{"day":{"type":"string","nullable":true,"example":"2026-08-27"},"at":{"type":"string","format":"date-time"},"count":{"type":"integer","example":215},"prices":{"type":"array","items":{"$ref":"#/components/schemas/DailyPrice"}}}}}}},"400":{"description":"`INVALID_DAY`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`BEYOND_LOOKBACK` — the day is older than your plan reaches.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`UNKNOWN_CHAIN`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/DailyUnavailable"}}}},"/v1/daily/{symbol}":{"get":{"operationId":"getDailySeries","summary":"Daily 00:00 UTC series for one asset","description":"Oldest-first, same ordering convention as `/history` so a caller charting both does not\nhave to reverse one of them.\n\n`symbol` is a ticker (`BTC`, `NVDA`) for off-chain rows or a pair (`BTC_USD`) for on-chain\nones; with `class=onchain` a bare ticker is read as `TICKER/USD`. A pair published on more\nthan one chain returns `400 AMBIGUOUS_CHAIN` rather than interleaving two chains into one\nline — add `chain=` to pick one.\n","tags":["Daily"],"parameters":[{"name":"symbol","in":"path","required":true,"description":"Ticker or pair. Use `_` for `/`, e.g. `BTC_USD`.","schema":{"type":"string","example":"BTC"}},{"name":"class","in":"query","required":false,"schema":{"type":"string","enum":["crypto","equity","onchain"]}},{"name":"chain","in":"query","required":false,"schema":{"type":"string","example":"arc"}},{"name":"from","in":"query","required":false,"description":"`YYYY-MM-DD`, ISO timestamp or unix time. Clamped to your plan lookback.","schema":{"type":"string","example":"2026-01-01"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","example":"2026-08-27"}},{"name":"limit","in":"query","required":false,"description":"Newest N rows within the range, returned oldest-first.","schema":{"type":"integer","default":400,"maximum":5000}}],"responses":{"200":{"description":"The daily series.","content":{"application/json":{"schema":{"type":"object","properties":{"symbol":{"type":"string","example":"BTC"},"assetClass":{"type":"string","example":"crypto"},"count":{"type":"integer","example":400},"from":{"type":"string","example":"2025-07-24"},"to":{"type":"string","example":"2026-08-27"},"prices":{"type":"array","items":{"$ref":"#/components/schemas/DailyPrice"}}}}}}},"400":{"description":"`AMBIGUOUS_CHAIN` — the pair is stored for several chains.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`NO_DAILY_HISTORY` or `UNKNOWN_CHAIN`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/DailyUnavailable"}}}},"/v1/daily/{symbol}/{day}":{"get":{"operationId":"getDailyPrice","summary":"One asset at one 00:00 UTC boundary","description":"The settlement shape: exact day in, one price out, `404` when nothing is stored for it.\nIt never substitutes a neighbouring day — a settlement that silently used the wrong day\nis worse than one that failed. For a nearest-observation answer with the distance\nattached, use `GET /v1/{chain}/feeds/{pair}/at`.\n","tags":["Daily"],"parameters":[{"name":"symbol","in":"path","required":true,"schema":{"type":"string","example":"NVDA"}},{"name":"day","in":"path","required":true,"schema":{"type":"string","example":"2026-08-27"}},{"name":"class","in":"query","required":false,"schema":{"type":"string","enum":["crypto","equity","onchain"]}},{"name":"chain","in":"query","required":false,"schema":{"type":"string","example":"arc"}}],"responses":{"200":{"description":"The stored snapshot.","content":{"application/json":{"schema":{"type":"object","properties":{"symbol":{"type":"string","example":"NVDA"},"day":{"type":"string","example":"2026-08-27"},"at":{"type":"string","format":"date-time"},"price":{"$ref":"#/components/schemas/DailyPrice"},"alsoStored":{"type":"array","description":"Other classes or chains holding the same symbol on that day.","items":{"$ref":"#/components/schemas/DailyPrice"}}}}}}},"400":{"description":"`INVALID_DAY` or `DAY_IN_FUTURE`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`BEYOND_LOOKBACK`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`NO_SNAPSHOT` or `UNKNOWN_CHAIN`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/DailyUnavailable"}}}}},"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","bearerFormat":"sq_live_...","description":"Optional Squidlor API key, sent as `Authorization: Bearer sq_live_...`. Get one at\n<https://build.squidlor.com>.\n\n**The API works keyless.** Without a key you are the `anon` tier, limited per IP.\nA key raises your limits and unlocks per-project usage stats:\n\n| Tier            | Requests/min | History lookback |\n|-----------------|--------------|------------------|\n| `anon` (keyless)| 30 per IP    | 30 days          |\n| `free`          | 300          | 30 days          |\n| `pro`           | 3000         | unlimited        |\n| `institutional` | unlimited    | unlimited        |\n\nA Pro key lifts the 30-day cap on `/history` and `/ohlc`, so `from` is no longer\nclamped. Institutional access is arranged at build@squidlor.com.\n\nPresenting a *malformed or revoked* key is an error (`401 INVALID_API_KEY`) rather\nthan a silent downgrade, so a bad key in a deploy does not look like a mysterious\n30/min ceiling. Presenting a valid key while the key-lookup path is degraded falls\nback to anonymous limits and sets `X-Squidlor-Key-Unverified: true`. Only strings\nbeginning `sq_live_` are treated as keys at all.\n"},"apiKeyQuery":{"type":"apiKey","in":"query","name":"apiKey","description":"The same optional key as the `apiKey` bearer scheme, passed as `?apiKey=sq_live_...`\nfor callers that cannot set headers (browser `<img>`/CSV imports, spreadsheet\nconnectors, webhooks). Identical tiers and limits; prefer the header where possible,\nsince query strings end up in logs. Ignored unless it starts with `sq_live_`.\n"}},"parameters":{"Chain":{"name":"chain","in":"path","required":true,"description":"Chain slug (`arc`) or the numeric chainId (`5042002` on testnet). Anything\nelse that parses as a positive number is\ntreated as an unknown chain and returns `404`.\n","schema":{"type":"string","pattern":"^(arc|[0-9]+)$"},"examples":{"slug":{"summary":"Slug","value":"arc"},"numeric":{"summary":"Numeric chainId","value":"5042002"}}},"Pair":{"name":"pair","in":"path","required":true,"description":"Feed pair in underscore form — the first `_` stands in for `/`, so `BTC_USD` means\n`BTC/USD`. Case-insensitive; it is upper-cased before lookup.\n","schema":{"type":"string","pattern":"^[A-Za-z0-9.]{1,12}_[A-Za-z0-9.]{1,12}$"},"example":"BTC_USD"},"ChainIdQuery":{"name":"chainId","in":"query","required":false,"description":"Numeric chainId. Defaults to the configured chain when omitted.","schema":{"type":"integer","examples":[5042002]}},"From":{"name":"from","in":"query","required":false,"description":"Inclusive start of the window. Accepts unix seconds, unix milliseconds, or an\nISO-8601 string. On `/history` and `/ohlc` this is clamped to your plan's lookback.\n","schema":{"type":"string"},"examples":{"iso":{"summary":"ISO-8601","value":"2026-08-01T00:00:00Z"},"unixSeconds":{"summary":"Unix seconds","value":"1785974400"}}},"To":{"name":"to","in":"query","required":false,"description":"Inclusive end of the window. Same formats as `from`.","schema":{"type":"string"},"example":"2026-08-04T12:00:00Z"}},"headers":{"XRateLimitLimit":{"description":"Requests allowed in the current one-minute window for your tier. Omitted for unlimited (institutional) keys.","schema":{"type":"integer"},"example":30},"XRateLimitRemaining":{"description":"Requests left in the current window.","schema":{"type":"integer"},"example":29},"XRateLimitReset":{"description":"Seconds until the current window resets.","schema":{"type":"integer"},"example":42},"XSquidlorTier":{"description":"The tier this request was billed against.","schema":{"type":"string","enum":["anon","free","pro","institutional"]},"example":"anon"},"XSquidlorKeyUnverified":{"description":"Present and `true` when a key was supplied but could not be confirmed (key auth not\nconfigured on the instance, or the lookup path was down). The request was served at\nanonymous limits.\n","schema":{"type":"string","enum":["true"]}},"XHistoryClamped":{"description":"Present and `true` when `from` was moved forward to fit your plan's history\nlookback. Also set when `from` was omitted entirely, since the window then starts at\nthe cap.\n","schema":{"type":"string","enum":["true"]}},"XHistoryLookbackDays":{"description":"The lookback ceiling, in days, that was applied. Sent alongside `X-History-Clamped`.","schema":{"type":"integer"},"example":30},"RetryAfter":{"description":"Seconds to wait before retrying — the remaining lifetime of the current rate-limit window.","schema":{"type":"integer"},"example":42}},"responses":{"InvalidApiKey":{"description":"A key was presented but is not valid or has been revoked. Retry without it to fall back to anonymous limits.","headers":{"X-Squidlor-Tier":{"$ref":"#/components/headers/XSquidlorTier"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CodedError"},"examples":{"invalidKey":{"value":{"code":"INVALID_API_KEY","message":"This API key is not valid or has been revoked. Manage keys at https://build.squidlor.com."}}}}}},"RateLimited":{"description":"Rate limit for your tier exceeded. Wait `retryAfterSec` seconds, or use a key with a higher limit.","headers":{"Retry-After":{"$ref":"#/components/headers/RetryAfter"},"X-RateLimit-Limit":{"$ref":"#/components/headers/XRateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/XRateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/XRateLimitReset"},"X-Squidlor-Tier":{"$ref":"#/components/headers/XSquidlorTier"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitError"},"examples":{"anonymous":{"summary":"Keyless caller","value":{"code":"RATE_LIMITED","message":"Anonymous requests are limited to 30/min. A free API key raises this to 300/min — https://build.squidlor.com.","retryAfterSec":42,"tier":"anon"}},"keyed":{"summary":"Keyed caller","value":{"code":"RATE_LIMITED","message":"Rate limit of 300/min exceeded for your free plan.","retryAfterSec":17,"tier":"free"}}}}}},"ChainNotSupported":{"description":"The chain slug or chainId is not configured on this deployment. An unrecognised slug\nreturns `404` rather than falling back to a default chain — a typo like\n`/v1/robinhoood/feeds` must not silently return another chain's prices.\n","headers":{"X-Squidlor-Tier":{"$ref":"#/components/headers/XSquidlorTier"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"unknownChain":{"value":{"message":"chain not supported: base"}}}}}},"FeedOrChainNotFound":{"description":"The chain is not supported, or no aggregator is configured for that pair on it.","headers":{"X-Squidlor-Tier":{"$ref":"#/components/headers/XSquidlorTier"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"feedNotFound":{"summary":"Unknown pair","value":{"message":"Feed not found: DOGE/USD on chain 5042002"}},"chainNotSupported":{"summary":"Unknown chain","value":{"message":"chain not supported: base"}}}}}},"InvalidInterval":{"description":"The `interval` query parameter is not one of the supported bucket sizes.","headers":{"X-Squidlor-Tier":{"$ref":"#/components/headers/XSquidlorTier"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"badInterval":{"value":{"message":"invalid interval: 2h. Use one of 1m, 5m, 15m, 1h, 4h, 1d"}}}}}},"HistoryDisabled":{"description":"History is not enabled on this deployment, or its MongoDB connection is down. All\nlive on-chain reads keep working; only `/history`, `/ohlc` and `/audit` are affected.\n","headers":{"X-Squidlor-Tier":{"$ref":"#/components/headers/XSquidlorTier"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"notEnabled":{"value":{"message":"history not enabled — set MONGODB_URI for the aggregator-api"}}}}}},"InternalError":{"description":"Unhandled error. In practice this is almost always an upstream RPC failure\n(timeout, rate limit, or a multicall revert) surfacing with the provider's message.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"rpcFailure":{"value":{"message":"HTTP request failed. Status: 429 URL: https://rpc.testnet.arc.io"}}}}}},"InvalidChainId":{"description":"`chainId` was present but not a positive number. A malformed `chainId` is the\ncaller's input error, so it returns `400` with `code: INVALID_CHAIN_ID` rather than\nsurfacing as a server error.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"invalidChainId":{"value":{"code":"INVALID_CHAIN_ID","message":"invalid chainId: bogus"}}}}}},"PriceStreamUnavailable":{"description":"The realtime price engine is not reachable, or realtime prices are not enabled on this\ndeployment (`PRICE_STREAM_UNAVAILABLE`). On-chain values remain available at\n`/v1/{chain}/feeds` — this failure is isolated to the off-chain feed.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"unavailable":{"value":{"code":"PRICE_STREAM_UNAVAILABLE","message":"The realtime price engine is not reachable right now. On-chain values remain available at /v1/feeds."}}}}}},"DailyUnavailable":{"description":"The daily price book is unreachable, or not enabled on this deployment\n(`DAILY_UNAVAILABLE`). It needs `MONGODB_URI`; live reads at `/v1/feeds` and\n`/v1/prices` are unaffected.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"unavailable":{"value":{"code":"DAILY_UNAVAILABLE","message":"The daily price store is not enabled on this deployment (set MONGODB_URI)."}}}}}},"UpstreamError":{"description":"An upstream RPC failure while reading on-chain state. Retry with backoff; the\naggregator contracts themselves are unaffected.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"rpcFailure":{"value":{"message":"HTTP request failed. Status: 429 URL: https://arb1.arbitrum.io/rpc"}}}}}}},"schemas":{"DailyPrice":{"type":"object","description":"One asset's price at one 00:00 UTC boundary, from the permanent daily book.\n\nRead `source` before trusting a row for settlement:\n\n  * `price-stream` — our venue median, captured at the boundary\n  * `equity-median` — our median of independent quote APIs, captured at the boundary\n  * `onchain:<chainId>` — the on-chain aggregator answer at the boundary\n  * `feed-round` — recovered from the nearest 60s history sample after a restart\n  * `backfill:<vendor>` — an external daily candle, seeded for days that predate us\n\n`offsetMs` is how far the observation sits from the boundary. It is 0 for a backfilled\ncandle (the vendor's bucket IS the boundary), a second or two for a live capture, and\nhours for a snapshot taken by hand after a missed midnight.\n","properties":{"assetClass":{"type":"string","enum":["crypto","equity","onchain"],"example":"crypto"},"symbol":{"type":"string","example":"BTC"},"quote":{"type":"string","example":"USD"},"day":{"type":"string","example":"2026-08-27"},"at":{"type":"string","format":"date-time","description":"The 00:00 UTC boundary itself."},"observedAt":{"type":"string","format":"date-time","description":"When the value was actually read."},"offsetMs":{"type":"integer","example":812},"price":{"type":"number","example":79023.75},"priceRaw":{"type":"string","description":"The same number as an integer at `decimals`, when the source has one.","example":"7902375000000"},"decimals":{"type":"integer","example":8},"source":{"type":"string","example":"price-stream"},"contributors":{"type":"array","description":"Venues or quote APIs behind the median.","items":{"type":"string"},"example":["coinbase","gate","kraken","okx"]},"contributorCount":{"type":"integer","example":4},"chainId":{"type":"integer","description":"On-chain rows only. The same pair on two chains is two rows, not one.","example":5042002},"stale":{"type":"boolean","description":"The underlying reading was already stale when taken."},"session":{"type":"string","description":"Equities only — the trading session this boundary reports. 00:00 UTC is after the US\nclose, so a weekday boundary carries the previous day's close, and Saturday, Sunday\nand Monday boundaries all carry Friday's.\n","example":"2026-08-26"},"sessionInferred":{"type":"boolean","description":"`session` came from the calendar (weekends only, no holiday table) rather than the data source."},"note":{"type":"string"}}},"PriceTick":{"type":"object","description":"One realtime median. `priceRaw` is the same number at 8 decimals — the integer form that\ngets signed and pushed on-chain, so a consumer can compare the two feeds without\nfloating-point drift.\n","properties":{"symbol":{"type":"string","example":"BTC"},"price":{"type":"number","example":64919.98},"priceRaw":{"type":"string","description":"Integer price at `decimals`.","example":"6491998000000"},"decimals":{"type":"integer","example":8},"ts":{"type":"integer","description":"Unix ms when the median was computed.","example":1785958022007},"seq":{"type":"integer","description":"Per-symbol counter. Monotonic while the engine runs; a jump backwards means it\nrestarted, which is the signal to re-read a snapshot rather than assume continuity.\n","example":302},"venues":{"type":"object","description":"The venue readings this median was taken over.","additionalProperties":{"type":"number"},"example":{"coinbase":64867.34,"gate":64920.5,"binance":64919.98,"bybit":64921.3,"hub":64845.12}},"freshestAgeMs":{"type":"integer","description":"Age of the freshest contributing venue reading, ms.","example":28}},"required":["symbol","price","priceRaw","decimals","ts","seq","venues"]},"PriceListResponse":{"type":"object","properties":{"count":{"type":"integer","example":5},"engineAgeMs":{"type":"integer","nullable":true,"description":"How long ago the price engine last published anything. Distinguishes \"this symbol is\nquiet\" from \"the engine is dead\".\n","example":341},"prices":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/PriceTick"},{"type":"object","properties":{"ageMs":{"type":"integer","example":335},"stale":{"type":"boolean","example":false}}}]}},"note":{"type":"string"},"asOf":{"type":"string","format":"date-time"}}},"Address":{"type":"string","description":"EIP-55 checksummed 20-byte address.","pattern":"^0x[0-9a-fA-F]{40}$","examples":["0x94800f5Cebb5677F1855e9C9024b1Bc9685b60AF"]},"EventId":{"type":"string","description":"0x-prefixed 32-byte hex event id.","pattern":"^0x[0-9a-fA-F]{64}$","examples":["0x9c3f1a7b5d2e48f0a6b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f3"]},"UnixSeconds":{"type":"integer","description":"Unix timestamp in seconds, as reported by chain state.","examples":[1785974400]},"Interval":{"type":"string","description":"Bucket size for downsampling and candles.","enum":["1m","5m","15m","1h","4h","1d"]},"SelectionMode":{"type":"string","description":"How the aggregator picks its answer from the configured sources.","enum":["MEDIAN","PRIMARY_WITH_FALLBACK"]},"Error":{"type":"object","description":"Plain error body used by the route guards and the global error handler.","required":["message"],"properties":{"message":{"type":"string","description":"Human-readable explanation. Not machine-parseable — switch on the status code."}},"examples":[{"message":"chain not supported: base"}]},"CodedError":{"type":"object","description":"Error body from the metering middleware, which adds a stable machine-readable `code`.","required":["code","message"],"properties":{"code":{"type":"string","description":"Stable error code.","enum":["INVALID_API_KEY","RATE_LIMITED"]},"message":{"type":"string"}}},"RateLimitError":{"allOf":[{"$ref":"#/components/schemas/CodedError"},{"type":"object","required":["retryAfterSec","tier"],"properties":{"retryAfterSec":{"type":"integer","description":"Seconds until the window resets. Mirrors the `Retry-After` header."},"tier":{"$ref":"#/components/schemas/Tier"}}}]},"Tier":{"type":"string","description":"Plan the request was billed against. Keyless callers are `anon`.","enum":["anon","free","pro","institutional"]},"SourceEntry":{"type":"object","description":"One source adapter behind an aggregator, read live. `price`/`priceRaw`/`updatedAt`\ncome from the adapter's own `latestPrice()`; if that read failed, they are absent and\n`error` explains why.\n","required":["index","adapter","name","enabled","maxStaleness","isStale"],"properties":{"index":{"type":"integer","description":"Position in the aggregator's source array."},"adapter":{"$ref":"#/components/schemas/Address"},"name":{"type":"string","description":"Adapter's self-reported `name()`. Falls back to `source` if the call failed."},"enabled":{"type":"boolean","description":"Whether the aggregator currently counts this source."},"maxStaleness":{"type":"integer","description":"Per-source staleness ceiling in seconds. `0` means the aggregator's `defaultMaxStaleness` applies."},"price":{"type":"string","description":"Adapter price formatted with the aggregator's `decimals`."},"priceRaw":{"type":"string","description":"Same price as an unscaled integer, decimal-encoded (may exceed IEEE-754 precision)."},"updatedAt":{"$ref":"#/components/schemas/UnixSeconds"},"isStale":{"type":"boolean","description":"True when `updatedAt` is older than the effective staleness ceiling."},"error":{"type":"string","description":"First line of the adapter read failure, when `latestPrice()` reverted."}}},"FeedDetail":{"type":"object","description":"Full live state of one aggregator contract.","required":["chainId","pair","aggregator","description","decimals","owner","selectionMode","minHealthySources","defaultMaxStaleness","latestRoundId","sources"],"properties":{"chainId":{"type":"integer"},"pair":{"type":"string","description":"Upper-cased slash form, e.g. `BTC/USD`."},"aggregator":{"$ref":"#/components/schemas/Address"},"description":{"type":"string","description":"The contract's own `description()`."},"decimals":{"type":"integer","description":"Fixed-point decimals for every price on this feed. `8` for all current feeds."},"owner":{"$ref":"#/components/schemas/Address"},"selectionMode":{"$ref":"#/components/schemas/SelectionMode"},"minHealthySources":{"type":"integer","description":"How many fresh sources `peek()` requires before it will answer."},"defaultMaxStaleness":{"type":"integer","description":"Fallback staleness ceiling in seconds for sources with `maxStaleness = 0`."},"latestRoundId":{"type":"string","description":"Latest round id, decimal-encoded (uint256)."},"median":{"type":"string","description":"Aggregate from `peek()`, formatted with `decimals`. Absent when `peekError` is set."},"medianRaw":{"type":"string","description":"Aggregate as an unscaled integer, decimal-encoded."},"freshestUpdatedAt":{"$ref":"#/components/schemas/UnixSeconds"},"healthyCount":{"type":"integer","description":"Sources that were fresh and enabled at read time."},"peekError":{"type":"string","description":"First line of the revert reason when `peek()` failed — usually too few healthy sources."},"sources":{"type":"array","description":"One entry per configured source, in contract order.","items":{"$ref":"#/components/schemas/SourceEntry"}}}},"FeedDetailResponse":{"allOf":[{"$ref":"#/components/schemas/FeedDetail"},{"type":"object","required":["cachedAt"],"properties":{"cachedAt":{"type":"string","format":"date-time","description":"When this response was assembled. Reads are memoised for the instance's cache TTL (10s by default)."}}}]},"FeedSummary":{"type":"object","description":"Condensed aggregator state for list views.","required":["chainId","pair","aggregator","description","totalSources"],"properties":{"chainId":{"type":"integer"},"pair":{"type":"string"},"aggregator":{"$ref":"#/components/schemas/Address"},"description":{"type":"string"},"median":{"type":"string","description":"Aggregate formatted with the feed's decimals. Absent when `peekError` is set."},"healthyCount":{"type":"integer"},"totalSources":{"type":"integer","description":"Configured sources, healthy or not."},"freshestUpdatedAt":{"$ref":"#/components/schemas/UnixSeconds"},"peekError":{"type":"string"}}},"FeedListResponse":{"type":"object","required":["chainId","count","feeds","cachedAt"],"properties":{"chainId":{"type":"integer"},"count":{"type":"integer","description":"Length of `feeds`."},"feeds":{"type":"array","items":{"$ref":"#/components/schemas/FeedSummary"}},"cachedAt":{"type":"string","format":"date-time"}}},"ChainValueResponse":{"type":"object","description":"Minimal value payload returned by the chain-scoped `/value` route.","required":["pair","chainId","decimals"],"properties":{"pair":{"type":"string"},"chainId":{"type":"integer"},"value":{"type":"string","description":"Median formatted with `decimals`."},"valueRaw":{"type":"string","description":"Median as an unscaled integer, decimal-encoded."},"decimals":{"type":"integer"},"healthyCount":{"type":"integer"},"updatedAt":{"$ref":"#/components/schemas/UnixSeconds"}}},"ChainValueUnavailable":{"type":"object","description":"Body of the chain-scoped `/value` `503` — the aggregate could not be read.","required":["pair","chainId","error"],"properties":{"pair":{"type":"string"},"chainId":{"type":"integer"},"error":{"type":"string","description":"First line of the `peek()` revert reason."}}},"LegacyValueResponse":{"type":"object","description":"Value payload of the deprecated `/v1/feeds/{pair}/value` route.","required":["pair","chainId","ok","decimals","totalSources"],"properties":{"pair":{"type":"string"},"chainId":{"type":"integer"},"ok":{"type":"boolean","description":"Always `true` on a `200`.","const":true},"value":{"type":"string"},"valueRaw":{"type":"string"},"decimals":{"type":"integer"},"healthyCount":{"type":"integer"},"totalSources":{"type":"integer"},"updatedAt":{"$ref":"#/components/schemas/UnixSeconds"},"mode":{"$ref":"#/components/schemas/SelectionMode"}}},"LegacyValueUnavailable":{"type":"object","description":"Body of the deprecated `/value` `503`.","required":["pair","chainId","ok","error","healthyCount","totalSources"],"properties":{"pair":{"type":"string"},"chainId":{"type":"integer"},"ok":{"type":"boolean","const":false},"error":{"type":"string"},"healthyCount":{"type":"integer","description":"Defaults to `0` when the aggregate read failed outright."},"totalSources":{"type":"integer"}}},"Constituent":{"type":"object","description":"One off-chain quote provider's answer. Exactly one of `price` or `error` is present.","required":["name"],"properties":{"name":{"type":"string","description":"Provider key.","enum":["yahoo","nasdaq","finnhub","twelvedata"]},"price":{"type":"number","description":"Quote in USD."},"error":{"type":"string","description":"Why the provider was skipped or failed, truncated to 120 characters."}}},"ConstituentsResponse":{"type":"object","description":"On-chain Squidlor leg plus a live recomputation of the off-chain quote set. Note the\ndeliberate naming: `liveOffChainMedian` is *not* the on-chain median.\n","required":["chainId","pair","onChainSquidlor","symbol","contributors","sources","warning","asOf"],"properties":{"chainId":{"type":"integer"},"pair":{"type":"string"},"onChainSquidlor":{"description":"The `squidlor:`-prefixed source as currently stored in the aggregator. `null` when the feed or that leg is missing.","oneOf":[{"type":"null"},{"type":"object","properties":{"price":{"type":"string","description":"Stored price formatted with the feed's decimals."},"updatedAt":{"$ref":"#/components/schemas/UnixSeconds"},"ageHours":{"type":"number","description":"How long ago the leg was pushed, in hours, to two decimal places."},"isStale":{"type":"boolean"}}}]},"symbol":{"type":"string","description":"Equity ticker parsed from the pair.","examples":["NVDA"]},"liveOffChainMedian":{"type":"number","description":"Median of the providers that answered *right now*. What Squidlor would publish if\nit pushed at this instant — never the on-chain value. Absent when every provider\nfailed.\n"},"contributors":{"type":"array","description":"Names of the providers that contributed a price.","items":{"type":"string"}},"sources":{"type":"array","description":"Every provider attempted, with its price or its error.","items":{"$ref":"#/components/schemas/Constituent"}},"warning":{"type":"string","description":"Standing caveat, returned verbatim on every response, that `liveOffChainMedian` must not be substituted for the on-chain reading."},"asOf":{"type":"string","format":"date-time","description":"When the off-chain quotes were fetched."}}},"HistoryPoint":{"type":"object","description":"One recorded sample. `bucket` is present only on downsampled (interval) responses.","required":["ts"],"properties":{"bucket":{"type":"string","format":"date-time","description":"Truncated bucket start this sample represents. Interval responses only."},"ts":{"type":"string","format":"date-time","description":"Timestamp of the underlying sample — for interval responses, the last sample in the bucket."},"median":{"type":"string","description":"Median formatted with the feed's decimals, as recorded."},"medianNum":{"type":"number","description":"Same median as a float, for charting. Interval responses only include rounds where this is set."},"healthyCount":{"type":"integer"}}},"HistoryResponse":{"type":"object","required":["chainId","pair","interval","count","points"],"properties":{"chainId":{"type":"integer"},"pair":{"type":"string"},"interval":{"type":"string","description":"Echo of the requested bucket, or `raw` when no downsampling was applied.","examples":["1h","raw"]},"count":{"type":"integer","description":"Length of `points`."},"points":{"type":"array","description":"Oldest-first.","items":{"$ref":"#/components/schemas/HistoryPoint"}}}},"OhlcCandle":{"type":"object","required":["t","open","high","low","close","samples"],"properties":{"t":{"type":"string","format":"date-time","description":"Candle open time (bucket start)."},"open":{"type":"number"},"high":{"type":"number"},"low":{"type":"number"},"close":{"type":"number"},"samples":{"type":"integer","description":"Recorded rounds that fell into this candle."}}},"OhlcResponse":{"type":"object","required":["chainId","pair","interval","count","candles"],"properties":{"chainId":{"type":"integer"},"pair":{"type":"string"},"interval":{"$ref":"#/components/schemas/Interval"},"count":{"type":"integer"},"candles":{"type":"array","description":"Oldest-first.","items":{"$ref":"#/components/schemas/OhlcCandle"}}}},"SourceSample":{"type":"object","description":"One source's answer within a recorded round, with its deviation from that round's median.","required":["index","adapter","name","enabled","isStale"],"properties":{"index":{"type":"integer"},"adapter":{"$ref":"#/components/schemas/Address"},"name":{"type":"string"},"enabled":{"type":"boolean"},"price":{"type":"string"},"priceNum":{"type":"number"},"updatedAt":{"$ref":"#/components/schemas/UnixSeconds"},"isStale":{"type":"boolean"},"deviationBps":{"type":"number","description":"Signed distance from the round's median, in basis points."},"error":{"type":"string"}}},"AuditRound":{"type":"object","description":"One recorded round of one feed — the audit unit. Simultaneously a history point and a per-source snapshot.","required":["chainId","pair","ts","decimals","selectionMode","flagged","sources"],"properties":{"chainId":{"type":"integer"},"pair":{"type":"string"},"ts":{"type":"string","format":"date-time","description":"When the recorder sampled the feed."},"decimals":{"type":"integer"},"selectionMode":{"type":"string","description":"Aggregator mode at sample time."},"median":{"type":"string"},"medianNum":{"type":"number"},"medianRaw":{"type":"string"},"healthyCount":{"type":"integer"},"freshestUpdatedAt":{"$ref":"#/components/schemas/UnixSeconds"},"peekError":{"type":"string"},"maxAbsDeviationBps":{"type":"number","description":"Largest absolute per-source deviation in the round."},"flagged":{"type":"boolean","description":"Whether the recorder marked this round anomalous."},"flagReasons":{"type":"array","description":"Why the round was flagged. Present only on flagged rounds.","items":{"type":"string"}},"sources":{"type":"array","description":"Every source's answer. Filtered by name when the `source` query parameter is used.","items":{"$ref":"#/components/schemas/SourceSample"}}}},"AuditResponse":{"type":"object","required":["chainId","pair","count","rounds"],"properties":{"chainId":{"type":"integer"},"pair":{"type":"string"},"count":{"type":"integer"},"rounds":{"type":"array","description":"Newest-first.","items":{"$ref":"#/components/schemas/AuditRound"}}}},"RandomnessRequest":{"type":"object","description":"One randomness request. `randomness*` fields appear only once fulfilled.","required":["sequenceNumber","requester","requestedAt","fulfilled"],"properties":{"sequenceNumber":{"type":"string","description":"Entropy sequence number, decimal-encoded."},"requester":{"$ref":"#/components/schemas/Address"},"randomness":{"type":"string","description":"Fulfilled value as 0x-prefixed, zero-padded 32-byte hex.","pattern":"^0x[0-9a-f]{64}$"},"randomnessDecimal":{"type":"string","description":"The same uint256 in base 10."},"requestedAt":{"$ref":"#/components/schemas/UnixSeconds"},"fulfilledAt":{"$ref":"#/components/schemas/UnixSeconds"},"fulfilled":{"type":"boolean"}}},"RandomnessResponse":{"type":"object","required":["chainId","contract","entropy","provider","owner","feeWei","feeEth","totalRequests","recentRequests","cachedAt"],"properties":{"chainId":{"type":"integer"},"contract":{"$ref":"#/components/schemas/Address"},"entropy":{"$ref":"#/components/schemas/Address"},"provider":{"$ref":"#/components/schemas/Address"},"owner":{"$ref":"#/components/schemas/Address"},"feeWei":{"type":"string","description":"Current request fee in wei, decimal-encoded."},"feeEth":{"type":"string","description":"The same fee formatted in ether."},"totalRequests":{"type":"string","description":"Lifetime request count, decimal-encoded."},"recentRequests":{"type":"array","description":"Newest-first, up to `limit` entries.","items":{"$ref":"#/components/schemas/RandomnessRequest"}},"cachedAt":{"type":"string","format":"date-time"}}},"Outcome":{"type":"string","description":"Resolution of a yes/no event.","enum":["UNRESOLVED","YES","NO","INVALID"]},"PerSourceOutcome":{"type":"object","description":"One resolver source's answer for an event.","required":["sourceIndex","sourceName","outcome","outcomeCode","resolved","resolvedAt","enabled","adapter"],"properties":{"sourceIndex":{"type":"integer"},"sourceName":{"type":"string","description":"Source's self-reported name. `?` when the per-source read failed."},"outcome":{"$ref":"#/components/schemas/Outcome"},"outcomeCode":{"type":"integer","description":"Numeric form of `outcome` — 0 UNRESOLVED, 1 YES, 2 NO, 3 INVALID.","minimum":0,"maximum":3},"resolved":{"type":"boolean"},"resolvedAt":{"type":"integer","description":"Unix seconds, or `0` when unresolved."},"enabled":{"type":"boolean"},"adapter":{"$ref":"#/components/schemas/Address"}}},"EventSummary":{"type":"object","description":"A registered question with its aggregated and per-source resolutions.","required":["eventId","question","registeredAt","livenessSeconds","aggregated","perSource"],"properties":{"eventId":{"$ref":"#/components/schemas/EventId"},"question":{"type":"string","description":"Question text from the resolver. Empty string when the read failed."},"registeredAt":{"$ref":"#/components/schemas/UnixSeconds"},"livenessSeconds":{"type":"integer","description":"Dispute window the resolver enforces before an answer is final."},"aggregated":{"type":"object","description":"The aggregator's answer. When `getOutcome()` reverts, this reports `UNRESOLVED` plus `error`.","required":["outcome","outcomeCode","resolvedCount","totalEnabled"],"properties":{"outcome":{"$ref":"#/components/schemas/Outcome"},"outcomeCode":{"type":"integer","minimum":0,"maximum":3},"resolvedCount":{"type":"integer"},"totalEnabled":{"type":"integer"},"error":{"type":"string","description":"First line of the `getOutcome()` revert reason, when it reverted."}}},"perSource":{"type":"array","items":{"$ref":"#/components/schemas/PerSourceOutcome"}}}},"EventsListResponse":{"type":"object","required":["chainId","aggregator","resolver","mode","minHealthy","sourceCount","events","cachedAt"],"properties":{"chainId":{"type":"integer"},"aggregator":{"$ref":"#/components/schemas/Address"},"resolver":{"$ref":"#/components/schemas/Address"},"mode":{"type":"string","description":"How the event aggregator combines source resolutions.","enum":["MAJORITY","UNANIMOUS","PRIMARY_WITH_FALLBACK"]},"minHealthy":{"type":"integer"},"sourceCount":{"type":"integer"},"events":{"type":"array","description":"Newest-first by `registeredAt`.","items":{"$ref":"#/components/schemas/EventSummary"}},"cachedAt":{"type":"string","format":"date-time"}}},"EventDetailResponse":{"allOf":[{"$ref":"#/components/schemas/EventSummary"},{"type":"object","required":["cachedAt"],"properties":{"cachedAt":{"type":"string","format":"date-time"}}}]},"LegacyEventDetailResponse":{"allOf":[{"type":"object","required":["chainId"],"properties":{"chainId":{"type":"integer"}}},{"$ref":"#/components/schemas/EventDetailResponse"}]},"ServiceInfo":{"type":"object","description":"Discovery document served at the API root.","required":["name","version","endpoints","chains","auth","openapi"],"properties":{"name":{"type":"string","const":"squidlor-aggregator-api"},"version":{"type":"string"},"endpoints":{"type":"object","description":"Map of `METHOD /path` to a one-line description.","additionalProperties":{"type":"string"}},"chains":{"type":"array","description":"Supported chain slugs.","items":{"type":"string"}},"auth":{"type":"object","required":["required","note","header","queryParam","getKey","limits"],"properties":{"required":{"type":"boolean","description":"Always `false` — the API is keyless-first.","const":false},"note":{"type":"string"},"header":{"type":"string","description":"Header form for a key."},"queryParam":{"type":"string","description":"Query-parameter name for a key."},"getKey":{"type":"string","format":"uri"},"limits":{"type":"object","description":"Live tier table from this instance's configuration.","required":["anonymous","free","pro","institutional"],"properties":{"anonymous":{"type":"string"},"free":{"type":"string"},"pro":{"type":"string"},"institutional":{"type":"string"}}}}},"openapi":{"type":"string","description":"Path to the machine-readable spec."}}},"Health":{"type":"object","required":["status","service","env"],"properties":{"status":{"type":"string","const":"ok"},"service":{"type":"string","const":"aggregator-api"},"env":{"type":"string","description":"The `NODE_ENV` of the running instance."}}},"MeteringHealth":{"type":"object","description":"Diagnostics for the identify → rate limit → count path.","required":["status","configured","keyCache","rateLimiter","usage","mongo"],"properties":{"status":{"type":"string","const":"ok"},"configured":{"type":"object","description":"Which parts of metering are switched on for this instance.","required":["keyAuth","rateLimit","usage"],"properties":{"keyAuth":{"type":"boolean","description":"True when `API_KEY_PEPPER` is set. When false every caller is anonymous."},"rateLimit":{"type":"boolean"},"usage":{"type":"boolean"}}},"keyCache":{"type":"object","description":"API-key resolution cache.","required":["size","hits","misses","lookupFailures","hitRate"],"properties":{"size":{"type":"integer"},"hits":{"type":"integer"},"misses":{"type":"integer"},"lookupFailures":{"type":"integer"},"hitRate":{"type":"number"}}},"rateLimiter":{"type":"object","required":["configured","healthy","degradedRequests"],"properties":{"configured":{"type":"boolean","description":"True when a Redis URL is configured."},"healthy":{"type":"boolean"},"degradedRequests":{"type":"integer","description":"Requests allowed through without a counter because Redis was unreachable."}}},"usage":{"type":"object","required":["pending","flushed","flushErrors"],"properties":{"pending":{"type":"integer"},"flushed":{"type":"integer"},"flushErrors":{"type":"integer"}}},"mongo":{"type":"string","enum":["connected","disconnected"]}}}}}}