Skip to Content
Overview

Claros

Claros is a verifiable real-world-data oracle on Casper. An autonomous agent reads trusted public sources (U.S. energy data from the EIA, plus civic feeds such as San Diego parking revenue), attests each value on-chain together with its provenance, and exposes it as a self-describing feed that any app, backend, or contract can read by a single feed_id.

If you have used Pyth , Claros will feel familiar. Values live on-chain as integers, every feed describes its own decimals and unit, and a reading is amount / 10^decimals. Casper is the settlement layer, your feed_id is the key, and there is no indexer to run.

Claros runs on the Casper testnet (network casper-test). Off-chain reads through the REST API and the SDK are free and need no key, wallet, or indexer. Only on-chain cross-contract calls and the x402 metered endpoint involve gas or payment.

What problem it solves

Smart contracts cannot call an HTTP API, and most real-world data (energy prices, generation, emissions, municipal revenue) lives behind public web APIs that contracts and other agents cannot trust directly. Even when an app fetches that data off-chain, there is no shared, tamper-evident record of what value was true at a given time.

Claros closes that gap:

  • One canonical value on-chain. Each feed has exactly one latest attested value, written to a Casper contract by a known attester.
  • Provenance you can verify. Every attestation carries the reporting period, a source_hash of the upstream payload, the attester address, and a timestamp.
  • A self-describing schema. A feed publishes its own decimals, unit, source, route, and frequency, so consumers never hardcode scaling factors.
  • Many ways in. Read the same value from a frontend, a backend in any language, another Casper contract, or a paid pay-per-call endpoint.

The model: self-describing feeds, the Pyth way

A reading is split across two contracts, joined by the feed_id:

ContractHoldsKey fields
AttestationRegistrythe latest attested valueperiod, amount (integer), source_hash, attester, timestamp
FeedRegistryself-describing metadatadecimals, unit, title, source, route, frequency, description

The on-chain amount is always an unsigned integer (U512). To get the human number you divide by 10^decimals, exactly like Pyth’s price x 10^expo:

// EIA.PET.PRICE.WTI.DAILY (WTI crude oil spot price) amount = 78940000n // integer, from AttestationRegistry decimals = 6 // from FeedRegistry value = 78940000 / 10 ** 6 // 78.94 ($/bbl)

Always read decimals and unit from the feed metadata, never assume them. Different feeds use different scales (unit prices use 6, volumes and energy use 3, counts use 0), and a feed can be upgraded. See Decimals and scaling.

Pairing the value with its self-describing metadata is the heart of the design. See How it works for the full attestation pipeline and the two-registry layout, and Decimals and scaling for the exact integer math.

How a reading is made

Source

The agent pulls a fresh value from a trusted public source: the EIA APIv2 for energy series, or the City of San Diego open-data API for parking revenue.

Prove eligibility

Before it can publish, the agent clears the on-chain EligibilityGate with a Groth16 zero-knowledge proof, so only an authorized attester (without revealing its private identity) can write a value.

Attest on-chain

The value is normalized to an integer and written to AttestationRegistry under its feed_id, alongside the reporting period, a source_hash, the attester, and a timestamp. The matching metadata (decimals, unit, source) lives in FeedRegistry.

Read it

Your app or contract reads the feed by feed_id through any of the four methods below and computes amount / 10^decimals.

The agent runs as an hourly heartbeat that acts only on new data. Each cycle also anomaly-checks the reading and makes a treasury decision, recorded on-chain through the TreasuryVault, so Claros is an oracle and an autonomous on-chain participant at once. See How it works for the full agent cycle.

What data Claros has

Claros currently serves 38 feeds live on-chain: the EIA energy series, the civic San Diego parking feed (OP-1), and an operator-claimed solar feed (EIA.ELEC.GEN_SUN.US48.HOURLY, attested by an independent operator). Those feeds are mapped from a crawled catalog of 232 EIA datasets, and so far 78+ attestations have been written.

The energy feeds span every major EIA family: petroleum, natural gas, electricity, coal, nuclear, densified biomass, total and state energy (SEDS), CO2 emissions, short-term outlooks, and international energy. A few examples:

feed_idWhat it measuresUnitDecimals
EIA.PET.PRICE.WTI.DAILYWTI crude oil spot price$/bbl6
EIA.NG.PRICE.HENRYHUB.DAILYHenry Hub natural gas spot price$/MMBtu6
EIA.ELEC.DEMAND.US48.HOURLYU.S. Lower-48 electricity demandMWh3
EIA.CO2.AGG.US_TOTAL.ANNUALU.S. total CO2 emissionsMMT CO26

Recent values include WTI at $78.94/bbl and Henry Hub at $3.16/MMBtu. The flagship civic feed OP-1 (San Diego parking revenue) read $2,734.20 for the period 2026-06-23.

The EIA APIv2 is one uniform faceted API, and a feed_id pins down a single series within it: a route (for example petroleum/pri/spt), one frequency, a data column, and a set of facet filters (for example series, duoarea, stateid, or fueltype). That mapping is covered in the data model. Beyond the 36 live energy feeds, any dataset in the catalog can be registered and attested on demand.

Four ways to read it

The same on-chain value is reachable four ways. Pick by where your code runs and whether you want a free read or metered, paid access. See Choose a method for a side-by-side comparison.

MethodBest forCostReads from
REST APIAny language, apps, dashboards, agentsFreeOn-chain via the SDK
TypeScript SDKTypeScript apps and frontends, no indexerFreeCasper state directly
Cross-contractOther Casper contracts consuming a feedGas onlyThe registries on-chain
x402 meteredPay-per-call and agent-to-agent accessPaid (WCSPR)A gated HTTP endpoint

The off-chain methods return the same reading. Here is a single feed in each:

Plain HTTP, any language, no key. Run services/claros-api (port 4030) or point at a hosted instance:

curl http://localhost:4030/v1/feeds/EIA.PET.PRICE.WTI.DAILY # { # "feed_id": "EIA.PET.PRICE.WTI.DAILY", # "value": 78.94, "amount": "78940000", "decimals": 6, # "unit": "$/bbl", "title": "WTI crude spot", "source": "EIA", # "period": 20260623, "source_hash": "…", "updated_at": 1750636800000 # }

The service also exposes GET /v1/feeds for every feed and GET /v1/datasets?q=&family= for discovery.

The x402 metered endpoint wraps a feed behind the HTTP 402 payment protocol: a first request returns 402 Payment Required, the client signs a WCSPR payment and retries with an X-PAYMENT header, a facilitator settles it on Casper, and the response carries the reading plus its on-chain provenance. That metered path is how the Claros agent funds its own attestations.

Network and contracts

Everything is live on the Casper testnet (network casper-test), reachable at the public RPC https://node.testnet.casper.network/rpc and viewable on the explorer at https://testnet.cspr.live. The four Claros contracts are upgradable and keyed by package hash:

ContractRolePackage hash
AttestationRegistryLatest attested value per feed_id236b5104...f98116cc
FeedRegistrySelf-describing metadata per feed_id741cc223...0bddf5b6
TreasuryVaultAgent reinvestment ledgera90b082d...e887ffd7b
EligibilityGateZK Groth16 access gate7be33b05...e15aa5227

Casper testnet charges the gas limit you set, not the gas you consume, and there is no refund. Off-chain REST and SDK reads cost nothing. See Network and contracts for the full package hashes, the attester account, and gas guidance.

Where to go next

Last updated on