{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/aspern-org/json-schema/aspern-org-resolve-question-schema.json",
  "title": "ResolveQuestion",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/aspern-org-judgement-api-openapi.yml#/components/schemas/ResolveQuestion",
  "oneOf": [
    {
      "$ref": "#/$defs/ResolveThresholdQuestion"
    },
    {
      "$ref": "#/$defs/ResolveExposureQuestion"
    },
    {
      "$ref": "#/$defs/ResolvePlainQuestion"
    }
  ],
  "$defs": {
    "ResolveExposureQuestion": {
      "type": "object",
      "required": [
        "kind",
        "vault",
        "from",
        "to",
        "threshold",
        "instrument"
      ],
      "properties": {
        "kind": {
          "type": "string",
          "enum": [
            "instrument_exposure_below"
          ]
        },
        "vault": {
          "type": "string",
          "minLength": 1,
          "description": "The vault, as ASPERN slugs it."
        },
        "from": {
          "type": "integer",
          "format": "int64",
          "description": "Start of the window, inclusive, in milliseconds since the Unix epoch.",
          "x-unit": "timestamp"
        },
        "to": {
          "type": "integer",
          "format": "int64",
          "description": "End of the window, inclusive, in milliseconds since the Unix epoch.",
          "x-unit": "timestamp"
        },
        "threshold": {
          "type": "number",
          "x-unit": "decimal-fraction",
          "description": "The share of the gross book allowed, as a fraction."
        },
        "instrument": {
          "type": "string",
          "description": "The instrument the limit is about, e.g. BTC."
        }
      }
    },
    "ResolvePlainQuestion": {
      "type": "object",
      "required": [
        "kind",
        "vault",
        "from",
        "to"
      ],
      "properties": {
        "kind": {
          "type": "string",
          "enum": [
            "was_forced_out",
            "still_operating"
          ],
          "description": "Neither takes a threshold: one asks whether the venue forced the book out, the other whether the strategy was still trading."
        },
        "vault": {
          "type": "string",
          "minLength": 1,
          "description": "The vault, as ASPERN slugs it."
        },
        "from": {
          "type": "integer",
          "format": "int64",
          "description": "Start of the window, inclusive, in milliseconds since the Unix epoch.",
          "x-unit": "timestamp"
        },
        "to": {
          "type": "integer",
          "format": "int64",
          "description": "End of the window, inclusive, in milliseconds since the Unix epoch.",
          "x-unit": "timestamp"
        }
      }
    },
    "ResolveThresholdQuestion": {
      "type": "object",
      "required": [
        "kind",
        "vault",
        "from",
        "to",
        "threshold"
      ],
      "properties": {
        "kind": {
          "type": "string",
          "enum": [
            "max_drawdown_below",
            "return_above",
            "leverage_below"
          ]
        },
        "vault": {
          "type": "string",
          "minLength": 1,
          "description": "The vault, as ASPERN slugs it. /v1/vaults lists them and /v1/examples names working ones."
        },
        "from": {
          "type": "integer",
          "format": "int64",
          "description": "Start of the window, INCLUSIVE, in milliseconds since the Unix epoch. Not an ISO string.",
          "x-unit": "timestamp"
        },
        "to": {
          "type": "integer",
          "format": "int64",
          "description": "End of the window, inclusive, in milliseconds since the Unix epoch. Must be after `from`.",
          "x-unit": "timestamp"
        },
        "threshold": {
          "type": "number",
          "x-unit": "depends-on-kind",
          "description": "A fraction for a drawdown or a return — 0.1 is ten per cent — and a MULTIPLE for leverage, so the unit depends on `kind` and is annotated as such rather than being guessed at. Compared strictly: a drawdown of exactly the threshold is a breach, because \"below\" is not \"at\"."
        }
      }
    }
  }
}