{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/farmdash/json-schema/farmdash-execute-order-request-schema.json",
  "title": "ExecuteOrderRequest",
  "x-generated": "2026-11-09",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/farmdash-openapi.yml#/components/schemas/ExecuteOrderRequest",
  "type": "object",
  "required": [
    "agentAddress",
    "coin",
    "isBuy",
    "size",
    "price",
    "orderType",
    "nonce",
    "expiresAt",
    "intentHash",
    "signature"
  ],
  "properties": {
    "executionTrialId": {
      "type": "string",
      "description": "Inherited durable futures lifecycle. Accepted orders commit; ambiguous submission stays held pending direct venue reconciliation."
    },
    "accountAddress": {
      "type": "string",
      "pattern": "^0x[a-fA-F0-9]{40}$"
    },
    "executionMode": {
      "type": "string",
      "enum": [
        "USER_SIGNED",
        "BOUNDED_AUTONOMOUS"
      ],
      "default": "USER_SIGNED",
      "description": "USER_SIGNED is preserved for unenrolled signers. Owner registration permanently enrolls the API wallet on its network across accounts, including after expiry/revocation; stripping mode/session fields cannot bypass bounded policy. Bounded dispatch returns nonretryable bounded_futures_preparation_only while rollout is not operational."
    },
    "grantId": {
      "type": "string",
      "description": "Required for BOUNDED_AUTONOMOUS"
    },
    "sessionId": {
      "type": "string",
      "description": "Required for BOUNDED_AUTONOMOUS; binds session agent separately from API wallet"
    },
    "sessionToken": {
      "type": "string",
      "description": "Session capability; alternatively X-FarmDash-Session-Token header"
    },
    "agentAddress": {
      "type": "string",
      "pattern": "^0x[a-fA-F0-9]{40}$"
    },
    "coin": {
      "type": "string"
    },
    "isBuy": {
      "type": "boolean"
    },
    "size": {
      "type": "string"
    },
    "price": {
      "type": "string"
    },
    "orderType": {
      "type": "string",
      "enum": [
        "limit_gtc",
        "limit_ioc",
        "limit_alo",
        "market_ioc",
        "stop_loss",
        "take_profit"
      ],
      "description": "`market_ioc` is a signed, price-protected IOC limit order with a live 100 bps adverse-price cap, never an unbounded market order."
    },
    "reduceOnly": {
      "type": "boolean",
      "default": false
    },
    "leverage": {
      "oneOf": [
        {
          "type": "number"
        },
        {
          "type": "string"
        }
      ]
    },
    "signedAction": {
      "type": "object",
      "description": "If supplied, must contain the signed FarmDash builder term `{ b: treasury, f: 1 }`; f is tenths of a basis point."
    },
    "nonce": {
      "type": "integer"
    },
    "expiresAt": {
      "type": "integer"
    },
    "intentHash": {
      "type": "string"
    },
    "signature": {
      "$ref": "#/$defs/EIP712Signature"
    }
  },
  "$defs": {
    "EIP712Signature": {
      "type": "object",
      "required": [
        "r",
        "s",
        "v"
      ],
      "properties": {
        "r": {
          "type": "string"
        },
        "s": {
          "type": "string"
        },
        "v": {
          "type": "integer"
        }
      }
    }
  }
}