MeteraDOCS
Request access

Live todayLive

Traces

Every answer has a trace: which sources could answer, which one won and why, which checks ran, what the anchor said, and a proof anyone can check.

get_trace

Returns the full verification record behind an answer. Takes one parameter, traceId. You can only read traces from your own calls. Free: it reports a call already made and already charged.

Reading a trace

The real trace for the Quickstart's token.price call (tr_2acejo), shortened where marked:

json
{
  "trace_id": "tr_2acejo",
  "status": "delivered",
  "level": "anchored",
  "source": "kraken",
  "trace": {
    "candidates": [
      { "sourceId": "kraken",   "utility": 15.372625, "sampledTheta": 0.640542 },
      { "sourceId": "bitstamp", "utility": 11.622636, "sampledTheta": 0.484292 },
      { "sourceId": "okx",      "utility": 9.075706,  "sampledTheta": 0.37817 },
      { "sourceId": "coinbase", "utility": 8.994058,  "sampledTheta": 0.374768 },
      { "sourceId": "jupiter",  "utility": 7.994169,  "sampledTheta": 0.333106 }
    ],
    "chosen": "kraken",
    "reason": "best utility under policy",
    "attempts": [
      { "sourceId": "kraken", "result": "ok", "latencyMs": 23, "costCredits": 0.001 }
    ],
    "checks": ["status", "schema", "freshness", "sanity", "anchor", "semantic"],
    "checkPolicy": {
      "always": ["status", "schema", "freshness", "sanity"],
      "sampled": ["semantic"],
      "semanticRan": true
    },
    "anchor": {
      "via": "chainlink",
      "feed": "CH31Xns5z3M1cTAbKW34jcxPPciazARpijcHj9rxtemt",
      "value": 71.33,
      "tolerance": 0.02,
      "ageSeconds": 30,
      "maxRoundAgeSeconds": 270,
      "independentOfSource": false
    },
    "verification": {
      "level": "anchored",
      "reason": "chainlink feed agreed (on-chain read)",
      "anchorKind": "on-chain"
    }
  },
  "proof": { "...": "see Proof below" }
}

What each part tells you:

  • candidates: every source that could answer, scored. sampledTheta is the source's sampled reliability; utility weighs it against cost and latency. Sampling means a strong source does not win every time, so weaker sources keep being measured.
  • chosen and attempts: which source was called, in what order, and how each attempt ended. Here the first attempt succeeded in 23 ms.
  • checks: the four checks that always run (status, schema, freshness, sanity), plus anchor and the sampled semantic check.
  • checkPolicy: semantic is the L3 judge. It is sampled rather than run on every call: always while a source is new, always when a divergence is unresolved, otherwise at random. When it is absent, it was not owed; it was not skipped.
  • anchor: the reference the value was compared with. Here a Chainlink feed read on Solana said 71.33 against Kraken's 71.29, inside the 0.02 tolerance, with a round 30 s old (limit 270 s). independentOfSource: false is Metera telling you the anchor partly reads the same market.

Proof

Every trace carries a proof block that lets anyone check, without trusting Metera, what was delivered and when.

json
"proof": {
  "leaf": {
    "v": 1, "type": "token.price", "level": "anchored", "origin": "measured",
    "params": { "token": "SOL" }, "source": "kraken", "status": "delivered",
    "traceId": "tr_2acejo",
    "valueHash": "22438c5d5e8cd7f0e164d17ab9e6e12aed6747a3d414d0963bab78fd8e7efcda",
    "anchorKind": "on-chain", "deliveredAt": 1796262210673
  },
  "leafHash": "cfe8bae24494c298061101b90e8d7205c03e6f30fb420e96625a09d98cc74964",
  "merkleRoot": null,
  "merklePath": null,
  "signature": null,
  "network": "mainnet",
  "memoProgram": "MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr",
  "expectedFeePayer": "6eHysHSNUxY7fooJMRfVPMcZGk3ZiBMb6GfapKySzTYL",
  "status": "failed",
  "proves": "anchoring failed for this trace; see error. The record is unproven, not wrong."
}

To verify a proof:

  1. Canonicalise leaf (keys sorted at every depth, no whitespace) and SHA-256 it. It must equal leafHash.
  2. Walk merklePath from leafHash (leaves prefixed 0x00, nodes 0x01). It must reach merkleRoot.
  3. Fetch signature on the named network and confirm its memo contains merkleRoot.
  4. Confirm the transaction's fee payer equals expectedFeePayer.

Step 1 in TypeScript:

ts
import { createHash } from "node:crypto";

function canonical(x: unknown): string {
  if (Array.isArray(x)) return `[${x.map(canonical).join(",")}]`;
  if (x && typeof x === "object") {
    const keys = Object.keys(x as object).sort();
    return `{${keys.map(k => `${JSON.stringify(k)}:${canonical((x as any)[k])}`).join(",")}}`;
  }
  return JSON.stringify(x);
}

export function leafHash(leaf: object): string {
  return createHash("sha256").update(canonical(leaf)).digest("hex");
}

// leafHash(trace.proof.leaf) === trace.proof.leafHash

In this real example the on-chain write failed (the memo transaction's fee payer could not cover rent), so status is failed and there is no root or signature. Metera says so plainly: the record is unproven, not wrong.