{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/coinrithm-com/json-schema/coinrithm-com-futures-close-request-schema.json",
  "title": "FuturesCloseRequest",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/coinrithm-com-futures-api-openapi.yml#/components/schemas/FuturesCloseRequest",
  "type": "object",
  "required": [
    "positionId",
    "idempotencyKey"
  ],
  "properties": {
    "positionId": {
      "type": "integer"
    },
    "fraction": {
      "type": "number",
      "exclusiveMinimum": 0,
      "maximum": 1,
      "description": "(0,1] portion to close. Omit or 1 = full close."
    },
    "idempotencyKey": {
      "type": "string"
    },
    "agentTrace": {
      "$ref": "#/$defs/AgentTraceMetadata"
    }
  },
  "$defs": {
    "AgentTraceMetadata": {
      "type": "object",
      "description": "Optional private trace metadata supplied by a user-run agent. CoinRithm\nstores only this structured summary; do not send chain-of-thought,\nsecrets, emails, or private account identity.\n",
      "properties": {
        "runId": {
          "type": [
            "string",
            "null"
          ]
        },
        "decisionId": {
          "type": [
            "string",
            "null"
          ]
        },
        "strategyLabel": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 120
        },
        "confidence": {
          "type": [
            "number",
            "null"
          ],
          "minimum": 0,
          "maximum": 1
        },
        "rationaleSummary": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 1200
        }
      }
    }
  }
}