{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/coinrithm-com/json-schema/coinrithm-com-futures-open-request-schema.json",
  "title": "FuturesOpenRequest",
  "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/FuturesOpenRequest",
  "type": "object",
  "required": [
    "coinId",
    "side",
    "leverage",
    "marginMusd",
    "idempotencyKey"
  ],
  "properties": {
    "coinId": {
      "type": "string"
    },
    "side": {
      "type": "string",
      "enum": [
        "long",
        "short"
      ]
    },
    "leverage": {
      "type": "number",
      "minimum": 1,
      "maximum": 20
    },
    "marginMusd": {
      "type": "number",
      "minimum": 10
    },
    "idempotencyKey": {
      "type": "string",
      "description": "Unique per intent. Reusing it replays the original result."
    },
    "stopLossPrice": {
      "type": [
        "number",
        "null"
      ],
      "description": "Optional open-time resting stop-loss. Side-aware: long requires\nliq < SL < entry mark; short requires entry mark < SL < liq\n(rejected as a dead trigger otherwise). Fired by the per-minute\nworker; the FULL position settles at mark with\nexitReason=stop_loss. Not accepted on an ADD — use /futures/sl-tp.\n"
    },
    "takeProfitPrice": {
      "type": [
        "number",
        "null"
      ],
      "description": "Optional open-time resting take-profit (long: above mark; short:\nbelow). Same worker semantics, exitReason=take_profit.\n"
    },
    "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
        }
      }
    }
  }
}