{
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "$id": "https://signalshopper.com/signals/schema/profile.schema.json",
 "title": "Signal Shopper profile feed",
 "description": "One value at each level of a price axis for one symbol, with marked levels on that axis. Dealer gamma by price level, with the last price and the zero-GEX level, is the usual case. Levels must rise from one point to the next; a schema cannot express that, so Signal Shopper checks it when the feed loads.",
 "type": "object",
 "required": [
  "format",
  "symbol",
  "points"
 ],
 "properties": {
  "format": {
   "const": "signalshopper.profile/1"
  },
  "provider": {
   "type": "string"
  },
  "symbol": {
   "type": "string",
   "minLength": 1
  },
  "asOf": {
   "type": "string",
   "format": "date-time"
  },
  "refreshSeconds": {
   "type": "number",
   "minimum": 5,
   "description": "How often the feed changes, in seconds. The page reads it again after this long while it is on screen."
  },
  "levelLabel": {
   "type": "string",
   "minLength": 1,
   "description": "What the levels are, for example \"Price\"."
  },
  "valueName": {
   "type": "string",
   "minLength": 1
  },
  "valueFormat": {
   "enum": [
    "percent",
    "number"
   ]
  },
  "valueUnit": {
   "type": "string",
   "minLength": 1
  },
  "legend": {
   "type": "object",
   "required": [
    "positive",
    "negative"
   ],
   "properties": {
    "positive": {
     "type": "string",
     "minLength": 1
    },
    "negative": {
     "type": "string",
     "minLength": 1
    }
   },
   "description": "What a value above zero and a value below zero mean."
  },
  "markers": {
   "type": "array",
   "maxItems": 12,
   "description": "Levels to mark on the chart, the most important first.",
   "items": {
    "type": "object",
    "required": [
     "level",
     "label"
    ],
    "properties": {
     "level": {
      "type": "number"
     },
     "label": {
      "type": "string",
      "minLength": 1
     },
     "kind": {
      "const": "last",
      "description": "Marks the last price. The chart reads the value there and measures the other markers from it. At most one."
     }
    }
   }
  },
  "points": {
   "type": "array",
   "minItems": 2,
   "maxItems": 500,
   "items": {
    "type": "object",
    "required": [
     "level",
     "value"
    ],
    "properties": {
     "level": {
      "type": "number"
     },
     "value": {
      "type": "number"
     }
    }
   }
  }
 }
}
