{"uid":"cap_AuSqpgBCC47eJp7I_u2ZX","slug":"apix402-oracle-staleness-checker-base-ac8ea3c4","name":"APIX402 Oracle Staleness Checker (Base)","description":"Onchain- and crypto-market data for trading AI agents. Payment via x402 (USDC, exact scheme).","url":"https://api402x.com/oracle-staleness?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","required":[],"properties":{"assets":{"type":"string","description":"Optional. Comma-separated asset list, e.g. \"ETH/USD,BTC/USD\". Supported: ETH/USD, BTC/USD, USDC/USD. Omit for all three. An unsupported asset is refused rather than served with a generic threshold."}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","description":"Full JSON Schema for this response is at /openapi.json, and the free /preview sibling returns the same shape on live data. It is not inlined here because response headers have a hard 16 KB limit in common HTTP clients (Node's default) and this response is large. The example alongside is complete and real."}}}}},"responseSchema":{"type":"json","example":{"count":1,"assets":[{"pyth":{"expo":-8,"price":"1890.77072612","feed_id":"0xff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace","contract":"0x8250f4aF4B972684F7b336503E2D6dFeDeB1487a","price_raw":"189077072612","confidence":"1.65561399","guard_rule":"Pyth's own recommended guard is getPriceNoOlderThan(id, 60), where 60s is this contract's live getValidTimePeriod(). It reverts when now - publishTime exceeds that bound. This value is derived from getPriceUnsafe(), not by calling the guard: on-chain Pyth is pull-based and the guard does revert in production, so a read path that used it would fail precisely when the answer is interesting.","age_seconds":125,"publish_time":"2026-08-13T06:42:55.000Z","confidence_raw":"165561399","implementation":"0x41c9e39574f40ad34c79f1c99b66a45efb830d4c","would_revert_with_error":"StalePrice()","valid_time_period_seconds":60,"would_revert_with_selector":"0x19abf40e","would_standard_guard_reject":true,"implementation_matches_pinned":true},"asset":"ETH/USD","chain":"eip155:8453","spread":{"bps":12.1,"interpretation":"Chainlink and Pyth differ by 12.1 bps. Pyth's own confidence interval on this price is 8.75 bps, so this single reading sits OUTSIDE Pyth's stated uncertainty. That is not by itself evidence the oracles disagree: one sample outside a stated band is unremarkable, and a sustained pattern rather than one reading would be needed to call it a real divergence. Note also that the two prices are stamped 1070s apart (Chainlink is the older of the two), so part of any gap is simply the market moving between the two observations, not the oracles disagreeing.","unavailable_reason":null,"pyth_confidence_bps":8.75,"exceeds_pyth_confidence":true},"verdict":"ETH/USD: Chainlink is 1195s (0.33h) old against a measured 1200s heartbeat, which is inside its own 1320s bound — a consumer guard built on this feed's heartbeat would accept it. A consumer applying one uniform 60s bound to every feed would wrongly reject it: this feed is behaving exactly as designed. On-chain Pyth is 125s old against its own 60s validity window — Pyth's recommended guard getPriceNoOlderThan(id, 60) WOULD REVERT right now with StalePrice() (0x19abf40e). On-chain Pyth is pull-based: it holds whatever was last pushed, so this is a normal state, not an outage.","chainlink":{"price":"1893.0617","proxy":"0x71041dddad3595F9CEd3DcCFBe3D1F4b0a16Bb70","decimals":8,"phase_id":2,"round_id":"36893488147419129672","price_raw":"189306170000","aggregator":"0x1e0B2C3896338FBb201C4f0A27C6904801Dca06B","guard_rule":"A consumer guard for this feed rejects when now - updatedAt > 1320s (measured heartbeat 1200s + 120s grace for block-time jitter). This bound is specific to this feed: on this same chain the heartbeats differ by 72x.","updated_at":"2026-08-13T06:25:05.000Z","age_seconds":1195,"description":"ETH / USD","proxy_verified":true,"heartbeat_seconds":1200,"stale_after_seconds":1320,"naive_uniform_guard_seconds":60,"would_standard_guard_reject":false,"naive_uniform_guard_would_reject":true},"fetched_at":"2026-08-13T06:45:00.523Z","sources_status":{"pyth":"ok","chainlink":"ok"},"observed_at_block":"49907075","observed_at_block_time":"2026-08-13T06:44:57.000Z","any_source_would_be_rejected":true}],"degraded":false,"asset_status":{"BTC/USD":"ok","ETH/USD":"ok","USDC/USD":"ok"},"generated_at":"2026-08-13T06:45:00.523Z"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.003","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"down","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.003/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_2wXBWUQ8ol_YJ8rOTPxm2","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.003","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Reports the real-time staleness of Chainlink and Pyth oracle prices on Base, with per-feed staleness bounds and a Chainlink-vs-Pyth spread contextualized against Pyth's own confidence interval.","exampleAgentPrompt":"Check whether the ETH/USD oracle prices from Chainlink and Pyth are currently stale on Base, and tell me if a standard staleness guard would reject either of them — also show me the spread between the two and whether it's outside Pyth's confidence interval.","exampleUseCases":[{"title":"Pre-trade oracle freshness check","prompt":"Before I execute this DeFi trade on Base, check if the ETH/USD and BTC/USD oracle prices from Chainlink and Pyth are fresh right now, and let me know if a staleness guard would reject either feed."},{"title":"Smart contract staleness guard audit","prompt":"My Solidity contract uses a single 60-second staleness threshold for all price feeds — can you check whether that guard would wrongly reject the USDC/USD Chainlink feed on Base, which I heard runs a 24-hour heartbeat by design?"},{"title":"Oracle divergence investigation","prompt":"Check if Chainlink and Pyth are actually disagreeing on the ETH/USD price on Base right now, and tell me whether any difference is inside or outside Pyth's own confidence interval so I can tell if it's a real divergence or just noise."}],"resultDescription":"Returns a JSON object with one entry per requested asset (defaulting to ETH/USD, BTC/USD, and USDC/USD), each containing: Chainlink proxy address, implementation address, current price, age in seconds, per-feed staleness bound, whether a standard guard would reject it; Pyth feed ID, contract address, price, age, valid_time_period, confidence interval, and rejection verdict; the Chainlink-vs-Pyth spread in bps with interpretation relative to Pyth's confidence interval; and an overall staleness verdict with human-readable explanation. Also includes the block number and timestamp at which all readings were taken.","failureModes":["Unsupported asset symbol returns an error rather than a generic result","Network or RPC issues on Base may cause a failed or delayed response","Truncated or malformed asset query parameter results in a refusal","Payment failure via x402 returns a 402 response before any data is returned"],"whenToPreferThis":"Choose this endpoint when you need authoritative, per-feed staleness analysis for Chainlink and Pyth on Base rather than writing your own on-chain reader — especially when the correct proxy address, heartbeat cadence, and meaning of 'stale' for each specific feed are not already known. It is also the right choice when you need to compare oracle prices while correctly contextualizing any spread against Pyth's own confidence interval to avoid false divergence alarms.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-13T04:25:43.898Z","isFirstParty":false,"canonicalSlug":"apix402-oracle-staleness-checker-base-ac8ea3c4"}