{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/philidor-io/json-schema/philidor-io-asset-peg-history-response-schema.json",
  "title": "AssetPegHistoryResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/philidor-io-reference-api-openapi.yml#/components/schemas/AssetPegHistoryResponse",
  "type": "object",
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/AssetPegHistoryPoint"
      }
    },
    "meta": {
      "type": "object",
      "properties": {
        "symbol": {
          "type": "string",
          "description": "Trimmed request symbol, original case. Match is case-insensitive and exact: msUSD matches msUSD, not a title search, and USDC does not include USDC.e. Unknown symbols are 200 with an empty series."
        },
        "days": {
          "type": "integer"
        },
        "page": {
          "type": "integer"
        },
        "limit": {
          "type": "integer"
        },
        "hasMore": {
          "type": "boolean",
          "description": "True when another page exists. Increment page until this is false before treating a 90-day or 1-year series as complete. There is no total count."
        },
        "order": {
          "type": "string",
          "enum": [
            "observed_at_asc"
          ],
          "description": "Points are ordered by observed_at, then chain_id, then event_id. Concatenate pages in order."
        }
      },
      "required": [
        "symbol",
        "days",
        "page",
        "limit",
        "hasMore",
        "order"
      ]
    }
  },
  "required": [
    "data",
    "meta"
  ],
  "$defs": {
    "AssetPegHistoryPoint": {
      "type": "object",
      "properties": {
        "event_id": {
          "type": "integer",
          "description": "events.id of this peg-monitor observation. Not a grouped headline."
        },
        "chain_id": {
          "type": "integer",
          "description": "Chain of the observation. Split chart series on this field; prices differ per chain."
        },
        "chain_name": {
          "type": [
            "string",
            "null"
          ]
        },
        "asset_address": {
          "type": [
            "string",
            "null"
          ],
          "description": "Token address from entity_key, or data.asset_address when the key is blank."
        },
        "price_usd": {
          "type": "number",
          "exclusiveMinimum": 0,
          "description": "data.price_usd. Never parsed from the event title."
        },
        "peg_target_usd": {
          "type": [
            "number",
            "null"
          ],
          "description": "data.peg_target_usd when it is a finite number, otherwise null."
        },
        "drift_pct": {
          "type": [
            "number",
            "null"
          ],
          "description": "data.drift_pct (percent, not a fraction) when it is a finite number, otherwise null."
        },
        "severity": {
          "type": "string"
        },
        "observed_at": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d{1,6})?Z$",
          "description": "data.observed_at when it is a UTC ISO timestamp, otherwise events.occurred_at. Chart x-axis."
        }
      },
      "required": [
        "event_id",
        "chain_id",
        "chain_name",
        "asset_address",
        "price_usd",
        "peg_target_usd",
        "drift_pct",
        "severity",
        "observed_at"
      ]
    }
  }
}