{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/zerogex-io/json-schema/zerogex-io-strike-profile-bucket-schema.json",
  "title": "StrikeProfileBucket",
  "description": "One time bucket of the Strike-Profile-Timeseries.\n\n``timestamp`` is the bucket start (ET-session aligned via the same\nbucket expression every historical endpoint uses).  ``open`` /\n``high`` / ``low`` / ``close`` are the underlying OHLC for the\nbucket; ``close`` is the canonical \"spot\" used to compute the\nper-strike dollar-gamma values below.  ``gamma_flip`` is the\nanalytics-engine value from the bucket's representative\n``gex_summary`` row.  ``call_wall`` / ``put_wall`` are computed\nlive for the bucket from the same (expiration-filtered,\nsummed-by-strike) gamma rows the ``strikes`` payload renders, via\nthe canonical :func:`src.analytics.walls.compute_call_put_walls`\nhelper, evaluated against this bucket's ``close``.  Wall scope\ntherefore follows the request's ``expirations`` filter:\n``expirations=all`` yields the cross-expiration aggregate walls\n(same basis as the live ``/api/gex/summary``);\n``expirations=<YYYY-MM-DD>`` yields walls scoped to that\nexpiration's gamma alone.  ``call_wall`` / ``put_wall`` are\n``None`` when the bucket has no strikes or no underlying close.\n``pin_strike`` / ``pin_confidence`` are the Pin Strike (the reachable\n0DTE strike with the strongest modeled positive/restoring dealer gamma\ninto expiration — see :mod:`src.analytics.pin_strike`) and its 0..1\ndominance over the other viable pins, as of this bucket's close.  They\nare read verbatim from the bucket's representative ``gex_summary`` row\nand, unlike the walls and the flip, are NOT scoped by ``expirations``:\nthe pin is 0DTE-by-construction and whole-chain by definition, so it\nreads the same in every expiration scope — matching the live surfaces,\nwhere the pin does not move when the Expiry selector changes.  Both are\n``None`` when the bucket has no active pin and on rows written before\nthe pin columns shipped; a ``None`` pin is drawn as no line, never as\n``0``.\n\n``call_walls`` / ``put_walls`` are the ranked ladders (``C1``/``C2``/…,\n``P1``/``P2``/…) behind the optional secondary-wall levels, computed from\nthe same rows and the same ``close`` as the scalars, so they follow the\n``expirations`` filter identically and rank 1 equals the scalar.\n\n``strikes`` is the per-strike payload; one row per strike\navailable in this bucket's snapshot universe (after the optional\nexpiration filter).",
  "x-generated": "2026-11-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/zerogex-io-openapi.json#/components/schemas/StrikeProfileBucket",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "title": "Timestamp"
    },
    "symbol": {
      "type": "string",
      "title": "Symbol"
    },
    "open": {
      "anyOf": [
        {
          "type": "string",
          "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
        },
        {
          "type": "null"
        }
      ],
      "title": "Open"
    },
    "high": {
      "anyOf": [
        {
          "type": "string",
          "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
        },
        {
          "type": "null"
        }
      ],
      "title": "High"
    },
    "low": {
      "anyOf": [
        {
          "type": "string",
          "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
        },
        {
          "type": "null"
        }
      ],
      "title": "Low"
    },
    "close": {
      "anyOf": [
        {
          "type": "string",
          "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
        },
        {
          "type": "null"
        }
      ],
      "title": "Close"
    },
    "gamma_flip": {
      "anyOf": [
        {
          "type": "string",
          "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
        },
        {
          "type": "null"
        }
      ],
      "title": "Gamma Flip"
    },
    "call_wall": {
      "anyOf": [
        {
          "type": "string",
          "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
        },
        {
          "type": "null"
        }
      ],
      "title": "Call Wall"
    },
    "put_wall": {
      "anyOf": [
        {
          "type": "string",
          "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
        },
        {
          "type": "null"
        }
      ],
      "title": "Put Wall"
    },
    "call_walls": {
      "items": {
        "$ref": "#/$defs/WallLevel"
      },
      "type": "array",
      "title": "Call Walls"
    },
    "put_walls": {
      "items": {
        "$ref": "#/$defs/WallLevel"
      },
      "type": "array",
      "title": "Put Walls"
    },
    "pin_strike": {
      "anyOf": [
        {
          "type": "string",
          "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
        },
        {
          "type": "null"
        }
      ],
      "title": "Pin Strike"
    },
    "pin_confidence": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Pin Confidence"
    },
    "strikes": {
      "items": {
        "$ref": "#/$defs/StrikeProfileStrike"
      },
      "type": "array",
      "title": "Strikes"
    },
    "expired_excluded": {
      "items": {
        "type": "string",
        "format": "date"
      },
      "type": "array",
      "title": "Expired Excluded"
    }
  },
  "type": "object",
  "required": [
    "timestamp",
    "symbol",
    "strikes"
  ],
  "$defs": {
    "StrikeProfileStrike": {
      "properties": {
        "strike": {
          "type": "string",
          "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
          "title": "Strike"
        },
        "call_gamma": {
          "type": "string",
          "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
          "title": "Call Gamma"
        },
        "put_gamma": {
          "type": "string",
          "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
          "title": "Put Gamma"
        },
        "net_gamma": {
          "type": "string",
          "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
          "title": "Net Gamma"
        },
        "call_oi": {
          "type": "integer",
          "title": "Call Oi"
        },
        "put_oi": {
          "type": "integer",
          "title": "Put Oi"
        }
      },
      "type": "object",
      "required": [
        "strike",
        "call_gamma",
        "put_gamma",
        "net_gamma",
        "call_oi",
        "put_oi"
      ],
      "title": "StrikeProfileStrike",
      "description": "Per-strike row inside a Strike-Profile-Timeseries bucket.\n\n``call_gamma`` / ``put_gamma`` / ``net_gamma`` carry the same dollar\ngamma exposure quantities that ``/api/gex/by-strike`` returns under\n``call_gex`` / ``put_gex`` / ``net_gex`` (``γ × OI × 100 × S² × 0.01``,\n\"$ per 1% spot move\"), evaluated against this bucket's close price.\nNames follow the request shape — readers that already speak the\nby-strike units can map them straight through."
    },
    "WallLevel": {
      "properties": {
        "rank": {
          "type": "integer",
          "title": "Rank"
        },
        "label": {
          "type": "string",
          "title": "Label"
        },
        "strike": {
          "type": "string",
          "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
          "title": "Strike"
        },
        "strength": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
            },
            {
              "type": "null"
            }
          ],
          "title": "Strength"
        }
      },
      "type": "object",
      "required": [
        "rank",
        "label",
        "strike"
      ],
      "title": "WallLevel",
      "description": "One rung of the Call/Put Wall ladder (``C1``/``C2``/``P1``/``P2``…).\n\nProduced by :func:`src.analytics.walls.compute_wall_ladder`, which ranks\nthe eligible strikes on each side of spot by aggregated dollar gamma.\nRank 1 is by construction the canonical Call/Put Wall — the same value\nthe sibling ``call_wall`` / ``put_wall`` scalar carries — so a client can\ndraw the ladder without the primary wall ever disagreeing with it.\n\n``label`` ships from the server (``C1``, ``P2``, …) so every surface —\nchart page, dashboard widget, any future export — spells a wall the same\nway instead of each re-deriving the name.  ``strength`` is the dollar\ngamma at the strike on the canonical ``γ × 100 × S² × 0.01`` scale,\nletting a client dim or size a marker by how much book is actually there."
    }
  }
}