{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/bot-trade-org/json-schema/bot-trade-org-run-snapshot-schema.json",
  "title": "RunSnapshot",
  "x-generated": "2026-11-03",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/bot-trade-org-openapi.json#/components/schemas/RunSnapshot",
  "additionalProperties": false,
  "properties": {
    "$schema": {
      "description": "A URL to the JSON Schema for this object.",
      "format": "uri",
      "readOnly": true,
      "type": "string"
    },
    "last_equity": {
      "$ref": "#/$defs/RunEquity"
    },
    "positions": {
      "items": {
        "$ref": "#/$defs/RunPosition"
      },
      "type": [
        "array",
        "null"
      ]
    },
    "queued_orders": {
      "items": {
        "$ref": "#/$defs/RunOrder"
      },
      "type": [
        "array",
        "null"
      ]
    },
    "run": {
      "$ref": "#/$defs/Run"
    }
  },
  "required": [
    "run",
    "positions",
    "queued_orders"
  ],
  "type": "object",
  "$defs": {
    "AgentInfo": {
      "additionalProperties": false,
      "properties": {
        "config": {
          "additionalProperties": {},
          "type": "object"
        },
        "framework": {
          "type": "string"
        },
        "model": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "source_revision": {
          "type": "string"
        },
        "source_url": {
          "type": "string"
        },
        "version": {
          "type": "string"
        }
      },
      "required": [
        "name"
      ],
      "type": "object"
    },
    "Run": {
      "additionalProperties": false,
      "properties": {
        "agent_info": {
          "$ref": "#/$defs/AgentInfo"
        },
        "api_key_id": {
          "type": "string"
        },
        "bot_name": {
          "type": "string"
        },
        "cash": {
          "format": "double",
          "type": "number"
        },
        "completed_at": {
          "format": "date-time",
          "type": "string"
        },
        "created_at": {
          "format": "date-time",
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "last_activity_at": {
          "format": "date-time",
          "type": "string"
        },
        "published": {
          "type": "boolean"
        },
        "scenario_id": {
          "type": "string"
        },
        "scenario_version": {
          "format": "int64",
          "type": "integer"
        },
        "sim_time": {
          "format": "date-time",
          "type": "string"
        },
        "starting_cash": {
          "format": "double",
          "type": "number"
        },
        "status": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "scenario_id",
        "scenario_version",
        "status",
        "sim_time",
        "cash",
        "starting_cash",
        "last_activity_at",
        "created_at",
        "published"
      ],
      "type": "object"
    },
    "RunEquity": {
      "additionalProperties": false,
      "properties": {
        "cash": {
          "format": "double",
          "type": "number"
        },
        "equity": {
          "format": "double",
          "type": "number"
        },
        "positions_value": {
          "format": "double",
          "type": "number"
        },
        "run_id": {
          "type": "string"
        },
        "sim_time": {
          "format": "date-time",
          "type": "string"
        }
      },
      "required": [
        "run_id",
        "sim_time",
        "cash",
        "positions_value",
        "equity"
      ],
      "type": "object"
    },
    "RunOrder": {
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "string"
        },
        "quantity": {
          "format": "double",
          "type": "number"
        },
        "queued_at": {
          "format": "date-time",
          "type": "string"
        },
        "queued_at_sim_time": {
          "format": "date-time",
          "type": "string"
        },
        "reasoning": {
          "type": "string"
        },
        "run_id": {
          "type": "string"
        },
        "side": {
          "type": "string"
        },
        "symbol": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "run_id",
        "symbol",
        "side",
        "quantity",
        "queued_at",
        "queued_at_sim_time"
      ],
      "type": "object"
    },
    "RunPosition": {
      "additionalProperties": false,
      "properties": {
        "avg_cost": {
          "format": "double",
          "type": "number"
        },
        "quantity": {
          "format": "double",
          "type": "number"
        },
        "run_id": {
          "type": "string"
        },
        "symbol": {
          "type": "string"
        },
        "updated_at": {
          "format": "date-time",
          "type": "string"
        }
      },
      "required": [
        "run_id",
        "symbol",
        "quantity",
        "avg_cost",
        "updated_at"
      ],
      "type": "object"
    }
  }
}