{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/agenticfinancegraph-com/json-schema/agenticfinancegraph-com-metric-schema.json",
  "title": "Metric",
  "x-generated": "2026-11-01",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/agenticfinancegraph-com-openapi.json#/components/schemas/Metric",
  "type": "object",
  "required": [
    "value",
    "unit",
    "producer",
    "kind"
  ],
  "properties": {
    "value": {
      "type": "number"
    },
    "unit": {
      "type": "string"
    },
    "producer": {
      "type": "string",
      "description": "self | DefiLlama | Keyrock | 8004scan | ..."
    },
    "kind": {
      "type": "string",
      "enum": [
        "live",
        "measured",
        "context",
        "cited"
      ],
      "description": "live: read from a public API or eth_call; measured: our own sweep, census or scan; context: market scale, never agent activity; cited: someone else research, dated, not reproduced"
    },
    "window": {
      "type": "string",
      "description": "Time window the value describes"
    },
    "as_of": {
      "type": "string",
      "format": "date-time"
    },
    "method": {
      "type": "string",
      "description": "How a live value was produced, e.g. eth_call totalAssets()"
    },
    "caveat": {
      "type": "string"
    },
    "stale": {
      "type": "boolean",
      "description": "true when the source did not answer at the last check; the value is the last one actually measured"
    },
    "definition_id": {
      "type": "string",
      "description": "Frozen definition of the figure; GET /def/{id}"
    },
    "third_party": {
      "type": "boolean"
    },
    "note": {
      "type": "string"
    },
    "replaces": {
      "type": "string"
    }
  }
}