Skip to main content
Three terms appear throughout these docs:
  • A source defines one value: what to read (an HTTP API, a contract call or a Solana account), how to decode it, how to compute the value, and how the value becomes 32 bytes. It is identified by its sourceId, the hash of its canonical form.
  • A feed is a source at one quorum (signaturesRequired) under one registry version. Rounds are keyed by feed: at most one round per feed every 100 ms.
  • A Solana Feed account holds the latest verified value that one submitter wrote for a source at one quorum.
There is no feed-creation step. A source exists as soon as you define it, and a Feed account is created the first time someone submits an attestation for it.

Source

A source is one JSON document with up to four typed inputs (http, evm, starknet, svm), a transform over exact decimals, assertions, a declared 32-byte output and an optional median tolerance policy. The SDK fills in the defaults, so the common case is one call:
The full format, every operator and the limits are on Source format. Reading chain state is covered in Chain data sources, and combining several inputs with rules in Policies.

Source ID

  • The canonical form is UTF-8 JSON with object keys sorted, no whitespace, and every number written as a string. It is a strict subset of RFC 8785 (JCS).
  • The same source gives the same sourceId for everyone, on every chain. It contains no owner, payer, quorum or chain.
  • Derive it with the SDK (source.idHex, or deriveSourceIdHex(doc)) or the MCP derive_source_id tool rather than hashing by hand: one differing byte gives a different source.
  • The gateway and the nodes recompute it from the source you send, and the SDK rejects a response that names a different sourceId.
Only the sourceId reaches the chain. Verifiers treat it as an opaque 32-byte value, so a consumer pins the sourceId it expects.

Feeds and rounds

A round is keyed by its feed, (sourceId, signaturesRequired, registryVersion), and by its timestamp, which the gateway takes from its own clock rounded down to a 100 ms tick:
  • A feed runs at most one round per tick, so at most 10 rounds per second. Requests for the same feed inside one tick share that round: the nodes run it once and every caller receives the same attestation. Each caller still spends its own quota unit or payment.
  • One consumer gets one round per tick per feed. A second request by the same consumer (or x402 payer) for the same source and quorum in the same tick is answered with HTTP 409; retry after one full tick, 100 ms plus a small jitter. The SDK and the MCP round tools do this for you.
  • There is no idempotency key. A retried request is a new round.
The same source at a different quorum is a different feed. Round timing has the details.

Exact and tolerance mode

By default a round is exact: every signing node must produce the identical 32 bytes. Design exact sources around settled data:
  • Prefer finalized values over live-drifting ones, and for chain reads a block old enough to be final.
  • Avoid per-request timestamps, request IDs and unstable ordering in the response.
  • Point the decoder at exactly the field you need, and use assert to refuse a response that does not look right.
  • Do not read a Solana account that changes every slot (an AMM pool, an order book) in exact mode. Nodes a slot apart would disagree and the round would fail.
For numeric values that move between fetches, use tolerance mode. The nodes share their results, drop stale and outlying ones, and sign the median:
  • aggregation is part of the sourceId, so a source’s tolerance settings cannot change without changing its identity.
  • The round needs signaturesRequired of at least 3, and the output must be int256.
  • The optional maxDeviationAbs adds an absolute band, for values near zero. See Aggregation.
Before paying for a round, preview the source: the gateway runs it twice, one second apart, and says whether the value was stable.

Values

The signed value is always 32 bytes, and the source’s output says what they mean:
  • Numeric sources declare their scale in output.decimals; value / 10^decimals is the number. int256 is two’s complement.
  • bool is 0x…01 or 0x…00, bytes32 is left-padded bytes, string32 is right-padded UTF-8.
  • For data that is not a number or is longer than 32 bytes (a signature, a document, several readings), use the keccak256 output. The signed value is then the hash, and the round’s response carries the bytes that were hashed (up to 1 KB) as valuePreimage. The gateway keeps no copy, so keep the response if you need the preimage. A submitter can pass a preimage of up to 256 bytes to submit_attestation, which checks it and marks the feed Hash; the preimage itself is not stored on chain.
  • The gateway also returns a human-readable rendering of the value (value in the response, result.value in the SDK). It is not signed. Use the signed 32 bytes, payload.value.
  • Decode a value only after verifying the attestation or validating the Feed account address.

Solana feed account

Each submitter maintains its own account for a source and quorum, so a reader decides whose feed it reads. The program re-verifies every write, so a submitter cannot change a value. It only chooses which attestations to submit and when. The account stores no decimals: the scale comes from the source. Reading a feed is free and needs no subscription. Verify on Solana shows how to read one from TypeScript or from your own program.