{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/immix/json-schema/immix-executions-list-executions-response-schema.json",
  "title": "ListExecutionsResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/immix-executions-api-openapi.yml#/components/schemas/executions_ListExecutionsResponse",
  "type": "object",
  "properties": {
    "nextCursor": {
      "type": [
        "string",
        "null"
      ],
      "description": "Pass as `cursor` for the next page. Null on the last page."
    },
    "prevCursor": {
      "type": [
        "string",
        "null"
      ],
      "description": "Pass as `cursor` for the previous page. Null on the first page."
    },
    "total": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Exact count matching the filter. Null unless `include=total`."
    },
    "globalSequence": {
      "$ref": "#/$defs/GlobalSequenceValue"
    },
    "asOfSeqTsNs": {
      "type": [
        "string",
        "null"
      ],
      "pattern": "^[0-9]+$",
      "description": "The sequencer timestamp (epoch-ns) the data is complete through; also sent as X-Immix-As-Of-Seq-Ts. Null when unknown."
    },
    "items": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ExecutionRecorded"
      }
    },
    "unscaled": {
      "type": "boolean",
      "description": "Never present since 0.3.2: an execution states its own scales, so no item is ever served raw. Kept, deprecated, so a client generated from 0.3.1 still compiles.",
      "deprecated": true
    }
  },
  "required": [
    "nextCursor",
    "prevCursor",
    "total",
    "globalSequence",
    "asOfSeqTsNs",
    "items"
  ],
  "$defs": {
    "ExecutionRecorded": {
      "type": "object",
      "properties": {
        "executionId": {
          "type": "string",
          "pattern": "^-?[0-9]+$",
          "description": "int64 as a decimal JSON string"
        },
        "orderId": {
          "type": "string",
          "pattern": "^-?[0-9]+$",
          "description": "0 = unattributed (discovered); set otherwise. int64 as a decimal JSON string"
        },
        "orgId": {
          "type": "integer"
        },
        "accountId": {
          "type": "integer"
        },
        "credentialId": {
          "type": "integer"
        },
        "instrumentId": {
          "type": "string",
          "pattern": "^-?[0-9]+$",
          "description": "int64 as a decimal JSON string"
        },
        "bookId": {
          "type": [
            "string",
            "null"
          ],
          "pattern": "^-?[0-9]+$",
          "description": "Denormalized from the order at recording (0 = none / discovered); re-stamped by attribution. int64 as a decimal JSON string"
        },
        "side": {
          "$ref": "#/$defs/ExecutionRecordedSide",
          "description": "UNKNOWN is the unset sentinel: outputs only — as input, omit the field instead; explicit UNKNOWN refuses 400. The value set is append-only: a consumer READING this field treats an unknown name as UNKNOWN, never as an error; as input an unknown name refuses 400 — the parse is strict"
        },
        "kind": {
          "$ref": "#/$defs/ExecutionRecordedKind",
          "description": "UNKNOWN is the unset sentinel: outputs only — as input, omit the field instead; explicit UNKNOWN refuses 400. The value set is append-only: a consumer READING this field treats an unknown name as UNKNOWN, never as an error; as input an unknown name refuses 400 — the parse is strict"
        },
        "liquidity": {
          "$ref": "#/$defs/ExecutionRecordedLiquidity",
          "description": "UNKNOWN is the unset sentinel: outputs only — as input, omit the field instead; explicit UNKNOWN refuses 400. The value set is append-only: a consumer READING this field treats an unknown name as UNKNOWN, never as an error; as input an unknown name refuses 400 — the parse is strict"
        },
        "fillQty": {
          "type": "string",
          "pattern": "^-?[0-9]+(\\.[0-9]+)?$",
          "maxLength": 64,
          "description": "Always positive; kind gives the sign of its effect (BUST reverses). money (a Decimal on the wire: a scaled integer with its own scale), served as an exact decimal string at the value's own scale — every fractional digit that scale states, trailing zeros included; never raw"
        },
        "fillPx": {
          "type": "string",
          "pattern": "^-?[0-9]+(\\.[0-9]+)?$",
          "maxLength": 64,
          "description": "money (a Decimal on the wire: a scaled integer with its own scale), served as an exact decimal string at the value's own scale — every fractional digit that scale states, trailing zeros included; never raw"
        },
        "fee": {
          "type": [
            "string",
            "null"
          ],
          "pattern": "^-?[0-9]+(\\.[0-9]+)?$",
          "maxLength": 64,
          "description": "money (a Decimal on the wire: a scaled integer with its own scale), served as an exact decimal string at the value's own scale — every fractional digit that scale states, trailing zeros included; never raw; null when the 0 sentinel means unset"
        },
        "feeAssetId": {
          "type": [
            "integer",
            "null"
          ]
        },
        "fillTsNs": {
          "type": [
            "string",
            "null"
          ],
          "pattern": "^-?[0-9]+$",
          "description": "int64 as a decimal JSON string"
        },
        "venueTsNs": {
          "type": [
            "string",
            "null"
          ],
          "pattern": "^-?[0-9]+$",
          "description": "int64 as a decimal JSON string"
        },
        "venueTradeId": {
          "type": "string",
          "description": "The venue execution id — the dedup key's third component."
        },
        "externalRef": {
          "type": "string",
          "description": "The venue order id as carried by the fill event; the auto-attribution join key for discovered rows (both facts carry it)."
        }
      },
      "required": [
        "executionId",
        "orderId",
        "orgId",
        "accountId",
        "credentialId",
        "instrumentId",
        "side",
        "kind",
        "liquidity",
        "fillQty",
        "fillPx",
        "venueTradeId",
        "externalRef"
      ],
      "title": "ExecutionRecorded"
    },
    "ExecutionRecordedKind": {
      "type": "string",
      "enum": [
        "UNKNOWN",
        "FILL",
        "BUST",
        "CORRECTION"
      ],
      "description": "UNKNOWN is the unset sentinel: outputs only — as input, omit the field instead; explicit UNKNOWN refuses 400. The value set is append-only: a consumer READING this field treats an unknown name as UNKNOWN, never as an error; as input an unknown name refuses 400 — the parse is strict",
      "title": "ExecutionRecordedKind"
    },
    "ExecutionRecordedLiquidity": {
      "type": "string",
      "enum": [
        "UNKNOWN",
        "MAKER",
        "TAKER"
      ],
      "description": "UNKNOWN is the unset sentinel: outputs only — as input, omit the field instead; explicit UNKNOWN refuses 400. The value set is append-only: a consumer READING this field treats an unknown name as UNKNOWN, never as an error; as input an unknown name refuses 400 — the parse is strict",
      "title": "ExecutionRecordedLiquidity"
    },
    "ExecutionRecordedSide": {
      "type": "string",
      "enum": [
        "UNKNOWN",
        "BUY",
        "SELL"
      ],
      "description": "UNKNOWN is the unset sentinel: outputs only — as input, omit the field instead; explicit UNKNOWN refuses 400. The value set is append-only: a consumer READING this field treats an unknown name as UNKNOWN, never as an error; as input an unknown name refuses 400 — the parse is strict",
      "title": "ExecutionRecordedSide"
    },
    "GlobalSequenceValue": {
      "type": "string",
      "pattern": "^[0-9]+$",
      "description": "The position as a decimal string — the last change this member had applied, orders, balance readings and algo instances included.",
      "title": "GlobalSequenceValue"
    }
  }
}