{
  "openapi": "3.1.0",
  "info": {
    "title": "Edel PERPS External REST API",
    "version": "0.1.0"
  },
  "servers": [
    {
      "url": "/",
      "description": "Current API origin"
    }
  ],
  "paths": {
    "/health": {
      "get": {
        "operationId": "getServiceHealth",
        "summary": "Get service health",
        "description": "Returns the API service liveness state without making financial-state claims.",
        "tags": [
          "System"
        ],
        "security": [],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HealthPayload"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "503": {
            "description": "Service or requested capability unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          }
        }
      }
    },
    "/ready": {
      "get": {
        "operationId": "getServiceReadiness",
        "summary": "Get service readiness",
        "description": "Returns API readiness, the current Canton-offline policy and the command intake restrictions enforced by the environment.",
        "tags": [
          "System"
        ],
        "security": [],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServiceReadinessPayload"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "503": {
            "description": "Service is not ready",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServiceReadinessPayload"
                }
              }
            }
          }
        }
      }
    },
    "/openapi.json": {
      "get": {
        "operationId": "getOpenApiDocument",
        "summary": "Fetch the OpenAPI document",
        "description": "Returns the OpenAPI 3.1 document describing this API.",
        "tags": [
          "System"
        ],
        "security": [],
        "parameters": [],
        "responses": {
          "200": {
            "description": "The OpenAPI 3.1 document describing this API",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/v1/affiliate/availability": {
      "get": {
        "operationId": "getAffiliateAvailability",
        "summary": "Get public affiliate availability",
        "description": "Returns whether affiliate capabilities are currently enabled and the effective policy version. This public read exposes no account, affiliate, referral or administrative data. Responses are not cached, so clients can observe availability changes on subsequent requests.",
        "tags": [
          "Affiliates"
        ],
        "security": [],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalAffiliateAvailabilityResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "503": {
            "description": "Service or requested capability unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/orders": {
      "post": {
        "operationId": "placeOrder",
        "summary": "Place an order",
        "description": "Submits a new order to the matching engine. Requires an Idempotency-Key header; the response is accepted for asynchronous processing.",
        "tags": [
          "Orders"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExternalPlaceOrderRequest"
              },
              "example": {
                "accountId": "{{accountId}}",
                "marketId": "{{marketId}}",
                "clientOrderId": "example-order-1",
                "side": "buy",
                "orderType": "limit",
                "price": "65000",
                "quantity": "0.001",
                "postOnly": false
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted for processing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalOrderResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "409": {
            "description": "Request rejected by the existing venue contract",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "503": {
            "description": "Service or requested capability unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/orders/batch": {
      "post": {
        "operationId": "placeOrderBatch",
        "summary": "Place a LIMIT order batch",
        "description": "Submits 1 to 32 LIMIT orders as one bounded batch. Each entry is decided independently in request order; accepted entries remain committed when another entry is refused.",
        "tags": [
          "Orders"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExternalBatchLimitOrderRequest"
              },
              "example": {
                "orders": [
                  {
                    "accountId": "{{accountId}}",
                    "marketId": "{{marketId}}",
                    "clientOrderId": "example-order-1",
                    "side": "buy",
                    "orderType": "limit",
                    "price": "65000",
                    "quantity": "0.001",
                    "postOnly": false
                  },
                  {
                    "accountId": "{{accountId}}",
                    "marketId": "{{marketId}}",
                    "clientOrderId": "example-order-2",
                    "side": "sell",
                    "orderType": "limit",
                    "price": "66000",
                    "quantity": "0.001",
                    "postOnly": false
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted for processing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalBatchLimitOrderResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "409": {
            "description": "Request rejected by the existing venue contract",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "503": {
            "description": "Service or requested capability unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/orders/batch/cancel": {
      "post": {
        "operationId": "cancelOrderBatch",
        "summary": "Cancel an order batch",
        "description": "Cancels 1 to 24 named owned orders as one bounded batch. Each entry receives an indexed result in request order; accepted cancellations remain committed when another entry is not found or already terminal. An exact idempotent retry returns the original decisions without applying the cancellations again. Cancellation remains available in cancel-only, paused, reduce-only and closed market sessions; a global engine halt refuses the batch.",
        "tags": [
          "Orders"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExternalBatchCancelOrderRequest"
              },
              "example": {
                "orders": [
                  {
                    "accountId": "{{accountId}}",
                    "marketId": "{{marketId}}",
                    "orderId": "{{orderId}}"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted for processing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalBatchCancelOrderResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "409": {
            "description": "Request rejected by the existing venue contract",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "503": {
            "description": "Service or requested capability unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/orders/preview": {
      "post": {
        "operationId": "previewOrder",
        "summary": "Preview an order",
        "description": "Computes estimated entry price, slippage, margin, fees, and liquidation price without reserving or journaling state.",
        "tags": [
          "Orders"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExternalOrderPreviewRequest"
              },
              "example": {
                "accountId": "{{accountId}}",
                "marketId": "{{marketId}}",
                "side": "buy",
                "orderType": "limit",
                "quantityAtoms": "100000",
                "priceAtoms": "6500000"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalOrderPreviewResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "409": {
            "description": "Request rejected by the existing venue contract",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "503": {
            "description": "Service or requested capability unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/orders/{orderId}": {
      "get": {
        "operationId": "getOrder",
        "summary": "Get an order",
        "description": "Returns the current lifecycle state of a single order by id.",
        "tags": [
          "Orders"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "orderId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalOrderResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "404": {
            "description": "Order id is unknown for the authenticated account",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "503": {
            "description": "Service or requested capability unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/orders/{orderId}/cancel": {
      "post": {
        "operationId": "cancelOrder",
        "summary": "Cancel an order",
        "description": "Cancels the unfilled remainder of an owned resting order and returns status `canceled`. An exact replay with the same `Idempotency-Key` returns the original accepted response; a later cancellation with a new key returns `not_found`. Unknown, terminal, wrong-market, and other-account order ids all return `not_found`. Cancellation is allowed while a market is `cancel_only`, `paused`, or `reduce_only`, but a global engine halt refuses it. The venue charges no placement fee, so cancellation refunds and reverses nothing. A partially filled order keeps the maker or taker fees already charged for its fills.",
        "tags": [
          "Orders"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "orderId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PublicCancelOrderRequest"
              },
              "example": {
                "accountId": "{{accountId}}",
                "marketId": "{{marketId}}"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted for processing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalOrderResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "404": {
            "description": "Order is not open for the authenticated account and market",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "409": {
            "description": "Request rejected by the existing venue contract",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "503": {
            "description": "Service or requested capability unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/withdrawals": {
      "post": {
        "operationId": "createWithdrawal",
        "summary": "Request a withdrawal",
        "description": "Opens a withdrawal request against free margin. Requires an Idempotency-Key header; settlement is asynchronous.",
        "tags": [
          "Withdrawals"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExternalWithdrawalRequest"
              },
              "example": {
                "accountId": "{{accountId}}",
                "asset": "USD.E",
                "amount": "10",
                "destination": "{{partyId}}"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted for processing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalWithdrawalResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "503": {
            "description": "Service or requested capability unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/withdrawals/{withdrawalId}": {
      "get": {
        "operationId": "getWithdrawal",
        "summary": "Get a withdrawal",
        "description": "Returns the current lifecycle state of a single withdrawal by id.",
        "tags": [
          "Withdrawals"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "withdrawalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalWithdrawalResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "503": {
            "description": "Service or requested capability unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/withdrawals/{withdrawalId}/authorize": {
      "post": {
        "operationId": "authorizeWithdrawal",
        "summary": "Authorize a withdrawal",
        "description": "Consumes a withdrawal authorization (two-person rule co-sign). Requires an Idempotency-Key header.",
        "tags": [
          "Withdrawals"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "withdrawalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExternalWithdrawalAuthorizationConsumeRequest"
              },
              "example": {
                "accountId": "{{accountId}}",
                "authorizationId": "{{authorizationId}}",
                "nonce": "{{nonce}}"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted for processing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalWithdrawalResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "503": {
            "description": "Service or requested capability unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/withdrawals/{withdrawalId}/confirm": {
      "post": {
        "operationId": "confirmDfnsWithdrawal",
        "summary": "Confirm an owner-signed withdrawal step",
        "description": "Prepares or completes the exact DFNS-signed Canton command currently due for this withdrawal, including V3 transfer-instruction acceptance.",
        "tags": [
          "Withdrawals"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "withdrawalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DfnsWithdrawalConfirmRequest"
              },
              "example": {
                "action": "complete",
                "withdrawalId": "{{withdrawalId}}",
                "signingStep": "owner_withdrawal_consent",
                "challengeIdentifier": "{{challengeIdentifier}}",
                "firstFactor": {
                  "kind": "Fido2",
                  "credentialAssertion": {
                    "credId": "{{passkeyCredentialId}}",
                    "clientData": "{{passkeyClientData}}",
                    "signature": "{{passkeySignature}}",
                    "authenticatorData": "{{passkeyAuthenticatorData}}"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DfnsWithdrawalConfirmResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "503": {
            "description": "Service or requested capability unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/auth/capabilities": {
      "get": {
        "operationId": "getAuthCapabilities",
        "summary": "Get authentication capabilities",
        "description": "Reports the DFNS end-user authentication methods available in this environment. Social registration and login providers are listed independently according to each method\u2019s availability. Product identity, email OTP and credential recovery are separate capabilities.",
        "tags": [
          "Auth"
        ],
        "security": [],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalAuthCapabilitiesResponse"
                },
                "example": {
                  "version": "external-auth-capabilities/v1",
                  "passkeyLogin": "available",
                  "delegatedRegistration": "product_identity_required",
                  "emailOtp": "email_otp_provider_required",
                  "credentialRecovery": "credential_recovery_not_configured",
                  "socialRegistrationProviders": [
                    "google"
                  ],
                  "socialLoginProviders": [
                    "google"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "503": {
            "description": "Service or requested capability unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/auth/social/register": {
      "post": {
        "operationId": "initiateSocialAuthRegistration",
        "summary": "Start Google/OIDC registration",
        "description": "Exchanges a Google OIDC identity token for a DFNS registration challenge when Google registration is available in the environment. A stable Idempotency-Key identifies the browser registration attempt across token refreshes but does not prove identity. The API selects the DFNS organization and OIDC provider; the browser cannot override either. Complete the returned challenge with a Fido2 credential through register/complete.",
        "tags": [
          "Auth"
        ],
        "security": [],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExternalAuthSocialRequest"
              },
              "example": {
                "idToken": "{{googleIdToken}}"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalAuthRegisterInitResponse"
                },
                "example": {
                  "version": "external-auth-register-init/v1",
                  "user": {
                    "id": "dfns-user-id",
                    "displayName": "Example trader",
                    "name": "example-trader"
                  },
                  "temporaryAuthenticationToken": "<redacted>",
                  "challenge": "base64url-registration-challenge",
                  "pubKeyCredParams": [
                    {
                      "type": "public-key",
                      "alg": -7
                    }
                  ],
                  "excludeCredentials": [],
                  "attestation": "none"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                },
                "example": {
                  "version": "external-rest-error/v1",
                  "requestId": "request-id",
                  "code": "unauthorized",
                  "safeMessage": "A verified end-user session is required.",
                  "retryable": false,
                  "recoveryActions": [
                    "do_not_retry"
                  ],
                  "occurredAtEpochMs": 0
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "503": {
            "description": "Service or requested capability unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                },
                "example": {
                  "version": "external-rest-error/v1",
                  "requestId": "request-id",
                  "code": "service_degraded",
                  "safeMessage": "Authentication dependencies are temporarily unavailable.",
                  "retryable": true,
                  "recoveryActions": [
                    "observe_status",
                    "retry_after"
                  ],
                  "occurredAtEpochMs": 0
                }
              }
            }
          }
        }
      }
    },
    "/v1/auth/social/register/recover": {
      "post": {
        "operationId": "recoverSocialAuthRegistration",
        "summary": "Resolve a Google registration outcome",
        "description": "Reconciles a pending or unknown Google registration attempt without repeating DFNS registration or credential completion. The API verifies the fresh Google assertion, exchanges it through DFNS social login as completion evidence, and transitions only the durable flow owned by the same provider subject and stable Idempotency-Key.",
        "tags": [
          "Auth"
        ],
        "security": [],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExternalAuthSocialRequest"
              },
              "example": {
                "idToken": "{{googleIdToken}}"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalAuthLoginCompleteResponse"
                },
                "example": {
                  "version": "external-auth-login/v1",
                  "token": "<redacted>",
                  "walletState": "wallet_ready"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                },
                "example": {
                  "version": "external-rest-error/v1",
                  "requestId": "request-id",
                  "code": "unauthorized",
                  "safeMessage": "A verified end-user session is required.",
                  "retryable": false,
                  "recoveryActions": [
                    "do_not_retry"
                  ],
                  "occurredAtEpochMs": 0
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "503": {
            "description": "Service or requested capability unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                },
                "example": {
                  "version": "external-rest-error/v1",
                  "requestId": "request-id",
                  "code": "service_degraded",
                  "safeMessage": "Authentication dependencies are temporarily unavailable.",
                  "retryable": true,
                  "recoveryActions": [
                    "observe_status",
                    "retry_after"
                  ],
                  "occurredAtEpochMs": 0
                }
              }
            }
          }
        }
      }
    },
    "/v1/auth/register/complete": {
      "post": {
        "operationId": "completeAuthRegistration",
        "summary": "Complete DFNS end-user registration",
        "description": "Completes a tracked DFNS end-user registration using the signed WebAuthn credential and temporary registration token. The caller must prove the same Google identity used at initiation. The result must match the registered user and permitted organization, and the account association must be saved successfully. An optional referral code is accepted only while the affiliate capability is enabled and current; otherwise a request containing one returns 404 before the credential is created.",
        "tags": [
          "Auth"
        ],
        "security": [],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExternalAuthRegisterCompleteRequest"
              },
              "example": {
                "temporaryAuthenticationToken": "{{temporaryAuthenticationToken}}",
                "firstFactorCredential": {
                  "credentialKind": "Fido2",
                  "credentialInfo": {
                    "credId": "{{passkeyCredentialId}}",
                    "clientData": "{{passkeyClientData}}",
                    "attestationData": "{{passkeyAttestationData}}"
                  },
                  "credentialName": "Example passkey"
                },
                "socialIdentity": {
                  "provider": "google",
                  "idToken": "{{googleIdToken}}"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalAuthRegisterCompleteResponse"
                },
                "example": {
                  "version": "external-auth-register-complete/v1",
                  "walletState": "wallet_ready",
                  "credential": {
                    "uuid": "passkey-credential-id",
                    "kind": "Fido2",
                    "name": "Primary passkey"
                  },
                  "user": {
                    "id": "dfns-user-id",
                    "username": "example-trader"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                },
                "example": {
                  "version": "external-rest-error/v1",
                  "requestId": "request-id",
                  "code": "unauthorized",
                  "safeMessage": "A verified end-user session is required.",
                  "retryable": false,
                  "recoveryActions": [
                    "do_not_retry"
                  ],
                  "occurredAtEpochMs": 0
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "404": {
            "description": "Requests carrying referralCode are hidden while affiliate-public is disabled or unavailable",
            "headers": {
              "x-edel-runtime-policy-version": {
                "description": "Runtime policy version that decided affiliate-public availability",
                "required": true,
                "schema": {
                  "type": "string",
                  "minLength": 1
                }
              }
            }
          },
          "503": {
            "description": "Service or requested capability unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                },
                "example": {
                  "version": "external-rest-error/v1",
                  "requestId": "request-id",
                  "code": "service_degraded",
                  "safeMessage": "Authentication dependencies are temporarily unavailable.",
                  "retryable": true,
                  "recoveryActions": [
                    "observe_status",
                    "retry_after"
                  ],
                  "occurredAtEpochMs": 0
                }
              }
            }
          }
        }
      }
    },
    "/v1/auth/login/init": {
      "post": {
        "operationId": "initiateAuthLogin",
        "summary": "Start passkey login",
        "description": "Starts a DFNS login challenge for an already-registered DFNS username. The browser must sign this challenge with its registered passkey before any bearer can be returned.",
        "tags": [
          "Auth"
        ],
        "security": [],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExternalAuthLoginInitRequest"
              },
              "example": {
                "username": "example-trader"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalAuthLoginInitResponse"
                },
                "example": {
                  "version": "external-auth-login-init/v1",
                  "challenge": "base64url-login-challenge",
                  "challengeIdentifier": "login-challenge-id",
                  "allowCredentials": {
                    "webauthn": [
                      {
                        "type": "public-key",
                        "id": "passkey-credential-id"
                      }
                    ]
                  },
                  "userVerification": "required"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "503": {
            "description": "Service or requested capability unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                },
                "example": {
                  "version": "external-rest-error/v1",
                  "requestId": "request-id",
                  "code": "service_degraded",
                  "safeMessage": "Authentication dependencies are temporarily unavailable.",
                  "retryable": true,
                  "recoveryActions": [
                    "observe_status",
                    "retry_after"
                  ],
                  "occurredAtEpochMs": 0
                }
              }
            }
          }
        }
      }
    },
    "/v1/auth/login/complete": {
      "post": {
        "operationId": "completeAuthLogin",
        "summary": "Complete passkey login",
        "description": "Submits the signed WebAuthn challenge to DFNS and returns the DFNS end-user bearer only after DFNS accepts the assertion.",
        "tags": [
          "Auth"
        ],
        "security": [],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExternalAuthLoginCompleteRequest"
              },
              "example": {
                "challengeIdentifier": "{{challengeIdentifier}}",
                "firstFactor": {
                  "kind": "Fido2",
                  "credentialAssertion": {
                    "credId": "{{passkeyCredentialId}}",
                    "clientData": "{{passkeyClientData}}",
                    "signature": "{{passkeySignature}}",
                    "authenticatorData": "{{passkeyAuthenticatorData}}"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalAuthLoginCompleteResponse"
                },
                "example": {
                  "version": "external-auth-login/v1",
                  "token": "<redacted>",
                  "walletState": "wallet_ready"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                },
                "example": {
                  "version": "external-rest-error/v1",
                  "requestId": "request-id",
                  "code": "unauthorized",
                  "safeMessage": "A verified end-user session is required.",
                  "retryable": false,
                  "recoveryActions": [
                    "do_not_retry"
                  ],
                  "occurredAtEpochMs": 0
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "503": {
            "description": "Service or requested capability unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                },
                "example": {
                  "version": "external-rest-error/v1",
                  "requestId": "request-id",
                  "code": "service_degraded",
                  "safeMessage": "Authentication dependencies are temporarily unavailable.",
                  "retryable": true,
                  "recoveryActions": [
                    "observe_status",
                    "retry_after"
                  ],
                  "occurredAtEpochMs": 0
                }
              }
            }
          }
        }
      }
    },
    "/v1/auth/social/login": {
      "post": {
        "operationId": "completeSocialAuthLogin",
        "summary": "Log in with Google/OIDC",
        "description": "Exchanges a Google OIDC identity token with DFNS when Google login is enabled in the environment. Returns the standard DFNS end-user bearer after token verification and account association. The API selects the DFNS organization and OIDC provider.",
        "tags": [
          "Auth"
        ],
        "security": [],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExternalAuthSocialRequest"
              },
              "example": {
                "idToken": "{{googleIdToken}}"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalAuthLoginCompleteResponse"
                },
                "example": {
                  "version": "external-auth-login/v1",
                  "token": "<redacted>",
                  "walletState": "wallet_ready"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                },
                "example": {
                  "version": "external-rest-error/v1",
                  "requestId": "request-id",
                  "code": "unauthorized",
                  "safeMessage": "A verified end-user session is required.",
                  "retryable": false,
                  "recoveryActions": [
                    "do_not_retry"
                  ],
                  "occurredAtEpochMs": 0
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "503": {
            "description": "Service or requested capability unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                },
                "example": {
                  "version": "external-rest-error/v1",
                  "requestId": "request-id",
                  "code": "service_degraded",
                  "safeMessage": "Authentication dependencies are temporarily unavailable.",
                  "retryable": true,
                  "recoveryActions": [
                    "observe_status",
                    "retry_after"
                  ],
                  "occurredAtEpochMs": 0
                }
              }
            }
          }
        }
      }
    },
    "/v1/auth/mapping/recover": {
      "post": {
        "operationId": "recoverAuthMapping",
        "summary": "Recover a DFNS account mapping",
        "description": "Idempotently restores the account association from a valid DFNS end-user bearer when registration did not finish saving that association. An optional referral code preserves attribution only when this request creates the missing association and the affiliate capability is enabled and current; otherwise a request containing one returns 404. The token must belong to the permitted DFNS organization. Client-supplied user and account identifiers are not accepted.",
        "tags": [
          "Auth"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "referralCode",
            "in": "query",
            "required": false,
            "description": "Optional referral code from the registration whose account-mapping write failed.",
            "schema": {
              "type": "string",
              "pattern": "^[a-f0-9]{16}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalAuthMappingRecoveryResponse"
                },
                "example": {
                  "version": "external-auth-mapping-recovery/v1",
                  "accountId": "engine-account-id"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                },
                "example": {
                  "version": "external-rest-error/v1",
                  "requestId": "request-id",
                  "code": "unauthorized",
                  "safeMessage": "A verified end-user session is required.",
                  "retryable": false,
                  "recoveryActions": [
                    "do_not_retry"
                  ],
                  "occurredAtEpochMs": 0
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "404": {
            "description": "Requests carrying referralCode are hidden while affiliate-public is disabled or unavailable",
            "headers": {
              "x-edel-runtime-policy-version": {
                "description": "Runtime policy version that decided affiliate-public availability",
                "required": true,
                "schema": {
                  "type": "string",
                  "minLength": 1
                }
              }
            }
          },
          "503": {
            "description": "Service or requested capability unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                },
                "example": {
                  "version": "external-rest-error/v1",
                  "requestId": "request-id",
                  "code": "service_degraded",
                  "safeMessage": "Authentication dependencies are temporarily unavailable.",
                  "retryable": true,
                  "recoveryActions": [
                    "observe_status",
                    "retry_after"
                  ],
                  "occurredAtEpochMs": 0
                }
              }
            }
          }
        }
      }
    },
    "/v1/realtime/ticket": {
      "post": {
        "operationId": "mintRealtimeTicket",
        "summary": "Mint a realtime connection ticket",
        "description": "Mints a short-lived account-scoped connection ticket from a verified DFNS trader session for the separate realtime service. The response is never cacheable.",
        "tags": [
          "Realtime access"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [],
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RealtimeTicketResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "503": {
            "description": "Service or requested capability unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "rotateRealtimeTicket",
        "summary": "Rotate a realtime connection ticket",
        "description": "Rotates a ticket used by the separate realtime service by presenting it in the JSON request body. No bearer credential is accepted for this operation.",
        "tags": [
          "Realtime access"
        ],
        "security": [],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RealtimeTicketRequest"
              },
              "example": {
                "ticket": "exampleRealtimeTicket0000000000000000000000"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RealtimeTicketResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "503": {
            "description": "Service or requested capability unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "revokeRealtimeTicketFamily",
        "summary": "Revoke a realtime ticket family",
        "description": "Idempotently revokes the separate realtime service's ticket family by presenting its current or previous ticket in the JSON request body.",
        "tags": [
          "Realtime access"
        ],
        "security": [],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RealtimeTicketRequest"
              },
              "example": {
                "ticket": "exampleRealtimeTicket0000000000000000000000"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "No content"
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "503": {
            "description": "Dependency unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/markets": {
      "get": {
        "operationId": "listMarkets",
        "summary": "List markets",
        "description": "Returns tradable markets with order-ticket metadata: scales, bounds, initial margin, maximum leverage, fees, and settlement asset.",
        "tags": [
          "Markets"
        ],
        "security": [],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalMarketCatalogResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "503": {
            "description": "Service or requested capability unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/leaderboard": {
      "get": {
        "operationId": "getLeaderboard",
        "summary": "Get the projected realized-PnL leaderboard",
        "description": "Returns a keyset-paginated rank and score histogram from a fixed snapshot of off-chain position data. Display the watermark as Data as of <markEpochMs>; it identifies the ranking snapshot, not Canton settlement finality. An empty published board returns 200 with entries: []; a missing or stale snapshot returns 503 with code snapshot_unavailable. Only eligible participants with trading volume are ranked. Bot accounts can rank in Development and testnet, never in production. Each entry\u2019s participantKind is human or bot so clients can identify bot rows. Display handles are pseudonyms, not account identifiers.",
        "tags": [
          "Leaderboard"
        ],
        "security": [],
        "parameters": [
          {
            "name": "window",
            "in": "query",
            "required": false,
            "description": "UTC ranking window. Defaults to daily.",
            "schema": {
              "type": "string",
              "enum": [
                "daily",
                "weekly",
                "monthly",
                "all_time"
              ],
              "default": "daily"
            }
          },
          {
            "name": "metric",
            "in": "query",
            "required": false,
            "description": "Ranking metric. The supported value is projected_realized_pnl.",
            "schema": {
              "type": "string",
              "enum": [
                "projected_realized_pnl"
              ],
              "default": "projected_realized_pnl"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size, from 1 to 100.",
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque cursor pinning the board version and last rank.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalLeaderboardResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "503": {
            "description": "Service or requested capability unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/markets/{marketId}": {
      "get": {
        "operationId": "getMarketSnapshot",
        "summary": "Get a market snapshot",
        "description": "Returns the current market snapshot (mark/index, status, funding) for a market.",
        "tags": [
          "Markets"
        ],
        "security": [],
        "parameters": [
          {
            "name": "marketId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalMarketSnapshotResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "503": {
            "description": "Service or requested capability unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/markets/{marketId}/stats": {
      "get": {
        "operationId": "getMarketStats",
        "summary": "Get market stats",
        "description": "Returns 24h volume, open interest, funding timing, market-data prices, and 24h price stats for a market detail screen.",
        "tags": [
          "Markets"
        ],
        "security": [],
        "parameters": [
          {
            "name": "marketId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalMarketStatsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "503": {
            "description": "Service or requested capability unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/markets/{marketId}/book": {
      "get": {
        "operationId": "getMarketBook",
        "summary": "Get the order book",
        "description": "Returns the current order-book snapshot (aggregated levels) for a market.",
        "tags": [
          "Markets"
        ],
        "security": [],
        "parameters": [
          {
            "name": "marketId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalBookSnapshotResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "503": {
            "description": "Service or requested capability unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/markets/{marketId}/candles": {
      "get": {
        "operationId": "getMarketCandles",
        "summary": "Get market candles",
        "description": "Returns index or trade candles over the half open window [from, to). Align from and to to the requested timeframe boundaries. Mark candles are unavailable.",
        "tags": [
          "Markets"
        ],
        "security": [],
        "parameters": [
          {
            "name": "marketId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "series",
            "in": "query",
            "required": false,
            "description": "Candle source series. Defaults to index. series=mark is unavailable and returns: HTTP 400 operation_not_available, retryable=false.",
            "schema": {
              "type": "string",
              "enum": [
                "trade",
                "index",
                "mark"
              ],
              "default": "index"
            }
          },
          {
            "name": "tf",
            "in": "query",
            "required": false,
            "description": "Candle timeframe. Defaults to 1m.",
            "schema": {
              "type": "string",
              "enum": [
                "1m",
                "3m",
                "5m",
                "15m",
                "30m",
                "1h",
                "2h",
                "4h",
                "8h",
                "12h",
                "1d",
                "3d",
                "1w",
                "1M"
              ],
              "default": "1m"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "description": "Optional inclusive epoch-millisecond start of [from, to); align to the timeframe boundary.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "description": "Optional exclusive epoch-millisecond end of [from, to); align to the timeframe boundary.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalCandlesResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                },
                "example": {
                  "version": "external-rest-error/v1",
                  "requestId": "request-id",
                  "code": "operation_not_available",
                  "safeMessage": "mark candle series is not served yet",
                  "retryable": false,
                  "recoveryActions": [
                    "do_not_retry"
                  ],
                  "occurredAtEpochMs": 0
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "503": {
            "description": "Service or requested capability unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/market-data/candidate-markets": {
      "get": {
        "operationId": "listMarketDataCandidateMarkets",
        "summary": "List market-data candidate markets",
        "description": "Returns the markets the market-data aggregator can price, with per-market provenance.",
        "tags": [
          "Market Data"
        ],
        "security": [],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketDataCandidateMarketsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "503": {
            "description": "Service or requested capability unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/accounts/{accountId}": {
      "get": {
        "operationId": "getAccountSnapshot",
        "summary": "Get an account snapshot",
        "description": "Returns the account snapshot (balances, margin, equity) for an account.",
        "tags": [
          "Accounts"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalAccountSnapshotResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "503": {
            "description": "Service or requested capability unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/accounts/{accountId}/positions": {
      "get": {
        "operationId": "getAccountPositions",
        "summary": "Get account positions",
        "description": "Returns open positions enriched with live liquidation price, margin health, and mark-sequence provenance.",
        "tags": [
          "Accounts"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalPositionSnapshotResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "503": {
            "description": "Service or requested capability unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/accounts/{accountId}/positions/history": {
      "get": {
        "operationId": "getAccountPositionHistory",
        "summary": "Get account position history",
        "description": "Returns paginated position episodes for an account from the lagging projection, newest close first with open episodes leading, newest opened first inside one close sequence. An unknown account is refused with invalid_request. The cursor is a base64url JSON object containing closeSequence (null for an open episode), openedAtEpochMs and positionId. A cursor issued before close-sequence paging (openedAtEpochMs and positionId only) is refused once with invalid_request; restart from the first page.",
        "tags": [
          "Accounts"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "marketId",
            "in": "query",
            "required": false,
            "description": "Optional market filter.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Optional episode status filter.",
            "schema": {
              "type": "string",
              "enum": [
                "open",
                "closed",
                "liquidated"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size, from 1 to 100. Defaults to 50.",
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Base64url JSON cursor with closeSequence, openedAtEpochMs and positionId.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalPositionHistoryResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "503": {
            "description": "Service or requested capability unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/accounts/{accountId}/transfers": {
      "get": {
        "operationId": "getAccountTransferHistory",
        "summary": "Get account transfer history",
        "description": "Returns paginated deposits and withdrawals for an account from the lagging projection. The cursor is a base64url JSON object containing updatedAtEpochMs and transferId.",
        "tags": [
          "Accounts"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "description": "Optional transfer kind filter.",
            "schema": {
              "type": "string",
              "enum": [
                "deposit",
                "withdrawal"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size, from 1 to 100. Defaults to 50.",
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Base64url JSON cursor with updatedAtEpochMs and transferId.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalTransferHistoryResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "503": {
            "description": "Service or requested capability unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/accounts/{accountId}/affiliate/earnings": {
      "get": {
        "operationId": "getAccountAffiliateEarnings",
        "summary": "Get affiliate earnings for an account",
        "description": "Available only when the affiliate capability is enabled for this environment; otherwise returns 404. Successful and hidden responses include x-edel-runtime-policy-version. Returns the settled affiliate periods paid to this account, newest first. A null affiliateId means the account is not registered as an affiliate, which differs from a registered affiliate with no settled earnings. Amounts are atom strings; the response provides no asset scale or formatted decimal value.",
        "tags": [
          "Accounts"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size, from 1 to 100. Defaults to 50.",
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque cursor returned as nextCursor by the previous page.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalAffiliateEarningsResponse"
                }
              }
            },
            "headers": {
              "x-edel-runtime-policy-version": {
                "description": "Runtime policy version that decided affiliate-public availability",
                "required": true,
                "schema": {
                  "type": "string",
                  "minLength": 1
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "404": {
            "description": "Route hidden while affiliate-public is disabled or unavailable",
            "headers": {
              "x-edel-runtime-policy-version": {
                "description": "Runtime policy version that decided affiliate-public availability",
                "required": true,
                "schema": {
                  "type": "string",
                  "minLength": 1
                }
              }
            }
          },
          "503": {
            "description": "Service or requested capability unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/accounts/{accountId}/affiliate/registration": {
      "post": {
        "operationId": "registerAccountAffiliate",
        "summary": "Register an affiliate account",
        "description": "Available only when the affiliate capability is enabled for this environment; otherwise returns 404. Successful and hidden responses include x-edel-runtime-policy-version. Registers the authenticated account as an affiliate and returns its stable referral code. Repeating the request returns the same registration.",
        "tags": [
          "Accounts"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalAffiliateProfileResponse"
                }
              }
            },
            "headers": {
              "x-edel-runtime-policy-version": {
                "description": "Runtime policy version that decided affiliate-public availability",
                "required": true,
                "schema": {
                  "type": "string",
                  "minLength": 1
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "404": {
            "description": "Route hidden while affiliate-public is disabled or unavailable",
            "headers": {
              "x-edel-runtime-policy-version": {
                "description": "Runtime policy version that decided affiliate-public availability",
                "required": true,
                "schema": {
                  "type": "string",
                  "minLength": 1
                }
              }
            }
          },
          "503": {
            "description": "Service or requested capability unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/accounts/{accountId}/kyc": {
      "get": {
        "operationId": "getAccountKycStatus",
        "summary": "Get account KYC status",
        "description": "Returns the authenticated account's KYC policy state without identity documents or other PII. The provider is unavailable in this build.",
        "tags": [
          "Accounts"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalKycStatusResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "503": {
            "description": "Service or requested capability unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/accounts/{accountId}/kyc/skip": {
      "post": {
        "operationId": "skipAccountKyc",
        "summary": "Skip optional account KYC",
        "description": "Records an idempotent skipped state only when KYC is optional in the environment. A skipped state does not mean that the account is verified.",
        "tags": [
          "Accounts"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalKycStatusResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "503": {
            "description": "Service or requested capability unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/accounts/{accountId}/affiliate/profile": {
      "get": {
        "operationId": "getAccountAffiliateProfile",
        "summary": "Get an affiliate profile",
        "description": "Available only when the affiliate capability is enabled for this environment; otherwise returns 404. Successful and hidden responses include x-edel-runtime-policy-version. Returns the authenticated account\u2019s affiliate registration and referral code, or an explicit unregistered state.",
        "tags": [
          "Accounts"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalAffiliateProfileResponse"
                }
              }
            },
            "headers": {
              "x-edel-runtime-policy-version": {
                "description": "Runtime policy version that decided affiliate-public availability",
                "required": true,
                "schema": {
                  "type": "string",
                  "minLength": 1
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "404": {
            "description": "Route hidden while affiliate-public is disabled or unavailable",
            "headers": {
              "x-edel-runtime-policy-version": {
                "description": "Runtime policy version that decided affiliate-public availability",
                "required": true,
                "schema": {
                  "type": "string",
                  "minLength": 1
                }
              }
            }
          },
          "503": {
            "description": "Service or requested capability unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/accounts/{accountId}/fills": {
      "get": {
        "operationId": "getAccountFillHistory",
        "summary": "Get account fill history",
        "description": "Returns paginated account fill history. Per-payment funding history is not available. Position episodes provide cumulative fundingPaidAtoms; this value is not a separate funding-payment ledger.",
        "tags": [
          "Accounts"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "marketId",
            "in": "query",
            "required": false,
            "description": "Optional market filter.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size, from 1 to 100. Defaults to 50.",
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Base64url JSON cursor with lastSequence and id.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalAccountFillHistoryResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "503": {
            "description": "Service or requested capability unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/accounts/{accountId}/orders": {
      "get": {
        "operationId": "getAccountOrderHistory",
        "summary": "Get account order history",
        "description": "Returns paginated historical order records, which can lag current execution. Use the live open-orders operation to determine which orders are currently working.",
        "tags": [
          "Accounts"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "marketId",
            "in": "query",
            "required": false,
            "description": "Optional market filter.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Optional order status filter.",
            "schema": {
              "type": "string",
              "enum": [
                "open",
                "partially_filled",
                "filled",
                "canceled",
                "replaced"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size, from 1 to 100. Defaults to 50.",
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Base64url JSON cursor with lastSequence and id.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalAccountOrderHistoryResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "503": {
            "description": "Service or requested capability unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/accounts/{accountId}/orders/open": {
      "get": {
        "operationId": "getAccountOpenOrders",
        "summary": "Get live open orders",
        "description": "Returns the authenticated account\u2019s currently working orders. Historical order records can lag execution and do not establish the current outcome. This response is bounded: truncated and openOrderCount report any shortfall, and resync is meaningful only when truncated is false. Amounts use exact atoms, and each order includes its market\u2019s scales because scales may differ across markets.",
        "tags": [
          "Accounts"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "marketId",
            "in": "query",
            "required": false,
            "description": "Optional market filter.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size, from 1 to 500. Defaults to 500.",
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 500,
              "default": 500
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalOpenOrdersResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "503": {
            "description": "Service or requested capability unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/markets": {
      "get": {
        "operationId": "ccxtV2FetchMarkets",
        "summary": "Fetch CCXT markets",
        "description": "Returns the market catalogue in the CCXT unified market format. fetchFundingRates uses this list plus one statistics request per requested symbol.",
        "tags": [
          "CCXT v2"
        ],
        "security": [],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2MarketsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Request rejected by the existing venue contract",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Service or requested capability unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/markets/{symbol}/stats": {
      "get": {
        "operationId": "ccxtV2FetchTickerAndFundingRate",
        "summary": "Fetch a CCXT ticker and funding rate",
        "description": "Returns market statistics in a compatible superset of CCXT unified Ticker and FundingRate fields.",
        "tags": [
          "CCXT v2"
        ],
        "security": [],
        "parameters": [
          {
            "name": "symbol",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2MarketStatsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Request rejected by the existing venue contract",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Service or requested capability unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/markets/{symbol}/candles": {
      "get": {
        "operationId": "ccxtV2FetchOhlcv",
        "summary": "Fetch CCXT OHLCV",
        "description": "Returns candle history using the CCXT timeframe, since and limit parameters, with an optional series selection.",
        "tags": [
          "CCXT v2"
        ],
        "security": [],
        "parameters": [
          {
            "name": "symbol",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "timeframe",
            "in": "query",
            "required": false,
            "description": "CCXT unified timeframe. Defaults to 1m.",
            "schema": {
              "type": "string",
              "enum": [
                "1m",
                "3m",
                "5m",
                "15m",
                "30m",
                "1h",
                "2h",
                "4h",
                "8h",
                "12h",
                "1d",
                "3d",
                "1w",
                "1M"
              ],
              "default": "1m"
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "description": "Optional inclusive Unix timestamp in integer milliseconds.",
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of candles, from 1 to 100. Defaults to 100.",
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 100,
              "default": 100
            }
          },
          {
            "name": "series",
            "in": "query",
            "required": false,
            "description": "Exchange-specific source series. Defaults to index. series=mark is unavailable and returns: HTTP 400 operation_not_available (CCXT NotSupported), retryable=false.",
            "schema": {
              "type": "string",
              "enum": [
                "trade",
                "index",
                "mark"
              ],
              "default": "index"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2OhlcvResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Request rejected by the existing venue contract",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Service or requested capability unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/markets/{symbol}/book": {
      "get": {
        "operationId": "ccxtV2FetchOrderBook",
        "summary": "Fetch a CCXT order book",
        "description": "Returns the order-book snapshot as CCXT price and amount tuples, bounded by limit.",
        "tags": [
          "CCXT v2"
        ],
        "security": [],
        "parameters": [
          {
            "name": "symbol",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum levels per side, from 1 to 500. Defaults to 100.",
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 500,
              "default": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2OrderBookResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Request rejected by the existing venue contract",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Service or requested capability unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/accounts/{accountId}": {
      "get": {
        "operationId": "ccxtV2FetchBalance",
        "summary": "Fetch a CCXT balance",
        "description": "Returns the free and total balance components from the account snapshot. used is not available and is omitted.",
        "tags": [
          "CCXT v2"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2BalanceResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Request rejected by the existing venue contract",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Service or requested capability unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/accounts/{accountId}/positions": {
      "get": {
        "operationId": "ccxtV2FetchPositions",
        "summary": "Fetch CCXT positions",
        "description": "Returns live position snapshots in the CCXT unified position format, optionally filtered by comma-separated CCXT symbols.",
        "tags": [
          "CCXT v2"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "symbols",
            "in": "query",
            "required": false,
            "description": "Optional comma-separated CCXT perpetual symbols.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2PositionsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Request rejected by the existing venue contract",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Service or requested capability unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/orders": {
      "post": {
        "operationId": "ccxtV2CreateOrders",
        "summary": "Create CCXT LIMIT orders",
        "description": "Submits 1 to 32 CCXT OrderRequest entries as LIMIT orders. Returns one result per entry in request order; accepted entries remain committed when another entry is refused. timeInForce is unsupported: if any entry supplies it, the request returns HTTP 501 NotSupported and no entry is placed.",
        "tags": [
          "CCXT v2"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CcxtV2CreateOrdersRequest"
              },
              "example": [
                {
                  "symbol": "BTC/USD:USD.E",
                  "type": "limit",
                  "side": "buy",
                  "amount": 0.001,
                  "price": 65000,
                  "params": {
                    "clientOrderId": "ccxt-example-1",
                    "postOnly": false
                  }
                },
                {
                  "symbol": "BTC/USD:USD.E",
                  "type": "limit",
                  "side": "sell",
                  "amount": 0.001,
                  "price": 66000,
                  "params": {
                    "clientOrderId": "ccxt-example-2",
                    "postOnly": false
                  }
                }
              ]
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted for processing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2CreateOrdersResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Request rejected by the existing venue contract",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "501": {
            "description": "Recognized request option is not supported",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Service or requested capability unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/order": {
      "post": {
        "operationId": "ccxtV2CreateOrder",
        "summary": "Create one CCXT order",
        "description": "Submits one CCXT unified LIMIT or MARKET order. The response combines known request fields with the accepted-order result; missing fill data is not synthesized. timeInForce is unsupported and returns HTTP 501 NotSupported.",
        "tags": [
          "CCXT v2"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CcxtV2CreateOrderRequest"
              },
              "example": {
                "symbol": "BTC/USD:USD.E",
                "type": "limit",
                "side": "buy",
                "amount": 0.001,
                "price": 65000,
                "params": {
                  "clientOrderId": "ccxt-example-1",
                  "postOnly": false
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted for processing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2Order"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Request rejected by the existing venue contract",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "501": {
            "description": "Recognized request option is not supported",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Service or requested capability unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/orders/{orderId}/cancel": {
      "post": {
        "operationId": "ccxtV2CancelOrder",
        "summary": "Cancel one CCXT order",
        "description": "Cancels an owned order through the CCXT cancelOrder interface. symbol is required to identify the exact market. Unknown, other-account, wrong-market, filled and terminal orders all return OrderNotFound.",
        "tags": [
          "CCXT v2"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "orderId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CcxtV2CancelOrderRequest"
              },
              "example": {
                "symbol": "BTC/USD:USD.E"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted for processing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2Order"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Request rejected by the existing venue contract",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Service or requested capability unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/orders/cancel": {
      "post": {
        "operationId": "ccxtV2CancelOrders",
        "summary": "Cancel CCXT orders",
        "description": "Cancels 1 to 24 named orders through the CCXT cancelOrders interface. Requires one explicit symbol, preserves request order and returns one indexed result per order ID. A rejected entry does not roll back accepted cancellations.",
        "tags": [
          "CCXT v2"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CcxtV2CancelOrdersRequest"
              },
              "example": {
                "ids": [
                  "{{orderId}}"
                ],
                "symbol": "BTC/USD:USD.E"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted for processing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2CancelOrdersResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Request rejected by the existing venue contract",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Service or requested capability unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/orders/{orderId}": {
      "get": {
        "operationId": "ccxtV2FetchOrder",
        "summary": "Fetch a CCXT order",
        "description": "Returns one order in the CCXT unified order format. Optional fields remain absent when the order response does not provide them.",
        "tags": [
          "CCXT v2"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "orderId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "symbol",
            "in": "query",
            "required": false,
            "description": "Optional CCXT symbol checked against the returned order.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2Order"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Request rejected by the existing venue contract",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Service or requested capability unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/accounts/{accountId}/orders": {
      "get": {
        "operationId": "ccxtV2FetchOrders",
        "summary": "Fetch CCXT orders",
        "description": "Returns cursor-paginated order history using CCXT symbol, status, since and limit filters. status=closed includes filled, canceled and replaced terminal rows.",
        "tags": [
          "CCXT v2"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "symbol",
            "in": "query",
            "required": false,
            "description": "Optional CCXT perpetual symbol.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "description": "Optional inclusive Unix timestamp in integer milliseconds.",
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum orders, from 1 to 100. Defaults to 50.",
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Optional CCXT unified status. closed includes every terminal Edel status.",
            "schema": {
              "type": "string",
              "enum": [
                "open",
                "closed",
                "canceled"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2OrdersResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Request rejected by the existing venue contract",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Service or requested capability unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/accounts/{accountId}/orders/open": {
      "get": {
        "operationId": "ccxtV2FetchOpenOrders",
        "summary": "Fetch CCXT open orders",
        "description": "Returns currently working orders in the CCXT unified order format. Refuses an incomplete result rather than presenting a truncated open-order list as complete.",
        "tags": [
          "CCXT v2"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "symbol",
            "in": "query",
            "required": false,
            "description": "Optional CCXT perpetual symbol.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "description": "Optional inclusive Unix timestamp in integer milliseconds.",
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum open orders, from 1 to 100. Defaults to 50.",
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 100,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2OrdersResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Request rejected by the existing venue contract",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Service or requested capability unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/accounts/{accountId}/fills": {
      "get": {
        "operationId": "ccxtV2FetchMyTrades",
        "summary": "Fetch CCXT private trades",
        "description": "Returns cursor-paginated account fill history using CCXT symbol, since and limit filters.",
        "tags": [
          "CCXT v2"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "symbol",
            "in": "query",
            "required": false,
            "description": "Optional CCXT perpetual symbol.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "description": "Optional inclusive Unix timestamp in integer milliseconds.",
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum trades, from 1 to 100. Defaults to 50.",
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 100,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2TradesResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Request rejected by the existing venue contract",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Service or requested capability unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/not-implemented/fetch-trades": {
      "get": {
        "operationId": "ccxtV2NotImplementedFetchTrades",
        "summary": "NOT IMPLEMENTED: CCXT fetchTrades",
        "description": "NOT IMPLEMENTED. Edel has no public perpetual trade tape for the CCXT unified fetchTrades method. Edel is a perpetuals venue and does not offer a spot product. Returns 501 NotSupported without executing a trading action.",
        "tags": [
          "CCXT v2"
        ],
        "security": [],
        "parameters": [],
        "responses": {
          "501": {
            "description": "NOT IMPLEMENTED. This route always returns the closed CCXT not-implemented response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2NotImplementedResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/not-implemented/cancel-all-orders": {
      "post": {
        "operationId": "ccxtV2NotImplementedCancelAllOrders",
        "summary": "NOT IMPLEMENTED: CCXT cancelAllOrders",
        "description": "NOT IMPLEMENTED. The CCXT cancelAllOrders operation is unavailable; this route does not cancel any orders.",
        "tags": [
          "CCXT v2"
        ],
        "security": [],
        "parameters": [],
        "responses": {
          "501": {
            "description": "NOT IMPLEMENTED. This route always returns the closed CCXT not-implemented response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2NotImplementedResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/not-implemented/edit-order": {
      "put": {
        "operationId": "ccxtV2NotImplementedEditOrder",
        "summary": "NOT IMPLEMENTED: CCXT editOrder",
        "description": "NOT IMPLEMENTED. Edel does not expose a CCXT unified editOrder or replace operation. Edel is a perpetuals venue and does not offer a spot product. Returns 501 NotSupported without executing a trading action.",
        "tags": [
          "CCXT v2"
        ],
        "security": [],
        "parameters": [],
        "responses": {
          "501": {
            "description": "NOT IMPLEMENTED. This route always returns the closed CCXT not-implemented response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2NotImplementedResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/not-implemented/fetch-funding-rate-history": {
      "get": {
        "operationId": "ccxtV2NotImplementedFetchFundingRateHistory",
        "summary": "NOT IMPLEMENTED: CCXT fetchFundingRateHistory",
        "description": "NOT IMPLEMENTED. Edel does not publish a historical perpetual funding-rate series. Edel is a perpetuals venue and does not offer a spot product. Returns 501 NotSupported without executing a trading action.",
        "tags": [
          "CCXT v2"
        ],
        "security": [],
        "parameters": [],
        "responses": {
          "501": {
            "description": "NOT IMPLEMENTED. This route always returns the closed CCXT not-implemented response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2NotImplementedResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/not-implemented/fetch-funding-history": {
      "get": {
        "operationId": "ccxtV2NotImplementedFetchFundingHistory",
        "summary": "NOT IMPLEMENTED: CCXT fetchFundingHistory",
        "description": "NOT IMPLEMENTED. Edel does not publish a per-payment perpetual funding ledger through /v2. Edel is a perpetuals venue and does not offer a spot product. Returns 501 NotSupported without executing a trading action.",
        "tags": [
          "CCXT v2"
        ],
        "security": [],
        "parameters": [],
        "responses": {
          "501": {
            "description": "NOT IMPLEMENTED. This route always returns the closed CCXT not-implemented response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2NotImplementedResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/not-implemented/set-leverage": {
      "put": {
        "operationId": "ccxtV2NotImplementedSetLeverage",
        "summary": "NOT IMPLEMENTED: CCXT setLeverage",
        "description": "NOT IMPLEMENTED. Edel accepts leverage on an individual perpetual order and has no CCXT unified setLeverage setting. Edel is a perpetuals venue and does not offer a spot product. Returns 501 NotSupported without executing a trading action.",
        "tags": [
          "CCXT v2"
        ],
        "security": [],
        "parameters": [],
        "responses": {
          "501": {
            "description": "NOT IMPLEMENTED. This route always returns the closed CCXT not-implemented response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2NotImplementedResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/not-implemented/set-margin-mode": {
      "put": {
        "operationId": "ccxtV2NotImplementedSetMarginMode",
        "summary": "NOT IMPLEMENTED: CCXT setMarginMode",
        "description": "NOT IMPLEMENTED. Edel publishes cross margin and has no CCXT unified setMarginMode setting. Edel is a perpetuals venue and does not offer a spot product. Returns 501 NotSupported without executing a trading action.",
        "tags": [
          "CCXT v2"
        ],
        "security": [],
        "parameters": [],
        "responses": {
          "501": {
            "description": "NOT IMPLEMENTED. This route always returns the closed CCXT not-implemented response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CcxtV2NotImplementedResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/accounts/{accountId}/party/consent": {
      "post": {
        "operationId": "ensureAccountReceiverConsent",
        "summary": "Set up receiver-only USD.E consent",
        "description": "Performs nonfinancial Party setup with one explicit owner signature. Package absence is nonfatal. Pending retries recover the same operation; revoked consent is never silently recreated.",
        "tags": [
          "Accounts"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PartySetupRequest"
              },
              "example": {
                "approval": {
                  "challengeIdentifier": "{{challengeIdentifier}}",
                  "firstFactor": {
                    "kind": "Fido2",
                    "credentialAssertion": {
                      "credId": "{{passkeyCredentialId}}",
                      "clientData": "{{passkeyClientData}}",
                      "signature": "{{passkeySignature}}",
                      "authenticatorData": "{{passkeyAuthenticatorData}}"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartySetupResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "503": {
            "description": "Service or requested capability unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/accounts/{accountId}/party": {
      "post": {
        "operationId": "initAccountPartyOnboarding",
        "summary": "Initiate DFNS-backed Canton Party onboarding",
        "description": "Starts secure account setup using the authenticated user\u2019s delegated non-custodial DFNS Ed25519 signing key. The returned approval set depends on the environment: one approval challenge in Local, or three passkey challenges in Development. An already-active account returns its existing Party without new challenges.",
        "tags": [
          "Accounts"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DfnsPartyOnboardingInitResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "503": {
            "description": "Service or requested capability unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "getAccountPartyOnboarding",
        "summary": "Get DFNS-backed Canton Party onboarding status",
        "description": "Returns only the authenticated account's safe Party activation state. DFNS signing-key metadata, topology transactions, hashes, signatures, and bearer material are never exposed.",
        "tags": [
          "Accounts"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DfnsPartyOnboardingStatusResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "503": {
            "description": "Service or requested capability unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/accounts/{accountId}/party/complete": {
      "post": {
        "operationId": "completeAccountPartyOnboarding",
        "summary": "Complete DFNS-backed Canton Party onboarding",
        "description": "Completes secure account setup after all required approvals are supplied: one approval in Local or three passkey approvals in Development. The account is bound to the Party only after its active status is confirmed. Submit the exact approval set returned for this account and environment.",
        "tags": [
          "Accounts"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DfnsPartyOnboardingCompleteRequest"
              },
              "example": {
                "approvals": [
                  {
                    "ordinal": 1,
                    "challengeIdentifier": "{{challengeIdentifier}}",
                    "firstFactor": {
                      "kind": "Fido2",
                      "credentialAssertion": {
                        "credId": "{{passkeyCredentialId}}",
                        "clientData": "{{passkeyClientData}}",
                        "signature": "{{passkeySignature}}",
                        "authenticatorData": "{{passkeyAuthenticatorData}}"
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DfnsPartyOnboardingCompleteResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "503": {
            "description": "Service or requested capability unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/accounts/{accountId}/local-signing-wallet": {
      "post": {
        "operationId": "createLocalSigningWallet",
        "summary": "Create a local signing wallet",
        "description": "Available only in Local for testing. This capability is unavailable in Development, where account setup uses the authenticated user\u2019s delegated DFNS Ed25519 signing key.",
        "tags": [
          "Accounts"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LocalSigningWalletResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "503": {
            "description": "Service or requested capability unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/accounts/{accountId}/faucet-grant": {
      "post": {
        "operationId": "requestAccountFaucetGrant",
        "summary": "Request the account's test funds",
        "description": "Provides the authenticated account with a one-time funding intent for simulated USD.E collateral. The server sets the amount; callers cannot specify it. Repeated requests return the same funding intent with replayed set to true. Available only in Local and Development; the route is absent in other environments.",
        "tags": [
          "Accounts"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FaucetGrantResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "503": {
            "description": "Service or requested capability unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/accounts/{accountId}/local-signing-funding-intents": {
      "get": {
        "operationId": "listLocalSigningFundingIntents",
        "summary": "List owner funding intents",
        "description": "Returns the authenticated account owner\u2019s saved faucet funding intents and deposit state after reload. In Local and Development, eligibility requires an active Canton Party associated with the same environment and delegated DFNS signing key.",
        "tags": [
          "Accounts"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LocalSigningDepositDiscoveryResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "503": {
            "description": "Service or requested capability unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/accounts/{accountId}/deposits": {
      "post": {
        "operationId": "prepareLocalSigningDeposit",
        "summary": "Prepare a deposit",
        "description": "Atomically binds the authenticated owner's deposit to one deterministic deposit. Send `fundingIntentId` to deposit an exact durable faucet intent: the treasury transfer offer is then prepared on Canton, and its asset and amount cannot be changed by the caller. Where the venue's collateral is USDCx, send `amount` instead: the exact decimal amount deposited from the USDCx the account's Party already holds, with an `Idempotency-Key` header, so a retried request returns the same deposit. The amount is kept to every digit within USDCx's 10 decimals and never rounded. A non-zero digit past the 10th decimal answers 409 `command_rejected` with message `invalid_amount` and `rejectionGuard` `deposit_amount_scale_exceeded`; zero answers `deposit_amount_invalid`; text that is not a plain decimal of at most 64 characters answers 400 `invalid_request`; an amount where the collateral is USD.E answers `deposit_amount_rail_unsupported`; a missing key answers 400 `idempotency_key_required`. The deposit is answered `bound`; confirm then asks for the one owner signature.",
        "tags": [
          "Accounts"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LocalSigningDepositPrepareRequest"
              },
              "example": {
                "fundingIntentId": "{{fundingIntentId}}"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LocalSigningDepositResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "503": {
            "description": "Service or requested capability unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/accounts/{accountId}/deposits/confirm": {
      "post": {
        "operationId": "confirmLocalSigningDeposit",
        "summary": "Authorize a DFNS-signed Canton deposit",
        "description": "Drives the next owner-authorized Canton command. When an owner approval is due, initiate returns a DFNS WebAuthn challenge with status `approval_required`, and complete consumes that exact assertion and executes the immutable prepared transaction. When no owner approval is due, initiate returns the deposit itself: `submitted` or `submitted_unknown` while a Canton step is still being confirmed, and `ledger_confirmed` once the final ledger receipt exists. After a `submitted` or `submitted_unknown` answer, initiate again until the next approval or `ledger_confirmed`; a deposit needs up to three owner approvals. Prepared transactions, hashes, signatures, and bearer material remain server-only.",
        "tags": [
          "Accounts"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DfnsDepositConfirmRequest"
              },
              "example": {
                "action": "complete",
                "depositId": "{{depositId}}",
                "signingStep": "owner_offer_acceptance",
                "challengeIdentifier": "{{challengeIdentifier}}",
                "firstFactor": {
                  "kind": "Fido2",
                  "credentialAssertion": {
                    "credId": "{{passkeyCredentialId}}",
                    "clientData": "{{passkeyClientData}}",
                    "signature": "{{passkeySignature}}",
                    "authenticatorData": "{{passkeyAuthenticatorData}}"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DfnsDepositConfirmResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "503": {
            "description": "Service or requested capability unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/accounts/{accountId}/favorites/{marketId}": {
      "put": {
        "operationId": "putAccountMarketFavorite",
        "summary": "Favorite a market",
        "description": "Adds a market to the account's favorite market list. Repeating the request is a no-op.",
        "tags": [
          "Accounts"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "marketId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalMarketFavoriteResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "503": {
            "description": "Service or requested capability unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteAccountMarketFavorite",
        "summary": "Unfavorite a market",
        "description": "Removes a market from the account's favorite market list. Repeating the request is a no-op.",
        "tags": [
          "Accounts"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "marketId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalMarketFavoriteResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "503": {
            "description": "Service or requested capability unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/agent-connect/start": {
      "post": {
        "operationId": "startAgentConnect",
        "summary": "Start connecting an agent",
        "description": "Starts the agent connect device grant (RFC 8628 shape). Show `verificationUrl` and `userCode` to the account owner, who approves in the browser with a passkey session. Then call `completeAgentConnect` every `intervalSeconds` until it returns the API key. The grant expires after `expiresInSeconds`. Rate limited per source address; the response is never cacheable.",
        "tags": [
          "Agent access"
        ],
        "security": [],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AgentConnectStartRequest"
              },
              "example": {
                "clientName": "Example trading agent",
                "scopes": [
                  "read",
                  "trade"
                ],
                "lifetimeSeconds": 86400
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentConnectStartResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "503": {
            "description": "Service or requested capability unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/agent-connect/complete": {
      "post": {
        "operationId": "completeAgentConnect",
        "summary": "Collect the API key of an approved agent",
        "description": "Called by the agent with its connect code every `intervalSeconds`. Answers `authorization_pending` until the owner approves, `slow_down` when called faster than the interval, `expired` for an unknown, expired or already collected code, and `approved` with the API key exactly once. A one-time handshake that ends within ten minutes, not a live data feed. Rate limited per source address; the response is never cacheable.",
        "tags": [
          "Agent access"
        ],
        "security": [],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AgentConnectCompleteRequest"
              },
              "example": {
                "connectCode": "exampleAgentConnectCode00000000000000000000"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentConnectCompleteResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "503": {
            "description": "Service or requested capability unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/accounts/{accountId}/agent-connect/approve": {
      "post": {
        "operationId": "approveAgentConnect",
        "summary": "Approve an agent for the account",
        "description": "Approves a pending agent connect grant for the authenticated account. Requires the owner's passkey session; an API key is refused with `passkey_required`. `scopes` must equal the scopes the agent requested, so an approval never grants more than the approval page showed.",
        "tags": [
          "Agent access"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AgentConnectApproveRequest"
              },
              "example": {
                "userCode": "BCDF-GHJK",
                "scopes": [
                  "read",
                  "trade"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentConnectApproveResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "409": {
            "description": "Request rejected by the existing venue contract",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "503": {
            "description": "Service or requested capability unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/api-keys/current": {
      "get": {
        "operationId": "getCurrentApiKey",
        "summary": "Read the authenticated API key metadata",
        "description": "Returns only the current key's account, prefix, scopes, expiry and principal kind. Never returns the secret. Passkey sessions and missing or refused keys cannot read this route.",
        "tags": [
          "Auth"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeySummary"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                },
                "example": {
                  "version": "external-rest-error/v1",
                  "requestId": "request-id",
                  "code": "unauthorized",
                  "safeMessage": "A verified end-user session is required.",
                  "retryable": false,
                  "recoveryActions": [
                    "do_not_retry"
                  ],
                  "occurredAtEpochMs": 0
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "503": {
            "description": "Service or requested capability unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/accounts/{accountId}/api-keys": {
      "get": {
        "operationId": "listApiKeys",
        "summary": "List the account's API keys",
        "description": "Lists the newest API keys issued for the account with their state, scopes, expiry and display prefix. Never returns a key. Requires the owner's passkey session.",
        "tags": [
          "Agent access"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeyListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "503": {
            "description": "Service or requested capability unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/accounts/{accountId}/api-keys/{keyId}": {
      "delete": {
        "operationId": "revokeApiKey",
        "summary": "Revoke an API key",
        "description": "Revokes one of the account's API keys immediately. Repeating the request keeps the first revocation time. Requires the owner's passkey session.",
        "tags": [
          "Agent access"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "keyId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeyRevokeResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          },
          "503": {
            "description": "Service or requested capability unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExternalRestError"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "The authorization field takes the session bearer returned by sign-in, or an API key where the route allows keys. Paste the token itself into the authorization field."
      }
    },
    "schemas": {
      "ExternalRestError": {
        "type": "object",
        "properties": {
          "version": {
            "type": "string",
            "const": "external-rest-error/v1"
          },
          "requestId": {
            "type": "string",
            "minLength": 1
          },
          "code": {
            "type": "string",
            "enum": [
              "invalid_request",
              "unauthorized",
              "forbidden",
              "not_found",
              "idempotency_key_required",
              "rate_limited",
              "operation_not_available",
              "kyc_required",
              "command_rejected",
              "snapshot_unavailable",
              "service_degraded",
              "order_intake_stopped",
              "account_intake_stopped",
              "withdrawal_intake_stopped",
              "deposit_intake_stopped",
              "canton_offline",
              "dependency_unavailable",
              "account_legacy_excluded",
              "bot_fence_stale",
              "api_key_already_rotated",
              "malformed_command",
              "malformed_order_command",
              "unsupported_order_command",
              "duplicate_order_command",
              "idempotency_key_conflict",
              "unknown_market",
              "unknown_order",
              "invalid_account",
              "invalid_side",
              "invalid_order_id",
              "invalid_order_type",
              "market_order_unavailable",
              "invalid_price",
              "invalid_quantity",
              "invalid_leverage",
              "invalid_slippage",
              "market_halted",
              "duplicate_order_id",
              "market_not_open",
              "market_session_closed",
              "market_pre_close_cutoff",
              "reduce_only_required",
              "reduce_only_position_unavailable",
              "self_trade_prevented",
              "post_only_would_cross",
              "max_matches_exceeded",
              "risk_reserve_unavailable",
              "invalid_status_transition",
              "sequencer_rejected",
              "unknown_margin_account",
              "invalid_order_size",
              "withdrawals_blocked",
              "liquidation_candidate",
              "bad_debt",
              "insufficient_margin",
              "leverage_exceeds_market_max",
              "reserve_id_conflict",
              "unknown_reserve",
              "mark_unavailable",
              "insufficient_liquidity",
              "invalid_preview_request",
              "order_rejected_unmapped"
            ]
          },
          "safeMessage": {
            "type": "string",
            "minLength": 1
          },
          "retryable": {
            "type": "boolean"
          },
          "recoveryActions": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "none",
                "retry_after",
                "observe_status",
                "refresh_snapshot",
                "resubscribe_stream",
                "wait_for_projector",
                "wait_for_operator_recovery",
                "contact_support",
                "request_approval",
                "rerun_dry_run",
                "do_not_retry"
              ]
            },
            "minItems": 1
          },
          "realtimeTicketFailure": {
            "type": "string",
            "enum": [
              "invalid",
              "replayed",
              "replaced",
              "expired",
              "revoked",
              "store_unavailable"
            ]
          },
          "apiKeyRejection": {
            "type": "string",
            "enum": [
              "malformed",
              "unknown",
              "expired",
              "revoked",
              "principal_unavailable",
              "store_unavailable",
              "scope_insufficient",
              "passkey_required",
              "environment_forbidden",
              "principal_mismatch",
              "bot_fence_invalid",
              "bot_fence_stale",
              "already_rotated"
            ]
          },
          "rejectionGuard": {
            "type": "string",
            "enum": [
              "amount_atoms_invalid",
              "command_act_as_invalid",
              "command_field_required",
              "command_value_missing",
              "completion_synchronizer_mismatch",
              "deposit_field_required",
              "deposit_integer_invalid",
              "deposit_timestamp_invalid",
              "hashing_scheme_unspecified",
              "ledger_node_id_invalid",
              "ledger_offset_invalid",
              "rejection_completion_status",
              "signature_failure_reason_invalid",
              "signature_field_hex",
              "signature_field_required",
              "submission_id_mismatch",
              "successful_completion_evidence",
              "consumed_replay_evidence",
              "delegated_signing_key_binding",
              "deposit_asset_unsupported",
              "deposit_amount_invalid",
              "deposit_amount_rail_unsupported",
              "deposit_amount_scale_exceeded",
              "deposit_missing",
              "deposit_owner_binding",
              "deposit_scope",
              "dfns_confirmation_environment",
              "funding_intent",
              "funding_intent_advance",
              "funding_intent_already_bound",
              "funding_intent_cancelled",
              "funding_intent_consumed_without_deposit",
              "funding_intent_missing",
              "intent_asset_unsupported",
              "intent_owner_binding",
              "local_confirmation_environment",
              "owner_intent_scope",
              "owner_kind_unsupported",
              "planned_command_identities",
              "request_owner_binding",
              "local_authority_party_missing",
              "local_confirmation_deposit_status",
              "local_operator_replay_mismatch",
              "local_recovery_step_mismatch",
              "local_signer_failed",
              "local_signing_key_mismatch",
              "local_wallet_binding",
              "operator_step_expected",
              "owner_step_expected",
              "owner_submission_command_binding",
              "planned_command_missing",
              "planned_command_not_unique",
              "post_offer_step_expected",
              "reconciliation_signature_scope",
              "signature_completion_action",
              "signature_hex_missing",
              "signing_step_ahead_of_deposit",
              "treasury_execution_restore",
              "treasury_offer_contract_missing",
              "unknown_command_candidates",
              "completion_read_refused",
              "completion_correlation",
              "completion_not_unique",
              "completion_transaction_correlation",
              "interactive_act_as_missing",
              "interactive_transaction_correlation",
              "reconcile_binding_mismatch",
              "rejected_completion_has_update",
              "standard_submission_correlation",
              "standard_submission_response_invalid",
              "successful_completion_update_missing",
              "unrecoverable_command_evidence",
              "executed_evidence_correlation",
              "executed_evidence_replay",
              "executed_evidence_rows",
              "executed_evidence_signature_status",
              "execute_permit_rows",
              "execute_permit_signature_status",
              "ledger_rejection_correlation",
              "ledger_rejection_replay",
              "ledger_rejection_rows",
              "ledger_rejection_signature_status",
              "preparation_lock_busy",
              "reconciliation_signature_state",
              "signature_identity_binding",
              "signature_identity_missing",
              "signature_permitted_command",
              "signature_preparable_state",
              "signature_preparation_replay",
              "signature_record_identity",
              "signature_record_missing",
              "signature_record_shape",
              "signature_replay",
              "signature_row_count",
              "signature_scope_environment",
              "signature_scope_fingerprint",
              "signature_session_consistency",
              "canton_command_identity",
              "command_completion_evidence",
              "command_confirm_rows",
              "command_confirm_state",
              "command_evidence_replay",
              "command_permit_rows",
              "command_permit_state",
              "command_predecessors_unconfirmed",
              "command_release_evidence",
              "command_release_replay",
              "command_release_rows",
              "command_release_state",
              "signature_restart_state",
              "existing_receipt_replay",
              "existing_receipt_rows",
              "existing_receipt_state",
              "local_replay_command_state",
              "local_replay_fence_rows",
              "local_replay_fence_state",
              "local_replay_step",
              "persisted_permit_mismatch",
              "treasury_offer_command_identity",
              "treasury_offer_confirm_rows",
              "treasury_offer_confirm_state",
              "treasury_offer_evidence_replay",
              "treasury_offer_permit_rows",
              "treasury_offer_permit_state",
              "treasury_offer_reject_rows",
              "treasury_offer_reject_state",
              "treasury_offer_rejection_replay",
              "treasury_offer_submission_id",
              "treasury_input_amount_mismatch",
              "treasury_input_release_rows",
              "treasury_input_release_state",
              "treasury_input_reservation_mismatch",
              "treasury_input_reservation_rows",
              "treasury_input_reservation_state"
            ]
          },
          "withdrawalFailure": {
            "type": "string",
            "enum": [
              "requested",
              "margin_reserved",
              "authorized",
              "submitted",
              "settled",
              "rejected",
              "expired",
              "failed",
              "invalid_transition",
              "authorization_setup_failed",
              "margin_blocked",
              "co_sign_incomplete",
              "co_sign_self_approval",
              "ttl_expired",
              "canton_submission_failed",
              "withdrawal_payout_dfns_signature_failed",
              "withdrawal_payout_canton_submit_refused",
              "withdrawal_payout_ledger_time_expired",
              "asset_unsupported",
              "withdrawal_amount_invalid",
              "withdrawal_amount_scale_exceeded",
              "withdrawal_authorization_binding_mismatch",
              "withdrawal_capability_unavailable",
              "withdrawal_checkpoint_unavailable",
              "withdrawal_destination_not_owned",
              "withdrawal_not_found",
              "withdrawal_operators_missing",
              "withdrawal_operators_not_distinct",
              "withdrawal_owner_party_invalid",
              "withdrawal_owner_unavailable",
              "withdrawal_request_invalid",
              "withdrawal_request_ended",
              "withdrawal_reservation_release_failed",
              "withdrawal_unavailable",
              "withdrawal_submission_unavailable",
              "withdrawal_enqueue_failed",
              "withdrawal_publish_failed"
            ]
          },
          "dependency": {
            "type": "string",
            "enum": [
              "dfns",
              "engine"
            ]
          },
          "occurredAtEpochMs": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "version",
          "requestId",
          "code",
          "safeMessage",
          "retryable",
          "recoveryActions",
          "occurredAtEpochMs"
        ],
        "additionalProperties": false
      },
      "HealthPayload": {
        "type": "object",
        "properties": {
          "service": {
            "type": "string",
            "minLength": 1
          },
          "status": {
            "type": "string",
            "enum": [
              "starting",
              "ready",
              "degraded",
              "unavailable"
            ]
          },
          "degradedState": {
            "type": "string",
            "enum": [
              "none",
              "warmup",
              "paused",
              "draining_to_journal",
              "runtime_policy_unavailable",
              "database_unavailable",
              "journal_unavailable",
              "projection_group_not_owned",
              "projection_stale",
              "replica_lagging",
              "projector_backfilling",
              "market_data_unavailable",
              "canton_unavailable",
              "signer_unavailable",
              "reconciliation_blocked",
              "kill_switch_active",
              "authority_unreachable",
              "unknown_command_outcome",
              "action_requires_approval",
              "dry_run_expired",
              "unsafe_action_blocked"
            ]
          },
          "journalSequence": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "runtimePolicyVersion": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 1
          },
          "sourceDigest": {
            "type": "string",
            "minLength": 1
          }
        },
        "required": [
          "service",
          "status",
          "degradedState",
          "journalSequence",
          "runtimePolicyVersion"
        ],
        "additionalProperties": false
      },
      "ServiceReadinessPayload": {
        "type": "object",
        "properties": {
          "service": {
            "type": "string",
            "minLength": 1
          },
          "status": {
            "type": "string",
            "enum": [
              "starting",
              "ready",
              "degraded",
              "unavailable"
            ]
          },
          "degradedState": {
            "type": "string",
            "enum": [
              "none",
              "warmup",
              "paused",
              "draining_to_journal",
              "runtime_policy_unavailable",
              "database_unavailable",
              "journal_unavailable",
              "projection_group_not_owned",
              "projection_stale",
              "replica_lagging",
              "projector_backfilling",
              "market_data_unavailable",
              "canton_unavailable",
              "signer_unavailable",
              "reconciliation_blocked",
              "kill_switch_active",
              "authority_unreachable",
              "unknown_command_outcome",
              "action_requires_approval",
              "dry_run_expired",
              "unsafe_action_blocked"
            ]
          },
          "journalSequence": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "runtimePolicyVersion": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 1
          },
          "sourceDigest": {
            "type": "string",
            "minLength": 1
          },
          "databasePool": {
            "type": "object",
            "properties": {
              "total": {
                "type": "integer",
                "minimum": 0
              },
              "idle": {
                "type": "integer",
                "minimum": 0
              },
              "waiting": {
                "type": "integer",
                "minimum": 0
              },
              "max": {
                "type": "integer",
                "minimum": 0
              },
              "reason": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "database_pool_waiting",
                  "database_slots_exhausted",
                  null
                ]
              },
              "pools": {
                "type": "object",
                "additionalProperties": {
                  "type": "object",
                  "properties": {
                    "total": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "idle": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "waiting": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "max": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "reason": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "enum": [
                        "database_pool_waiting",
                        "database_slots_exhausted",
                        null
                      ]
                    }
                  },
                  "required": [
                    "total",
                    "idle",
                    "waiting",
                    "max",
                    "reason"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "total",
              "idle",
              "waiting",
              "max",
              "reason"
            ],
            "additionalProperties": false
          },
          "keyVerifier": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "state": {
                    "type": "string",
                    "const": "ready"
                  },
                  "reason": {
                    "type": "string",
                    "const": "none"
                  }
                },
                "required": [
                  "state",
                  "reason"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "state": {
                    "type": "string",
                    "const": "unavailable"
                  },
                  "reason": {
                    "type": "string",
                    "const": "key_verifier_not_composed"
                  }
                },
                "required": [
                  "state",
                  "reason"
                ],
                "additionalProperties": false
              }
            ]
          },
          "edjcTail": {
            "type": "object",
            "properties": {
              "composed": {
                "type": "boolean"
              },
              "reader": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "directory",
                  "engine_route",
                  null
                ]
              },
              "reasonCode": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "realtime_edjc:engine_url_required",
                  "realtime_edjc:engine_url_invalid",
                  "realtime_edjc:service_secret_required",
                  "realtime_edjc:source_binding_missing",
                  "realtime_edjc:source_binding_invalid",
                  "realtime_edjc:source_not_served",
                  "realtime_edjc:page_read_failed",
                  "realtime_edjc:page_read_empty",
                  "realtime_edjc:edj1_tail_retired",
                  "realtime_edjc:market_data_stream_required",
                  "realtime_edjc:database_required",
                  "realtime_edjc:recovery_admission_pending",
                  "realtime_edjc:recovery_binding_refused",
                  "realtime_edjc:catching_up",
                  "realtime_edjc:fold_restore_failed",
                  null
                ]
              },
              "bindingRefusal": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "edjc_recovery_descriptor_unreachable",
                  "edjc_recovery_maintenance_required",
                  "edjc_recovery_locating",
                  "edjc_recovery_generation_conflict",
                  "edjc_recovery_descriptor_invalid",
                  "edjc_recovery_override_conflict",
                  "edjc_recovery_override_invalid",
                  "edjc_recovery_expected_epoch_missing",
                  "edjc_generation_pin_conflict",
                  "edjc_generation_pin_unavailable",
                  null
                ]
              },
              "cursorOrdinal": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "committedThroughOrdinal": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "maxLagRecords": {
                "type": "integer",
                "exclusiveMinimum": 0,
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "foldRestore": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "path": {
                    "type": "string",
                    "enum": [
                      "snapshot",
                      "full_replay"
                    ]
                  },
                  "snapshotOrdinal": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "discardReason": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      "edjc_fold_snapshot_missing",
                      "edjc_fold_snapshot_unsupported",
                      "edjc_fold_snapshot_codec_unsupported",
                      "edjc_fold_snapshot_payload_digest_mismatch",
                      "edjc_fold_snapshot_decode_failed",
                      "edjc_fold_snapshot_source_conflict",
                      "edjc_fold_snapshot_groups_conflict",
                      "edjc_fold_snapshot_ahead_of_checkpoint",
                      "edjc_fold_snapshot_ahead_of_native_frontier",
                      "edjc_fold_snapshot_anchor_digest_mismatch",
                      "edjc_fold_snapshot_unreadable",
                      "edjc_fold_snapshot_deposit_frontier_conflict",
                      null
                    ]
                  }
                },
                "required": [
                  "path",
                  "snapshotOrdinal",
                  "discardReason"
                ],
                "additionalProperties": false
              },
              "withdrawalFrameRefusals": {
                "type": "object",
                "properties": {
                  "record_version": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "record_invalid": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "frame_invalid": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  }
                },
                "required": [
                  "record_version",
                  "record_invalid",
                  "frame_invalid"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "composed",
              "reader",
              "reasonCode",
              "cursorOrdinal",
              "committedThroughOrdinal"
            ],
            "additionalProperties": false
          },
          "replication": {
            "type": "object",
            "properties": {
              "read": {
                "type": "boolean"
              },
              "leaderFailureDomainDeclared": {
                "type": [
                  "boolean",
                  "null"
                ]
              },
              "hasQualifyingStandby": {
                "type": [
                  "boolean",
                  "null"
                ]
              },
              "reportingStandbyCount": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0
              },
              "refusedStandbyCount": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0
              },
              "lastQualifyingObservationAgeMs": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0
              },
              "appliedSequence": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0
              },
              "replicatedSequence": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0
              },
              "replicationStalledForMs": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0
              },
              "committedUnavailableReason": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "no_standby_configured",
                  "no_qualifying_standby",
                  "standby_unreachable",
                  "standby_unresponsive",
                  "no_replicated_records",
                  null
                ]
              },
              "unavailableReason": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "cpp_writer_front_not_composed",
                  "native_replication_reply_refused",
                  "cpp_writer_query_failed",
                  null
                ]
              }
            },
            "required": [
              "read",
              "leaderFailureDomainDeclared",
              "hasQualifyingStandby",
              "reportingStandbyCount",
              "refusedStandbyCount",
              "lastQualifyingObservationAgeMs",
              "appliedSequence",
              "replicatedSequence",
              "replicationStalledForMs",
              "committedUnavailableReason",
              "unavailableReason"
            ],
            "additionalProperties": false
          },
          "engineKillSwitch": {
            "type": "object",
            "properties": {
              "version": {
                "type": "string",
                "const": "engine-kill-switch-status/v1"
              },
              "authorityComposed": {
                "type": "boolean"
              },
              "engaged": {
                "type": "boolean"
              },
              "activeSinceEpochMs": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "reasonCode": {
                "type": "string",
                "enum": [
                  "active_claims",
                  "no_active_claims",
                  "authority_not_composed"
                ]
              },
              "activeClaims": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "actor": {
                      "type": "string",
                      "const": "worker"
                    },
                    "source": {
                      "type": "string",
                      "enum": [
                        "ledger_reconciliation",
                        "journal_persistor_volume_guard",
                        "legacy_worker"
                      ]
                    },
                    "activatedAtEpochMs": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "causeCode": {
                      "type": "string",
                      "enum": [
                        "reconciliation_safety_proof_failed",
                        "local_log_volume_exhausted",
                        "legacy_unspecified"
                      ]
                    },
                    "recoveryCondition": {
                      "type": "string",
                      "enum": [
                        "complete_reconciliation_pass",
                        "local_log_volume_above_release_floor",
                        "legacy_unspecified"
                      ]
                    },
                    "effectScope": {
                      "type": "string",
                      "const": "venue_wide"
                    },
                    "evidence": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "ledger_reconciliation"
                            },
                            "classification": {
                              "type": "string",
                              "enum": [
                                "consistent",
                                "pending_explainable",
                                "divergent",
                                "unknown"
                              ]
                            },
                            "accountsChecked": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            "consistentAccounts": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            "pendingExplainableAccounts": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            "divergentAccounts": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            "unknownAccounts": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            "coverage": {
                              "type": [
                                "object",
                                "null"
                              ],
                              "properties": {
                                "requestedAccounts": {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                "readAccounts": {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                "unreadableAccounts": {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                "unaccountedAccounts": {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                "legacyExcludedAccounts": {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                }
                              },
                              "required": [
                                "requestedAccounts",
                                "readAccounts",
                                "unreadableAccounts",
                                "unaccountedAccounts",
                                "legacyExcludedAccounts"
                              ],
                              "additionalProperties": false
                            },
                            "unreadableReasons": {
                              "type": "object",
                              "additionalProperties": {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              }
                            }
                          },
                          "required": [
                            "kind",
                            "classification",
                            "accountsChecked",
                            "consistentAccounts",
                            "pendingExplainableAccounts",
                            "divergentAccounts",
                            "unknownAccounts",
                            "coverage",
                            "unreadableReasons"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "journal_volume"
                            },
                            "freeBytes": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            "thresholdBytes": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "kind",
                            "freeBytes",
                            "thresholdBytes"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "legacy_unspecified"
                            }
                          },
                          "required": [
                            "kind"
                          ],
                          "additionalProperties": false
                        }
                      ]
                    },
                    "persistence": {
                      "type": "object",
                      "properties": {
                        "state": {
                          "type": "string",
                          "enum": [
                            "pending",
                            "persisted",
                            "failed",
                            "unavailable"
                          ]
                        }
                      },
                      "required": [
                        "state"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "actor",
                    "source",
                    "activatedAtEpochMs",
                    "causeCode",
                    "recoveryCondition",
                    "effectScope",
                    "evidence",
                    "persistence"
                  ],
                  "additionalProperties": false
                },
                "maxItems": 3
              },
              "lastTransition": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "actor": {
                    "type": "string",
                    "const": "worker"
                  },
                  "source": {
                    "type": "string",
                    "enum": [
                      "ledger_reconciliation",
                      "journal_persistor_volume_guard",
                      "legacy_worker"
                    ]
                  },
                  "engaged": {
                    "type": "boolean"
                  },
                  "occurredAtEpochMs": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "causeCode": {
                    "type": "string",
                    "enum": [
                      "reconciliation_safety_proof_failed",
                      "reconciliation_recovery_proved",
                      "local_log_volume_exhausted",
                      "local_log_volume_recovered",
                      "legacy_unspecified"
                    ]
                  },
                  "persistence": {
                    "type": "object",
                    "properties": {
                      "state": {
                        "type": "string",
                        "enum": [
                          "pending",
                          "persisted",
                          "failed",
                          "unavailable"
                        ]
                      }
                    },
                    "required": [
                      "state"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "actor",
                  "source",
                  "engaged",
                  "occurredAtEpochMs",
                  "causeCode",
                  "persistence"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "version",
              "authorityComposed",
              "engaged",
              "activeSinceEpochMs",
              "reasonCode",
              "activeClaims"
            ],
            "additionalProperties": false
          },
          "engineBootRecovery": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "mode": {
                "type": "string",
                "enum": [
                  "full_replay",
                  "snapshot"
                ]
              },
              "reason": {
                "type": "string",
                "enum": [
                  "snapshot_restored",
                  "snapshot_not_attempted",
                  "snapshot_restore_disabled",
                  "journal_disabled",
                  "journal_empty",
                  "snapshot_missing",
                  "snapshot_truncated",
                  "snapshot_checksum_mismatch",
                  "snapshot_domain_unknown",
                  "snapshot_trailing_bytes",
                  "snapshot_anchor_count_out_of_domain",
                  "snapshot_undecodable",
                  "snapshot_anchor_invalid",
                  "snapshot_ahead_of_log",
                  "snapshot_cutoff_digest_mismatch",
                  "snapshot_limits_mismatch",
                  "snapshot_side_tables_missing",
                  "snapshot_side_tables_malformed",
                  "snapshot_side_tables_digest_mismatch",
                  "snapshot_side_tables_unbound",
                  "snapshot_restore_refused",
                  "snapshot_state_hash_mismatch",
                  "snapshot_side_tables_mismatch",
                  "snapshot_cutoff_mid_group"
                ]
              },
              "logBase": {
                "type": "string",
                "enum": [
                  "snapshot_anchored",
                  "journal_disabled",
                  "journal_empty",
                  "snapshot_restore_disabled",
                  "snapshot_not_anchorable",
                  "anchor_not_on_log",
                  "snapshot_discarded"
                ]
              }
            },
            "required": [
              "mode",
              "reason"
            ],
            "additionalProperties": false
          },
          "engineHeldRowSettlement": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "reason": {
                "type": "string",
                "const": "held_rows_settled"
              },
              "heldCommand": {
                "type": "string",
                "enum": [
                  "applied",
                  "absent",
                  "none"
                ]
              },
              "orderRoute": {
                "type": "string",
                "enum": [
                  "settled",
                  "fenced",
                  "not_held"
                ]
              },
              "committedThroughOrdinal": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "settledAtEpochMs": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "reason",
              "heldCommand",
              "orderRoute",
              "committedThroughOrdinal",
              "settledAtEpochMs"
            ],
            "additionalProperties": false
          },
          "sequencerFence": {
            "type": "object",
            "properties": {
              "state": {
                "type": "string",
                "enum": [
                  "clear",
                  "held",
                  "permanent"
                ]
              },
              "reason": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "main_reply_ambiguous",
                  "order_reply_ambiguous",
                  "journal_append_failed",
                  "journal_group_unwritable",
                  "after_commit_failed",
                  "journal_sequence_mismatch",
                  "writer_identity_invalid",
                  "apply_failed",
                  "held_append_record_mismatch",
                  "auto_close_repair_query_failed",
                  "auto_close_repair_reply_invalid",
                  "auto_close_repair_consequence_refused",
                  "auto_close_repair_committed_unavailable",
                  "held_settlement_timeout",
                  "marked_unhealthy",
                  "initial_state_fenced",
                  null
                ]
              },
              "sinceEpochMs": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0
              },
              "settledBy": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "core_log_applied",
                  "core_log_absent",
                  "order_route",
                  "replay",
                  null
                ]
              }
            },
            "required": [
              "state",
              "reason",
              "sinceEpochMs",
              "settledBy"
            ],
            "additionalProperties": false
          },
          "accountPositionCommitWait": {
            "type": "object",
            "properties": {
              "waits": {
                "type": "integer",
                "minimum": 0,
                "maximum": 1000000000
              },
              "recoveries": {
                "type": "integer",
                "minimum": 0,
                "maximum": 1000000000
              },
              "refusals": {
                "type": "integer",
                "minimum": 0,
                "maximum": 1000000000
              },
              "unbound": {
                "type": "object",
                "additionalProperties": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 1000000000
                }
              },
              "budget": {
                "type": "object",
                "properties": {
                  "ceilingMs": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "pollIntervalMs": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "ackPolls": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "redemptionAllowanceMs": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  }
                },
                "required": [
                  "ceilingMs",
                  "pollIntervalMs",
                  "ackPolls",
                  "redemptionAllowanceMs"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "waits",
              "recoveries",
              "refusals"
            ],
            "additionalProperties": false
          },
          "reconcilerEngineRead": {
            "type": "object",
            "properties": {
              "prefixBehindTipRetries": {
                "type": "integer",
                "minimum": 0,
                "maximum": 1000000000
              },
              "prefixBehindTipRecoveries": {
                "type": "integer",
                "minimum": 0,
                "maximum": 1000000000
              }
            },
            "required": [
              "prefixBehindTipRetries",
              "prefixBehindTipRecoveries"
            ],
            "additionalProperties": false
          },
          "reconciliationCommitLag": {
            "type": "object",
            "properties": {
              "sinceEpochMs": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "passes": {
                "type": "integer",
                "minimum": 0,
                "maximum": 1000000000
              },
              "committedVisibleOrdinal": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "deferralsOpened": {
                "type": "integer",
                "minimum": 0,
                "maximum": 1000000000
              },
              "deferralsExhausted": {
                "type": "integer",
                "minimum": 0,
                "maximum": 1000000000
              },
              "haltEngagements": {
                "type": "integer",
                "minimum": 0,
                "maximum": 1000000000
              },
              "haltReleases": {
                "type": "integer",
                "minimum": 0,
                "maximum": 1000000000
              }
            },
            "required": [
              "sinceEpochMs",
              "passes",
              "committedVisibleOrdinal",
              "deferralsOpened",
              "deferralsExhausted",
              "haltEngagements",
              "haltReleases"
            ],
            "additionalProperties": false
          },
          "marketBook": {
            "type": "object",
            "properties": {
              "composed": {
                "type": "boolean"
              },
              "markets": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "marketId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "lastPolledAtEpochMs": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "minimum": 0
                    },
                    "lastPublishedAtEpochMs": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "minimum": 0
                    },
                    "lastSnapshotSequence": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "minimum": 0
                    },
                    "consecutiveFailures": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "lastFailureReason": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "enum": [
                        "market_book:request_failed",
                        "market_book:request_timeout",
                        "market_book:response_status_invalid",
                        "market_book:response_schema_invalid",
                        "market_book:publish_failed",
                        null
                      ]
                    }
                  },
                  "required": [
                    "marketId",
                    "lastPolledAtEpochMs",
                    "lastPublishedAtEpochMs",
                    "lastSnapshotSequence",
                    "consecutiveFailures",
                    "lastFailureReason"
                  ],
                  "additionalProperties": false
                },
                "maxItems": 64
              }
            },
            "required": [
              "composed",
              "markets"
            ],
            "additionalProperties": false
          },
          "liveAccount": {
            "type": "object",
            "properties": {
              "composed": {
                "type": "boolean"
              },
              "lastPassAtEpochMs": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0
              },
              "trackedAccountCount": {
                "type": "integer",
                "minimum": 0
              },
              "consecutiveFailures": {
                "type": "integer",
                "minimum": 0
              },
              "lastFailureReason": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "live_account:open_account_read_failed",
                  "live_account:engine_view_unavailable",
                  "live_account:engine_view_stale",
                  "live_account:publication_failed",
                  "live_account:candidate_limit_reached",
                  null
                ]
              }
            },
            "required": [
              "composed",
              "lastPassAtEpochMs",
              "trackedAccountCount",
              "consecutiveFailures",
              "lastFailureReason"
            ],
            "additionalProperties": false
          },
          "degradedLeg": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "databasePool",
              "projector",
              "canton_stream",
              "canton_runtime_identity",
              "reconciliation",
              "settlement",
              "withdrawal_consume",
              "jetstream_consumer",
              "engine_cpp_transport",
              "core_mirror",
              "engine_replication",
              "engine_kill_switch",
              "funding_engine",
              "market_mark_freshness",
              "journal_archive",
              "market_data_face",
              null
            ]
          },
          "degradedLegState": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "database_pool_waiting",
              "database_slots_exhausted",
              "not_composed",
              "run_failed",
              "awaiting_first_run",
              "not_caught_up",
              "group_not_owned",
              "binding_deferred",
              "ownership_unclaimed",
              "identity_unverified",
              "halt_engaged",
              "halt_delivery_failed",
              "margin_configuration_upgrade_pending",
              "auto_close_repair_in_progress",
              "auto_close_repair_awaiting_committed",
              "refused_stopped",
              "mark_stale",
              "standby_absent",
              "replication_stalled",
              "stopped_awaiting_replacement",
              "archive_lag_exceeded",
              "local_journal_bytes_exceeded",
              "market_data_face_contradicted",
              null
            ]
          },
          "degradedReason": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 1
          },
          "degradedReasonCode": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "journal_configuration:accounting_epoch_missing",
              "journal_configuration:accounting_epoch_mismatch",
              "journal_configuration:page_request_invalid",
              "journal_configuration:service_identity_required",
              "journal_configuration:writer_provenance_invalid",
              "journal_configuration:per_record_fsync_required",
              "journal_configuration:synchronous_commit_required",
              "journal_configuration:engine_url_required",
              "journal_configuration:engine_url_invalid",
              "journal_configuration:service_secret_required",
              "journal_configuration:service_secret_invalid",
              "journal_lock:writer_lock_state_invalid",
              "journal_lock:writer_lock_held",
              "journal_lock:writer_lock_invalid",
              "journal_lock:advisory_lock_held",
              "journal_lock:operation_in_progress",
              "journal_lock:projection_group_not_owned",
              "journal_provenance:manifest_missing",
              "journal_provenance:source_missing_for_manifest",
              "journal_provenance:manifest_missing_for_history",
              "journal_provenance:authoritative_manifest_requires_provenanced_writer",
              "journal_provenance:writer_provenance_unavailable",
              "journal_provenance:writer_provenance_invalid",
              "journal_provenance:writer_provenance_mismatch",
              "journal_provenance:journal_identity_changed",
              "journal_provenance:writer_incarnation_mismatch",
              "journal_provenance:manifest_tip_mismatch",
              "journal_provenance:manifest_tip_changed",
              "journal_provenance:manifest_compare_and_swap_failed",
              "journal_provenance:identity_provisioning_compare_and_swap_failed",
              "journal_provenance:source_identity_changed",
              "journal_provenance:indexed_source_identity_changed",
              "journal_provenance:snapshot_mismatch",
              "journal_provenance:manifest_tip_regressed",
              "journal_provenance:manifest_tip_unanchored",
              "journal_provenance:manifest_commit_marker_unsafe",
              "journal_provenance:command_link_profile_mismatch",
              "journal_provenance:command_link_profile_not_consumed",
              "journal_provenance:readiness_epoch_mismatch",
              "journal_data:incomplete_tail",
              "journal_data:invalid_json",
              "journal_data:record_schema_invalid",
              "journal_data:manifest_schema_invalid",
              "journal_data:manifest_hash_invalid",
              "journal_data:payload_hash_invalid",
              "journal_data:record_hash_invalid",
              "journal_data:hash_chain_invalid",
              "journal_data:fork_invalid",
              "journal_data:record_too_large",
              "journal_data:page_too_large",
              "journal_data:manifest_too_large",
              "journal_data:sequence_out_of_range",
              "journal_data:invalid_command_chain",
              "journal_data:command_link_profile_invalid",
              "journal_data:semantic_validation_failed",
              "journal_data:page_record_count_invalid",
              "journal_data:page_record_mismatch",
              "journal_data:page_invalid",
              "journal_availability:source_unavailable",
              "journal_availability:manifest_unavailable",
              "journal_availability:directory_unavailable",
              "journal_availability:source_changed_during_read",
              "journal_availability:source_changed_during_page",
              "journal_availability:manifest_changed_during_read",
              "journal_availability:writer_state_unavailable",
              "journal_availability:writer_fenced_after_append_uncertainty",
              "journal_availability:writer_closed",
              "journal_availability:invalid_write_progress",
              "journal_availability:database_unreachable_before_commit",
              "journal_availability:database_commit_outcome_uncertain",
              "journal_availability:database_provisioning_failed",
              "journal_availability:range_unavailable",
              "journal_availability:source_ended_before_committed_tip",
              "journal_availability:page_offsets_unavailable",
              "journal_availability:remote_response_status_invalid",
              "journal_availability:remote_response_content_type_invalid",
              "journal_availability:remote_response_too_large",
              "journal_availability:remote_response_body_invalid",
              "journal_availability:remote_response_json_invalid",
              "journal_availability:remote_page_invalid",
              "journal_availability:remote_request_timeout",
              "journal_availability:remote_request_failed",
              "journal_availability:page_build_failed",
              "journal_projection:not_composed",
              "journal_projection:run_failed",
              "journal_projection:not_caught_up",
              "journal_projection:iteration_in_progress",
              "journal_projection:consumer_topology_invalid",
              "journal_projection:source_consumer_missing",
              "journal_projection:checkpoint_invalid",
              "journal_projection:checkpoint_binding_failed",
              "journal_projection:snapshot_mismatch",
              "journal_projection:consumer_lagging",
              "journal_projection:cursor_state_missing",
              "journal_projection:preflight_page_missing",
              "journal_projection:source_capture_missing",
              "journal_projection:page_rejected",
              "journal_projection:page_checkpoint_binding_mismatch",
              "journal_projection:page_incomplete",
              "journal_projection:page_group_invalid",
              "journal_projection:waiting_for_dependency",
              "journal_projection:source_provenance_missing",
              "journal_data:private_file_invalid",
              "journal_provenance:manifest_identity_changed",
              "journal_availability:local_log_volume_exhausted",
              "journal_retired:edj1_persistor_format",
              "journal_retired:edj1_worker_projection",
              "journal_retired:edj1_page_transport",
              "journal_retired:edj1_market_data_stream",
              "journal_retired:edj1_realtime_tail",
              null
            ]
          },
          "engineTransport": {
            "type": "object",
            "properties": {
              "active": {
                "type": "string",
                "enum": [
                  "http",
                  "aeron_ipc",
                  "aeron_ipc_cpp",
                  "none"
                ]
              },
              "autoCloseRepairQuery": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "enum": [
                      "none",
                      "engine_unavailable",
                      "query_failed",
                      "reply_unreadable",
                      "unknown_refusal",
                      "service_identity_required",
                      "invalid_command",
                      "margin_configuration_upgrade_required",
                      "depth_limit_out_of_domain"
                    ]
                  },
                  "httpStatus": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "minimum": 100,
                    "maximum": 599
                  },
                  "attempts": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 3
                  },
                  "sourceJournalSequence": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "consequence": {
                    "type": "object",
                    "properties": {
                      "keeperReason": {
                        "type": "string",
                        "enum": [
                          "invalid_trigger",
                          "duplicate_trigger_id",
                          "unknown_trigger",
                          "journal_rejected",
                          "keeper_threw",
                          "keeper_timeout",
                          "unknown_refusal",
                          "position_evidence_unavailable",
                          "settlement_journal_failed"
                        ]
                      },
                      "keeperError": {
                        "type": "object",
                        "properties": {
                          "errorClass": {
                            "type": "string",
                            "enum": [
                              "journal_append_refused",
                              "journal_append_held",
                              "schema_invalid",
                              "error",
                              "non_error"
                            ]
                          },
                          "message": {
                            "type": "string",
                            "maxLength": 240
                          }
                        },
                        "required": [
                          "errorClass",
                          "message"
                        ],
                        "additionalProperties": false
                      },
                      "accountIdPrefix": {
                        "type": "string",
                        "maxLength": 8
                      },
                      "marketId": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 128
                      },
                      "sourceJournalSequence": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991,
                        "exclusiveMinimum": 0
                      },
                      "triggerKinds": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "enum": [
                            "stop_loss",
                            "take_profit"
                          ]
                        }
                      }
                    },
                    "required": [
                      "keeperReason",
                      "accountIdPrefix",
                      "marketId",
                      "sourceJournalSequence",
                      "triggerKinds"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "reason",
                  "httpStatus",
                  "attempts"
                ],
                "additionalProperties": false
              },
              "autoCloseRepair": {
                "type": "object",
                "properties": {
                  "sinceEpochMs": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "pendingIntentCount": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "committedWait": {
                    "type": "object",
                    "properties": {
                      "sinceEpochMs": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "reason": {
                        "type": "string",
                        "enum": [
                          "no_standby_configured",
                          "no_qualifying_standby",
                          "standby_unreachable",
                          "standby_unresponsive",
                          "no_replicated_records"
                        ]
                      },
                      "refusals": {
                        "type": "integer",
                        "exclusiveMinimum": 0,
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "sinceEpochMs",
                      "reason",
                      "refusals"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "sinceEpochMs",
                  "pendingIntentCount"
                ],
                "additionalProperties": false
              },
              "requested": {
                "type": "string",
                "const": "aeron_ipc_cpp"
              },
              "composed": {
                "type": "boolean"
              }
            },
            "required": [
              "active"
            ],
            "additionalProperties": false
          },
          "cantonOffline": {
            "type": "object",
            "properties": {
              "policyReadable": {
                "type": "boolean"
              },
              "policyVersion": {
                "type": [
                  "string",
                  "null"
                ],
                "minLength": 1
              },
              "engaged": {
                "type": "boolean"
              },
              "enforcing": {
                "type": "boolean"
              },
              "enforcedLegs": {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "deposit_intake",
                    "withdrawal_intake",
                    "onboarding",
                    "settlement_loop",
                    "withdrawal_consume_loop",
                    "indexer_stream"
                  ]
                }
              }
            },
            "required": [
              "policyReadable",
              "policyVersion",
              "engaged",
              "enforcing",
              "enforcedLegs"
            ],
            "additionalProperties": false
          },
          "apiReadinessLegs": {
            "type": "array",
            "items": {
              "oneOf": [
                {
                  "type": "object",
                  "properties": {
                    "leg": {
                      "type": "string",
                      "const": "capability"
                    },
                    "gating": {
                      "type": "boolean",
                      "const": true
                    },
                    "state": {
                      "type": "string",
                      "enum": [
                        "ready",
                        "degraded",
                        "unobserved",
                        "not_composed"
                      ]
                    },
                    "reason": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "enum": [
                        "health_shell",
                        "withdrawals_not_composed",
                        "canton_capability_not_ready",
                        "runtime_policy_not_published",
                        "runtime_policy_unreadable",
                        null
                      ]
                    }
                  },
                  "required": [
                    "leg",
                    "gating",
                    "state",
                    "reason"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "leg": {
                      "type": "string",
                      "const": "database_pool"
                    },
                    "gating": {
                      "type": "boolean",
                      "const": false
                    },
                    "state": {
                      "type": "string",
                      "enum": [
                        "ready",
                        "degraded",
                        "unobserved",
                        "not_composed"
                      ]
                    },
                    "reason": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "enum": [
                        "database_pool_waiting",
                        "database_slots_exhausted",
                        "database_not_configured",
                        "runtime_policy_feed_failed",
                        null
                      ]
                    }
                  },
                  "required": [
                    "leg",
                    "gating",
                    "state",
                    "reason"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "leg": {
                      "type": "string",
                      "const": "dfns"
                    },
                    "gating": {
                      "type": "boolean",
                      "const": false
                    },
                    "state": {
                      "type": "string",
                      "enum": [
                        "ready",
                        "degraded",
                        "unobserved",
                        "not_composed"
                      ]
                    },
                    "reason": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "enum": [
                        "dfns_not_configured",
                        "dfns_awaiting_first_request",
                        "dfns_request_failed",
                        "dfns_request_timeout",
                        "dfns_upstream_unauthorized",
                        "dfns_upstream_rate_limited",
                        "dfns_upstream_unavailable",
                        "dfns_credential_not_found",
                        "dfns_credential_inactive",
                        "dfns_identity_unreachable",
                        null
                      ]
                    },
                    "consecutiveFailures": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "lastFailureAgeMs": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "leg",
                    "gating",
                    "state",
                    "reason",
                    "consecutiveFailures",
                    "lastFailureAgeMs"
                  ],
                  "additionalProperties": false
                }
              ]
            }
          },
          "cantonEgress": {
            "type": "object",
            "properties": {
              "intervalMs": {
                "type": "integer",
                "exclusiveMinimum": 0,
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "lastProbeAgeMs": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "verification": {
                "type": "object",
                "properties": {
                  "schema": {
                    "type": "string",
                    "const": "canton-egress-verification/v1"
                  },
                  "reachable": {
                    "type": "boolean"
                  },
                  "failedHop": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      "tcp\u2192proxy",
                      "tcp\u2192ledger",
                      "connect\u2192ledger",
                      "tls",
                      "http",
                      "configuration",
                      null
                    ]
                  },
                  "hops": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string",
                          "enum": [
                            "tcp\u2192proxy",
                            "tcp\u2192ledger",
                            "connect\u2192ledger",
                            "tls",
                            "http"
                          ]
                        },
                        "latencyMs": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "passed": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "name",
                        "latencyMs",
                        "passed"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "schema",
                  "reachable",
                  "failedHop",
                  "hops"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "intervalMs",
              "lastProbeAgeMs",
              "verification"
            ],
            "additionalProperties": false
          },
          "affiliateAccrualSkips": {
            "type": "object",
            "properties": {
              "total": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "byReason": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "reasonCode": {
                      "type": "string",
                      "enum": [
                        "non_fill_event"
                      ]
                    },
                    "count": {
                      "type": "integer",
                      "exclusiveMinimum": 0,
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "firstEventId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "lastEventId": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "required": [
                    "reasonCode",
                    "count",
                    "firstEventId",
                    "lastEventId"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "total",
              "byReason"
            ],
            "additionalProperties": false
          },
          "cantonStream": {
            "type": "object",
            "properties": {
              "state": {
                "type": "string",
                "enum": [
                  "subscribing",
                  "ready",
                  "retry_wait",
                  "terminal"
                ]
              },
              "reasonCode": {
                "type": "string",
                "enum": [
                  "ledger_stream_unavailable",
                  "ledger_stream_event_invalid",
                  "canton_stream_checkpoint_rewound",
                  "canton_stream_checkpoint_load_failed",
                  "canton_stream_checkpoint_invalid",
                  "ledger_stream_bootstrap_failed",
                  "holding_interface_view_unavailable",
                  "deposit_sink_unavailable",
                  "withdrawal_sink_unavailable",
                  "stream_sink_refused",
                  "stream_subscribing",
                  "stream_progress"
                ]
              },
              "retryCount": {
                "type": "integer",
                "minimum": 0
              },
              "lastRetryAtEpochMs": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0
              },
              "nextRetryAtEpochMs": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0
              },
              "connected": {
                "type": "boolean"
              },
              "sink": {
                "type": "object",
                "properties": {
                  "attemptCount": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "engineReasonCode": {
                    "anyOf": [
                      {
                        "anyOf": [
                          {
                            "type": "string",
                            "enum": [
                              "malformed_command",
                              "unsupported_deposit_command",
                              "invalid_deposit_source",
                              "invalid_deposit_account",
                              "invalid_deposit_amount",
                              "invalid_deposit_asset",
                              "invalid_deposit_event",
                              "idempotency_key_conflict",
                              "unknown_margin_account",
                              "invalid_risk_event",
                              "risk_root_journal_unavailable",
                              "sequencer_rejected"
                            ]
                          },
                          {
                            "type": "string",
                            "enum": [
                              "native_deposit_admission_absent",
                              "native_deposit_history_unverifiable",
                              "native_deposit_commitment_unavailable",
                              "native_deposit_binding_mismatch",
                              "native_deposit_binding_unavailable"
                            ]
                          },
                          {
                            "type": "string",
                            "const": "stream_sink_refused"
                          },
                          {
                            "type": "string",
                            "enum": [
                              "holding_receipt_malformed",
                              "holding_instruction_not_accepted",
                              "holding_instrument_mismatch",
                              "holding_predecessor_state_unknown",
                              "holding_custody_delta_mismatch",
                              "holding_withdrawal_payout_mismatch"
                            ]
                          }
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "httpStatus": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "minimum": 100,
                    "maximum": 599
                  },
                  "reasonCode": {
                    "type": "string",
                    "enum": [
                      "sink_ready",
                      "sink_credited_by_local_signing",
                      "sink_http_unavailable",
                      "sink_timeout",
                      "sink_unreachable",
                      "sink_response_invalid",
                      "sink_not_observed"
                    ]
                  }
                },
                "required": [
                  "attemptCount",
                  "httpStatus",
                  "reasonCode"
                ],
                "additionalProperties": false
              },
              "parkedObservationCount": {
                "type": "integer",
                "minimum": 0
              },
              "lastParked": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "eventIdPrefix": {
                    "type": "string",
                    "maxLength": 12
                  },
                  "offset": {
                    "type": "string",
                    "pattern": "^[0-9]+$"
                  },
                  "reasonCode": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "malformed_command",
                          "unsupported_deposit_command",
                          "invalid_deposit_source",
                          "invalid_deposit_account",
                          "invalid_deposit_amount",
                          "invalid_deposit_asset",
                          "invalid_deposit_event",
                          "idempotency_key_conflict",
                          "unknown_margin_account",
                          "invalid_risk_event",
                          "risk_root_journal_unavailable",
                          "sequencer_rejected"
                        ]
                      },
                      {
                        "type": "string",
                        "enum": [
                          "native_deposit_admission_absent",
                          "native_deposit_history_unverifiable",
                          "native_deposit_commitment_unavailable",
                          "native_deposit_binding_mismatch",
                          "native_deposit_binding_unavailable"
                        ]
                      },
                      {
                        "type": "string",
                        "const": "stream_sink_refused"
                      },
                      {
                        "type": "string",
                        "enum": [
                          "holding_receipt_malformed",
                          "holding_instruction_not_accepted",
                          "holding_instrument_mismatch",
                          "holding_predecessor_state_unknown",
                          "holding_custody_delta_mismatch",
                          "holding_withdrawal_payout_mismatch"
                        ]
                      }
                    ]
                  }
                },
                "required": [
                  "eventIdPrefix",
                  "offset",
                  "reasonCode"
                ],
                "additionalProperties": false
              },
              "pendingDeposits": {
                "type": "object",
                "properties": {
                  "count": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "oldestAgeMs": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "byReason": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "reasonCode": {
                          "anyOf": [
                            {
                              "type": "string",
                              "enum": [
                                "malformed_command",
                                "unsupported_deposit_command",
                                "invalid_deposit_source",
                                "invalid_deposit_account",
                                "invalid_deposit_amount",
                                "invalid_deposit_asset",
                                "invalid_deposit_event",
                                "idempotency_key_conflict",
                                "unknown_margin_account",
                                "invalid_risk_event",
                                "risk_root_journal_unavailable",
                                "sequencer_rejected"
                              ]
                            },
                            {
                              "type": "string",
                              "enum": [
                                "native_deposit_admission_absent",
                                "native_deposit_history_unverifiable",
                                "native_deposit_commitment_unavailable",
                                "native_deposit_binding_mismatch",
                                "native_deposit_binding_unavailable"
                              ]
                            },
                            {
                              "type": "string",
                              "const": "stream_sink_refused"
                            },
                            {
                              "type": "string",
                              "enum": [
                                "holding_receipt_malformed",
                                "holding_instruction_not_accepted",
                                "holding_instrument_mismatch",
                                "holding_predecessor_state_unknown",
                                "holding_custody_delta_mismatch",
                                "holding_withdrawal_payout_mismatch"
                              ]
                            }
                          ]
                        },
                        "count": {
                          "type": "integer",
                          "exclusiveMinimum": 0,
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "reasonCode",
                        "count"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "count",
                  "oldestAgeMs",
                  "byReason"
                ],
                "additionalProperties": false
              },
              "custodyReconciliation": {
                "type": "object",
                "properties": {
                  "state": {
                    "type": "string",
                    "enum": [
                      "unseeded",
                      "consistent",
                      "broken"
                    ]
                  },
                  "reasonCode": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      "custody_tracker_capacity_exceeded",
                      "custody_state_unreadable",
                      "custody_holdings_below_tracked",
                      "custody_balances_mismatch",
                      null
                    ]
                  },
                  "scale": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 10
                  },
                  "trackedCustodyAtoms": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "pattern": "^-?\\d+$"
                  },
                  "accountBalancesAtoms": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "pattern": "^-?\\d+$"
                  },
                  "operatorHoldingsAtoms": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "pattern": "^-?\\d+$"
                  },
                  "operatorHoldingCount": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  }
                },
                "required": [
                  "state",
                  "reasonCode",
                  "scale",
                  "trackedCustodyAtoms",
                  "accountBalancesAtoms",
                  "operatorHoldingsAtoms",
                  "operatorHoldingCount"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "state",
              "reasonCode",
              "retryCount",
              "lastRetryAtEpochMs",
              "nextRetryAtEpochMs",
              "connected",
              "sink",
              "parkedObservationCount",
              "lastParked"
            ],
            "additionalProperties": false
          },
          "depositReconciliation": {
            "type": "object",
            "properties": {
              "attemptCount": {
                "type": "integer",
                "minimum": 0
              },
              "engineReasonCode": {
                "anyOf": [
                  {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "malformed_command",
                          "unsupported_deposit_command",
                          "invalid_deposit_source",
                          "invalid_deposit_account",
                          "invalid_deposit_amount",
                          "invalid_deposit_asset",
                          "invalid_deposit_event",
                          "idempotency_key_conflict",
                          "unknown_margin_account",
                          "invalid_risk_event",
                          "risk_root_journal_unavailable",
                          "sequencer_rejected"
                        ]
                      },
                      {
                        "type": "string",
                        "enum": [
                          "native_deposit_admission_absent",
                          "native_deposit_history_unverifiable",
                          "native_deposit_commitment_unavailable",
                          "native_deposit_binding_mismatch",
                          "native_deposit_binding_unavailable"
                        ]
                      },
                      {
                        "type": "string",
                        "const": "stream_sink_refused"
                      },
                      {
                        "type": "string",
                        "enum": [
                          "holding_receipt_malformed",
                          "holding_instruction_not_accepted",
                          "holding_instrument_mismatch",
                          "holding_predecessor_state_unknown",
                          "holding_custody_delta_mismatch",
                          "holding_withdrawal_payout_mismatch"
                        ]
                      }
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "httpStatus": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 100,
                "maximum": 599
              },
              "reasonCode": {
                "type": "string",
                "enum": [
                  "sink_ready",
                  "sink_credited_by_local_signing",
                  "sink_http_unavailable",
                  "sink_timeout",
                  "sink_unreachable",
                  "sink_response_invalid",
                  "sink_not_observed"
                ]
              }
            },
            "required": [
              "attemptCount",
              "httpStatus",
              "reasonCode"
            ],
            "additionalProperties": false
          },
          "pendingCoreMirrorFillCount": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "transferReceiptConflictCount": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "edjcTransferScope": {
            "type": "object",
            "properties": {
              "bindingKind": {
                "type": "string",
                "enum": [
                  "edjc_transfer_scope/v1",
                  "edjc_transfer_scope/v2"
                ]
              },
              "outsideScopeCashEntries": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "bindingKind",
              "outsideScopeCashEntries"
            ],
            "additionalProperties": false
          },
          "edjcFrontierWriter": {
            "type": "string",
            "enum": [
              "this_worker",
              "peer_worker"
            ]
          },
          "edjcDeferralReason": {
            "type": "string",
            "enum": [
              "edjc_frontier_writer_held_by_peer"
            ]
          },
          "edjcDeferredGroups": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "edjcBoot": {
            "type": "object",
            "properties": {
              "path": {
                "type": "string",
                "enum": [
                  "fold_snapshot",
                  "full_catch_up"
                ]
              },
              "snapshotOrdinal": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "tailRecords": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "reachedAfterMs": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "discardReason": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "edjc_fold_snapshot_missing",
                  "edjc_fold_snapshot_unsupported",
                  "edjc_fold_snapshot_codec_unsupported",
                  "edjc_fold_snapshot_payload_digest_mismatch",
                  "edjc_fold_snapshot_decode_failed",
                  "edjc_fold_snapshot_source_conflict",
                  "edjc_fold_snapshot_groups_conflict",
                  "edjc_fold_snapshot_ahead_of_checkpoint",
                  "edjc_fold_snapshot_ahead_of_native_frontier",
                  "edjc_fold_snapshot_anchor_digest_mismatch",
                  "edjc_fold_snapshot_unreadable",
                  "edjc_fold_snapshot_deposit_frontier_conflict",
                  null
                ]
              },
              "phase": {
                "type": "string",
                "enum": [
                  "catching_up",
                  "reached"
                ]
              },
              "foldOrdinal": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "committedThroughOrdinal": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "remainingRecords": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "reason": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "edjc_checkpoint_ahead_of_native_frontier",
                  "edjc_checkpoint_behind_native_frontier",
                  "edjc_frontier_writer_peer_row_missing",
                  "edjc_frontier_writer_peer_stalled",
                  "edjc_takeover_warm_state_missing",
                  "edjc_takeover_in_progress",
                  "edjc_takeover_timed_out",
                  "edjc_projector_lock_wait",
                  "edjc_frontier_writer_fenced",
                  "edjc_fold_snapshot_restore_retrying",
                  "edjc_frontier_writer_degraded_holder",
                  "edjc_warm_follower_behind_peer",
                  null
                ]
              }
            },
            "required": [
              "path",
              "snapshotOrdinal",
              "tailRecords",
              "reachedAfterMs",
              "discardReason",
              "phase",
              "foldOrdinal",
              "committedThroughOrdinal",
              "remainingRecords",
              "reason"
            ],
            "additionalProperties": false
          },
          "edjcTakeover": {
            "type": "object",
            "properties": {
              "groupId": {
                "type": "string",
                "enum": [
                  "native-account-cash/v1",
                  "native-order-groups",
                  "worker-transfer-history",
                  "market-data-ohlcv",
                  "worker-edjc-fold-snapshot"
                ]
              },
              "step": {
                "type": "string",
                "enum": [
                  "initialize",
                  "catch_up",
                  "snapshot_restore",
                  "snapshot_write"
                ]
              },
              "state": {
                "type": "string",
                "enum": [
                  "running",
                  "timed_out"
                ]
              },
              "ageMs": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "noProgressMs": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "boundMs": {
                "type": "number",
                "const": 60000
              },
              "page": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "fromOrdinal": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "maxRecords": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "committedThroughOrdinal": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  }
                },
                "required": [
                  "fromOrdinal",
                  "maxRecords",
                  "committedThroughOrdinal"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "groupId",
              "step",
              "state",
              "ageMs",
              "noProgressMs",
              "boundMs",
              "page"
            ],
            "additionalProperties": false
          },
          "edjcFreshness": {
            "type": "object",
            "properties": {
              "boundRecords": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "boundSeconds": {
                "type": "number",
                "minimum": 0
              },
              "lagRecords": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "provedAgeMs": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "withinBound": {
                "type": "boolean"
              }
            },
            "required": [
              "boundRecords",
              "boundSeconds",
              "lagRecords",
              "provedAgeMs",
              "withinBound"
            ],
            "additionalProperties": false
          },
          "edjcFoldSnapshot": {
            "type": "object",
            "properties": {
              "ordinal": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "ageMs": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "skipReason": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "edjc_fold_snapshot_checkpoint_moved",
                  "edjc_fold_snapshot_kept_newer",
                  "edjc_fold_snapshot_anchor_conflict",
                  "edjc_fold_snapshot_write_failed",
                  null
                ]
              },
              "writeOutcomes": {
                "type": "object",
                "properties": {
                  "written": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "kept_newer": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "conflict": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "checkpoint_moved": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  }
                },
                "required": [
                  "written",
                  "kept_newer",
                  "conflict",
                  "checkpoint_moved"
                ],
                "additionalProperties": false
              },
              "lag": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "foldOrdinal": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "storedOrdinal": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "records": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "seconds": {
                    "type": "number",
                    "minimum": 0
                  },
                  "boundRecords": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "boundSeconds": {
                    "type": "number",
                    "minimum": 0
                  },
                  "withinBound": {
                    "type": "boolean"
                  },
                  "reason": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      "edjc_fold_snapshot_checkpoint_moved",
                      "edjc_fold_snapshot_kept_newer",
                      "edjc_fold_snapshot_anchor_conflict",
                      "edjc_fold_snapshot_write_failed",
                      "edjc_fold_snapshot_export_unavailable",
                      "edjc_fold_snapshot_write_not_attempted",
                      null
                    ]
                  }
                },
                "required": [
                  "foldOrdinal",
                  "storedOrdinal",
                  "records",
                  "seconds",
                  "boundRecords",
                  "boundSeconds",
                  "withinBound",
                  "reason"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "ordinal",
              "ageMs",
              "skipReason",
              "writeOutcomes",
              "lag"
            ],
            "additionalProperties": false
          },
          "edjcRoutePace": {
            "type": "object",
            "properties": {
              "maxInFlight": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "inFlight": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "waiting": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "pagesRead": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "pagesServed": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "pacedPages": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "lastPageMs": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "slowPageMs": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "gapAfterSlowPageMs": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "maxInFlight",
              "inFlight",
              "waiting",
              "pagesRead",
              "pagesServed",
              "pacedPages",
              "lastPageMs",
              "slowPageMs",
              "gapAfterSlowPageMs"
            ],
            "additionalProperties": false
          },
          "edjcArchiveRead": {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "edjc_archive_read/v1"
              },
              "configuration": {
                "type": "string",
                "enum": [
                  "disabled",
                  "incomplete",
                  "enabled"
                ]
              },
              "invalidVariables": {
                "type": "array",
                "items": {
                  "type": "string",
                  "pattern": "^[A-Z][A-Z0-9_]{0,127}$"
                }
              },
              "verification": {
                "type": "object",
                "properties": {
                  "state": {
                    "type": "string",
                    "enum": [
                      "not_composed",
                      "unverified",
                      "verified",
                      "stale",
                      "refused"
                    ]
                  },
                  "verifiedThroughOrdinal": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "verifiedSegments": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "verifiedAtEpochMs": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "ageMs": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "pendingSegments": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "lastPass": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "properties": {
                      "kind": {
                        "type": "string",
                        "enum": [
                          "incremental",
                          "full"
                        ]
                      },
                      "heads": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "atEpochMs": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "durationMs": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "kind",
                      "heads",
                      "atEpochMs",
                      "durationMs"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "state",
                  "verifiedThroughOrdinal",
                  "verifiedSegments",
                  "verifiedAtEpochMs",
                  "ageMs",
                  "pendingSegments",
                  "lastPass"
                ],
                "additionalProperties": false
              },
              "pagesServed": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "cache": {
                "type": "object",
                "properties": {
                  "boundBytes": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "cachedSegments": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "cachedBytes": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "baseCutoffOrdinal": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "evictedSegments": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "evictedBytes": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "pageNeedsBytes": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  }
                },
                "required": [
                  "boundBytes",
                  "cachedSegments",
                  "cachedBytes",
                  "baseCutoffOrdinal",
                  "evictedSegments",
                  "evictedBytes",
                  "pageNeedsBytes"
                ],
                "additionalProperties": false
              },
              "archivedThroughOrdinal": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "engineBaseCutoffOrdinal": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "lastRefusal": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "enum": [
                      "edjc_archive_prefix_missing",
                      "edjc_archive_prefix_unverifiable",
                      "edjc_archive_unreachable",
                      "edjc_archive_access_denied",
                      "edjc_archive_request_refused",
                      "edjc_archive_configuration_incomplete",
                      "edjc_archive_cache_unavailable",
                      "edjc_archive_cache_unprepared",
                      "edjc_archive_cache_unsafe",
                      "edjc_archive_base_unreadable",
                      "edjc_archive_base_unnamed",
                      "edjc_archive_page_request_invalid",
                      "edjc_archive_page_reader_failed",
                      "edjc_archive_page_unreadable"
                    ]
                  },
                  "reason": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      "archive_log_not_found",
                      "archive_log_ambiguous",
                      "archive_index_missing",
                      "archive_segments_not_contiguous",
                      "archive_indices_disagree",
                      "archive_prefix_short",
                      "archive_cache_bound_exceeded",
                      "archive_cache_unprepared",
                      "archive_cache_unsafe",
                      "archive_cache_foreign_entry",
                      "archive_configuration_incomplete",
                      "bucket_unreachable",
                      "bucket_access_denied",
                      "upload_refused",
                      "remote_digest_mismatch",
                      "remote_size_mismatch",
                      "remote_object_missing",
                      "read_back_mismatch",
                      "manifest_invalid",
                      "local_file_unreadable",
                      "snapshot_unreadable",
                      "archive_pass_failed",
                      "log_identity_unavailable",
                      "log_identity_search_in_progress",
                      "segment_release_failed",
                      null
                    ]
                  },
                  "atEpochMs": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  }
                },
                "required": [
                  "name",
                  "reason",
                  "atEpochMs"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "kind",
              "configuration",
              "invalidVariables",
              "verification",
              "pagesServed",
              "cache",
              "archivedThroughOrdinal",
              "engineBaseCutoffOrdinal",
              "lastRefusal"
            ],
            "additionalProperties": false
          },
          "edjcGroupPageRoute": {
            "type": "object",
            "properties": {
              "windowMs": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "pagesServed": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "recordsServed": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "maxPageMs": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "eventLoopMaxBlockMs": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "eventLoopBlockBudgetMs": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "topBlockCause": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "page_request",
                  "page_reply",
                  "page_response",
                  "readiness",
                  "mirror_watermark",
                  "mirror_read",
                  "mirror_proof",
                  "mirror_historical_proof",
                  "heap_reclaim_suspected",
                  "unattributed",
                  null
                ]
              },
              "externalBytes": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "externalDeltaBytes": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "rssBytes": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "peakRssBytes": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "heapUsedBytes": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "heapUsedDeltaBytes": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "maxHeapDropBytes": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "heapObjectDiagnostics": {
                "type": "object",
                "properties": {
                  "enabled": {
                    "type": "boolean"
                  },
                  "sampleCount": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 2
                  },
                  "sampleMaxMs": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "sampleTotalMs": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "firstHeapUsedBytes": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "lastHeapUsedBytes": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "growth": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "objectType": {
                          "type": "string",
                          "pattern": "^[A-Za-z][A-Za-z0-9_ ]{0,63}$"
                        },
                        "countGrowth": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "protectedCountGrowth": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "objectType",
                        "countGrowth",
                        "protectedCountGrowth"
                      ],
                      "additionalProperties": false
                    },
                    "maxItems": 5
                  }
                },
                "required": [
                  "enabled",
                  "sampleCount",
                  "sampleMaxMs",
                  "sampleTotalMs",
                  "firstHeapUsedBytes",
                  "lastHeapUsedBytes",
                  "growth"
                ],
                "additionalProperties": false
              },
              "gcPauseMaxMs": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "eventLoopUtilization": {
                "type": [
                  "number",
                  "null"
                ],
                "minimum": 0,
                "maximum": 1
              },
              "indexCheckpoints": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "indexFallbacks": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "lastIndexFallbackReason": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "edjc_page_index_segment_list_changed",
                  "edjc_page_index_marker_changed",
                  "edjc_page_index_chain_conflict",
                  null
                ]
              }
            },
            "required": [
              "windowMs",
              "pagesServed",
              "recordsServed",
              "maxPageMs",
              "eventLoopMaxBlockMs",
              "eventLoopBlockBudgetMs",
              "topBlockCause",
              "externalBytes",
              "externalDeltaBytes",
              "rssBytes",
              "peakRssBytes",
              "heapUsedBytes",
              "heapUsedDeltaBytes",
              "maxHeapDropBytes",
              "heapObjectDiagnostics",
              "gcPauseMaxMs",
              "eventLoopUtilization",
              "indexCheckpoints",
              "indexFallbacks",
              "lastIndexFallbackReason"
            ],
            "additionalProperties": false
          },
          "journalArchive": {
            "type": "object",
            "properties": {
              "leg": {
                "type": "string",
                "const": "journal_archive"
              },
              "enabled": {
                "type": "boolean"
              },
              "legState": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "archive_lag_exceeded",
                  "local_journal_bytes_exceeded",
                  null
                ]
              },
              "localBytes": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "segmentCount": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "oldestLocalOrdinal": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "volumeFreeBytes": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "archivedThroughOrdinal": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "snapshotArchivedCutoffOrdinal": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "releasedThroughOrdinal": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "releaseEligibleThroughOrdinal": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "releaseRefusal": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "release_disabled",
                  "no_sealed_segment",
                  "core_snapshots_not_retained",
                  "runtime_snapshots_not_retained",
                  "consumer_watermark_unproven",
                  "reader_base_unanchored",
                  "archive_prefix_unverified",
                  "archive_snapshots_unverified",
                  "archive_prefix_short_of_base",
                  "core_snapshot_cutoff_behind",
                  "runtime_snapshot_cutoff_behind",
                  "consumer_watermark_behind",
                  null
                ]
              },
              "release": {
                "type": "object",
                "properties": {
                  "enabled": {
                    "type": "boolean"
                  },
                  "pointOrdinal": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "minimum": 1,
                    "maximum": 9007199254740991
                  },
                  "binding": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      "core_snapshot",
                      "runtime_snapshot",
                      "consumers",
                      "archive_prefix",
                      null
                    ]
                  },
                  "gateRefusal": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      "release_disabled",
                      "no_sealed_segment",
                      "core_snapshots_not_retained",
                      "runtime_snapshots_not_retained",
                      "consumer_watermark_unproven",
                      "reader_base_unanchored",
                      "archive_prefix_unverified",
                      "archive_snapshots_unverified",
                      "archive_prefix_short_of_base",
                      "core_snapshot_cutoff_behind",
                      "runtime_snapshot_cutoff_behind",
                      "consumer_watermark_behind",
                      null
                    ]
                  },
                  "terms": {
                    "type": "object",
                    "properties": {
                      "coreSnapshot": {
                        "type": "object",
                        "properties": {
                          "retainFromOrdinal": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "retained": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "retainFromOrdinal",
                          "retained"
                        ],
                        "additionalProperties": false
                      },
                      "runtimeSnapshot": {
                        "type": "object",
                        "properties": {
                          "retainFromOrdinal": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "retained": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "retainFromOrdinal",
                          "retained"
                        ],
                        "additionalProperties": false
                      },
                      "consumers": {
                        "type": "object",
                        "properties": {
                          "retainFromOrdinal": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "bindingConsumer": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "pattern": "^[a-z0-9][a-z0-9:_./-]{0,127}$"
                          },
                          "bindingReason": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "enum": [
                              "cold_catch_up_from_genesis",
                              "archive_verified_prefix",
                              "open_page_walk",
                              "no_open_page_walk",
                              "standby_replicated_sequence",
                              "no_failure_domain",
                              "boot_faces_open_whole",
                              "boot_faces_open_from_cut",
                              "not_measured",
                              null
                            ]
                          },
                          "unproven": {
                            "type": "array",
                            "items": {
                              "type": "string",
                              "pattern": "^[a-z0-9][a-z0-9:_./-]{0,127}$"
                            },
                            "maxItems": 64
                          }
                        },
                        "required": [
                          "retainFromOrdinal",
                          "bindingConsumer",
                          "unproven"
                        ],
                        "additionalProperties": false
                      },
                      "archivePrefix": {
                        "type": "object",
                        "properties": {
                          "retainFromOrdinal": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "readerBaseCutoffOrdinal": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "minimum": 0,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "retainFromOrdinal",
                          "readerBaseCutoffOrdinal"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "required": [
                      "coreSnapshot",
                      "runtimeSnapshot",
                      "consumers",
                      "archivePrefix"
                    ],
                    "additionalProperties": false
                  },
                  "lagRecords": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "lastReleasedSegment": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "pattern": "^core-[0-9]{10}\\.log$"
                  },
                  "lastReleasedAtEpochMs": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "releasedSegments": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "releasedBytes": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  }
                },
                "required": [
                  "enabled",
                  "pointOrdinal",
                  "binding",
                  "gateRefusal",
                  "terms",
                  "lagRecords",
                  "lastReleasedSegment",
                  "lastReleasedAtEpochMs",
                  "releasedSegments",
                  "releasedBytes"
                ],
                "additionalProperties": false
              },
              "lagSegments": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "lagBytes": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "lastUploadAtEpochMs": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "lastError": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "archive_configuration_incomplete",
                  "bucket_unreachable",
                  "bucket_access_denied",
                  "upload_refused",
                  "remote_digest_mismatch",
                  "remote_size_mismatch",
                  "remote_object_missing",
                  "read_back_mismatch",
                  "manifest_invalid",
                  "local_file_unreadable",
                  "snapshot_unreadable",
                  "archive_pass_failed",
                  "log_identity_unavailable",
                  "log_identity_search_in_progress",
                  "segment_release_failed",
                  null
                ]
              },
              "identity": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "source": {
                    "type": "string",
                    "enum": [
                      "genesis_segment",
                      "identity_record",
                      "archive_snapshot"
                    ]
                  },
                  "record": {
                    "type": "string",
                    "enum": [
                      "recorded",
                      "record_failed"
                    ]
                  }
                },
                "required": [
                  "source",
                  "record"
                ],
                "additionalProperties": false
              },
              "bounds": {
                "type": "object",
                "properties": {
                  "lagSegments": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "localBytes": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  }
                },
                "required": [
                  "lagSegments",
                  "localBytes"
                ],
                "additionalProperties": false
              },
              "snapshots": {
                "type": "object",
                "properties": {
                  "core": {
                    "type": "object",
                    "properties": {
                      "retained": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "bytes": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "oldestCutoffOrdinal": {
                        "type": [
                          "integer",
                          "null"
                        ],
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "newestCutoffOrdinal": {
                        "type": [
                          "integer",
                          "null"
                        ],
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "prunedAtStart": {
                        "type": [
                          "object",
                          "null"
                        ],
                        "properties": {
                          "links": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "releasedBytes": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "links",
                          "releasedBytes"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "required": [
                      "retained",
                      "bytes",
                      "oldestCutoffOrdinal",
                      "newestCutoffOrdinal"
                    ],
                    "additionalProperties": false
                  },
                  "runtime": {
                    "type": "object",
                    "properties": {
                      "directoryState": {
                        "type": "string",
                        "enum": [
                          "store_not_composed",
                          "directory_missing",
                          "directory_empty",
                          "bundles_present"
                        ]
                      },
                      "retained": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "bytes": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "oldestCutoffSequence": {
                        "type": [
                          "integer",
                          "null"
                        ],
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "newestCutoffSequence": {
                        "type": [
                          "integer",
                          "null"
                        ],
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "archivedCutoffSequence": {
                        "type": [
                          "integer",
                          "null"
                        ],
                        "minimum": 0,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "directoryState",
                      "retained",
                      "bytes",
                      "oldestCutoffSequence",
                      "newestCutoffSequence",
                      "archivedCutoffSequence"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "core",
                  "runtime"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "leg",
              "enabled",
              "legState",
              "localBytes",
              "segmentCount",
              "oldestLocalOrdinal",
              "volumeFreeBytes",
              "archivedThroughOrdinal",
              "snapshotArchivedCutoffOrdinal",
              "releasedThroughOrdinal",
              "releaseEligibleThroughOrdinal",
              "releaseRefusal",
              "release",
              "lagSegments",
              "lagBytes",
              "lastUploadAtEpochMs",
              "lastError",
              "identity",
              "bounds"
            ],
            "additionalProperties": false
          },
          "edjcReleaseWatermarks": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "const": "edjc_release_watermark/v1"
                },
                "consumer": {
                  "type": "string",
                  "enum": [
                    "worker_cold_catch_up",
                    "engine_edjc_read_route",
                    "replication",
                    "engine_boot_faces"
                  ]
                },
                "state": {
                  "type": "string",
                  "enum": [
                    "holding",
                    "idle",
                    "unproven"
                  ]
                },
                "reason": {
                  "type": "string",
                  "enum": [
                    "cold_catch_up_from_genesis",
                    "archive_verified_prefix",
                    "open_page_walk",
                    "no_open_page_walk",
                    "standby_replicated_sequence",
                    "no_failure_domain",
                    "boot_faces_open_whole",
                    "boot_faces_open_from_cut",
                    "not_measured"
                  ]
                },
                "retainFromOrdinal": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "exclusiveMinimum": 0,
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                },
                "checkpointOrdinal": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                },
                "logBase": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "enum": [
                    "snapshot_anchored",
                    "journal_empty",
                    "snapshot_not_anchorable",
                    "anchor_not_on_log",
                    null
                  ]
                }
              },
              "required": [
                "kind",
                "consumer",
                "state",
                "reason",
                "retainFromOrdinal",
                "checkpointOrdinal",
                "logBase"
              ],
              "additionalProperties": false
            },
            "maxItems": 4
          },
          "runtimeSnapshot": {
            "type": "object",
            "properties": {
              "leg": {
                "type": "string",
                "const": "runtime_snapshot"
              },
              "storeKind": {
                "type": "string",
                "enum": [
                  "volatile",
                  "file"
                ]
              },
              "cadenceRecords": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "maxAgeMs": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "lastCutoffSequence": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "lastWriteAtEpochMs": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "lastWriteDurationMs": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "writeInFlight": {
                "type": "boolean"
              },
              "retainedSnapshots": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "retainBound": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "lastError": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "snapshot_source_unavailable",
                  "snapshot_directory_unwritable",
                  "snapshot_schema_invalid",
                  "snapshot_write_unverified",
                  "snapshot_write_failed",
                  "snapshot_tip_unreadable",
                  null
                ]
              },
              "boot": {
                "type": "object",
                "properties": {
                  "mode": {
                    "type": "string",
                    "enum": [
                      "full_replay",
                      "snapshot"
                    ]
                  },
                  "reason": {
                    "type": "string",
                    "enum": [
                      "snapshot_restored",
                      "snapshot_not_attempted",
                      "snapshot_restore_disabled",
                      "journal_disabled",
                      "journal_empty",
                      "snapshot_missing",
                      "snapshot_truncated",
                      "snapshot_checksum_mismatch",
                      "snapshot_domain_unknown",
                      "snapshot_trailing_bytes",
                      "snapshot_anchor_count_out_of_domain",
                      "snapshot_undecodable",
                      "snapshot_anchor_invalid",
                      "snapshot_ahead_of_log",
                      "snapshot_cutoff_digest_mismatch",
                      "snapshot_limits_mismatch",
                      "snapshot_side_tables_missing",
                      "snapshot_side_tables_malformed",
                      "snapshot_side_tables_digest_mismatch",
                      "snapshot_side_tables_unbound",
                      "snapshot_restore_refused",
                      "snapshot_state_hash_mismatch",
                      "snapshot_side_tables_mismatch",
                      "snapshot_cutoff_mid_group"
                    ]
                  },
                  "restoreEnabled": {
                    "type": "boolean"
                  },
                  "cutoffSequence": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "tailRecords": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "cause": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "properties": {
                      "class": {
                        "type": "string",
                        "enum": [
                          "snapshot_schema_invalid",
                          "snapshot_version_mismatch",
                          "snapshot_read_failed",
                          "snapshot_checksum_mismatch"
                        ]
                      },
                      "detail": {
                        "type": "string",
                        "maxLength": 240
                      }
                    },
                    "required": [
                      "class",
                      "detail"
                    ],
                    "additionalProperties": false
                  },
                  "skipped": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "cutoffSequence": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "reason": {
                          "type": "string",
                          "enum": [
                            "snapshot_restored",
                            "snapshot_not_attempted",
                            "snapshot_restore_disabled",
                            "journal_disabled",
                            "journal_empty",
                            "snapshot_missing",
                            "snapshot_truncated",
                            "snapshot_checksum_mismatch",
                            "snapshot_domain_unknown",
                            "snapshot_trailing_bytes",
                            "snapshot_anchor_count_out_of_domain",
                            "snapshot_undecodable",
                            "snapshot_anchor_invalid",
                            "snapshot_ahead_of_log",
                            "snapshot_cutoff_digest_mismatch",
                            "snapshot_limits_mismatch",
                            "snapshot_side_tables_missing",
                            "snapshot_side_tables_malformed",
                            "snapshot_side_tables_digest_mismatch",
                            "snapshot_side_tables_unbound",
                            "snapshot_restore_refused",
                            "snapshot_state_hash_mismatch",
                            "snapshot_side_tables_mismatch",
                            "snapshot_cutoff_mid_group"
                          ]
                        },
                        "cause": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "properties": {
                            "class": {
                              "type": "string",
                              "enum": [
                                "snapshot_schema_invalid",
                                "snapshot_version_mismatch",
                                "snapshot_read_failed",
                                "snapshot_checksum_mismatch"
                              ]
                            },
                            "detail": {
                              "type": "string",
                              "maxLength": 240
                            }
                          },
                          "required": [
                            "class",
                            "detail"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "cutoffSequence",
                        "reason",
                        "cause"
                      ],
                      "additionalProperties": false
                    },
                    "maxItems": 64
                  },
                  "skippedOmitted": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  }
                },
                "required": [
                  "mode",
                  "reason",
                  "restoreEnabled",
                  "cutoffSequence",
                  "tailRecords",
                  "cause",
                  "skipped",
                  "skippedOmitted"
                ],
                "additionalProperties": false
              },
              "bootCapture": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "enum": [
                      "not_due",
                      "pending",
                      "captured",
                      "abandoned",
                      "refused",
                      "failed"
                    ]
                  },
                  "reason": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      "tail_within_cadence",
                      "store_volatile",
                      "sequencer_busy",
                      "source_unbound",
                      "journal_empty",
                      "record_hash_missing",
                      "write_failed",
                      "tip_unreadable",
                      "risk_face_writing",
                      "risk_marker_unwritten",
                      "withdrawal_gateway_face_writing",
                      "trigger_lifecycle_face_writing",
                      "trigger_keeper_busy",
                      "core_mirror_audit_pending",
                      "market_data_face_writing",
                      "native_funding_writing",
                      null
                    ]
                  },
                  "cutoffSequence": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "rounds": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  }
                },
                "required": [
                  "status",
                  "reason",
                  "cutoffSequence",
                  "rounds"
                ],
                "additionalProperties": false
              },
              "settledOrdinal": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "lastCutAgeMs": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "cutHeld": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "no_main_row_above_cut",
                  null
                ]
              }
            },
            "required": [
              "leg",
              "storeKind",
              "cadenceRecords",
              "lastCutoffSequence",
              "lastWriteAtEpochMs",
              "lastWriteDurationMs",
              "writeInFlight",
              "retainedSnapshots",
              "retainBound",
              "lastError",
              "boot"
            ],
            "additionalProperties": false
          },
          "marketDataFace": {
            "type": "object",
            "properties": {
              "leg": {
                "type": "string",
                "const": "market_data_face"
              },
              "foldState": {
                "type": "string",
                "enum": [
                  "folding",
                  "frozen",
                  "contradicted"
                ]
              },
              "legState": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "market_data_face_contradicted",
                  null
                ]
              },
              "frozenFaceCut": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "breach": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "laterOfferOrdinal": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "earlierOfferOrdinal": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  }
                },
                "required": [
                  "laterOfferOrdinal",
                  "earlierOfferOrdinal"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "leg",
              "foldState",
              "legState",
              "frozenFaceCut",
              "breach"
            ],
            "additionalProperties": false
          },
          "coreTreasury": {
            "type": "object",
            "properties": {
              "installed": {
                "type": "boolean"
              },
              "accountId": {
                "type": "string",
                "minLength": 1
              },
              "lastRefusal": {
                "type": [
                  "string",
                  "null"
                ],
                "minLength": 1
              }
            },
            "required": [
              "installed",
              "accountId",
              "lastRefusal"
            ],
            "additionalProperties": false
          },
          "riskAccountingMarker": {
            "type": "object",
            "properties": {
              "markerOrdinal": {
                "type": [
                  "integer",
                  "null"
                ],
                "exclusiveMinimum": 0
              },
              "lastRefusal": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "reason": {
                    "type": "string",
                    "enum": [
                      "front_not_bound",
                      "admission_refused_closed",
                      "admission_failed"
                    ]
                  },
                  "detail": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "reason",
                  "detail"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "markerOrdinal",
              "lastRefusal"
            ],
            "additionalProperties": false
          },
          "recoveryCutoff": {
            "type": "object",
            "properties": {
              "state": {
                "type": "string",
                "enum": [
                  "present",
                  "admission_pending",
                  "maintenance_required",
                  "locating",
                  "generation_conflict"
                ]
              },
              "cutoffOrdinal": {
                "type": [
                  "integer",
                  "null"
                ],
                "exclusiveMinimum": 0
              },
              "lastRefusal": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "reason": {
                    "type": "string",
                    "enum": [
                      "front_not_bound",
                      "accounting_epoch_missing",
                      "native_prefix_required",
                      "retries_exhausted",
                      "outcome_unresolved",
                      "existing_record_conflict",
                      "recovery_metadata_gate_unset",
                      "recovery_cutoff_table_unknown",
                      "admission_failed"
                    ]
                  }
                },
                "required": [
                  "reason"
                ],
                "additionalProperties": false
              },
              "announced": {
                "type": "boolean"
              }
            },
            "required": [
              "state",
              "cutoffOrdinal",
              "lastRefusal",
              "announced"
            ],
            "additionalProperties": false
          },
          "bunFundingEngine": {
            "type": "object",
            "properties": {
              "composed": {
                "type": "boolean"
              },
              "leg": {
                "type": "string",
                "const": "funding_engine"
              },
              "settlement": {
                "type": "string",
                "enum": [
                  "bun_risk_engine",
                  "native_core"
                ]
              },
              "lastAppliedPeriods": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "marketId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "checkpointSequence": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "lastTickEpochMs": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "exclusiveMinimum": 0
                    },
                    "recordedAnchorEpochMs": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "exclusiveMinimum": 0
                    }
                  },
                  "required": [
                    "marketId",
                    "checkpointSequence",
                    "lastTickEpochMs",
                    "recordedAnchorEpochMs"
                  ],
                  "additionalProperties": false
                }
              },
              "lastRefusal": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "funding_checkpoint_invalid",
                  "funding_checkpoint_retry_conflict",
                  "funding_checkpoint_stale",
                  "funding_checkpoint_out_of_sequence",
                  "funding_cumulative_index_mismatch",
                  "funding_period_missed",
                  "funding_period_overlap",
                  "funding_period_not_contiguous",
                  "funding_gap_anchor_mismatch",
                  "funding_gap_invalid",
                  "funding_gap_start_mismatch",
                  "funding_settlement_record_too_large",
                  "native_funding_not_enabled",
                  "funding_gap_cadence_mismatch",
                  "engine_transport_unavailable",
                  "native_funding_reply_unreadable",
                  null
                ]
              }
            },
            "required": [
              "composed",
              "leg",
              "settlement",
              "lastAppliedPeriods",
              "lastRefusal"
            ],
            "additionalProperties": false
          },
          "mainCommandChain": {
            "type": "string",
            "enum": [
              "core_digest",
              "bun_command_hash"
            ]
          },
          "coreMirror": {
            "type": "object",
            "properties": {
              "enabled": {
                "type": "boolean"
              },
              "mirroredOrdinal": {
                "type": "integer",
                "minimum": 0
              },
              "edjcTipOrdinal": {
                "type": "integer",
                "minimum": 0
              },
              "lastRefusal": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "reason": {
                    "type": "string",
                    "enum": [
                      "duplicate_ordinal",
                      "chain_broken",
                      "ordinal_gap",
                      "derivation_refused",
                      "append_rejected",
                      "lifecycle_unbound"
                    ]
                  },
                  "ordinal": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "stage": {
                    "type": "string",
                    "enum": [
                      "history_audit",
                      "tail"
                    ]
                  },
                  "detail": {
                    "type": "string"
                  }
                },
                "required": [
                  "reason",
                  "ordinal",
                  "stage",
                  "detail"
                ],
                "additionalProperties": false
              },
              "waiting": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "reason": {
                    "type": "string",
                    "enum": [
                      "sequencer_not_ready",
                      "journal_append_refused",
                      "committed_prefix_unavailable",
                      "committed_prefix_pending",
                      "committed_prefix_local_behind"
                    ]
                  },
                  "stage": {
                    "type": "string",
                    "enum": [
                      "history_audit",
                      "tail"
                    ]
                  },
                  "ordinal": {
                    "type": "integer",
                    "exclusiveMinimum": 0
                  },
                  "sequencerStatus": {
                    "type": "string",
                    "enum": [
                      "replaying",
                      "trading_ready",
                      "journal_unavailable",
                      "unhealthy"
                    ]
                  },
                  "sinceEpochMs": {
                    "type": "integer",
                    "exclusiveMinimum": 0
                  },
                  "ageMs": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "attempts": {
                    "type": "integer",
                    "exclusiveMinimum": 0
                  }
                },
                "required": [
                  "reason",
                  "stage",
                  "ordinal",
                  "sequencerStatus",
                  "sinceEpochMs",
                  "ageMs",
                  "attempts"
                ],
                "additionalProperties": false
              },
              "historyAudit": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "cursorOrdinal": {
                    "type": "integer",
                    "exclusiveMinimum": 0
                  },
                  "throughOrdinal": {
                    "type": "integer",
                    "exclusiveMinimum": 0
                  },
                  "sinceEpochMs": {
                    "type": "integer",
                    "exclusiveMinimum": 0
                  },
                  "ageMs": {
                    "type": "integer",
                    "minimum": 0
                  }
                },
                "required": [
                  "cursorOrdinal",
                  "throughOrdinal",
                  "sinceEpochMs",
                  "ageMs"
                ],
                "additionalProperties": false
              },
              "lastPollAtEpochMs": {
                "type": [
                  "integer",
                  "null"
                ],
                "exclusiveMinimum": 0
              },
              "mirroredSinceStart": {
                "type": "integer",
                "minimum": 0
              },
              "settleObserverFailures": {
                "type": "integer",
                "minimum": 0
              }
            },
            "required": [
              "enabled",
              "mirroredOrdinal",
              "edjcTipOrdinal",
              "lastRefusal",
              "waiting",
              "lastPollAtEpochMs",
              "mirroredSinceStart"
            ],
            "additionalProperties": false
          },
          "marketData": {
            "type": "object",
            "properties": {
              "streams": {
                "type": "object",
                "additionalProperties": {
                  "type": "object",
                  "properties": {
                    "degraded": {
                      "type": "boolean"
                    },
                    "reconnectAttempts": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "lastReason": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "enum": [
                        "network_refused",
                        "timeout",
                        "auth_rejected",
                        "exchange_unavailable",
                        "unknown",
                        null
                      ]
                    },
                    "refusedObservations": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "refusedObservationsByReason": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      }
                    },
                    "exchanges": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "object",
                        "properties": {
                          "degraded": {
                            "type": "boolean"
                          },
                          "reconnectAttempts": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "lastReason": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "enum": [
                              "network_refused",
                              "timeout",
                              "auth_rejected",
                              "exchange_unavailable",
                              "unknown",
                              null
                            ]
                          },
                          "refusedObservations": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "connected": {
                            "type": "boolean"
                          },
                          "lastAdmissibleObservationAgeMs": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "refusedObservationsByReason": {
                            "type": "object",
                            "additionalProperties": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            }
                          }
                        },
                        "required": [
                          "degraded",
                          "reconnectAttempts",
                          "lastReason",
                          "refusedObservations",
                          "connected",
                          "lastAdmissibleObservationAgeMs",
                          "refusedObservationsByReason"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "degraded",
                    "reconnectAttempts",
                    "lastReason",
                    "refusedObservations"
                  ],
                  "additionalProperties": false
                }
              },
              "referenceQuorum": {
                "type": "object",
                "additionalProperties": {
                  "type": "object",
                  "properties": {
                    "state": {
                      "type": "string",
                      "enum": [
                        "met",
                        "missing"
                      ]
                    },
                    "surviving": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "required": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "sinceEpochMs": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "missingTransitions": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "state",
                    "surviving",
                    "required",
                    "sinceEpochMs",
                    "missingTransitions"
                  ],
                  "additionalProperties": false
                }
              },
              "markFreshness": {
                "type": "object",
                "additionalProperties": {
                  "type": "object",
                  "properties": {
                    "state": {
                      "type": "string",
                      "enum": [
                        "fresh",
                        "awaiting_first_admission",
                        "stale",
                        "session_closed"
                      ]
                    },
                    "lastAdmittedAtEpochMs": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "ageMs": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "boundMs": {
                      "type": "integer",
                      "exclusiveMinimum": 0,
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "state",
                    "lastAdmittedAtEpochMs",
                    "ageMs",
                    "boundMs"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "streams"
            ],
            "additionalProperties": false
          },
          "chainlinkAdmission": {
            "type": "object",
            "properties": {
              "pending": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "symbol": {
                      "type": "string",
                      "minLength": 1
                    },
                    "state": {
                      "type": "string",
                      "enum": [
                        "admission_reset_pending"
                      ]
                    }
                  },
                  "required": [
                    "symbol",
                    "state"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "pending"
            ],
            "additionalProperties": false
          },
          "fixAcceptor": {
            "type": "object",
            "properties": {
              "state": {
                "type": "string",
                "enum": [
                  "stub"
                ]
              },
              "blockedReason": {
                "type": "string",
                "enum": [
                  "counterparty_technology_decision_required"
                ]
              }
            },
            "required": [
              "state",
              "blockedReason"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "service",
          "status",
          "degradedState",
          "journalSequence",
          "runtimePolicyVersion"
        ],
        "additionalProperties": false
      },
      "ExternalAffiliateAvailabilityResponse": {
        "type": "object",
        "properties": {
          "version": {
            "type": "string",
            "const": "external-affiliate-availability/v1"
          },
          "enabled": {
            "type": "boolean"
          },
          "policyVersion": {
            "type": "string",
            "minLength": 1
          }
        },
        "required": [
          "version",
          "enabled",
          "policyVersion"
        ],
        "additionalProperties": false
      },
      "ExternalPlaceOrderRequest": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "accountId": {
                "type": "string",
                "minLength": 1
              },
              "marketId": {
                "type": "string",
                "minLength": 1
              },
              "clientOrderId": {
                "type": "string",
                "minLength": 1
              },
              "side": {
                "type": "string",
                "enum": [
                  "buy",
                  "sell"
                ]
              },
              "reduceOnly": {
                "type": "boolean"
              },
              "leverageX": {
                "type": "integer",
                "minimum": 1
              },
              "autoClose": {
                "type": "object",
                "properties": {
                  "takeProfitPriceAtoms": {
                    "type": "string",
                    "pattern": "^[1-9][0-9]*$"
                  },
                  "stopLossPriceAtoms": {
                    "type": "string",
                    "pattern": "^[1-9][0-9]*$"
                  }
                },
                "additionalProperties": false
              },
              "orderType": {
                "type": "string",
                "const": "market"
              },
              "quantity": {
                "type": "string",
                "pattern": "^[0-9]+(?:\\.[0-9]+)?$"
              }
            },
            "required": [
              "accountId",
              "marketId",
              "clientOrderId",
              "side",
              "orderType",
              "quantity"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "accountId": {
                "type": "string",
                "minLength": 1
              },
              "marketId": {
                "type": "string",
                "minLength": 1
              },
              "clientOrderId": {
                "type": "string",
                "minLength": 1
              },
              "side": {
                "type": "string",
                "enum": [
                  "buy",
                  "sell"
                ]
              },
              "reduceOnly": {
                "type": "boolean"
              },
              "leverageX": {
                "type": "integer",
                "minimum": 1
              },
              "autoClose": {
                "type": "object",
                "properties": {
                  "takeProfitPriceAtoms": {
                    "type": "string",
                    "pattern": "^[1-9][0-9]*$"
                  },
                  "stopLossPriceAtoms": {
                    "type": "string",
                    "pattern": "^[1-9][0-9]*$"
                  }
                },
                "additionalProperties": false
              },
              "orderType": {
                "type": "string",
                "const": "market"
              },
              "notional": {
                "type": "string",
                "pattern": "^[0-9]+(?:\\.[0-9]+)?$"
              }
            },
            "required": [
              "accountId",
              "marketId",
              "clientOrderId",
              "side",
              "orderType",
              "notional"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "accountId": {
                "type": "string",
                "minLength": 1
              },
              "marketId": {
                "type": "string",
                "minLength": 1
              },
              "clientOrderId": {
                "type": "string",
                "minLength": 1
              },
              "side": {
                "type": "string",
                "enum": [
                  "buy",
                  "sell"
                ]
              },
              "reduceOnly": {
                "type": "boolean"
              },
              "leverageX": {
                "type": "integer",
                "minimum": 1
              },
              "autoClose": {
                "type": "object",
                "properties": {
                  "takeProfitPriceAtoms": {
                    "type": "string",
                    "pattern": "^[1-9][0-9]*$"
                  },
                  "stopLossPriceAtoms": {
                    "type": "string",
                    "pattern": "^[1-9][0-9]*$"
                  }
                },
                "additionalProperties": false
              },
              "orderType": {
                "type": "string",
                "const": "limit"
              },
              "price": {
                "type": "string",
                "pattern": "^[0-9]+(?:\\.[0-9]+)?$"
              },
              "quantity": {
                "type": "string",
                "pattern": "^[0-9]+(?:\\.[0-9]+)?$"
              },
              "postOnly": {
                "type": "boolean"
              }
            },
            "required": [
              "accountId",
              "marketId",
              "clientOrderId",
              "side",
              "orderType",
              "price",
              "quantity"
            ],
            "additionalProperties": false
          }
        ]
      },
      "ExternalOrderResponse": {
        "type": "object",
        "properties": {
          "version": {
            "type": "string",
            "const": "external-order/v1"
          },
          "orderId": {
            "type": "string",
            "minLength": 1
          },
          "accountId": {
            "type": "string",
            "minLength": 1
          },
          "marketId": {
            "type": "string",
            "minLength": 1
          },
          "status": {
            "type": "string",
            "enum": [
              "open",
              "partially_filled",
              "filled",
              "canceled",
              "replaced"
            ]
          },
          "lastSequence": {
            "type": "integer",
            "minimum": 0
          },
          "idempotencyKey": {
            "type": "string",
            "minLength": 1
          },
          "cancelReason": {
            "type": "string",
            "enum": [
              "margin_unbacked",
              "risk_evidence_incomplete",
              "market_session_closed",
              "reduce_only_position_unavailable"
            ]
          }
        },
        "required": [
          "version",
          "orderId",
          "accountId",
          "marketId",
          "status",
          "lastSequence",
          "idempotencyKey"
        ],
        "additionalProperties": false
      },
      "ExternalBatchLimitOrderRequest": {
        "type": "object",
        "properties": {
          "orders": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "accountId": {
                  "type": "string",
                  "minLength": 1
                },
                "marketId": {
                  "type": "string",
                  "minLength": 1
                },
                "clientOrderId": {
                  "type": "string",
                  "minLength": 1
                },
                "side": {
                  "type": "string",
                  "enum": [
                    "buy",
                    "sell"
                  ]
                },
                "reduceOnly": {
                  "type": "boolean"
                },
                "leverageX": {
                  "type": "integer",
                  "minimum": 1
                },
                "autoClose": {
                  "type": "object",
                  "properties": {
                    "takeProfitPriceAtoms": {
                      "type": "string",
                      "pattern": "^[1-9][0-9]*$"
                    },
                    "stopLossPriceAtoms": {
                      "type": "string",
                      "pattern": "^[1-9][0-9]*$"
                    }
                  },
                  "additionalProperties": false
                },
                "orderType": {
                  "type": "string",
                  "const": "limit"
                },
                "price": {
                  "type": "string",
                  "pattern": "^[0-9]+(?:\\.[0-9]+)?$"
                },
                "quantity": {
                  "type": "string",
                  "pattern": "^[0-9]+(?:\\.[0-9]+)?$"
                },
                "postOnly": {
                  "type": "boolean"
                }
              },
              "required": [
                "accountId",
                "marketId",
                "clientOrderId",
                "side",
                "orderType",
                "price",
                "quantity"
              ],
              "additionalProperties": false
            },
            "minItems": 1,
            "maxItems": 32
          }
        },
        "required": [
          "orders"
        ],
        "additionalProperties": false
      },
      "ExternalBatchLimitOrderResponse": {
        "type": "object",
        "properties": {
          "version": {
            "type": "string",
            "const": "external-limit-order-batch/v1"
          },
          "outcomes": {
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "type": "object",
                  "properties": {
                    "index": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "accepted": {
                      "type": "boolean",
                      "const": true
                    },
                    "orderId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "accountId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "marketId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "open",
                        "partially_filled",
                        "filled",
                        "canceled",
                        "replaced"
                      ]
                    },
                    "lastSequence": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "idempotencyKey": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "required": [
                    "index",
                    "accepted",
                    "orderId",
                    "accountId",
                    "marketId",
                    "status",
                    "lastSequence",
                    "idempotencyKey"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "index": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "accepted": {
                      "type": "boolean",
                      "const": false
                    },
                    "reasonCode": {
                      "type": "string",
                      "enum": [
                        "malformed_command",
                        "malformed_order_command",
                        "unsupported_order_command",
                        "duplicate_order_command",
                        "idempotency_key_conflict",
                        "unknown_market",
                        "unknown_order",
                        "invalid_account",
                        "invalid_side",
                        "invalid_order_id",
                        "invalid_order_type",
                        "market_order_unavailable",
                        "invalid_price",
                        "invalid_quantity",
                        "invalid_leverage",
                        "invalid_slippage",
                        "market_halted",
                        "duplicate_order_id",
                        "market_not_open",
                        "market_session_closed",
                        "market_pre_close_cutoff",
                        "reduce_only_required",
                        "reduce_only_position_unavailable",
                        "self_trade_prevented",
                        "post_only_would_cross",
                        "max_matches_exceeded",
                        "risk_reserve_unavailable",
                        "invalid_status_transition",
                        "sequencer_rejected",
                        "unknown_margin_account",
                        "invalid_order_size",
                        "withdrawals_blocked",
                        "liquidation_candidate",
                        "bad_debt",
                        "insufficient_margin",
                        "leverage_exceeds_market_max",
                        "reserve_id_conflict",
                        "unknown_reserve",
                        "mark_unavailable",
                        "insufficient_liquidity",
                        "invalid_preview_request",
                        "order_rejected_unmapped"
                      ]
                    },
                    "field": {
                      "type": "string",
                      "minLength": 1
                    },
                    "safeMessage": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "required": [
                    "index",
                    "accepted",
                    "reasonCode",
                    "field",
                    "safeMessage"
                  ],
                  "additionalProperties": false
                }
              ]
            },
            "minItems": 1,
            "maxItems": 32
          }
        },
        "required": [
          "version",
          "outcomes"
        ],
        "additionalProperties": false
      },
      "ExternalBatchCancelOrderRequest": {
        "type": "object",
        "properties": {
          "orders": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "accountId": {
                  "type": "string",
                  "minLength": 1
                },
                "marketId": {
                  "type": "string",
                  "minLength": 1
                },
                "orderId": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "required": [
                "accountId",
                "marketId",
                "orderId"
              ],
              "additionalProperties": false
            },
            "minItems": 1,
            "maxItems": 24
          }
        },
        "required": [
          "orders"
        ],
        "additionalProperties": false
      },
      "ExternalBatchCancelOrderResponse": {
        "type": "object",
        "properties": {
          "version": {
            "type": "string",
            "const": "external-cancel-order-batch/v1"
          },
          "outcomes": {
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "type": "object",
                  "properties": {
                    "index": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "accepted": {
                      "type": "boolean",
                      "const": true
                    },
                    "orderId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "accountId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "marketId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "open",
                        "partially_filled",
                        "filled",
                        "canceled",
                        "replaced"
                      ]
                    },
                    "lastSequence": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "idempotencyKey": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "required": [
                    "index",
                    "accepted",
                    "orderId",
                    "accountId",
                    "marketId",
                    "status",
                    "lastSequence",
                    "idempotencyKey"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "index": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "accepted": {
                      "type": "boolean",
                      "const": false
                    },
                    "reasonCode": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "malformed_command",
                            "malformed_order_command",
                            "unsupported_order_command",
                            "duplicate_order_command",
                            "idempotency_key_conflict",
                            "invalid_side",
                            "invalid_order_id",
                            "invalid_order_type",
                            "market_order_unavailable",
                            "invalid_price",
                            "invalid_quantity",
                            "invalid_leverage",
                            "invalid_slippage",
                            "market_halted",
                            "duplicate_order_id",
                            "market_not_open",
                            "market_session_closed",
                            "market_pre_close_cutoff",
                            "reduce_only_required",
                            "reduce_only_position_unavailable",
                            "self_trade_prevented",
                            "post_only_would_cross",
                            "max_matches_exceeded",
                            "risk_reserve_unavailable",
                            "sequencer_rejected",
                            "unknown_margin_account",
                            "invalid_order_size",
                            "withdrawals_blocked",
                            "liquidation_candidate",
                            "bad_debt",
                            "insufficient_margin",
                            "leverage_exceeds_market_max",
                            "reserve_id_conflict",
                            "unknown_reserve",
                            "mark_unavailable",
                            "insufficient_liquidity",
                            "invalid_preview_request",
                            "order_rejected_unmapped"
                          ]
                        },
                        {
                          "type": "string",
                          "const": "not_found"
                        }
                      ]
                    },
                    "field": {
                      "type": "string",
                      "minLength": 1
                    },
                    "safeMessage": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "required": [
                    "index",
                    "accepted",
                    "reasonCode",
                    "field",
                    "safeMessage"
                  ],
                  "additionalProperties": false
                }
              ]
            },
            "minItems": 1,
            "maxItems": 24
          }
        },
        "required": [
          "version",
          "outcomes"
        ],
        "additionalProperties": false
      },
      "ExternalOrderPreviewRequest": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "accountId": {
                "type": "string",
                "minLength": 1
              },
              "marketId": {
                "type": "string",
                "minLength": 1
              },
              "side": {
                "type": "string",
                "enum": [
                  "buy",
                  "sell"
                ]
              },
              "leverageX": {
                "type": "integer",
                "minimum": 1
              },
              "reduceOnly": {
                "type": "boolean"
              },
              "orderType": {
                "type": "string",
                "const": "market"
              },
              "quantityAtoms": {
                "type": "string",
                "pattern": "^[1-9][0-9]*$"
              },
              "notionalAtoms": {
                "type": "string",
                "pattern": "^[1-9][0-9]*$"
              }
            },
            "required": [
              "accountId",
              "marketId",
              "side",
              "orderType"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "accountId": {
                "type": "string",
                "minLength": 1
              },
              "marketId": {
                "type": "string",
                "minLength": 1
              },
              "side": {
                "type": "string",
                "enum": [
                  "buy",
                  "sell"
                ]
              },
              "leverageX": {
                "type": "integer",
                "minimum": 1
              },
              "reduceOnly": {
                "type": "boolean"
              },
              "orderType": {
                "type": "string",
                "const": "limit"
              },
              "quantityAtoms": {
                "type": "string",
                "pattern": "^[1-9][0-9]*$"
              },
              "priceAtoms": {
                "type": "string",
                "pattern": "^[1-9][0-9]*$"
              },
              "postOnly": {
                "type": "boolean"
              }
            },
            "required": [
              "accountId",
              "marketId",
              "side",
              "orderType",
              "quantityAtoms",
              "priceAtoms"
            ],
            "additionalProperties": false
          }
        ]
      },
      "ExternalOrderPreviewResponse": {
        "type": "object",
        "properties": {
          "version": {
            "type": "string",
            "const": "external-order-preview/v1"
          },
          "accountId": {
            "type": "string",
            "minLength": 1
          },
          "marketId": {
            "type": "string",
            "minLength": 1
          },
          "side": {
            "type": "string",
            "enum": [
              "buy",
              "sell"
            ]
          },
          "orderType": {
            "type": "string",
            "enum": [
              "limit",
              "market"
            ]
          },
          "quantityAtoms": {
            "type": "string",
            "pattern": "^[1-9][0-9]*$"
          },
          "quantity": {
            "type": "string",
            "pattern": "^-?[0-9]+\\.[0-9]+$"
          },
          "notionalAtoms": {
            "type": "string",
            "pattern": "^[1-9][0-9]*$"
          },
          "notional": {
            "type": "string",
            "pattern": "^-?[0-9]+\\.[0-9]+$"
          },
          "estimatedEntryPriceAtoms": {
            "type": "string",
            "pattern": "^[1-9][0-9]*$"
          },
          "estimatedEntryPrice": {
            "type": "string",
            "pattern": "^-?[0-9]+\\.[0-9]+$"
          },
          "estimatedSlippageBps": {
            "type": "integer",
            "minimum": 0
          },
          "wouldExceedMaxSlippage": {
            "type": "boolean"
          },
          "requiredMarginAtoms": {
            "type": "string",
            "pattern": "^[0-9]+$"
          },
          "requiredMargin": {
            "type": "string",
            "pattern": "^-?[0-9]+\\.[0-9]+$"
          },
          "estimatedFeeAtoms": {
            "type": "string",
            "pattern": "^[0-9]+$"
          },
          "estimatedFee": {
            "type": "string",
            "pattern": "^-?[0-9]+\\.[0-9]+$"
          },
          "feeRole": {
            "type": "string",
            "enum": [
              "maker",
              "taker"
            ]
          },
          "estimatedLiquidationPriceAtoms": {
            "type": "string",
            "pattern": "^[0-9]+$"
          },
          "estimatedLiquidationPrice": {
            "type": "string",
            "pattern": "^-?[0-9]+\\.[0-9]+$"
          },
          "maintenanceMarginBps": {
            "type": "integer",
            "minimum": 0
          },
          "availableForOrdersAtoms": {
            "type": "string",
            "pattern": "^[0-9]+$"
          },
          "availableForOrders": {
            "type": "string",
            "pattern": "^-?[0-9]+\\.[0-9]+$"
          },
          "sufficient": {
            "type": "boolean"
          },
          "asOf": {
            "type": "object",
            "properties": {
              "markPriceAtoms": {
                "type": "string",
                "pattern": "^[1-9][0-9]*$"
              },
              "markPrice": {
                "type": "string",
                "pattern": "^-?[0-9]+\\.[0-9]+$"
              },
              "journalSequence": {
                "type": "integer",
                "minimum": 0
              }
            },
            "required": [
              "markPriceAtoms",
              "markPrice",
              "journalSequence"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "version",
          "accountId",
          "marketId",
          "side",
          "orderType",
          "quantityAtoms",
          "quantity",
          "notionalAtoms",
          "notional",
          "estimatedEntryPriceAtoms",
          "estimatedEntryPrice",
          "estimatedSlippageBps",
          "wouldExceedMaxSlippage",
          "requiredMarginAtoms",
          "requiredMargin",
          "estimatedFeeAtoms",
          "estimatedFee",
          "feeRole",
          "estimatedLiquidationPriceAtoms",
          "estimatedLiquidationPrice",
          "maintenanceMarginBps",
          "availableForOrdersAtoms",
          "availableForOrders",
          "sufficient",
          "asOf"
        ],
        "additionalProperties": false
      },
      "PublicCancelOrderRequest": {
        "type": "object",
        "properties": {
          "accountId": {
            "type": "string",
            "minLength": 1
          },
          "marketId": {
            "type": "string",
            "minLength": 1
          }
        },
        "required": [
          "accountId",
          "marketId"
        ],
        "additionalProperties": false
      },
      "ExternalWithdrawalRequest": {
        "type": "object",
        "properties": {
          "accountId": {
            "type": "string",
            "minLength": 1
          },
          "asset": {
            "type": "string",
            "minLength": 1
          },
          "amount": {
            "type": "string",
            "pattern": "^[0-9]+(?:\\.[0-9]+)?$"
          },
          "destination": {
            "type": "string",
            "minLength": 1
          }
        },
        "required": [
          "accountId",
          "asset",
          "amount",
          "destination"
        ],
        "additionalProperties": false
      },
      "ExternalWithdrawalResponse": {
        "type": "object",
        "properties": {
          "version": {
            "type": "string",
            "const": "external-withdrawal/v1"
          },
          "withdrawalId": {
            "type": "string",
            "minLength": 1
          },
          "accountId": {
            "type": "string",
            "minLength": 1
          },
          "asset": {
            "type": "string",
            "minLength": 1
          },
          "amount": {
            "type": "string",
            "pattern": "^[0-9]+(?:\\.[0-9]+)?$"
          },
          "status": {
            "type": "string",
            "enum": [
              "requested",
              "reserved",
              "authorized",
              "submitted",
              "blocked"
            ]
          },
          "lastSequence": {
            "type": "integer",
            "minimum": 0
          },
          "idempotencyKey": {
            "type": "string",
            "minLength": 1
          }
        },
        "required": [
          "version",
          "withdrawalId",
          "accountId",
          "asset",
          "amount",
          "status",
          "lastSequence"
        ],
        "additionalProperties": false
      },
      "ExternalWithdrawalAuthorizationConsumeRequest": {
        "type": "object",
        "properties": {
          "accountId": {
            "type": "string",
            "minLength": 1
          },
          "authorizationId": {
            "type": "string",
            "minLength": 1
          },
          "nonce": {
            "type": "string",
            "minLength": 1
          }
        },
        "required": [
          "accountId",
          "authorizationId",
          "nonce"
        ],
        "additionalProperties": false
      },
      "DfnsWithdrawalConfirmRequest": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "action": {
                "type": "string",
                "const": "status"
              },
              "withdrawalId": {
                "type": "string",
                "minLength": 1
              }
            },
            "required": [
              "action",
              "withdrawalId"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "action": {
                "type": "string",
                "const": "initiate"
              },
              "withdrawalId": {
                "type": "string",
                "minLength": 1
              }
            },
            "required": [
              "action",
              "withdrawalId"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "action": {
                "type": "string",
                "const": "complete"
              },
              "withdrawalId": {
                "type": "string",
                "minLength": 1
              },
              "signingStep": {
                "type": "string",
                "enum": [
                  "owner_withdrawal_consent",
                  "owner_payout_acceptance"
                ]
              },
              "challengeIdentifier": {
                "type": "string",
                "minLength": 1
              },
              "firstFactor": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "Fido2"
                      },
                      "credentialAssertion": {
                        "type": "object",
                        "properties": {
                          "credId": {
                            "type": "string",
                            "minLength": 1
                          },
                          "clientData": {
                            "type": "string",
                            "minLength": 1
                          },
                          "signature": {
                            "type": "string",
                            "minLength": 1
                          },
                          "authenticatorData": {
                            "type": "string",
                            "minLength": 1
                          },
                          "algorithm": {
                            "type": "string",
                            "minLength": 1
                          },
                          "userHandle": {
                            "type": "string",
                            "minLength": 1
                          }
                        },
                        "required": [
                          "credId",
                          "clientData",
                          "signature",
                          "authenticatorData"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "required": [
                      "kind",
                      "credentialAssertion"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "Key"
                      },
                      "credentialAssertion": {
                        "type": "object",
                        "properties": {
                          "credId": {
                            "type": "string",
                            "minLength": 1
                          },
                          "clientData": {
                            "type": "string",
                            "minLength": 1
                          },
                          "signature": {
                            "type": "string",
                            "minLength": 1
                          }
                        },
                        "required": [
                          "credId",
                          "clientData",
                          "signature"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "required": [
                      "kind",
                      "credentialAssertion"
                    ],
                    "additionalProperties": false
                  }
                ]
              }
            },
            "required": [
              "action",
              "withdrawalId",
              "signingStep",
              "challengeIdentifier",
              "firstFactor"
            ],
            "additionalProperties": false
          }
        ]
      },
      "DfnsWithdrawalConfirmResponse": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "version": {
                "type": "string",
                "const": "local-signing/v2"
              },
              "status": {
                "type": "string",
                "const": "approval_required"
              },
              "signingStep": {
                "type": "string",
                "enum": [
                  "owner_withdrawal_consent",
                  "owner_payout_acceptance"
                ]
              },
              "challenge": {
                "type": "object",
                "properties": {
                  "challenge": {
                    "type": "string",
                    "minLength": 1
                  },
                  "challengeIdentifier": {
                    "type": "string",
                    "minLength": 1
                  },
                  "allowCredentials": {
                    "type": "object",
                    "properties": {
                      "key": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "type": {
                              "type": "string",
                              "const": "public-key"
                            },
                            "id": {
                              "type": "string",
                              "minLength": 1
                            }
                          },
                          "required": [
                            "type",
                            "id"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "webauthn": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "type": {
                              "type": "string",
                              "const": "public-key"
                            },
                            "id": {
                              "type": "string",
                              "minLength": 1
                            }
                          },
                          "required": [
                            "type",
                            "id"
                          ],
                          "additionalProperties": false
                        }
                      }
                    },
                    "required": [
                      "key",
                      "webauthn"
                    ],
                    "additionalProperties": false
                  },
                  "userVerification": {
                    "type": "string",
                    "enum": [
                      "required",
                      "preferred",
                      "discouraged"
                    ]
                  }
                },
                "required": [
                  "challenge",
                  "challengeIdentifier",
                  "allowCredentials",
                  "userVerification"
                ],
                "additionalProperties": false
              },
              "withdrawal": {
                "type": "object",
                "properties": {
                  "version": {
                    "type": "string",
                    "const": "local-signing/v2"
                  },
                  "withdrawalId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "accountId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "asset": {
                    "type": "string",
                    "enum": [
                      "USD.E",
                      "USDCx"
                    ]
                  },
                  "amountAtoms": {
                    "type": "string",
                    "pattern": "^[1-9][0-9]*$"
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "authorized",
                      "consented",
                      "consumed",
                      "paid_out",
                      "offer_expired",
                      "reclaimed",
                      "failed"
                    ]
                  },
                  "dueSigningStep": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      "owner_withdrawal_consent",
                      "owner_payout_acceptance",
                      null
                    ]
                  },
                  "payoutOfferExpiresAtEpochMs": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "exclusiveMinimum": 0
                  },
                  "settled": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "version",
                  "withdrawalId",
                  "accountId",
                  "asset",
                  "amountAtoms",
                  "status",
                  "dueSigningStep",
                  "payoutOfferExpiresAtEpochMs",
                  "settled"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "version",
              "status",
              "signingStep",
              "challenge",
              "withdrawal"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "version": {
                "type": "string",
                "const": "local-signing/v2"
              },
              "withdrawalId": {
                "type": "string",
                "minLength": 1
              },
              "accountId": {
                "type": "string",
                "minLength": 1
              },
              "asset": {
                "type": "string",
                "enum": [
                  "USD.E",
                  "USDCx"
                ]
              },
              "amountAtoms": {
                "type": "string",
                "pattern": "^[1-9][0-9]*$"
              },
              "status": {
                "type": "string",
                "enum": [
                  "authorized",
                  "consented",
                  "consumed",
                  "paid_out",
                  "offer_expired",
                  "reclaimed",
                  "failed"
                ]
              },
              "dueSigningStep": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "owner_withdrawal_consent",
                  "owner_payout_acceptance",
                  null
                ]
              },
              "payoutOfferExpiresAtEpochMs": {
                "type": [
                  "integer",
                  "null"
                ],
                "exclusiveMinimum": 0
              },
              "settled": {
                "type": "boolean"
              }
            },
            "required": [
              "version",
              "withdrawalId",
              "accountId",
              "asset",
              "amountAtoms",
              "status",
              "dueSigningStep",
              "payoutOfferExpiresAtEpochMs",
              "settled"
            ],
            "additionalProperties": false
          }
        ]
      },
      "ExternalAuthCapabilitiesResponse": {
        "type": "object",
        "properties": {
          "version": {
            "type": "string",
            "const": "external-auth-capabilities/v1"
          },
          "passkeyLogin": {
            "type": "string",
            "enum": [
              "available",
              "dfns_not_configured"
            ]
          },
          "delegatedRegistration": {
            "type": "string",
            "enum": [
              "dfns_not_configured",
              "product_identity_required"
            ]
          },
          "emailOtp": {
            "type": "string",
            "const": "email_otp_provider_required"
          },
          "credentialRecovery": {
            "type": "string",
            "const": "credential_recovery_not_configured"
          },
          "socialRegistrationProviders": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "google"
              ]
            }
          },
          "socialLoginProviders": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "google"
              ]
            }
          }
        },
        "required": [
          "version",
          "passkeyLogin",
          "delegatedRegistration",
          "emailOtp",
          "credentialRecovery",
          "socialRegistrationProviders",
          "socialLoginProviders"
        ],
        "additionalProperties": false
      },
      "ExternalAuthSocialRequest": {
        "type": "object",
        "properties": {
          "idToken": {
            "type": "string",
            "minLength": 1,
            "maxLength": 16384
          }
        },
        "required": [
          "idToken"
        ],
        "additionalProperties": false
      },
      "ExternalAuthRegisterInitResponse": {
        "type": "object",
        "properties": {
          "version": {
            "type": "string",
            "const": "external-auth-register-init/v1"
          },
          "user": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1
              },
              "displayName": {
                "type": "string"
              },
              "name": {
                "type": "string",
                "minLength": 1
              }
            },
            "required": [
              "id",
              "displayName",
              "name"
            ],
            "additionalProperties": false
          },
          "temporaryAuthenticationToken": {
            "type": "string",
            "minLength": 1
          },
          "challenge": {
            "type": "string",
            "minLength": 1
          }
        },
        "required": [
          "version",
          "user",
          "temporaryAuthenticationToken",
          "challenge"
        ],
        "additionalProperties": true
      },
      "ExternalAuthLoginCompleteResponse": {
        "type": "object",
        "properties": {
          "version": {
            "type": "string",
            "const": "external-auth-login/v1"
          },
          "token": {
            "type": "string",
            "minLength": 1
          },
          "walletState": {
            "type": "string",
            "enum": [
              "wallet_ready",
              "wallet_pending_org_config"
            ]
          }
        },
        "required": [
          "version",
          "token",
          "walletState"
        ],
        "additionalProperties": false
      },
      "ExternalAuthRegisterCompleteRequest": {
        "type": "object",
        "properties": {
          "temporaryAuthenticationToken": {
            "type": "string",
            "minLength": 1
          },
          "firstFactorCredential": {
            "type": "object",
            "properties": {
              "credentialKind": {
                "type": "string",
                "const": "Fido2"
              },
              "credentialInfo": {
                "type": "object",
                "additionalProperties": {}
              },
              "credentialName": {
                "type": "string",
                "minLength": 1
              }
            },
            "required": [
              "credentialKind",
              "credentialInfo"
            ],
            "additionalProperties": false
          },
          "secondFactorCredential": {
            "type": "object",
            "properties": {
              "credentialKind": {
                "type": "string",
                "const": "Fido2"
              },
              "credentialInfo": {
                "type": "object",
                "additionalProperties": {}
              },
              "credentialName": {
                "type": "string",
                "minLength": 1
              }
            },
            "required": [
              "credentialKind",
              "credentialInfo"
            ],
            "additionalProperties": false
          },
          "referralCode": {
            "type": "string",
            "pattern": "^[a-f0-9]{16}$"
          },
          "socialIdentity": {
            "type": "object",
            "properties": {
              "provider": {
                "type": "string",
                "const": "google"
              },
              "idToken": {
                "type": "string",
                "minLength": 1,
                "maxLength": 16384
              }
            },
            "required": [
              "provider",
              "idToken"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "temporaryAuthenticationToken",
          "firstFactorCredential",
          "socialIdentity"
        ],
        "additionalProperties": false
      },
      "ExternalAuthRegisterCompleteResponse": {
        "type": "object",
        "properties": {
          "version": {
            "type": "string",
            "const": "external-auth-register-complete/v1"
          },
          "walletState": {
            "type": "string",
            "enum": [
              "wallet_ready",
              "wallet_pending_org_config"
            ]
          },
          "credential": {
            "type": "object",
            "properties": {
              "uuid": {
                "type": "string",
                "minLength": 1
              },
              "kind": {
                "anyOf": [
                  {
                    "type": "string",
                    "enum": [
                      "Fido2",
                      "Key",
                      "Password",
                      "PasswordProtectedKey"
                    ]
                  },
                  {
                    "type": "string",
                    "minLength": 1
                  }
                ]
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "uuid",
              "kind",
              "name"
            ],
            "additionalProperties": false
          },
          "user": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1
              },
              "username": {
                "type": "string",
                "minLength": 1
              },
              "orgId": {
                "type": "string"
              },
              "tenantId": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "username"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "version",
          "walletState",
          "credential",
          "user"
        ],
        "additionalProperties": false
      },
      "ExternalAuthLoginInitRequest": {
        "type": "object",
        "properties": {
          "username": {
            "type": "string",
            "minLength": 1
          }
        },
        "required": [
          "username"
        ],
        "additionalProperties": false
      },
      "ExternalAuthLoginInitResponse": {
        "type": "object",
        "properties": {
          "version": {
            "type": "string",
            "const": "external-auth-login-init/v1"
          },
          "challenge": {
            "type": "string",
            "minLength": 1
          },
          "challengeIdentifier": {
            "type": "string",
            "minLength": 1
          },
          "allowCredentials": {
            "type": "object",
            "properties": {
              "webauthn": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "public-key"
                    },
                    "id": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "required": [
                    "type",
                    "id"
                  ],
                  "additionalProperties": false
                },
                "minItems": 1
              }
            },
            "required": [
              "webauthn"
            ],
            "additionalProperties": false
          },
          "userVerification": {
            "type": "string",
            "enum": [
              "required",
              "preferred",
              "discouraged"
            ]
          }
        },
        "required": [
          "version",
          "challenge",
          "challengeIdentifier",
          "allowCredentials",
          "userVerification"
        ],
        "additionalProperties": true
      },
      "ExternalAuthLoginCompleteRequest": {
        "type": "object",
        "properties": {
          "challengeIdentifier": {
            "type": "string",
            "minLength": 1
          },
          "firstFactor": {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "const": "Fido2"
              },
              "credentialAssertion": {
                "type": "object",
                "properties": {
                  "credId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "clientData": {
                    "type": "string",
                    "minLength": 1
                  },
                  "signature": {
                    "type": "string",
                    "minLength": 1
                  },
                  "authenticatorData": {
                    "type": "string",
                    "minLength": 1
                  },
                  "algorithm": {
                    "type": "string",
                    "minLength": 1
                  },
                  "userHandle": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "credId",
                  "clientData",
                  "signature",
                  "authenticatorData"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "kind",
              "credentialAssertion"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "challengeIdentifier",
          "firstFactor"
        ],
        "additionalProperties": false
      },
      "ExternalAuthMappingRecoveryResponse": {
        "type": "object",
        "properties": {
          "version": {
            "type": "string",
            "const": "external-auth-mapping-recovery/v1"
          },
          "accountId": {
            "type": "string",
            "minLength": 1
          }
        },
        "required": [
          "version",
          "accountId"
        ],
        "additionalProperties": false
      },
      "RealtimeTicketResponse": {
        "type": "object",
        "properties": {
          "ticket": {
            "type": "string",
            "minLength": 43,
            "maxLength": 43,
            "pattern": "^[A-Za-z0-9_-]+$"
          },
          "accountId": {
            "type": "string",
            "minLength": 1
          },
          "expiresAt": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "ticket",
          "accountId",
          "expiresAt"
        ],
        "additionalProperties": false
      },
      "RealtimeTicketRequest": {
        "type": "object",
        "properties": {
          "ticket": {
            "type": "string",
            "minLength": 43,
            "maxLength": 43,
            "pattern": "^[A-Za-z0-9_-]+$"
          }
        },
        "required": [
          "ticket"
        ],
        "additionalProperties": false
      },
      "ExternalMarketCatalogResponse": {
        "type": "object",
        "properties": {
          "version": {
            "type": "string",
            "const": "external-market-catalog/v1"
          },
          "markets": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "marketId": {
                  "type": "string",
                  "minLength": 1
                },
                "underlyingSymbol": {
                  "type": "string",
                  "minLength": 1
                },
                "marketType": {
                  "type": "string",
                  "enum": [
                    "crypto",
                    "stock",
                    "forex",
                    "commodity",
                    "index"
                  ]
                },
                "logoUrl": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "logoUnavailable": {
                  "type": "boolean"
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "draft",
                    "backfilling",
                    "open",
                    "paused",
                    "halted",
                    "cancel_only",
                    "reduce_only"
                  ]
                },
                "priceScale": {
                  "type": "integer",
                  "minimum": 0
                },
                "quantityScale": {
                  "type": "integer",
                  "minimum": 0
                },
                "minPrice": {
                  "type": "string",
                  "minLength": 1
                },
                "maxPrice": {
                  "type": "string",
                  "minLength": 1
                },
                "minQuantity": {
                  "type": "string",
                  "minLength": 1
                },
                "maxQuantity": {
                  "type": "string",
                  "minLength": 1
                },
                "initialMarginBps": {
                  "type": "integer",
                  "exclusiveMinimum": 0
                },
                "maintenanceMarginTiers": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "notionalThresholdAtoms": {
                        "type": "string",
                        "pattern": "^(0|[1-9][0-9]*)$"
                      },
                      "maintenanceMarginBps": {
                        "type": "integer",
                        "exclusiveMinimum": 0,
                        "minimum": -9007199254740991,
                        "maximum": 9999
                      }
                    },
                    "required": [
                      "notionalThresholdAtoms",
                      "maintenanceMarginBps"
                    ],
                    "additionalProperties": false
                  },
                  "minItems": 1,
                  "maxItems": 16
                },
                "maxLeverageX": {
                  "type": "integer",
                  "exclusiveMinimum": 0
                },
                "makerFeeBps": {
                  "type": "integer",
                  "minimum": 0
                },
                "takerFeeBps": {
                  "type": "integer",
                  "minimum": 0
                },
                "settlementAsset": {
                  "type": "string",
                  "minLength": 1
                },
                "lastPriceAtoms": {
                  "type": "string",
                  "pattern": "^[0-9]+$"
                },
                "lastPrice": {
                  "type": "string",
                  "pattern": "^-?[0-9]+\\.[0-9]+$"
                },
                "change24hBps": {
                  "type": "string",
                  "pattern": "^-?(0|[1-9][0-9]*)$"
                },
                "favorite": {
                  "type": "boolean"
                },
                "settlementAssetDecimals": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 10,
                  "description": "Decimal places of settlementAsset: every collateral amount (balances, margin, PnL, fees, deposits, withdrawals) is an integer count of 10^-settlementAssetDecimals units of it."
                }
              },
              "required": [
                "marketId",
                "underlyingSymbol",
                "marketType",
                "logoUrl",
                "logoUnavailable",
                "status",
                "priceScale",
                "quantityScale",
                "minPrice",
                "maxPrice",
                "minQuantity",
                "maxQuantity",
                "initialMarginBps",
                "maintenanceMarginTiers",
                "maxLeverageX",
                "makerFeeBps",
                "takerFeeBps",
                "settlementAsset",
                "lastPriceAtoms",
                "lastPrice",
                "change24hBps",
                "settlementAssetDecimals"
              ],
              "additionalProperties": false
            }
          },
          "snapshotSequence": {
            "type": "integer",
            "minimum": 0
          },
          "readModelDigest": {
            "type": "string",
            "pattern": "^sha256:[0-9a-f]{64}$",
            "description": "Identifies the market-registry PROJECTION CHECKPOINT this catalogue was read from -- a hash of {panel, journalSequence, version}. It does NOT cover the market content below and cannot be recomputed from it: two responses with identical markets differ if the checkpoint moved."
          }
        },
        "required": [
          "version",
          "markets",
          "snapshotSequence",
          "readModelDigest"
        ],
        "additionalProperties": false
      },
      "ExternalLeaderboardResponse": {
        "type": "object",
        "properties": {
          "version": {
            "type": "string",
            "const": "external-leaderboard/v1"
          },
          "windowKind": {
            "type": "string",
            "enum": [
              "daily",
              "weekly",
              "monthly",
              "all_time"
            ]
          },
          "metricKind": {
            "type": "string",
            "enum": [
              "projected_realized_pnl"
            ]
          },
          "provenance": {
            "type": "string",
            "enum": [
              "off_chain_position_projection"
            ]
          },
          "boardVersion": {
            "type": "string",
            "pattern": "^[1-9][0-9]*$"
          },
          "markEpochMs": {
            "type": "integer",
            "minimum": 0
          },
          "throughJournalSequence": {
            "type": "integer",
            "minimum": 0
          },
          "periodStartEpochMs": {
            "type": "integer",
            "minimum": 0
          },
          "periodEndEpochMs": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "scoreHistogram": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "percentileUpperBoundBps": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 10000
                },
                "minimumScoreAtoms": {
                  "type": "string",
                  "pattern": "^(0|-?[1-9][0-9]*)$"
                },
                "maximumScoreAtoms": {
                  "type": "string",
                  "pattern": "^(0|-?[1-9][0-9]*)$"
                },
                "accountCount": {
                  "type": "integer",
                  "exclusiveMinimum": 0
                }
              },
              "required": [
                "percentileUpperBoundBps",
                "minimumScoreAtoms",
                "maximumScoreAtoms",
                "accountCount"
              ],
              "additionalProperties": false
            }
          },
          "entries": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "rank": {
                  "type": "integer",
                  "exclusiveMinimum": 0
                },
                "displayHandle": {
                  "type": "string",
                  "pattern": "^trader-[a-f0-9]{16}$"
                },
                "participantKind": {
                  "type": "string",
                  "enum": [
                    "human",
                    "bot"
                  ]
                },
                "scoreAtoms": {
                  "type": "string",
                  "pattern": "^(0|-?[1-9][0-9]*)$"
                },
                "realizedPnlAtoms": {
                  "type": "string",
                  "pattern": "^(0|-?[1-9][0-9]*)$"
                },
                "feesPaidAtoms": {
                  "type": "string",
                  "pattern": "^(0|[1-9][0-9]*)$"
                },
                "fundingPaidAtoms": {
                  "type": "string",
                  "pattern": "^(0|-?[1-9][0-9]*)$"
                },
                "closedNotionalAtoms": {
                  "type": "string",
                  "pattern": "^(0|[1-9][0-9]*)$"
                },
                "fillCount": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "required": [
                "rank",
                "displayHandle",
                "participantKind",
                "scoreAtoms",
                "realizedPnlAtoms",
                "feesPaidAtoms",
                "fundingPaidAtoms",
                "closedNotionalAtoms",
                "fillCount"
              ],
              "additionalProperties": false
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 1
          }
        },
        "required": [
          "version",
          "windowKind",
          "metricKind",
          "provenance",
          "boardVersion",
          "markEpochMs",
          "throughJournalSequence",
          "periodStartEpochMs",
          "periodEndEpochMs",
          "scoreHistogram",
          "entries",
          "nextCursor"
        ],
        "additionalProperties": false
      },
      "ExternalMarketSnapshotResponse": {
        "type": "object",
        "properties": {
          "version": {
            "type": "string",
            "const": "external-market-snapshot/v1"
          },
          "marketId": {
            "type": "string",
            "minLength": 1
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "backfilling",
              "open",
              "paused",
              "halted",
              "cancel_only",
              "reduce_only"
            ]
          },
          "market": {
            "type": "object",
            "properties": {
              "marketId": {
                "type": "string",
                "minLength": 1
              },
              "underlyingSymbol": {
                "type": "string",
                "minLength": 1
              },
              "marketType": {
                "type": "string",
                "enum": [
                  "crypto",
                  "stock",
                  "forex",
                  "commodity",
                  "index"
                ]
              },
              "logoUrl": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "logoUnavailable": {
                "type": "boolean"
              },
              "status": {
                "type": "string",
                "enum": [
                  "draft",
                  "backfilling",
                  "open",
                  "paused",
                  "halted",
                  "cancel_only",
                  "reduce_only"
                ]
              },
              "priceScale": {
                "type": "integer",
                "minimum": 0
              },
              "quantityScale": {
                "type": "integer",
                "minimum": 0
              },
              "minPrice": {
                "type": "string",
                "minLength": 1
              },
              "maxPrice": {
                "type": "string",
                "minLength": 1
              },
              "minQuantity": {
                "type": "string",
                "minLength": 1
              },
              "maxQuantity": {
                "type": "string",
                "minLength": 1
              },
              "initialMarginBps": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "maintenanceMarginTiers": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "notionalThresholdAtoms": {
                      "type": "string",
                      "pattern": "^(0|[1-9][0-9]*)$"
                    },
                    "maintenanceMarginBps": {
                      "type": "integer",
                      "exclusiveMinimum": 0,
                      "minimum": -9007199254740991,
                      "maximum": 9999
                    }
                  },
                  "required": [
                    "notionalThresholdAtoms",
                    "maintenanceMarginBps"
                  ],
                  "additionalProperties": false
                },
                "minItems": 1,
                "maxItems": 16
              },
              "maxLeverageX": {
                "type": "integer",
                "exclusiveMinimum": 0
              },
              "makerFeeBps": {
                "type": "integer",
                "minimum": 0
              },
              "takerFeeBps": {
                "type": "integer",
                "minimum": 0
              },
              "settlementAsset": {
                "type": "string",
                "minLength": 1
              },
              "lastPriceAtoms": {
                "type": "string",
                "pattern": "^[0-9]+$"
              },
              "lastPrice": {
                "type": "string",
                "pattern": "^-?[0-9]+\\.[0-9]+$"
              },
              "change24hBps": {
                "type": "string",
                "pattern": "^-?(0|[1-9][0-9]*)$"
              },
              "favorite": {
                "type": "boolean"
              },
              "settlementAssetDecimals": {
                "type": "integer",
                "minimum": 0,
                "maximum": 10,
                "description": "Decimal places of settlementAsset: every collateral amount (balances, margin, PnL, fees, deposits, withdrawals) is an integer count of 10^-settlementAssetDecimals units of it."
              }
            },
            "required": [
              "marketId",
              "underlyingSymbol",
              "marketType",
              "logoUrl",
              "logoUnavailable",
              "status",
              "priceScale",
              "quantityScale",
              "minPrice",
              "maxPrice",
              "minQuantity",
              "maxQuantity",
              "initialMarginBps",
              "maintenanceMarginTiers",
              "maxLeverageX",
              "makerFeeBps",
              "takerFeeBps",
              "settlementAsset",
              "lastPriceAtoms",
              "lastPrice",
              "change24hBps",
              "settlementAssetDecimals"
            ],
            "additionalProperties": false
          },
          "marketSession": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "state": {
                "type": "string",
                "enum": [
                  "open",
                  "closed"
                ]
              },
              "asOfEpochMs": {
                "type": "integer",
                "minimum": 0
              },
              "nextOpenEpochMs": {
                "type": "integer",
                "minimum": 0
              },
              "nextCloseEpochMs": {
                "type": "integer",
                "minimum": 0
              },
              "riskIncreasingOrderCutoffEpochMs": {
                "type": "integer",
                "minimum": 0
              }
            },
            "required": [
              "state",
              "asOfEpochMs",
              "nextOpenEpochMs",
              "nextCloseEpochMs",
              "riskIncreasingOrderCutoffEpochMs"
            ],
            "additionalProperties": false
          },
          "snapshotSequence": {
            "type": "integer",
            "minimum": 0
          },
          "readModelDigest": {
            "type": "string",
            "pattern": "^sha256:[0-9a-f]{64}$",
            "description": "Identifies the market-registry PROJECTION CHECKPOINT this market was read from -- a hash of {panel, journalSequence, version}, covering the whole registry rather than the single market returned here. It does NOT cover the payload and cannot be recomputed from it."
          },
          "resync": {
            "type": "object",
            "properties": {
              "stream": {
                "type": "string",
                "const": "market.status"
              },
              "fromSequence": {
                "type": "integer",
                "exclusiveMinimum": 0
              }
            },
            "required": [
              "stream",
              "fromSequence"
            ],
            "additionalProperties": true
          }
        },
        "required": [
          "version",
          "marketId",
          "status",
          "market",
          "marketSession",
          "snapshotSequence",
          "readModelDigest",
          "resync"
        ],
        "additionalProperties": false
      },
      "ExternalMarketStatsResponse": {
        "type": "object",
        "properties": {
          "version": {
            "type": "string",
            "const": "external-market-stats/v1"
          },
          "marketId": {
            "type": "string",
            "minLength": 1
          },
          "volume24hQuoteAtoms": {
            "type": "string",
            "pattern": "^[0-9]+$"
          },
          "volume24hQuote": {
            "type": "string",
            "pattern": "^-?[0-9]+\\.[0-9]+$"
          },
          "openInterestBaseAtoms": {
            "type": "string",
            "pattern": "^[0-9]+$"
          },
          "openInterestBase": {
            "type": "string",
            "pattern": "^-?[0-9]+\\.[0-9]+$"
          },
          "openInterestQuoteAtoms": {
            "type": "string",
            "pattern": "^[0-9]+$"
          },
          "openInterestQuote": {
            "type": "string",
            "pattern": "^-?[0-9]+\\.[0-9]+$"
          },
          "fundingRateBps": {
            "type": "string",
            "pattern": "^-?(0|[1-9][0-9]*)$"
          },
          "predictedFundingRateBps": {
            "type": "string",
            "pattern": "^-?(0|[1-9][0-9]*)$"
          },
          "nextFundingTimeEpochMs": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "fundingIntervalMs": {
            "type": "integer",
            "minimum": 0
          },
          "marketData": {
            "type": "object",
            "properties": {
              "indexPriceAtoms": {
                "type": "string",
                "pattern": "^[0-9]+$"
              },
              "indexPrice": {
                "type": "string",
                "pattern": "^-?[0-9]+\\.[0-9]+$"
              },
              "markPriceAtoms": {
                "type": "string",
                "pattern": "^[0-9]+$"
              },
              "markPrice": {
                "type": "string",
                "pattern": "^-?[0-9]+\\.[0-9]+$"
              },
              "asOfEpochMs": {
                "type": "integer",
                "minimum": 0
              }
            },
            "required": [
              "indexPriceAtoms",
              "indexPrice",
              "markPriceAtoms",
              "markPrice",
              "asOfEpochMs"
            ],
            "additionalProperties": false
          },
          "lastPriceAtoms": {
            "type": "string",
            "pattern": "^[0-9]+$"
          },
          "lastPrice": {
            "type": "string",
            "pattern": "^-?[0-9]+\\.[0-9]+$"
          },
          "change24hBps": {
            "type": "string",
            "pattern": "^-?(0|[1-9][0-9]*)$"
          },
          "high24hAtoms": {
            "type": "string",
            "pattern": "^[0-9]+$"
          },
          "high24h": {
            "type": "string",
            "pattern": "^-?[0-9]+\\.[0-9]+$"
          },
          "low24hAtoms": {
            "type": "string",
            "pattern": "^[0-9]+$"
          },
          "low24h": {
            "type": "string",
            "pattern": "^-?[0-9]+\\.[0-9]+$"
          }
        },
        "required": [
          "version",
          "marketId",
          "volume24hQuoteAtoms",
          "volume24hQuote",
          "openInterestBaseAtoms",
          "openInterestBase",
          "openInterestQuoteAtoms",
          "openInterestQuote",
          "fundingRateBps",
          "predictedFundingRateBps",
          "nextFundingTimeEpochMs",
          "fundingIntervalMs",
          "marketData",
          "lastPriceAtoms",
          "lastPrice",
          "change24hBps",
          "high24hAtoms",
          "high24h",
          "low24hAtoms",
          "low24h"
        ],
        "additionalProperties": false
      },
      "ExternalBookSnapshotResponse": {
        "type": "object",
        "properties": {
          "version": {
            "type": "string",
            "const": "external-book-snapshot/v1"
          },
          "marketId": {
            "type": "string",
            "minLength": 1
          },
          "snapshotSequence": {
            "type": "integer",
            "minimum": 0
          },
          "readModelDigest": {
            "type": "string",
            "pattern": "^sha256:[0-9a-f]{64}$",
            "description": "Covers the book content published here -- marketId, snapshotSequence, bids and asks. Recomputable by a client from this payload."
          },
          "bids": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "priceAtoms": {
                  "type": "string",
                  "pattern": "^[0-9]+$"
                },
                "price": {
                  "type": "string",
                  "pattern": "^-?[0-9]+\\.[0-9]+$"
                },
                "sizeAtoms": {
                  "type": "string",
                  "pattern": "^[0-9]+$"
                },
                "size": {
                  "type": "string",
                  "pattern": "^-?[0-9]+\\.[0-9]+$"
                }
              },
              "required": [
                "priceAtoms",
                "price",
                "sizeAtoms",
                "size"
              ],
              "additionalProperties": false
            }
          },
          "asks": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "priceAtoms": {
                  "type": "string",
                  "pattern": "^[0-9]+$"
                },
                "price": {
                  "type": "string",
                  "pattern": "^-?[0-9]+\\.[0-9]+$"
                },
                "sizeAtoms": {
                  "type": "string",
                  "pattern": "^[0-9]+$"
                },
                "size": {
                  "type": "string",
                  "pattern": "^-?[0-9]+\\.[0-9]+$"
                }
              },
              "required": [
                "priceAtoms",
                "price",
                "sizeAtoms",
                "size"
              ],
              "additionalProperties": false
            }
          },
          "checksum": {
            "type": "string",
            "pattern": "^sha256:[0-9a-f]{64}$"
          },
          "resync": {
            "type": "object",
            "properties": {
              "stream": {
                "type": "string",
                "const": "market.book"
              },
              "fromSequence": {
                "type": "integer",
                "exclusiveMinimum": 0
              }
            },
            "required": [
              "stream",
              "fromSequence"
            ],
            "additionalProperties": true
          }
        },
        "required": [
          "version",
          "marketId",
          "snapshotSequence",
          "readModelDigest",
          "bids",
          "asks",
          "checksum",
          "resync"
        ],
        "additionalProperties": false
      },
      "ExternalCandlesResponse": {
        "type": "object",
        "properties": {
          "version": {
            "type": "string",
            "const": "external-candles/v1"
          },
          "marketId": {
            "type": "string",
            "minLength": 1
          },
          "series": {
            "type": "string",
            "enum": [
              "trade",
              "index",
              "mark"
            ]
          },
          "timeframe": {
            "type": "string",
            "enum": [
              "1m",
              "3m",
              "5m",
              "15m",
              "30m",
              "1h",
              "2h",
              "4h",
              "8h",
              "12h",
              "1d",
              "3d",
              "1w",
              "1M"
            ]
          },
          "fromEpochMs": {
            "type": "integer",
            "minimum": 0
          },
          "toEpochMs": {
            "type": "integer",
            "minimum": 0
          },
          "snapshotSequence": {
            "type": "integer",
            "minimum": 0
          },
          "candles": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "bucketStartEpochMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "open": {
                  "type": "string",
                  "minLength": 1
                },
                "high": {
                  "type": "string",
                  "minLength": 1
                },
                "low": {
                  "type": "string",
                  "minLength": 1
                },
                "close": {
                  "type": "string",
                  "minLength": 1
                },
                "volume": {
                  "type": "string",
                  "minLength": 1
                },
                "source": {
                  "type": "string",
                  "enum": [
                    "trade",
                    "index",
                    "external"
                  ]
                }
              },
              "required": [
                "bucketStartEpochMs",
                "open",
                "high",
                "low",
                "close",
                "volume",
                "source"
              ],
              "additionalProperties": false
            }
          },
          "gaps": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "fromEpochMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "toEpochMs": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "required": [
                "fromEpochMs",
                "toEpochMs"
              ],
              "additionalProperties": false
            }
          },
          "resync": {
            "type": "object",
            "properties": {
              "stream": {
                "type": "string",
                "const": "market.candles"
              },
              "fromSequence": {
                "type": "integer",
                "exclusiveMinimum": 0
              }
            },
            "required": [
              "stream",
              "fromSequence"
            ],
            "additionalProperties": true
          }
        },
        "required": [
          "version",
          "marketId",
          "series",
          "timeframe",
          "fromEpochMs",
          "toEpochMs",
          "snapshotSequence",
          "candles",
          "gaps",
          "resync"
        ],
        "additionalProperties": false
      },
      "MarketDataCandidateMarketsResponse": {
        "type": "object",
        "properties": {
          "version": {
            "type": "string",
            "const": "market-data-candidate-markets/v1"
          },
          "markets": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "symbol": {
                  "type": "string",
                  "minLength": 1
                },
                "marketType": {
                  "type": "string",
                  "enum": [
                    "crypto",
                    "stock",
                    "forex",
                    "commodity",
                    "index"
                  ]
                },
                "providers": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "enum": [
                      "chainlink-streams",
                      "coindesk",
                      "massive",
                      "alpaca",
                      "coinmarketcap",
                      "ccxt"
                    ]
                  },
                  "minItems": 1
                },
                "providerDetails": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "providerId": {
                        "type": "string",
                        "enum": [
                          "chainlink-streams",
                          "coindesk",
                          "massive",
                          "alpaca",
                          "coinmarketcap",
                          "ccxt"
                        ]
                      },
                      "providerSymbol": {
                        "type": "string",
                        "minLength": 1
                      },
                      "logoUrl": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "required": [
                      "providerId",
                      "providerSymbol",
                      "logoUrl"
                    ],
                    "additionalProperties": false
                  },
                  "minItems": 1
                },
                "decimals": {
                  "type": "integer",
                  "minimum": 0
                },
                "logoUrl": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "logoUnavailable": {
                  "type": "boolean"
                }
              },
              "required": [
                "symbol",
                "marketType",
                "providers",
                "providerDetails",
                "decimals",
                "logoUrl",
                "logoUnavailable"
              ],
              "additionalProperties": false
            }
          },
          "unavailableProviders": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "providerId": {
                  "type": "string",
                  "enum": [
                    "chainlink-streams",
                    "coindesk",
                    "massive",
                    "alpaca",
                    "coinmarketcap",
                    "ccxt"
                  ]
                },
                "reason": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "required": [
                "providerId",
                "reason"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "version",
          "markets",
          "unavailableProviders"
        ],
        "additionalProperties": false
      },
      "ExternalAccountSnapshotResponse": {
        "type": "object",
        "properties": {
          "consentState": {
            "type": "string",
            "enum": [
              "absent",
              "pending",
              "active",
              "revoked",
              "package_unavailable"
            ],
            "default": "absent"
          },
          "version": {
            "type": "string",
            "const": "external-account-snapshot/v1"
          },
          "accountId": {
            "type": "string",
            "minLength": 1
          },
          "asset": {
            "type": "string",
            "minLength": 1
          },
          "snapshotSequence": {
            "type": "integer",
            "minimum": 0
          },
          "readModelDigest": {
            "type": "string",
            "pattern": "^sha256:[0-9a-f]{64}$",
            "description": "Covers the engine account view this response was built from, before decimal formatting. Not recomputable from the formatted payload."
          },
          "marginMode": {
            "type": "string",
            "enum": [
              "isolated",
              "cross"
            ]
          },
          "cashBalanceAtoms": {
            "type": "string",
            "pattern": "^[0-9]+$"
          },
          "cashBalance": {
            "type": "string",
            "pattern": "^-?[0-9]+\\.[0-9]+$"
          },
          "equityAtoms": {
            "type": "string",
            "pattern": "^-?[0-9]+$"
          },
          "equity": {
            "type": "string",
            "pattern": "^-?[0-9]+\\.[0-9]+$"
          },
          "availableForOrdersAtoms": {
            "type": "string",
            "pattern": "^[0-9]+$"
          },
          "availableForOrders": {
            "type": "string",
            "pattern": "^-?[0-9]+\\.[0-9]+$"
          },
          "riskEvidence": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "const": "complete"
                  }
                },
                "required": [
                  "status"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "const": "incomplete"
                  },
                  "reasonCode": {
                    "type": "string",
                    "enum": [
                      "legacy_unknown",
                      "missing_accepted_mark"
                    ]
                  }
                },
                "required": [
                  "status",
                  "reasonCode"
                ],
                "additionalProperties": false
              }
            ]
          },
          "positions": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "marketId": {
                  "type": "string",
                  "minLength": 1
                },
                "unrealizedPnlAtoms": {
                  "type": "string",
                  "pattern": "^-?(0|[1-9][0-9]*)$"
                },
                "signedBaseAtoms": {
                  "type": "string",
                  "pattern": "^-?(0|[1-9][0-9]*)$"
                },
                "entryNotionalAtoms": {
                  "type": "string",
                  "pattern": "^(0|[1-9][0-9]*)$"
                },
                "markPriceAtoms": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "pattern": "^(0|[1-9][0-9]*)$"
                }
              },
              "required": [
                "marketId",
                "unrealizedPnlAtoms",
                "signedBaseAtoms",
                "entryNotionalAtoms",
                "markPriceAtoms"
              ],
              "additionalProperties": false
            }
          },
          "resync": {
            "type": "object",
            "properties": {
              "stream": {
                "type": "string",
                "const": "account.margin"
              },
              "fromSequence": {
                "type": "integer",
                "exclusiveMinimum": 0
              }
            },
            "required": [
              "stream",
              "fromSequence"
            ],
            "additionalProperties": true
          }
        },
        "required": [
          "version",
          "accountId",
          "asset",
          "snapshotSequence",
          "readModelDigest",
          "marginMode",
          "cashBalanceAtoms",
          "cashBalance",
          "equityAtoms",
          "equity",
          "availableForOrdersAtoms",
          "availableForOrders",
          "resync"
        ],
        "additionalProperties": false
      },
      "ExternalPositionSnapshotResponse": {
        "type": "object",
        "properties": {
          "version": {
            "type": "string",
            "const": "external-position-snapshot/v1"
          },
          "accountId": {
            "type": "string",
            "minLength": 1
          },
          "snapshotSequence": {
            "type": "integer",
            "minimum": 0
          },
          "readModelDigest": {
            "type": "string",
            "pattern": "^sha256:[0-9a-f]{64}$",
            "description": "Identifies the stored position-episode data only. Live market-risk values included in positions are outside its scope, so mark-price and marginStatus changes do not necessarily change the digest. It cannot be verified by hashing the positions array."
          },
          "freshness": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "fresh",
                  "stale",
                  "backfilling",
                  "inconsistent"
                ]
              },
              "degradedState": {
                "type": "string",
                "enum": [
                  "none",
                  "warmup",
                  "paused",
                  "draining_to_journal",
                  "runtime_policy_unavailable",
                  "database_unavailable",
                  "journal_unavailable",
                  "projection_group_not_owned",
                  "projection_stale",
                  "replica_lagging",
                  "projector_backfilling",
                  "market_data_unavailable",
                  "canton_unavailable",
                  "signer_unavailable",
                  "reconciliation_blocked",
                  "kill_switch_active",
                  "authority_unreachable",
                  "unknown_command_outcome",
                  "action_requires_approval",
                  "dry_run_expired",
                  "unsafe_action_blocked"
                ]
              },
              "journalSequence": {
                "type": "integer",
                "minimum": 0
              },
              "asOfEpochMs": {
                "type": "integer",
                "minimum": 0
              },
              "projectorLagMs": {
                "type": "integer",
                "minimum": 0
              },
              "dbReplicaLagMs": {
                "type": "integer",
                "minimum": 0
              },
              "backfillStatus": {
                "type": "string",
                "enum": [
                  "live",
                  "backfilling"
                ]
              }
            },
            "required": [
              "status",
              "degradedState",
              "journalSequence",
              "asOfEpochMs",
              "projectorLagMs",
              "dbReplicaLagMs",
              "backfillStatus"
            ],
            "additionalProperties": false
          },
          "positions": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "positionId": {
                  "type": "string",
                  "minLength": 1
                },
                "accountId": {
                  "type": "string",
                  "minLength": 1
                },
                "marketId": {
                  "type": "string",
                  "minLength": 1
                },
                "side": {
                  "type": "string",
                  "enum": [
                    "long",
                    "short"
                  ]
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "open",
                    "closed",
                    "liquidated"
                  ]
                },
                "openedAtEpochMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "closedAtEpochMs": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "minimum": 0
                },
                "maxQuantityAtoms": {
                  "type": "string",
                  "pattern": "^[0-9]+$"
                },
                "maxQuantity": {
                  "type": "string",
                  "pattern": "^-?[0-9]+\\.[0-9]+$"
                },
                "currentQuantityAtoms": {
                  "type": "string",
                  "pattern": "^[0-9]+$"
                },
                "currentQuantity": {
                  "type": "string",
                  "pattern": "^-?[0-9]+\\.[0-9]+$"
                },
                "avgEntryPriceAtoms": {
                  "type": "string",
                  "pattern": "^[0-9]+$"
                },
                "avgEntryPrice": {
                  "type": "string",
                  "pattern": "^-?[0-9]+\\.[0-9]+$"
                },
                "avgExitPriceAtoms": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "pattern": "^[0-9]+$"
                },
                "avgExitPrice": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "pattern": "^-?[0-9]+\\.[0-9]+$"
                },
                "realizedPnlAtoms": {
                  "type": "string",
                  "pattern": "^-?[0-9]+$"
                },
                "realizedPnl": {
                  "type": "string",
                  "pattern": "^-?[0-9]+\\.[0-9]+$"
                },
                "feesPaidAtoms": {
                  "type": "string",
                  "pattern": "^[0-9]+$"
                },
                "feesPaid": {
                  "type": "string",
                  "pattern": "^-?[0-9]+\\.[0-9]+$"
                },
                "fundingPaidAtoms": {
                  "type": "string",
                  "pattern": "^-?[0-9]+$"
                },
                "fundingPaid": {
                  "type": "string",
                  "pattern": "^-?[0-9]+\\.[0-9]+$"
                },
                "closeReason": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "enum": [
                    "user_close",
                    "liquidation",
                    null
                  ]
                },
                "lastSequence": {
                  "type": "integer",
                  "minimum": 0
                },
                "markPriceAtoms": {
                  "type": "string",
                  "pattern": "^(0|[1-9][0-9]*)$"
                },
                "unrealizedPnlAtoms": {
                  "type": "string",
                  "pattern": "^-?(0|[1-9][0-9]*)$"
                },
                "liquidationPriceAtoms": {
                  "type": "string",
                  "pattern": "^(0|[1-9][0-9]*)$"
                },
                "marginHealthBps": {
                  "type": "string",
                  "pattern": "^-?(0|[1-9][0-9]*)$"
                },
                "equityAtoms": {
                  "type": "string",
                  "pattern": "^-?(0|[1-9][0-9]*)$"
                },
                "maintenanceRequirementAtoms": {
                  "type": "string",
                  "pattern": "^(0|[1-9][0-9]*)$"
                },
                "marginStatus": {
                  "type": "string",
                  "enum": [
                    "healthy",
                    "liquidation_candidate",
                    "bankrupt"
                  ]
                },
                "riskAsOfMarketDataSequence": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "liquidationTierConsistent": {
                  "type": "boolean",
                  "const": true
                }
              },
              "required": [
                "positionId",
                "accountId",
                "marketId",
                "side",
                "status",
                "openedAtEpochMs",
                "closedAtEpochMs",
                "maxQuantityAtoms",
                "maxQuantity",
                "currentQuantityAtoms",
                "currentQuantity",
                "avgEntryPriceAtoms",
                "avgEntryPrice",
                "avgExitPriceAtoms",
                "avgExitPrice",
                "realizedPnlAtoms",
                "realizedPnl",
                "feesPaidAtoms",
                "feesPaid",
                "fundingPaidAtoms",
                "fundingPaid",
                "closeReason",
                "lastSequence",
                "markPriceAtoms",
                "unrealizedPnlAtoms",
                "liquidationPriceAtoms",
                "marginHealthBps",
                "equityAtoms",
                "maintenanceRequirementAtoms",
                "marginStatus",
                "riskAsOfMarketDataSequence",
                "liquidationTierConsistent"
              ],
              "additionalProperties": false
            }
          },
          "resync": {
            "type": "object",
            "properties": {
              "stream": {
                "type": "string",
                "const": "account.positions"
              },
              "fromSequence": {
                "type": "integer",
                "exclusiveMinimum": 0
              }
            },
            "required": [
              "stream",
              "fromSequence"
            ],
            "additionalProperties": true
          }
        },
        "required": [
          "version",
          "accountId",
          "snapshotSequence",
          "readModelDigest",
          "positions",
          "resync"
        ],
        "additionalProperties": false
      },
      "ExternalPositionHistoryResponse": {
        "type": "object",
        "properties": {
          "version": {
            "type": "string",
            "const": "external-position-history/v1"
          },
          "accountId": {
            "type": "string",
            "minLength": 1
          },
          "marketId": {
            "type": "string",
            "minLength": 1
          },
          "status": {
            "type": "string",
            "enum": [
              "open",
              "closed",
              "liquidated"
            ]
          },
          "episodes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "positionId": {
                  "type": "string",
                  "minLength": 1
                },
                "accountId": {
                  "type": "string",
                  "minLength": 1
                },
                "marketId": {
                  "type": "string",
                  "minLength": 1
                },
                "side": {
                  "type": "string",
                  "enum": [
                    "long",
                    "short"
                  ]
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "open",
                    "closed",
                    "liquidated"
                  ]
                },
                "openedAtEpochMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "closedAtEpochMs": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "minimum": 0
                },
                "maxQuantityAtoms": {
                  "type": "string",
                  "pattern": "^[0-9]+$"
                },
                "maxQuantity": {
                  "type": "string",
                  "pattern": "^-?[0-9]+\\.[0-9]+$"
                },
                "currentQuantityAtoms": {
                  "type": "string",
                  "pattern": "^[0-9]+$"
                },
                "currentQuantity": {
                  "type": "string",
                  "pattern": "^-?[0-9]+\\.[0-9]+$"
                },
                "avgEntryPriceAtoms": {
                  "type": "string",
                  "pattern": "^[0-9]+$"
                },
                "avgEntryPrice": {
                  "type": "string",
                  "pattern": "^-?[0-9]+\\.[0-9]+$"
                },
                "avgExitPriceAtoms": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "pattern": "^[0-9]+$"
                },
                "avgExitPrice": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "pattern": "^-?[0-9]+\\.[0-9]+$"
                },
                "realizedPnlAtoms": {
                  "type": "string",
                  "pattern": "^-?[0-9]+$"
                },
                "realizedPnl": {
                  "type": "string",
                  "pattern": "^-?[0-9]+\\.[0-9]+$"
                },
                "feesPaidAtoms": {
                  "type": "string",
                  "pattern": "^[0-9]+$"
                },
                "feesPaid": {
                  "type": "string",
                  "pattern": "^-?[0-9]+\\.[0-9]+$"
                },
                "fundingPaidAtoms": {
                  "type": "string",
                  "pattern": "^-?[0-9]+$"
                },
                "fundingPaid": {
                  "type": "string",
                  "pattern": "^-?[0-9]+\\.[0-9]+$"
                },
                "closeReason": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "enum": [
                    "user_close",
                    "liquidation",
                    null
                  ]
                },
                "lastSequence": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "required": [
                "positionId",
                "accountId",
                "marketId",
                "side",
                "status",
                "openedAtEpochMs",
                "closedAtEpochMs",
                "maxQuantityAtoms",
                "maxQuantity",
                "currentQuantityAtoms",
                "currentQuantity",
                "avgEntryPriceAtoms",
                "avgEntryPrice",
                "avgExitPriceAtoms",
                "avgExitPrice",
                "realizedPnlAtoms",
                "realizedPnl",
                "feesPaidAtoms",
                "feesPaid",
                "fundingPaidAtoms",
                "fundingPaid",
                "closeReason",
                "lastSequence"
              ],
              "additionalProperties": false
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 1
          },
          "freshness": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "fresh",
                  "stale",
                  "backfilling",
                  "inconsistent"
                ]
              },
              "degradedState": {
                "type": "string",
                "enum": [
                  "none",
                  "warmup",
                  "paused",
                  "draining_to_journal",
                  "runtime_policy_unavailable",
                  "database_unavailable",
                  "journal_unavailable",
                  "projection_group_not_owned",
                  "projection_stale",
                  "replica_lagging",
                  "projector_backfilling",
                  "market_data_unavailable",
                  "canton_unavailable",
                  "signer_unavailable",
                  "reconciliation_blocked",
                  "kill_switch_active",
                  "authority_unreachable",
                  "unknown_command_outcome",
                  "action_requires_approval",
                  "dry_run_expired",
                  "unsafe_action_blocked"
                ]
              },
              "journalSequence": {
                "type": "integer",
                "minimum": 0
              },
              "asOfEpochMs": {
                "type": "integer",
                "minimum": 0
              },
              "projectorLagMs": {
                "type": "integer",
                "minimum": 0
              },
              "dbReplicaLagMs": {
                "type": "integer",
                "minimum": 0
              },
              "backfillStatus": {
                "type": "string",
                "enum": [
                  "live",
                  "backfilling"
                ]
              }
            },
            "required": [
              "status",
              "degradedState",
              "journalSequence",
              "asOfEpochMs",
              "projectorLagMs",
              "dbReplicaLagMs",
              "backfillStatus"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "version",
          "accountId",
          "episodes",
          "nextCursor",
          "freshness"
        ],
        "additionalProperties": false
      },
      "ExternalTransferHistoryResponse": {
        "type": "object",
        "properties": {
          "version": {
            "type": "string",
            "const": "external-transfer-history/v1"
          },
          "accountId": {
            "type": "string",
            "minLength": 1
          },
          "kind": {
            "type": "string",
            "enum": [
              "deposit",
              "withdrawal"
            ]
          },
          "transfers": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "transferId": {
                  "type": "string",
                  "minLength": 1
                },
                "accountId": {
                  "type": "string",
                  "minLength": 1
                },
                "kind": {
                  "type": "string",
                  "enum": [
                    "deposit",
                    "withdrawal"
                  ]
                },
                "asset": {
                  "type": "string",
                  "minLength": 1
                },
                "amountAtoms": {
                  "type": "string",
                  "pattern": "^[0-9]+$"
                },
                "amount": {
                  "type": "string",
                  "pattern": "^-?[0-9]+\\.[0-9]+$"
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "credited",
                    "requested",
                    "authorized",
                    "rejected",
                    "settled"
                  ]
                },
                "cantonEventId": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "minLength": 1
                },
                "updatedAtEpochMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "lastSequence": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "required": [
                "transferId",
                "accountId",
                "kind",
                "asset",
                "amountAtoms",
                "amount",
                "status",
                "cantonEventId",
                "updatedAtEpochMs",
                "lastSequence"
              ],
              "additionalProperties": false
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 1
          },
          "freshness": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "fresh",
                  "stale",
                  "backfilling",
                  "inconsistent"
                ]
              },
              "degradedState": {
                "type": "string",
                "enum": [
                  "none",
                  "warmup",
                  "paused",
                  "draining_to_journal",
                  "runtime_policy_unavailable",
                  "database_unavailable",
                  "journal_unavailable",
                  "projection_group_not_owned",
                  "projection_stale",
                  "replica_lagging",
                  "projector_backfilling",
                  "market_data_unavailable",
                  "canton_unavailable",
                  "signer_unavailable",
                  "reconciliation_blocked",
                  "kill_switch_active",
                  "authority_unreachable",
                  "unknown_command_outcome",
                  "action_requires_approval",
                  "dry_run_expired",
                  "unsafe_action_blocked"
                ]
              },
              "journalSequence": {
                "type": "integer",
                "minimum": 0
              },
              "asOfEpochMs": {
                "type": "integer",
                "minimum": 0
              },
              "projectorLagMs": {
                "type": "integer",
                "minimum": 0
              },
              "dbReplicaLagMs": {
                "type": "integer",
                "minimum": 0
              },
              "backfillStatus": {
                "type": "string",
                "enum": [
                  "live",
                  "backfilling"
                ]
              }
            },
            "required": [
              "status",
              "degradedState",
              "journalSequence",
              "asOfEpochMs",
              "projectorLagMs",
              "dbReplicaLagMs",
              "backfillStatus"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "version",
          "accountId",
          "transfers",
          "nextCursor",
          "freshness"
        ],
        "additionalProperties": false
      },
      "ExternalAffiliateEarningsResponse": {
        "type": "object",
        "properties": {
          "version": {
            "type": "string",
            "const": "external-affiliate-earnings/v1"
          },
          "accountId": {
            "type": "string",
            "minLength": 1
          },
          "affiliateId": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 1
          },
          "settlements": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "settlementId": {
                  "type": "string",
                  "minLength": 1
                },
                "feeAsset": {
                  "type": "string",
                  "minLength": 1
                },
                "periodStartEpochMs": {
                  "type": "integer",
                  "exclusiveMinimum": 0
                },
                "periodEndEpochMs": {
                  "type": "integer",
                  "exclusiveMinimum": 0
                },
                "settledFeeAtoms": {
                  "type": "string",
                  "pattern": "^(0|[1-9][0-9]*)$"
                },
                "source": {
                  "type": "string",
                  "enum": [
                    "paid_fee_atoms"
                  ]
                },
                "throughJournalSequence": {
                  "type": "integer",
                  "minimum": 0
                },
                "fillCount": {
                  "type": "integer",
                  "minimum": 0
                },
                "settledAtEpochMs": {
                  "type": "integer",
                  "exclusiveMinimum": 0
                },
                "acknowledgedShortfall": {
                  "type": "object",
                  "properties": {
                    "journalSequences": {
                      "type": "array",
                      "items": {
                        "type": "integer",
                        "exclusiveMinimum": 0
                      },
                      "minItems": 1
                    },
                    "reason": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "required": [
                    "journalSequences",
                    "reason"
                  ],
                  "additionalProperties": false
                }
              },
              "required": [
                "settlementId",
                "feeAsset",
                "periodStartEpochMs",
                "periodEndEpochMs",
                "settledFeeAtoms",
                "source",
                "throughJournalSequence",
                "fillCount",
                "settledAtEpochMs"
              ],
              "additionalProperties": false
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 1
          }
        },
        "required": [
          "version",
          "accountId",
          "affiliateId",
          "settlements",
          "nextCursor"
        ],
        "additionalProperties": false
      },
      "ExternalAffiliateProfileResponse": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "version": {
                "type": "string",
                "const": "external-affiliate-profile/v1"
              },
              "accountId": {
                "type": "string",
                "minLength": 1
              },
              "registered": {
                "type": "boolean",
                "const": false
              },
              "affiliateId": {
                "type": "null"
              },
              "referralCode": {
                "type": "null"
              },
              "registeredAtEpochMs": {
                "type": "null"
              }
            },
            "required": [
              "version",
              "accountId",
              "registered",
              "affiliateId",
              "referralCode",
              "registeredAtEpochMs"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "version": {
                "type": "string",
                "const": "external-affiliate-profile/v1"
              },
              "accountId": {
                "type": "string",
                "minLength": 1
              },
              "registered": {
                "type": "boolean",
                "const": true
              },
              "affiliateId": {
                "type": "string",
                "minLength": 1
              },
              "referralCode": {
                "type": "string",
                "pattern": "^[a-f0-9]{16}$"
              },
              "registeredAtEpochMs": {
                "type": "integer",
                "exclusiveMinimum": 0
              }
            },
            "required": [
              "version",
              "accountId",
              "registered",
              "affiliateId",
              "referralCode",
              "registeredAtEpochMs"
            ],
            "additionalProperties": false
          }
        ]
      },
      "ExternalKycStatusResponse": {
        "type": "object",
        "properties": {
          "version": {
            "type": "string",
            "const": "external-kyc-status/v1"
          },
          "required": {
            "type": "boolean"
          },
          "providerAvailability": {
            "type": "string",
            "const": "unavailable"
          },
          "state": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "const": "not_started"
                  },
                  "createdAtEpochMs": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "updatedAtEpochMs": {
                    "type": "integer",
                    "minimum": 0
                  }
                },
                "required": [
                  "status",
                  "createdAtEpochMs",
                  "updatedAtEpochMs"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "const": "skipped"
                  },
                  "createdAtEpochMs": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "updatedAtEpochMs": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "skippedAtEpochMs": {
                    "type": "integer",
                    "minimum": 0
                  }
                },
                "required": [
                  "status",
                  "createdAtEpochMs",
                  "updatedAtEpochMs",
                  "skippedAtEpochMs"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "const": "verified"
                  },
                  "createdAtEpochMs": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "updatedAtEpochMs": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "verifiedAtEpochMs": {
                    "type": "integer",
                    "minimum": 0
                  }
                },
                "required": [
                  "status",
                  "createdAtEpochMs",
                  "updatedAtEpochMs",
                  "verifiedAtEpochMs"
                ],
                "additionalProperties": false
              }
            ]
          }
        },
        "required": [
          "version",
          "required",
          "providerAvailability",
          "state"
        ],
        "additionalProperties": false
      },
      "ExternalAccountFillHistoryResponse": {
        "type": "object",
        "properties": {
          "version": {
            "type": "string",
            "const": "external-account-fill-history/v1"
          },
          "accountId": {
            "type": "string",
            "minLength": 1
          },
          "marketId": {
            "type": "string",
            "minLength": 1
          },
          "fills": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "tradeId": {
                  "type": "string",
                  "minLength": 1
                },
                "accountId": {
                  "type": "string",
                  "minLength": 1
                },
                "marketId": {
                  "type": "string",
                  "minLength": 1
                },
                "role": {
                  "type": "string",
                  "enum": [
                    "maker",
                    "taker"
                  ]
                },
                "feePaidAtoms": {
                  "type": "string",
                  "pattern": "^[0-9]+$"
                },
                "feePaid": {
                  "type": "string",
                  "pattern": "^-?[0-9]+\\.[0-9]+$"
                },
                "feeRole": {
                  "type": "string",
                  "enum": [
                    "maker",
                    "taker"
                  ]
                },
                "side": {
                  "type": "string",
                  "enum": [
                    "buy",
                    "sell"
                  ]
                },
                "priceAtoms": {
                  "type": "string",
                  "pattern": "^[0-9]+$"
                },
                "price": {
                  "type": "string",
                  "pattern": "^-?[0-9]+\\.[0-9]+$"
                },
                "sizeAtoms": {
                  "type": "string",
                  "pattern": "^[0-9]+$"
                },
                "size": {
                  "type": "string",
                  "pattern": "^-?[0-9]+\\.[0-9]+$"
                },
                "orderId": {
                  "type": "string",
                  "minLength": 1
                },
                "counterpartyOrderId": {
                  "type": "string",
                  "minLength": 1
                },
                "realizedPnlAtoms": {
                  "type": "string",
                  "pattern": "^-?[0-9]+$"
                },
                "realizedPnl": {
                  "type": "string",
                  "pattern": "^-?[0-9]+\\.[0-9]+$"
                },
                "occurredAtEpochMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "lastSequence": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "required": [
                "tradeId",
                "accountId",
                "marketId",
                "role",
                "feePaidAtoms",
                "feePaid",
                "feeRole",
                "side",
                "priceAtoms",
                "price",
                "sizeAtoms",
                "size",
                "orderId",
                "counterpartyOrderId",
                "occurredAtEpochMs",
                "lastSequence"
              ],
              "additionalProperties": false
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 1
          },
          "freshness": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "fresh",
                  "stale",
                  "backfilling",
                  "inconsistent"
                ]
              },
              "degradedState": {
                "type": "string",
                "enum": [
                  "none",
                  "warmup",
                  "paused",
                  "draining_to_journal",
                  "runtime_policy_unavailable",
                  "database_unavailable",
                  "journal_unavailable",
                  "projection_group_not_owned",
                  "projection_stale",
                  "replica_lagging",
                  "projector_backfilling",
                  "market_data_unavailable",
                  "canton_unavailable",
                  "signer_unavailable",
                  "reconciliation_blocked",
                  "kill_switch_active",
                  "authority_unreachable",
                  "unknown_command_outcome",
                  "action_requires_approval",
                  "dry_run_expired",
                  "unsafe_action_blocked"
                ]
              },
              "journalSequence": {
                "type": "integer",
                "minimum": 0
              },
              "asOfEpochMs": {
                "type": "integer",
                "minimum": 0
              },
              "projectorLagMs": {
                "type": "integer",
                "minimum": 0
              },
              "dbReplicaLagMs": {
                "type": "integer",
                "minimum": 0
              },
              "backfillStatus": {
                "type": "string",
                "enum": [
                  "live",
                  "backfilling"
                ]
              }
            },
            "required": [
              "status",
              "degradedState",
              "journalSequence",
              "asOfEpochMs",
              "projectorLagMs",
              "dbReplicaLagMs",
              "backfillStatus"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "version",
          "accountId",
          "fills",
          "nextCursor",
          "freshness"
        ],
        "additionalProperties": false
      },
      "ExternalAccountOrderHistoryResponse": {
        "type": "object",
        "properties": {
          "version": {
            "type": "string",
            "const": "external-account-order-history/v2"
          },
          "commandOutcomes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "eventId": {
                  "type": "string",
                  "pattern": "^edjc:[a-f0-9]{64}$"
                },
                "source": {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "type": "string",
                      "const": "edjc_source/v1"
                    },
                    "engineId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "shardId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "accountingEpoch": {
                      "type": "string",
                      "minLength": 1
                    },
                    "bootstrapDigest": {
                      "type": "string",
                      "pattern": "^sha256:[a-f0-9]{64}$"
                    }
                  },
                  "required": [
                    "kind",
                    "engineId",
                    "shardId",
                    "accountingEpoch",
                    "bootstrapDigest"
                  ],
                  "additionalProperties": false
                },
                "recordDigest": {
                  "type": "string",
                  "pattern": "^sha256:[a-f0-9]{64}$"
                },
                "recordOrdinal": {
                  "type": "integer",
                  "exclusiveMinimum": 0
                },
                "engineSequence": {
                  "type": "integer",
                  "minimum": 0
                },
                "eventIndex": {
                  "type": "integer",
                  "minimum": 0
                },
                "assignedAtEpochMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "outcome": {
                  "type": "string",
                  "const": "rejected"
                },
                "commandId": {
                  "type": "string",
                  "minLength": 1
                },
                "orderId": {
                  "type": "string",
                  "minLength": 1
                },
                "accountId": {
                  "type": "string",
                  "minLength": 1
                },
                "marketId": {
                  "type": "string",
                  "minLength": 1
                },
                "reason": {
                  "type": "string",
                  "enum": [
                    "engine_paused",
                    "missing_market_data_regime",
                    "malformed_command",
                    "idempotency_key_conflict",
                    "unsupported_order_command",
                    "malformed_order_command",
                    "unknown_market",
                    "invalid_account",
                    "invalid_side",
                    "invalid_order_type",
                    "invalid_time_in_force",
                    "invalid_slippage",
                    "invalid_price",
                    "invalid_quantity",
                    "invalid_leverage",
                    "reduce_only_required",
                    "market_halted",
                    "market_not_open",
                    "invalid_order_id",
                    "duplicate_order_id",
                    "market_order_unavailable",
                    "reduce_only_position_unavailable",
                    "self_trade_prevented",
                    "risk_reserve_unavailable",
                    "unknown_margin_account",
                    "withdrawals_blocked",
                    "liquidation_candidate",
                    "bad_debt",
                    "insufficient_margin",
                    "leverage_exceeds_market_max",
                    "reserve_id_conflict",
                    "sequencer_rejected",
                    "stale_market_data_regime",
                    "diverged_market_data_regime",
                    "low_confidence_market_data_regime",
                    "expired_market_data_regime",
                    "halted_market_data_regime",
                    "manual_pause_market_data_regime",
                    "unknown_order",
                    "invalid_status_transition",
                    "post_only_would_cross",
                    "max_matches_exceeded"
                  ]
                },
                "materializedAtEpochMs": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "required": [
                "eventId",
                "source",
                "recordDigest",
                "recordOrdinal",
                "engineSequence",
                "eventIndex",
                "assignedAtEpochMs",
                "outcome",
                "commandId",
                "orderId",
                "accountId",
                "marketId",
                "reason",
                "materializedAtEpochMs"
              ],
              "additionalProperties": false
            }
          },
          "accountId": {
            "type": "string",
            "minLength": 1
          },
          "marketId": {
            "type": "string",
            "minLength": 1
          },
          "status": {
            "type": "string",
            "enum": [
              "open",
              "partially_filled",
              "filled",
              "canceled",
              "replaced"
            ]
          },
          "orders": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "orderId": {
                  "type": "string",
                  "minLength": 1
                },
                "accountId": {
                  "type": "string",
                  "minLength": 1
                },
                "marketId": {
                  "type": "string",
                  "minLength": 1
                },
                "configurationId": {
                  "type": "string",
                  "minLength": 1,
                  "pattern": "^[A-Za-z0-9_-]+$"
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "open",
                    "partially_filled",
                    "filled",
                    "canceled",
                    "replaced"
                  ]
                },
                "side": {
                  "type": "string",
                  "enum": [
                    "buy",
                    "sell"
                  ]
                },
                "orderType": {
                  "type": "string",
                  "enum": [
                    "limit",
                    "market"
                  ]
                },
                "price": {
                  "type": "string",
                  "pattern": "^[0-9]+(?:\\.[0-9]+)?$"
                },
                "quantity": {
                  "type": "string",
                  "pattern": "^[0-9]+(?:\\.[0-9]+)?$"
                },
                "filledQuantity": {
                  "type": "string",
                  "pattern": "^[0-9]+(?:\\.[0-9]+)?$"
                },
                "remainingQuantity": {
                  "type": "string",
                  "pattern": "^[0-9]+(?:\\.[0-9]+)?$"
                },
                "reduceOnly": {
                  "type": "boolean"
                },
                "updatedAtEpochMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "lastSequence": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "required": [
                "orderId",
                "accountId",
                "marketId",
                "status",
                "updatedAtEpochMs",
                "lastSequence"
              ],
              "additionalProperties": false
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 1
          },
          "freshness": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "fresh",
                  "stale",
                  "backfilling",
                  "inconsistent"
                ]
              },
              "degradedState": {
                "type": "string",
                "enum": [
                  "none",
                  "warmup",
                  "paused",
                  "draining_to_journal",
                  "runtime_policy_unavailable",
                  "database_unavailable",
                  "journal_unavailable",
                  "projection_group_not_owned",
                  "projection_stale",
                  "replica_lagging",
                  "projector_backfilling",
                  "market_data_unavailable",
                  "canton_unavailable",
                  "signer_unavailable",
                  "reconciliation_blocked",
                  "kill_switch_active",
                  "authority_unreachable",
                  "unknown_command_outcome",
                  "action_requires_approval",
                  "dry_run_expired",
                  "unsafe_action_blocked"
                ]
              },
              "journalSequence": {
                "type": "integer",
                "minimum": 0
              },
              "asOfEpochMs": {
                "type": "integer",
                "minimum": 0
              },
              "projectorLagMs": {
                "type": "integer",
                "minimum": 0
              },
              "dbReplicaLagMs": {
                "type": "integer",
                "minimum": 0
              },
              "backfillStatus": {
                "type": "string",
                "enum": [
                  "live",
                  "backfilling"
                ]
              }
            },
            "required": [
              "status",
              "degradedState",
              "journalSequence",
              "asOfEpochMs",
              "projectorLagMs",
              "dbReplicaLagMs",
              "backfillStatus"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "version",
          "accountId",
          "orders",
          "nextCursor",
          "freshness"
        ],
        "additionalProperties": false
      },
      "ExternalOpenOrdersResponse": {
        "type": "object",
        "properties": {
          "version": {
            "type": "string",
            "const": "external-open-orders/v1"
          },
          "accountId": {
            "type": "string",
            "minLength": 1
          },
          "marketId": {
            "type": "string",
            "minLength": 1
          },
          "orders": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "orderId": {
                  "type": "string",
                  "minLength": 1
                },
                "accountId": {
                  "type": "string",
                  "minLength": 1
                },
                "marketId": {
                  "type": "string",
                  "minLength": 1
                },
                "side": {
                  "type": "string",
                  "enum": [
                    "buy",
                    "sell"
                  ]
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "open",
                    "partially_filled"
                  ]
                },
                "priceAtoms": {
                  "type": "string",
                  "pattern": "^(0|[1-9][0-9]*)$"
                },
                "quantityAtoms": {
                  "type": "string",
                  "pattern": "^(0|[1-9][0-9]*)$"
                },
                "filledQuantityAtoms": {
                  "type": "string",
                  "pattern": "^(0|[1-9][0-9]*)$"
                },
                "remainingQuantityAtoms": {
                  "type": "string",
                  "pattern": "^(0|[1-9][0-9]*)$"
                },
                "reduceOnly": {
                  "type": "boolean"
                },
                "autoClose": {
                  "type": "object",
                  "properties": {
                    "takeProfitPriceAtoms": {
                      "type": "string",
                      "pattern": "^[1-9][0-9]*$"
                    },
                    "stopLossPriceAtoms": {
                      "type": "string",
                      "pattern": "^[1-9][0-9]*$"
                    }
                  },
                  "additionalProperties": false
                },
                "sequence": {
                  "type": "integer",
                  "minimum": 0
                },
                "receivedAtEpochMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "createdJournalSequence": {
                  "type": "integer",
                  "minimum": 0
                },
                "updatedJournalSequence": {
                  "type": "integer",
                  "minimum": 0
                },
                "priceScale": {
                  "type": "integer",
                  "minimum": 0
                },
                "quantityScale": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "required": [
                "orderId",
                "accountId",
                "marketId",
                "side",
                "status",
                "priceAtoms",
                "quantityAtoms",
                "filledQuantityAtoms",
                "remainingQuantityAtoms",
                "reduceOnly",
                "sequence",
                "receivedAtEpochMs",
                "createdJournalSequence",
                "updatedJournalSequence",
                "priceScale",
                "quantityScale"
              ],
              "additionalProperties": false
            },
            "maxItems": 500
          },
          "openOrderCount": {
            "type": "integer",
            "minimum": 0
          },
          "truncated": {
            "type": "boolean"
          },
          "snapshotSequence": {
            "type": "integer",
            "minimum": 0
          },
          "resync": {
            "type": "object",
            "properties": {
              "stream": {
                "type": "string",
                "const": "account.orders"
              },
              "fromSequence": {
                "type": "integer",
                "minimum": 0
              }
            },
            "required": [
              "stream",
              "fromSequence"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "version",
          "accountId",
          "orders",
          "openOrderCount",
          "truncated",
          "snapshotSequence",
          "resync"
        ],
        "additionalProperties": false
      },
      "CcxtV2MarketsResponse": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1
            },
            "symbol": {
              "type": "string",
              "minLength": 1
            },
            "base": {
              "type": "string",
              "minLength": 1
            },
            "quote": {
              "type": "string",
              "minLength": 1
            },
            "settle": {
              "type": "string",
              "minLength": 1
            },
            "baseId": {
              "type": "string",
              "minLength": 1
            },
            "quoteId": {
              "type": "string",
              "minLength": 1
            },
            "settleId": {
              "type": "string",
              "minLength": 1
            },
            "type": {
              "type": "string",
              "const": "swap"
            },
            "spot": {
              "type": "boolean",
              "const": false
            },
            "margin": {
              "type": "boolean",
              "const": false
            },
            "swap": {
              "type": "boolean",
              "const": true
            },
            "future": {
              "type": "boolean",
              "const": false
            },
            "option": {
              "type": "boolean",
              "const": false
            },
            "active": {
              "type": "boolean"
            },
            "contract": {
              "type": "boolean",
              "const": true
            },
            "linear": {
              "type": "boolean",
              "const": true
            },
            "inverse": {
              "type": "boolean",
              "const": false
            },
            "maker": {
              "type": "number",
              "minimum": 0
            },
            "taker": {
              "type": "number",
              "minimum": 0
            },
            "precision": {
              "type": "object",
              "properties": {
                "amount": {
                  "type": "number",
                  "exclusiveMinimum": 0
                },
                "price": {
                  "type": "number",
                  "exclusiveMinimum": 0
                }
              },
              "required": [
                "amount",
                "price"
              ],
              "additionalProperties": false
            },
            "limits": {
              "type": "object",
              "properties": {
                "amount": {
                  "type": "object",
                  "properties": {
                    "min": {
                      "type": "number",
                      "minimum": 0
                    },
                    "max": {
                      "type": "number",
                      "exclusiveMinimum": 0
                    }
                  },
                  "required": [
                    "min",
                    "max"
                  ],
                  "additionalProperties": false
                },
                "price": {
                  "type": "object",
                  "properties": {
                    "min": {
                      "type": "number",
                      "minimum": 0
                    },
                    "max": {
                      "type": "number",
                      "exclusiveMinimum": 0
                    }
                  },
                  "required": [
                    "min",
                    "max"
                  ],
                  "additionalProperties": false
                },
                "leverage": {
                  "type": "object",
                  "properties": {
                    "min": {
                      "type": "number",
                      "const": 1
                    },
                    "max": {
                      "type": "number",
                      "exclusiveMinimum": 0
                    }
                  },
                  "required": [
                    "min",
                    "max"
                  ],
                  "additionalProperties": false
                }
              },
              "required": [
                "amount",
                "price",
                "leverage"
              ],
              "additionalProperties": false
            },
            "info": {
              "type": "object",
              "properties": {
                "marketId": {
                  "type": "string",
                  "minLength": 1
                },
                "underlyingSymbol": {
                  "type": "string",
                  "minLength": 1
                },
                "marketType": {
                  "type": "string",
                  "enum": [
                    "crypto",
                    "stock",
                    "forex",
                    "commodity",
                    "index"
                  ]
                },
                "logoUrl": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "logoUnavailable": {
                  "type": "boolean"
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "draft",
                    "backfilling",
                    "open",
                    "paused",
                    "halted",
                    "cancel_only",
                    "reduce_only"
                  ]
                },
                "priceScale": {
                  "type": "integer",
                  "minimum": 0
                },
                "quantityScale": {
                  "type": "integer",
                  "minimum": 0
                },
                "minPrice": {
                  "type": "string",
                  "minLength": 1
                },
                "maxPrice": {
                  "type": "string",
                  "minLength": 1
                },
                "minQuantity": {
                  "type": "string",
                  "minLength": 1
                },
                "maxQuantity": {
                  "type": "string",
                  "minLength": 1
                },
                "initialMarginBps": {
                  "type": "integer",
                  "exclusiveMinimum": 0
                },
                "maintenanceMarginTiers": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "notionalThresholdAtoms": {
                        "type": "string",
                        "pattern": "^(0|[1-9][0-9]*)$"
                      },
                      "maintenanceMarginBps": {
                        "type": "integer",
                        "exclusiveMinimum": 0,
                        "minimum": -9007199254740991,
                        "maximum": 9999
                      }
                    },
                    "required": [
                      "notionalThresholdAtoms",
                      "maintenanceMarginBps"
                    ],
                    "additionalProperties": false
                  },
                  "minItems": 1,
                  "maxItems": 16
                },
                "maxLeverageX": {
                  "type": "integer",
                  "exclusiveMinimum": 0
                },
                "makerFeeBps": {
                  "type": "integer",
                  "minimum": 0
                },
                "takerFeeBps": {
                  "type": "integer",
                  "minimum": 0
                },
                "settlementAsset": {
                  "type": "string",
                  "minLength": 1
                },
                "lastPriceAtoms": {
                  "type": "string",
                  "pattern": "^[0-9]+$"
                },
                "lastPrice": {
                  "type": "string",
                  "pattern": "^-?[0-9]+\\.[0-9]+$"
                },
                "change24hBps": {
                  "type": "string",
                  "pattern": "^-?(0|[1-9][0-9]*)$"
                },
                "favorite": {
                  "type": "boolean"
                },
                "settlementAssetDecimals": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 10,
                  "description": "Decimal places of settlementAsset: every collateral amount (balances, margin, PnL, fees, deposits, withdrawals) is an integer count of 10^-settlementAssetDecimals units of it."
                }
              },
              "required": [
                "marketId",
                "underlyingSymbol",
                "marketType",
                "logoUrl",
                "logoUnavailable",
                "status",
                "priceScale",
                "quantityScale",
                "minPrice",
                "maxPrice",
                "minQuantity",
                "maxQuantity",
                "initialMarginBps",
                "maintenanceMarginTiers",
                "maxLeverageX",
                "makerFeeBps",
                "takerFeeBps",
                "settlementAsset",
                "lastPriceAtoms",
                "lastPrice",
                "change24hBps",
                "settlementAssetDecimals"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "id",
            "symbol",
            "base",
            "quote",
            "settle",
            "baseId",
            "quoteId",
            "settleId",
            "type",
            "spot",
            "margin",
            "swap",
            "future",
            "option",
            "active",
            "contract",
            "linear",
            "inverse",
            "maker",
            "taker",
            "precision",
            "limits",
            "info"
          ],
          "additionalProperties": false
        }
      },
      "CcxtV2ErrorResponse": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "AccountNotEnabled",
              "ArgumentsRequired",
              "AuthenticationError",
              "BadRequest",
              "BadSymbol",
              "DuplicateOrderId",
              "ExchangeError",
              "ExchangeNotAvailable",
              "InsufficientFunds",
              "InvalidOrder",
              "MarketClosed",
              "NotSupported",
              "OrderNotFound",
              "PermissionDenied",
              "RateLimitExceeded"
            ]
          },
          "message": {
            "type": "string",
            "minLength": 1
          },
          "code": {
            "type": "string",
            "enum": [
              "invalid_request",
              "unauthorized",
              "forbidden",
              "not_found",
              "idempotency_key_required",
              "rate_limited",
              "operation_not_available",
              "kyc_required",
              "command_rejected",
              "snapshot_unavailable",
              "service_degraded",
              "order_intake_stopped",
              "account_intake_stopped",
              "withdrawal_intake_stopped",
              "deposit_intake_stopped",
              "canton_offline",
              "dependency_unavailable",
              "account_legacy_excluded",
              "bot_fence_stale",
              "api_key_already_rotated",
              "malformed_command",
              "malformed_order_command",
              "unsupported_order_command",
              "duplicate_order_command",
              "idempotency_key_conflict",
              "unknown_market",
              "unknown_order",
              "invalid_account",
              "invalid_side",
              "invalid_order_id",
              "invalid_order_type",
              "market_order_unavailable",
              "invalid_price",
              "invalid_quantity",
              "invalid_leverage",
              "invalid_slippage",
              "market_halted",
              "duplicate_order_id",
              "market_not_open",
              "market_session_closed",
              "market_pre_close_cutoff",
              "reduce_only_required",
              "reduce_only_position_unavailable",
              "self_trade_prevented",
              "post_only_would_cross",
              "max_matches_exceeded",
              "risk_reserve_unavailable",
              "invalid_status_transition",
              "sequencer_rejected",
              "unknown_margin_account",
              "invalid_order_size",
              "withdrawals_blocked",
              "liquidation_candidate",
              "bad_debt",
              "insufficient_margin",
              "leverage_exceeds_market_max",
              "reserve_id_conflict",
              "unknown_reserve",
              "mark_unavailable",
              "insufficient_liquidity",
              "invalid_preview_request",
              "order_rejected_unmapped"
            ]
          },
          "retryable": {
            "type": "boolean"
          },
          "timestamp": {
            "type": "integer",
            "minimum": 0
          },
          "datetime": {
            "type": "string"
          },
          "info": {
            "type": "object",
            "properties": {
              "version": {
                "type": "string",
                "const": "external-rest-error/v1"
              },
              "requestId": {
                "type": "string",
                "minLength": 1
              },
              "code": {
                "type": "string",
                "enum": [
                  "invalid_request",
                  "unauthorized",
                  "forbidden",
                  "not_found",
                  "idempotency_key_required",
                  "rate_limited",
                  "operation_not_available",
                  "kyc_required",
                  "command_rejected",
                  "snapshot_unavailable",
                  "service_degraded",
                  "order_intake_stopped",
                  "account_intake_stopped",
                  "withdrawal_intake_stopped",
                  "deposit_intake_stopped",
                  "canton_offline",
                  "dependency_unavailable",
                  "account_legacy_excluded",
                  "bot_fence_stale",
                  "api_key_already_rotated",
                  "malformed_command",
                  "malformed_order_command",
                  "unsupported_order_command",
                  "duplicate_order_command",
                  "idempotency_key_conflict",
                  "unknown_market",
                  "unknown_order",
                  "invalid_account",
                  "invalid_side",
                  "invalid_order_id",
                  "invalid_order_type",
                  "market_order_unavailable",
                  "invalid_price",
                  "invalid_quantity",
                  "invalid_leverage",
                  "invalid_slippage",
                  "market_halted",
                  "duplicate_order_id",
                  "market_not_open",
                  "market_session_closed",
                  "market_pre_close_cutoff",
                  "reduce_only_required",
                  "reduce_only_position_unavailable",
                  "self_trade_prevented",
                  "post_only_would_cross",
                  "max_matches_exceeded",
                  "risk_reserve_unavailable",
                  "invalid_status_transition",
                  "sequencer_rejected",
                  "unknown_margin_account",
                  "invalid_order_size",
                  "withdrawals_blocked",
                  "liquidation_candidate",
                  "bad_debt",
                  "insufficient_margin",
                  "leverage_exceeds_market_max",
                  "reserve_id_conflict",
                  "unknown_reserve",
                  "mark_unavailable",
                  "insufficient_liquidity",
                  "invalid_preview_request",
                  "order_rejected_unmapped"
                ]
              },
              "safeMessage": {
                "type": "string",
                "minLength": 1
              },
              "retryable": {
                "type": "boolean"
              },
              "recoveryActions": {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "none",
                    "retry_after",
                    "observe_status",
                    "refresh_snapshot",
                    "resubscribe_stream",
                    "wait_for_projector",
                    "wait_for_operator_recovery",
                    "contact_support",
                    "request_approval",
                    "rerun_dry_run",
                    "do_not_retry"
                  ]
                },
                "minItems": 1
              },
              "realtimeTicketFailure": {
                "type": "string",
                "enum": [
                  "invalid",
                  "replayed",
                  "replaced",
                  "expired",
                  "revoked",
                  "store_unavailable"
                ]
              },
              "apiKeyRejection": {
                "type": "string",
                "enum": [
                  "malformed",
                  "unknown",
                  "expired",
                  "revoked",
                  "principal_unavailable",
                  "store_unavailable",
                  "scope_insufficient",
                  "passkey_required",
                  "environment_forbidden",
                  "principal_mismatch",
                  "bot_fence_invalid",
                  "bot_fence_stale",
                  "already_rotated"
                ]
              },
              "rejectionGuard": {
                "type": "string",
                "enum": [
                  "amount_atoms_invalid",
                  "command_act_as_invalid",
                  "command_field_required",
                  "command_value_missing",
                  "completion_synchronizer_mismatch",
                  "deposit_field_required",
                  "deposit_integer_invalid",
                  "deposit_timestamp_invalid",
                  "hashing_scheme_unspecified",
                  "ledger_node_id_invalid",
                  "ledger_offset_invalid",
                  "rejection_completion_status",
                  "signature_failure_reason_invalid",
                  "signature_field_hex",
                  "signature_field_required",
                  "submission_id_mismatch",
                  "successful_completion_evidence",
                  "consumed_replay_evidence",
                  "delegated_signing_key_binding",
                  "deposit_asset_unsupported",
                  "deposit_amount_invalid",
                  "deposit_amount_rail_unsupported",
                  "deposit_amount_scale_exceeded",
                  "deposit_missing",
                  "deposit_owner_binding",
                  "deposit_scope",
                  "dfns_confirmation_environment",
                  "funding_intent",
                  "funding_intent_advance",
                  "funding_intent_already_bound",
                  "funding_intent_cancelled",
                  "funding_intent_consumed_without_deposit",
                  "funding_intent_missing",
                  "intent_asset_unsupported",
                  "intent_owner_binding",
                  "local_confirmation_environment",
                  "owner_intent_scope",
                  "owner_kind_unsupported",
                  "planned_command_identities",
                  "request_owner_binding",
                  "local_authority_party_missing",
                  "local_confirmation_deposit_status",
                  "local_operator_replay_mismatch",
                  "local_recovery_step_mismatch",
                  "local_signer_failed",
                  "local_signing_key_mismatch",
                  "local_wallet_binding",
                  "operator_step_expected",
                  "owner_step_expected",
                  "owner_submission_command_binding",
                  "planned_command_missing",
                  "planned_command_not_unique",
                  "post_offer_step_expected",
                  "reconciliation_signature_scope",
                  "signature_completion_action",
                  "signature_hex_missing",
                  "signing_step_ahead_of_deposit",
                  "treasury_execution_restore",
                  "treasury_offer_contract_missing",
                  "unknown_command_candidates",
                  "completion_read_refused",
                  "completion_correlation",
                  "completion_not_unique",
                  "completion_transaction_correlation",
                  "interactive_act_as_missing",
                  "interactive_transaction_correlation",
                  "reconcile_binding_mismatch",
                  "rejected_completion_has_update",
                  "standard_submission_correlation",
                  "standard_submission_response_invalid",
                  "successful_completion_update_missing",
                  "unrecoverable_command_evidence",
                  "executed_evidence_correlation",
                  "executed_evidence_replay",
                  "executed_evidence_rows",
                  "executed_evidence_signature_status",
                  "execute_permit_rows",
                  "execute_permit_signature_status",
                  "ledger_rejection_correlation",
                  "ledger_rejection_replay",
                  "ledger_rejection_rows",
                  "ledger_rejection_signature_status",
                  "preparation_lock_busy",
                  "reconciliation_signature_state",
                  "signature_identity_binding",
                  "signature_identity_missing",
                  "signature_permitted_command",
                  "signature_preparable_state",
                  "signature_preparation_replay",
                  "signature_record_identity",
                  "signature_record_missing",
                  "signature_record_shape",
                  "signature_replay",
                  "signature_row_count",
                  "signature_scope_environment",
                  "signature_scope_fingerprint",
                  "signature_session_consistency",
                  "canton_command_identity",
                  "command_completion_evidence",
                  "command_confirm_rows",
                  "command_confirm_state",
                  "command_evidence_replay",
                  "command_permit_rows",
                  "command_permit_state",
                  "command_predecessors_unconfirmed",
                  "command_release_evidence",
                  "command_release_replay",
                  "command_release_rows",
                  "command_release_state",
                  "signature_restart_state",
                  "existing_receipt_replay",
                  "existing_receipt_rows",
                  "existing_receipt_state",
                  "local_replay_command_state",
                  "local_replay_fence_rows",
                  "local_replay_fence_state",
                  "local_replay_step",
                  "persisted_permit_mismatch",
                  "treasury_offer_command_identity",
                  "treasury_offer_confirm_rows",
                  "treasury_offer_confirm_state",
                  "treasury_offer_evidence_replay",
                  "treasury_offer_permit_rows",
                  "treasury_offer_permit_state",
                  "treasury_offer_reject_rows",
                  "treasury_offer_reject_state",
                  "treasury_offer_rejection_replay",
                  "treasury_offer_submission_id",
                  "treasury_input_amount_mismatch",
                  "treasury_input_release_rows",
                  "treasury_input_release_state",
                  "treasury_input_reservation_mismatch",
                  "treasury_input_reservation_rows",
                  "treasury_input_reservation_state"
                ]
              },
              "withdrawalFailure": {
                "type": "string",
                "enum": [
                  "requested",
                  "margin_reserved",
                  "authorized",
                  "submitted",
                  "settled",
                  "rejected",
                  "expired",
                  "failed",
                  "invalid_transition",
                  "authorization_setup_failed",
                  "margin_blocked",
                  "co_sign_incomplete",
                  "co_sign_self_approval",
                  "ttl_expired",
                  "canton_submission_failed",
                  "withdrawal_payout_dfns_signature_failed",
                  "withdrawal_payout_canton_submit_refused",
                  "withdrawal_payout_ledger_time_expired",
                  "asset_unsupported",
                  "withdrawal_amount_invalid",
                  "withdrawal_amount_scale_exceeded",
                  "withdrawal_authorization_binding_mismatch",
                  "withdrawal_capability_unavailable",
                  "withdrawal_checkpoint_unavailable",
                  "withdrawal_destination_not_owned",
                  "withdrawal_not_found",
                  "withdrawal_operators_missing",
                  "withdrawal_operators_not_distinct",
                  "withdrawal_owner_party_invalid",
                  "withdrawal_owner_unavailable",
                  "withdrawal_request_invalid",
                  "withdrawal_request_ended",
                  "withdrawal_reservation_release_failed",
                  "withdrawal_unavailable",
                  "withdrawal_submission_unavailable",
                  "withdrawal_enqueue_failed",
                  "withdrawal_publish_failed"
                ]
              },
              "dependency": {
                "type": "string",
                "enum": [
                  "dfns",
                  "engine"
                ]
              },
              "occurredAtEpochMs": {
                "type": "integer",
                "minimum": 0
              }
            },
            "required": [
              "version",
              "requestId",
              "code",
              "safeMessage",
              "retryable",
              "recoveryActions",
              "occurredAtEpochMs"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "name",
          "message",
          "code",
          "retryable",
          "timestamp",
          "datetime",
          "info"
        ],
        "additionalProperties": false
      },
      "CcxtV2MarketStatsResponse": {
        "type": "object",
        "properties": {
          "symbol": {
            "type": "string",
            "minLength": 1
          },
          "timestamp": {
            "type": "integer",
            "minimum": 0
          },
          "datetime": {
            "type": "string"
          },
          "high": {
            "type": "number"
          },
          "low": {
            "type": "number"
          },
          "last": {
            "type": "number"
          },
          "quoteVolume": {
            "type": "number",
            "minimum": 0
          },
          "markPrice": {
            "type": "number"
          },
          "indexPrice": {
            "type": "number"
          },
          "fundingRate": {
            "type": "number"
          },
          "nextFundingRate": {
            "type": "number"
          },
          "nextFundingTimestamp": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "nextFundingDatetime": {
            "type": [
              "string",
              "null"
            ]
          },
          "interval": {
            "type": "string",
            "minLength": 1
          },
          "info": {
            "type": "object",
            "properties": {
              "version": {
                "type": "string",
                "const": "external-market-stats/v1"
              },
              "marketId": {
                "type": "string",
                "minLength": 1
              },
              "volume24hQuoteAtoms": {
                "type": "string",
                "pattern": "^[0-9]+$"
              },
              "volume24hQuote": {
                "type": "string",
                "pattern": "^-?[0-9]+\\.[0-9]+$"
              },
              "openInterestBaseAtoms": {
                "type": "string",
                "pattern": "^[0-9]+$"
              },
              "openInterestBase": {
                "type": "string",
                "pattern": "^-?[0-9]+\\.[0-9]+$"
              },
              "openInterestQuoteAtoms": {
                "type": "string",
                "pattern": "^[0-9]+$"
              },
              "openInterestQuote": {
                "type": "string",
                "pattern": "^-?[0-9]+\\.[0-9]+$"
              },
              "fundingRateBps": {
                "type": "string",
                "pattern": "^-?(0|[1-9][0-9]*)$"
              },
              "predictedFundingRateBps": {
                "type": "string",
                "pattern": "^-?(0|[1-9][0-9]*)$"
              },
              "nextFundingTimeEpochMs": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0
              },
              "fundingIntervalMs": {
                "type": "integer",
                "minimum": 0
              },
              "marketData": {
                "type": "object",
                "properties": {
                  "indexPriceAtoms": {
                    "type": "string",
                    "pattern": "^[0-9]+$"
                  },
                  "indexPrice": {
                    "type": "string",
                    "pattern": "^-?[0-9]+\\.[0-9]+$"
                  },
                  "markPriceAtoms": {
                    "type": "string",
                    "pattern": "^[0-9]+$"
                  },
                  "markPrice": {
                    "type": "string",
                    "pattern": "^-?[0-9]+\\.[0-9]+$"
                  },
                  "asOfEpochMs": {
                    "type": "integer",
                    "minimum": 0
                  }
                },
                "required": [
                  "indexPriceAtoms",
                  "indexPrice",
                  "markPriceAtoms",
                  "markPrice",
                  "asOfEpochMs"
                ],
                "additionalProperties": false
              },
              "lastPriceAtoms": {
                "type": "string",
                "pattern": "^[0-9]+$"
              },
              "lastPrice": {
                "type": "string",
                "pattern": "^-?[0-9]+\\.[0-9]+$"
              },
              "change24hBps": {
                "type": "string",
                "pattern": "^-?(0|[1-9][0-9]*)$"
              },
              "high24hAtoms": {
                "type": "string",
                "pattern": "^[0-9]+$"
              },
              "high24h": {
                "type": "string",
                "pattern": "^-?[0-9]+\\.[0-9]+$"
              },
              "low24hAtoms": {
                "type": "string",
                "pattern": "^[0-9]+$"
              },
              "low24h": {
                "type": "string",
                "pattern": "^-?[0-9]+\\.[0-9]+$"
              }
            },
            "required": [
              "version",
              "marketId",
              "volume24hQuoteAtoms",
              "volume24hQuote",
              "openInterestBaseAtoms",
              "openInterestBase",
              "openInterestQuoteAtoms",
              "openInterestQuote",
              "fundingRateBps",
              "predictedFundingRateBps",
              "nextFundingTimeEpochMs",
              "fundingIntervalMs",
              "marketData",
              "lastPriceAtoms",
              "lastPrice",
              "change24hBps",
              "high24hAtoms",
              "high24h",
              "low24hAtoms",
              "low24h"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "symbol",
          "timestamp",
          "datetime",
          "high",
          "low",
          "last",
          "quoteVolume",
          "markPrice",
          "indexPrice",
          "fundingRate",
          "nextFundingRate",
          "nextFundingTimestamp",
          "nextFundingDatetime",
          "interval",
          "info"
        ],
        "additionalProperties": false
      },
      "CcxtV2OhlcvResponse": {
        "type": "array",
        "items": {
          "type": "array",
          "prefixItems": [
            {
              "type": "integer",
              "minimum": 0
            },
            {
              "type": "number"
            },
            {
              "type": "number"
            },
            {
              "type": "number"
            },
            {
              "type": "number"
            },
            {
              "type": "number",
              "minimum": 0
            }
          ],
          "items": false,
          "minItems": 6,
          "maxItems": 6
        }
      },
      "CcxtV2OrderBookResponse": {
        "type": "object",
        "properties": {
          "symbol": {
            "type": "string",
            "minLength": 1
          },
          "bids": {
            "type": "array",
            "items": {
              "type": "array",
              "prefixItems": [
                {
                  "type": "number"
                },
                {
                  "type": "number",
                  "minimum": 0
                }
              ],
              "items": false,
              "minItems": 2,
              "maxItems": 2
            }
          },
          "asks": {
            "type": "array",
            "items": {
              "type": "array",
              "prefixItems": [
                {
                  "type": "number"
                },
                {
                  "type": "number",
                  "minimum": 0
                }
              ],
              "items": false,
              "minItems": 2,
              "maxItems": 2
            }
          },
          "nonce": {
            "type": "integer",
            "minimum": 0
          },
          "info": {
            "type": "object",
            "properties": {
              "version": {
                "type": "string",
                "const": "external-book-snapshot/v1"
              },
              "marketId": {
                "type": "string",
                "minLength": 1
              },
              "snapshotSequence": {
                "type": "integer",
                "minimum": 0
              },
              "readModelDigest": {
                "type": "string",
                "pattern": "^sha256:[0-9a-f]{64}$",
                "description": "Covers the book content published here -- marketId, snapshotSequence, bids and asks. Recomputable by a client from this payload."
              },
              "bids": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "priceAtoms": {
                      "type": "string",
                      "pattern": "^[0-9]+$"
                    },
                    "price": {
                      "type": "string",
                      "pattern": "^-?[0-9]+\\.[0-9]+$"
                    },
                    "sizeAtoms": {
                      "type": "string",
                      "pattern": "^[0-9]+$"
                    },
                    "size": {
                      "type": "string",
                      "pattern": "^-?[0-9]+\\.[0-9]+$"
                    }
                  },
                  "required": [
                    "priceAtoms",
                    "price",
                    "sizeAtoms",
                    "size"
                  ],
                  "additionalProperties": false
                }
              },
              "asks": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "priceAtoms": {
                      "type": "string",
                      "pattern": "^[0-9]+$"
                    },
                    "price": {
                      "type": "string",
                      "pattern": "^-?[0-9]+\\.[0-9]+$"
                    },
                    "sizeAtoms": {
                      "type": "string",
                      "pattern": "^[0-9]+$"
                    },
                    "size": {
                      "type": "string",
                      "pattern": "^-?[0-9]+\\.[0-9]+$"
                    }
                  },
                  "required": [
                    "priceAtoms",
                    "price",
                    "sizeAtoms",
                    "size"
                  ],
                  "additionalProperties": false
                }
              },
              "checksum": {
                "type": "string",
                "pattern": "^sha256:[0-9a-f]{64}$"
              },
              "resync": {
                "type": "object",
                "properties": {
                  "stream": {
                    "type": "string",
                    "const": "market.book"
                  },
                  "fromSequence": {
                    "type": "integer",
                    "exclusiveMinimum": 0
                  }
                },
                "required": [
                  "stream",
                  "fromSequence"
                ],
                "additionalProperties": true
              }
            },
            "required": [
              "version",
              "marketId",
              "snapshotSequence",
              "readModelDigest",
              "bids",
              "asks",
              "checksum",
              "resync"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "symbol",
          "bids",
          "asks",
          "nonce",
          "info"
        ],
        "additionalProperties": false
      },
      "CcxtV2BalanceResponse": {
        "type": "object",
        "properties": {
          "free": {
            "type": "object",
            "additionalProperties": {
              "type": "number"
            }
          },
          "used": {
            "type": "object",
            "additionalProperties": {
              "type": "number"
            }
          },
          "total": {
            "type": "object",
            "additionalProperties": {
              "type": "number"
            }
          },
          "info": {
            "type": "object",
            "properties": {
              "consentState": {
                "type": "string",
                "enum": [
                  "absent",
                  "pending",
                  "active",
                  "revoked",
                  "package_unavailable"
                ],
                "default": "absent"
              },
              "version": {
                "type": "string",
                "const": "external-account-snapshot/v1"
              },
              "accountId": {
                "type": "string",
                "minLength": 1
              },
              "asset": {
                "type": "string",
                "minLength": 1
              },
              "snapshotSequence": {
                "type": "integer",
                "minimum": 0
              },
              "readModelDigest": {
                "type": "string",
                "pattern": "^sha256:[0-9a-f]{64}$",
                "description": "Covers the engine account view this response was built from, before decimal formatting. Not recomputable from the formatted payload."
              },
              "marginMode": {
                "type": "string",
                "enum": [
                  "isolated",
                  "cross"
                ]
              },
              "cashBalanceAtoms": {
                "type": "string",
                "pattern": "^[0-9]+$"
              },
              "cashBalance": {
                "type": "string",
                "pattern": "^-?[0-9]+\\.[0-9]+$"
              },
              "equityAtoms": {
                "type": "string",
                "pattern": "^-?[0-9]+$"
              },
              "equity": {
                "type": "string",
                "pattern": "^-?[0-9]+\\.[0-9]+$"
              },
              "availableForOrdersAtoms": {
                "type": "string",
                "pattern": "^[0-9]+$"
              },
              "availableForOrders": {
                "type": "string",
                "pattern": "^-?[0-9]+\\.[0-9]+$"
              },
              "riskEvidence": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "status": {
                        "type": "string",
                        "const": "complete"
                      }
                    },
                    "required": [
                      "status"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "status": {
                        "type": "string",
                        "const": "incomplete"
                      },
                      "reasonCode": {
                        "type": "string",
                        "enum": [
                          "legacy_unknown",
                          "missing_accepted_mark"
                        ]
                      }
                    },
                    "required": [
                      "status",
                      "reasonCode"
                    ],
                    "additionalProperties": false
                  }
                ]
              },
              "positions": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "marketId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "unrealizedPnlAtoms": {
                      "type": "string",
                      "pattern": "^-?(0|[1-9][0-9]*)$"
                    },
                    "signedBaseAtoms": {
                      "type": "string",
                      "pattern": "^-?(0|[1-9][0-9]*)$"
                    },
                    "entryNotionalAtoms": {
                      "type": "string",
                      "pattern": "^(0|[1-9][0-9]*)$"
                    },
                    "markPriceAtoms": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "pattern": "^(0|[1-9][0-9]*)$"
                    }
                  },
                  "required": [
                    "marketId",
                    "unrealizedPnlAtoms",
                    "signedBaseAtoms",
                    "entryNotionalAtoms",
                    "markPriceAtoms"
                  ],
                  "additionalProperties": false
                }
              },
              "resync": {
                "type": "object",
                "properties": {
                  "stream": {
                    "type": "string",
                    "const": "account.margin"
                  },
                  "fromSequence": {
                    "type": "integer",
                    "exclusiveMinimum": 0
                  }
                },
                "required": [
                  "stream",
                  "fromSequence"
                ],
                "additionalProperties": true
              }
            },
            "required": [
              "version",
              "accountId",
              "asset",
              "snapshotSequence",
              "readModelDigest",
              "marginMode",
              "cashBalanceAtoms",
              "cashBalance",
              "equityAtoms",
              "equity",
              "availableForOrdersAtoms",
              "availableForOrders",
              "resync"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "free",
          "total",
          "info"
        ],
        "additionalProperties": {
          "type": "object",
          "properties": {
            "free": {
              "type": "number"
            },
            "used": {
              "type": "number"
            },
            "total": {
              "type": "number"
            }
          },
          "additionalProperties": false
        }
      },
      "CcxtV2PositionsResponse": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1
            },
            "symbol": {
              "type": "string",
              "minLength": 1
            },
            "timestamp": {
              "type": "integer",
              "minimum": 0
            },
            "datetime": {
              "type": "string"
            },
            "side": {
              "type": "string",
              "enum": [
                "long",
                "short"
              ]
            },
            "contracts": {
              "type": "number",
              "minimum": 0
            },
            "entryPrice": {
              "type": "number"
            },
            "markPrice": {
              "type": "number"
            },
            "liquidationPrice": {
              "type": "number"
            },
            "unrealizedPnl": {
              "type": "number"
            },
            "realizedPnl": {
              "type": "number"
            },
            "maintenanceMargin": {
              "type": "number",
              "minimum": 0
            },
            "info": {
              "type": "object",
              "properties": {
                "positionId": {
                  "type": "string",
                  "minLength": 1
                },
                "accountId": {
                  "type": "string",
                  "minLength": 1
                },
                "marketId": {
                  "type": "string",
                  "minLength": 1
                },
                "side": {
                  "type": "string",
                  "enum": [
                    "long",
                    "short"
                  ]
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "open",
                    "closed",
                    "liquidated"
                  ]
                },
                "openedAtEpochMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "closedAtEpochMs": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "minimum": 0
                },
                "maxQuantityAtoms": {
                  "type": "string",
                  "pattern": "^[0-9]+$"
                },
                "maxQuantity": {
                  "type": "string",
                  "pattern": "^-?[0-9]+\\.[0-9]+$"
                },
                "currentQuantityAtoms": {
                  "type": "string",
                  "pattern": "^[0-9]+$"
                },
                "currentQuantity": {
                  "type": "string",
                  "pattern": "^-?[0-9]+\\.[0-9]+$"
                },
                "avgEntryPriceAtoms": {
                  "type": "string",
                  "pattern": "^[0-9]+$"
                },
                "avgEntryPrice": {
                  "type": "string",
                  "pattern": "^-?[0-9]+\\.[0-9]+$"
                },
                "avgExitPriceAtoms": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "pattern": "^[0-9]+$"
                },
                "avgExitPrice": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "pattern": "^-?[0-9]+\\.[0-9]+$"
                },
                "realizedPnlAtoms": {
                  "type": "string",
                  "pattern": "^-?[0-9]+$"
                },
                "realizedPnl": {
                  "type": "string",
                  "pattern": "^-?[0-9]+\\.[0-9]+$"
                },
                "feesPaidAtoms": {
                  "type": "string",
                  "pattern": "^[0-9]+$"
                },
                "feesPaid": {
                  "type": "string",
                  "pattern": "^-?[0-9]+\\.[0-9]+$"
                },
                "fundingPaidAtoms": {
                  "type": "string",
                  "pattern": "^-?[0-9]+$"
                },
                "fundingPaid": {
                  "type": "string",
                  "pattern": "^-?[0-9]+\\.[0-9]+$"
                },
                "closeReason": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "enum": [
                    "user_close",
                    "liquidation",
                    null
                  ]
                },
                "lastSequence": {
                  "type": "integer",
                  "minimum": 0
                },
                "markPriceAtoms": {
                  "type": "string",
                  "pattern": "^(0|[1-9][0-9]*)$"
                },
                "unrealizedPnlAtoms": {
                  "type": "string",
                  "pattern": "^-?(0|[1-9][0-9]*)$"
                },
                "liquidationPriceAtoms": {
                  "type": "string",
                  "pattern": "^(0|[1-9][0-9]*)$"
                },
                "marginHealthBps": {
                  "type": "string",
                  "pattern": "^-?(0|[1-9][0-9]*)$"
                },
                "equityAtoms": {
                  "type": "string",
                  "pattern": "^-?(0|[1-9][0-9]*)$"
                },
                "maintenanceRequirementAtoms": {
                  "type": "string",
                  "pattern": "^(0|[1-9][0-9]*)$"
                },
                "marginStatus": {
                  "type": "string",
                  "enum": [
                    "healthy",
                    "liquidation_candidate",
                    "bankrupt"
                  ]
                },
                "riskAsOfMarketDataSequence": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "liquidationTierConsistent": {
                  "type": "boolean",
                  "const": true
                }
              },
              "required": [
                "positionId",
                "accountId",
                "marketId",
                "side",
                "status",
                "openedAtEpochMs",
                "closedAtEpochMs",
                "maxQuantityAtoms",
                "maxQuantity",
                "currentQuantityAtoms",
                "currentQuantity",
                "avgEntryPriceAtoms",
                "avgEntryPrice",
                "avgExitPriceAtoms",
                "avgExitPrice",
                "realizedPnlAtoms",
                "realizedPnl",
                "feesPaidAtoms",
                "feesPaid",
                "fundingPaidAtoms",
                "fundingPaid",
                "closeReason",
                "lastSequence",
                "markPriceAtoms",
                "unrealizedPnlAtoms",
                "liquidationPriceAtoms",
                "marginHealthBps",
                "equityAtoms",
                "maintenanceRequirementAtoms",
                "marginStatus",
                "riskAsOfMarketDataSequence",
                "liquidationTierConsistent"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "id",
            "symbol",
            "timestamp",
            "datetime",
            "side",
            "contracts",
            "entryPrice",
            "markPrice",
            "liquidationPrice",
            "realizedPnl",
            "info"
          ],
          "additionalProperties": false
        }
      },
      "CcxtV2CreateOrdersRequest": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "symbol": {
              "type": "string",
              "minLength": 1
            },
            "type": {
              "type": "string",
              "const": "limit"
            },
            "side": {
              "type": "string",
              "enum": [
                "buy",
                "sell"
              ]
            },
            "amount": {
              "type": "number",
              "exclusiveMinimum": 0
            },
            "price": {
              "type": "number",
              "exclusiveMinimum": 0
            },
            "params": {
              "type": "object",
              "properties": {
                "clientOrderId": {
                  "type": "string",
                  "minLength": 1
                },
                "reduceOnly": {
                  "type": "boolean"
                },
                "leverageX": {
                  "type": "integer",
                  "exclusiveMinimum": 0
                },
                "timeInForce": {
                  "type": "string",
                  "enum": [
                    "GTC",
                    "IOC",
                    "FOK",
                    "PO"
                  ]
                },
                "takeProfitPrice": {
                  "type": "number",
                  "exclusiveMinimum": 0
                },
                "stopLossPrice": {
                  "type": "number",
                  "exclusiveMinimum": 0
                },
                "postOnly": {
                  "type": "boolean"
                }
              },
              "additionalProperties": false
            }
          },
          "required": [
            "symbol",
            "type",
            "side",
            "amount",
            "price"
          ],
          "additionalProperties": false
        },
        "minItems": 1,
        "maxItems": 32
      },
      "CcxtV2CreateOrdersResponse": {
        "type": "array",
        "items": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1
                },
                "clientOrderId": {
                  "type": "string",
                  "minLength": 1
                },
                "symbol": {
                  "type": "string",
                  "minLength": 1
                },
                "timestamp": {
                  "type": "integer",
                  "minimum": 0
                },
                "datetime": {
                  "type": "string"
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "open",
                    "closed",
                    "canceled"
                  ]
                },
                "side": {
                  "type": "string",
                  "enum": [
                    "buy",
                    "sell"
                  ]
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "limit",
                    "market"
                  ]
                },
                "timeInForce": {
                  "type": "string",
                  "enum": [
                    "GTC",
                    "IOC"
                  ]
                },
                "price": {
                  "type": "number"
                },
                "amount": {
                  "type": "number",
                  "minimum": 0
                },
                "filled": {
                  "type": "number",
                  "minimum": 0
                },
                "remaining": {
                  "type": "number",
                  "minimum": 0
                },
                "reduceOnly": {
                  "type": "boolean"
                },
                "postOnly": {
                  "type": "boolean"
                },
                "info": {
                  "type": "object",
                  "properties": {
                    "index": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "accepted": {
                      "type": "boolean",
                      "const": true
                    },
                    "orderId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "accountId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "marketId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "open",
                        "partially_filled",
                        "filled",
                        "canceled",
                        "replaced"
                      ]
                    },
                    "lastSequence": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "idempotencyKey": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "required": [
                    "index",
                    "accepted",
                    "orderId",
                    "accountId",
                    "marketId",
                    "status",
                    "lastSequence",
                    "idempotencyKey"
                  ],
                  "additionalProperties": false
                },
                "index": {
                  "type": "integer",
                  "minimum": 0
                },
                "accepted": {
                  "type": "boolean",
                  "const": true
                }
              },
              "required": [
                "id",
                "symbol",
                "status",
                "info",
                "index",
                "accepted"
              ],
              "additionalProperties": false
            },
            {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "enum": [
                    "AccountNotEnabled",
                    "ArgumentsRequired",
                    "AuthenticationError",
                    "BadRequest",
                    "BadSymbol",
                    "DuplicateOrderId",
                    "ExchangeError",
                    "ExchangeNotAvailable",
                    "InsufficientFunds",
                    "InvalidOrder",
                    "MarketClosed",
                    "NotSupported",
                    "OrderNotFound",
                    "PermissionDenied",
                    "RateLimitExceeded"
                  ]
                },
                "message": {
                  "type": "string",
                  "minLength": 1
                },
                "code": {
                  "type": "string",
                  "enum": [
                    "invalid_request",
                    "unauthorized",
                    "forbidden",
                    "not_found",
                    "idempotency_key_required",
                    "rate_limited",
                    "operation_not_available",
                    "kyc_required",
                    "command_rejected",
                    "snapshot_unavailable",
                    "service_degraded",
                    "order_intake_stopped",
                    "account_intake_stopped",
                    "withdrawal_intake_stopped",
                    "deposit_intake_stopped",
                    "canton_offline",
                    "dependency_unavailable",
                    "account_legacy_excluded",
                    "bot_fence_stale",
                    "api_key_already_rotated",
                    "malformed_command",
                    "malformed_order_command",
                    "unsupported_order_command",
                    "duplicate_order_command",
                    "idempotency_key_conflict",
                    "unknown_market",
                    "unknown_order",
                    "invalid_account",
                    "invalid_side",
                    "invalid_order_id",
                    "invalid_order_type",
                    "market_order_unavailable",
                    "invalid_price",
                    "invalid_quantity",
                    "invalid_leverage",
                    "invalid_slippage",
                    "market_halted",
                    "duplicate_order_id",
                    "market_not_open",
                    "market_session_closed",
                    "market_pre_close_cutoff",
                    "reduce_only_required",
                    "reduce_only_position_unavailable",
                    "self_trade_prevented",
                    "post_only_would_cross",
                    "max_matches_exceeded",
                    "risk_reserve_unavailable",
                    "invalid_status_transition",
                    "sequencer_rejected",
                    "unknown_margin_account",
                    "invalid_order_size",
                    "withdrawals_blocked",
                    "liquidation_candidate",
                    "bad_debt",
                    "insufficient_margin",
                    "leverage_exceeds_market_max",
                    "reserve_id_conflict",
                    "unknown_reserve",
                    "mark_unavailable",
                    "insufficient_liquidity",
                    "invalid_preview_request",
                    "order_rejected_unmapped"
                  ]
                },
                "retryable": {
                  "type": "boolean"
                },
                "timestamp": {
                  "type": "integer",
                  "minimum": 0
                },
                "datetime": {
                  "type": "string"
                },
                "info": {
                  "type": "object",
                  "properties": {
                    "version": {
                      "type": "string",
                      "const": "external-rest-error/v1"
                    },
                    "requestId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "invalid_request",
                        "unauthorized",
                        "forbidden",
                        "not_found",
                        "idempotency_key_required",
                        "rate_limited",
                        "operation_not_available",
                        "kyc_required",
                        "command_rejected",
                        "snapshot_unavailable",
                        "service_degraded",
                        "order_intake_stopped",
                        "account_intake_stopped",
                        "withdrawal_intake_stopped",
                        "deposit_intake_stopped",
                        "canton_offline",
                        "dependency_unavailable",
                        "account_legacy_excluded",
                        "bot_fence_stale",
                        "api_key_already_rotated",
                        "malformed_command",
                        "malformed_order_command",
                        "unsupported_order_command",
                        "duplicate_order_command",
                        "idempotency_key_conflict",
                        "unknown_market",
                        "unknown_order",
                        "invalid_account",
                        "invalid_side",
                        "invalid_order_id",
                        "invalid_order_type",
                        "market_order_unavailable",
                        "invalid_price",
                        "invalid_quantity",
                        "invalid_leverage",
                        "invalid_slippage",
                        "market_halted",
                        "duplicate_order_id",
                        "market_not_open",
                        "market_session_closed",
                        "market_pre_close_cutoff",
                        "reduce_only_required",
                        "reduce_only_position_unavailable",
                        "self_trade_prevented",
                        "post_only_would_cross",
                        "max_matches_exceeded",
                        "risk_reserve_unavailable",
                        "invalid_status_transition",
                        "sequencer_rejected",
                        "unknown_margin_account",
                        "invalid_order_size",
                        "withdrawals_blocked",
                        "liquidation_candidate",
                        "bad_debt",
                        "insufficient_margin",
                        "leverage_exceeds_market_max",
                        "reserve_id_conflict",
                        "unknown_reserve",
                        "mark_unavailable",
                        "insufficient_liquidity",
                        "invalid_preview_request",
                        "order_rejected_unmapped"
                      ]
                    },
                    "safeMessage": {
                      "type": "string",
                      "minLength": 1
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "recoveryActions": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "none",
                          "retry_after",
                          "observe_status",
                          "refresh_snapshot",
                          "resubscribe_stream",
                          "wait_for_projector",
                          "wait_for_operator_recovery",
                          "contact_support",
                          "request_approval",
                          "rerun_dry_run",
                          "do_not_retry"
                        ]
                      },
                      "minItems": 1
                    },
                    "realtimeTicketFailure": {
                      "type": "string",
                      "enum": [
                        "invalid",
                        "replayed",
                        "replaced",
                        "expired",
                        "revoked",
                        "store_unavailable"
                      ]
                    },
                    "apiKeyRejection": {
                      "type": "string",
                      "enum": [
                        "malformed",
                        "unknown",
                        "expired",
                        "revoked",
                        "principal_unavailable",
                        "store_unavailable",
                        "scope_insufficient",
                        "passkey_required",
                        "environment_forbidden",
                        "principal_mismatch",
                        "bot_fence_invalid",
                        "bot_fence_stale",
                        "already_rotated"
                      ]
                    },
                    "rejectionGuard": {
                      "type": "string",
                      "enum": [
                        "amount_atoms_invalid",
                        "command_act_as_invalid",
                        "command_field_required",
                        "command_value_missing",
                        "completion_synchronizer_mismatch",
                        "deposit_field_required",
                        "deposit_integer_invalid",
                        "deposit_timestamp_invalid",
                        "hashing_scheme_unspecified",
                        "ledger_node_id_invalid",
                        "ledger_offset_invalid",
                        "rejection_completion_status",
                        "signature_failure_reason_invalid",
                        "signature_field_hex",
                        "signature_field_required",
                        "submission_id_mismatch",
                        "successful_completion_evidence",
                        "consumed_replay_evidence",
                        "delegated_signing_key_binding",
                        "deposit_asset_unsupported",
                        "deposit_amount_invalid",
                        "deposit_amount_rail_unsupported",
                        "deposit_amount_scale_exceeded",
                        "deposit_missing",
                        "deposit_owner_binding",
                        "deposit_scope",
                        "dfns_confirmation_environment",
                        "funding_intent",
                        "funding_intent_advance",
                        "funding_intent_already_bound",
                        "funding_intent_cancelled",
                        "funding_intent_consumed_without_deposit",
                        "funding_intent_missing",
                        "intent_asset_unsupported",
                        "intent_owner_binding",
                        "local_confirmation_environment",
                        "owner_intent_scope",
                        "owner_kind_unsupported",
                        "planned_command_identities",
                        "request_owner_binding",
                        "local_authority_party_missing",
                        "local_confirmation_deposit_status",
                        "local_operator_replay_mismatch",
                        "local_recovery_step_mismatch",
                        "local_signer_failed",
                        "local_signing_key_mismatch",
                        "local_wallet_binding",
                        "operator_step_expected",
                        "owner_step_expected",
                        "owner_submission_command_binding",
                        "planned_command_missing",
                        "planned_command_not_unique",
                        "post_offer_step_expected",
                        "reconciliation_signature_scope",
                        "signature_completion_action",
                        "signature_hex_missing",
                        "signing_step_ahead_of_deposit",
                        "treasury_execution_restore",
                        "treasury_offer_contract_missing",
                        "unknown_command_candidates",
                        "completion_read_refused",
                        "completion_correlation",
                        "completion_not_unique",
                        "completion_transaction_correlation",
                        "interactive_act_as_missing",
                        "interactive_transaction_correlation",
                        "reconcile_binding_mismatch",
                        "rejected_completion_has_update",
                        "standard_submission_correlation",
                        "standard_submission_response_invalid",
                        "successful_completion_update_missing",
                        "unrecoverable_command_evidence",
                        "executed_evidence_correlation",
                        "executed_evidence_replay",
                        "executed_evidence_rows",
                        "executed_evidence_signature_status",
                        "execute_permit_rows",
                        "execute_permit_signature_status",
                        "ledger_rejection_correlation",
                        "ledger_rejection_replay",
                        "ledger_rejection_rows",
                        "ledger_rejection_signature_status",
                        "preparation_lock_busy",
                        "reconciliation_signature_state",
                        "signature_identity_binding",
                        "signature_identity_missing",
                        "signature_permitted_command",
                        "signature_preparable_state",
                        "signature_preparation_replay",
                        "signature_record_identity",
                        "signature_record_missing",
                        "signature_record_shape",
                        "signature_replay",
                        "signature_row_count",
                        "signature_scope_environment",
                        "signature_scope_fingerprint",
                        "signature_session_consistency",
                        "canton_command_identity",
                        "command_completion_evidence",
                        "command_confirm_rows",
                        "command_confirm_state",
                        "command_evidence_replay",
                        "command_permit_rows",
                        "command_permit_state",
                        "command_predecessors_unconfirmed",
                        "command_release_evidence",
                        "command_release_replay",
                        "command_release_rows",
                        "command_release_state",
                        "signature_restart_state",
                        "existing_receipt_replay",
                        "existing_receipt_rows",
                        "existing_receipt_state",
                        "local_replay_command_state",
                        "local_replay_fence_rows",
                        "local_replay_fence_state",
                        "local_replay_step",
                        "persisted_permit_mismatch",
                        "treasury_offer_command_identity",
                        "treasury_offer_confirm_rows",
                        "treasury_offer_confirm_state",
                        "treasury_offer_evidence_replay",
                        "treasury_offer_permit_rows",
                        "treasury_offer_permit_state",
                        "treasury_offer_reject_rows",
                        "treasury_offer_reject_state",
                        "treasury_offer_rejection_replay",
                        "treasury_offer_submission_id",
                        "treasury_input_amount_mismatch",
                        "treasury_input_release_rows",
                        "treasury_input_release_state",
                        "treasury_input_reservation_mismatch",
                        "treasury_input_reservation_rows",
                        "treasury_input_reservation_state"
                      ]
                    },
                    "withdrawalFailure": {
                      "type": "string",
                      "enum": [
                        "requested",
                        "margin_reserved",
                        "authorized",
                        "submitted",
                        "settled",
                        "rejected",
                        "expired",
                        "failed",
                        "invalid_transition",
                        "authorization_setup_failed",
                        "margin_blocked",
                        "co_sign_incomplete",
                        "co_sign_self_approval",
                        "ttl_expired",
                        "canton_submission_failed",
                        "withdrawal_payout_dfns_signature_failed",
                        "withdrawal_payout_canton_submit_refused",
                        "withdrawal_payout_ledger_time_expired",
                        "asset_unsupported",
                        "withdrawal_amount_invalid",
                        "withdrawal_amount_scale_exceeded",
                        "withdrawal_authorization_binding_mismatch",
                        "withdrawal_capability_unavailable",
                        "withdrawal_checkpoint_unavailable",
                        "withdrawal_destination_not_owned",
                        "withdrawal_not_found",
                        "withdrawal_operators_missing",
                        "withdrawal_operators_not_distinct",
                        "withdrawal_owner_party_invalid",
                        "withdrawal_owner_unavailable",
                        "withdrawal_request_invalid",
                        "withdrawal_request_ended",
                        "withdrawal_reservation_release_failed",
                        "withdrawal_unavailable",
                        "withdrawal_submission_unavailable",
                        "withdrawal_enqueue_failed",
                        "withdrawal_publish_failed"
                      ]
                    },
                    "dependency": {
                      "type": "string",
                      "enum": [
                        "dfns",
                        "engine"
                      ]
                    },
                    "occurredAtEpochMs": {
                      "type": "integer",
                      "minimum": 0
                    }
                  },
                  "required": [
                    "version",
                    "requestId",
                    "code",
                    "safeMessage",
                    "retryable",
                    "recoveryActions",
                    "occurredAtEpochMs"
                  ],
                  "additionalProperties": false
                },
                "index": {
                  "type": "integer",
                  "minimum": 0
                },
                "accepted": {
                  "type": "boolean",
                  "const": false
                },
                "clientOrderId": {
                  "type": "string",
                  "minLength": 1
                },
                "field": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "required": [
                "name",
                "message",
                "code",
                "retryable",
                "timestamp",
                "datetime",
                "info",
                "index",
                "accepted",
                "clientOrderId",
                "field"
              ],
              "additionalProperties": false
            }
          ]
        },
        "minItems": 1,
        "maxItems": 32
      },
      "CcxtV2CreateOrderRequest": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "symbol": {
                "type": "string",
                "minLength": 1
              },
              "type": {
                "type": "string",
                "const": "limit"
              },
              "side": {
                "type": "string",
                "enum": [
                  "buy",
                  "sell"
                ]
              },
              "amount": {
                "type": "number",
                "exclusiveMinimum": 0
              },
              "price": {
                "type": "number",
                "exclusiveMinimum": 0
              },
              "params": {
                "type": "object",
                "properties": {
                  "clientOrderId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "reduceOnly": {
                    "type": "boolean"
                  },
                  "leverageX": {
                    "type": "integer",
                    "exclusiveMinimum": 0
                  },
                  "timeInForce": {
                    "type": "string",
                    "enum": [
                      "GTC",
                      "IOC",
                      "FOK",
                      "PO"
                    ]
                  },
                  "takeProfitPrice": {
                    "type": "number",
                    "exclusiveMinimum": 0
                  },
                  "stopLossPrice": {
                    "type": "number",
                    "exclusiveMinimum": 0
                  },
                  "postOnly": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              }
            },
            "required": [
              "symbol",
              "type",
              "side",
              "amount",
              "price"
            ],
            "additionalProperties": false
          },
          {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "symbol": {
                    "type": "string",
                    "minLength": 1
                  },
                  "type": {
                    "type": "string",
                    "const": "market"
                  },
                  "side": {
                    "type": "string",
                    "enum": [
                      "buy",
                      "sell"
                    ]
                  },
                  "amount": {
                    "type": "number",
                    "exclusiveMinimum": 0
                  },
                  "params": {
                    "type": "object",
                    "properties": {
                      "clientOrderId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "reduceOnly": {
                        "type": "boolean"
                      },
                      "leverageX": {
                        "type": "integer",
                        "exclusiveMinimum": 0
                      },
                      "timeInForce": {
                        "type": "string",
                        "enum": [
                          "GTC",
                          "IOC",
                          "FOK",
                          "PO"
                        ]
                      },
                      "takeProfitPrice": {
                        "type": "number",
                        "exclusiveMinimum": 0
                      },
                      "stopLossPrice": {
                        "type": "number",
                        "exclusiveMinimum": 0
                      }
                    },
                    "additionalProperties": false
                  }
                },
                "required": [
                  "symbol",
                  "type",
                  "side",
                  "amount"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "symbol": {
                    "type": "string",
                    "minLength": 1
                  },
                  "type": {
                    "type": "string",
                    "const": "market"
                  },
                  "side": {
                    "type": "string",
                    "enum": [
                      "buy",
                      "sell"
                    ]
                  },
                  "params": {
                    "type": "object",
                    "properties": {
                      "clientOrderId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "reduceOnly": {
                        "type": "boolean"
                      },
                      "leverageX": {
                        "type": "integer",
                        "exclusiveMinimum": 0
                      },
                      "timeInForce": {
                        "type": "string",
                        "enum": [
                          "GTC",
                          "IOC",
                          "FOK",
                          "PO"
                        ]
                      },
                      "takeProfitPrice": {
                        "type": "number",
                        "exclusiveMinimum": 0
                      },
                      "stopLossPrice": {
                        "type": "number",
                        "exclusiveMinimum": 0
                      },
                      "notional": {
                        "type": "number",
                        "exclusiveMinimum": 0
                      }
                    },
                    "required": [
                      "notional"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "symbol",
                  "type",
                  "side",
                  "params"
                ],
                "additionalProperties": false
              }
            ]
          }
        ]
      },
      "CcxtV2Order": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1
          },
          "clientOrderId": {
            "type": "string",
            "minLength": 1
          },
          "symbol": {
            "type": "string",
            "minLength": 1
          },
          "timestamp": {
            "type": "integer",
            "minimum": 0
          },
          "datetime": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "open",
              "closed",
              "canceled"
            ]
          },
          "side": {
            "type": "string",
            "enum": [
              "buy",
              "sell"
            ]
          },
          "type": {
            "type": "string",
            "enum": [
              "limit",
              "market"
            ]
          },
          "timeInForce": {
            "type": "string",
            "enum": [
              "GTC",
              "IOC"
            ]
          },
          "price": {
            "type": "number"
          },
          "amount": {
            "type": "number",
            "minimum": 0
          },
          "filled": {
            "type": "number",
            "minimum": 0
          },
          "remaining": {
            "type": "number",
            "minimum": 0
          },
          "reduceOnly": {
            "type": "boolean"
          },
          "postOnly": {
            "type": "boolean"
          },
          "info": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "version": {
                    "type": "string",
                    "const": "external-order/v1"
                  },
                  "orderId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "accountId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "marketId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "open",
                      "partially_filled",
                      "filled",
                      "canceled",
                      "replaced"
                    ]
                  },
                  "lastSequence": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "idempotencyKey": {
                    "type": "string",
                    "minLength": 1
                  },
                  "cancelReason": {
                    "type": "string",
                    "enum": [
                      "margin_unbacked",
                      "risk_evidence_incomplete",
                      "market_session_closed",
                      "reduce_only_position_unavailable"
                    ]
                  }
                },
                "required": [
                  "version",
                  "orderId",
                  "accountId",
                  "marketId",
                  "status",
                  "lastSequence",
                  "idempotencyKey"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "orderId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "accountId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "marketId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "configurationId": {
                    "type": "string",
                    "minLength": 1,
                    "pattern": "^[A-Za-z0-9_-]+$"
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "open",
                      "partially_filled",
                      "filled",
                      "canceled",
                      "replaced"
                    ]
                  },
                  "side": {
                    "type": "string",
                    "enum": [
                      "buy",
                      "sell"
                    ]
                  },
                  "orderType": {
                    "type": "string",
                    "enum": [
                      "limit",
                      "market"
                    ]
                  },
                  "price": {
                    "type": "string",
                    "pattern": "^[0-9]+(?:\\.[0-9]+)?$"
                  },
                  "quantity": {
                    "type": "string",
                    "pattern": "^[0-9]+(?:\\.[0-9]+)?$"
                  },
                  "filledQuantity": {
                    "type": "string",
                    "pattern": "^[0-9]+(?:\\.[0-9]+)?$"
                  },
                  "remainingQuantity": {
                    "type": "string",
                    "pattern": "^[0-9]+(?:\\.[0-9]+)?$"
                  },
                  "reduceOnly": {
                    "type": "boolean"
                  },
                  "updatedAtEpochMs": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "lastSequence": {
                    "type": "integer",
                    "minimum": 0
                  }
                },
                "required": [
                  "orderId",
                  "accountId",
                  "marketId",
                  "status",
                  "updatedAtEpochMs",
                  "lastSequence"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "orderId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "accountId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "marketId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "side": {
                    "type": "string",
                    "enum": [
                      "buy",
                      "sell"
                    ]
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "open",
                      "partially_filled"
                    ]
                  },
                  "priceAtoms": {
                    "type": "string",
                    "pattern": "^(0|[1-9][0-9]*)$"
                  },
                  "quantityAtoms": {
                    "type": "string",
                    "pattern": "^(0|[1-9][0-9]*)$"
                  },
                  "filledQuantityAtoms": {
                    "type": "string",
                    "pattern": "^(0|[1-9][0-9]*)$"
                  },
                  "remainingQuantityAtoms": {
                    "type": "string",
                    "pattern": "^(0|[1-9][0-9]*)$"
                  },
                  "reduceOnly": {
                    "type": "boolean"
                  },
                  "autoClose": {
                    "type": "object",
                    "properties": {
                      "takeProfitPriceAtoms": {
                        "type": "string",
                        "pattern": "^[1-9][0-9]*$"
                      },
                      "stopLossPriceAtoms": {
                        "type": "string",
                        "pattern": "^[1-9][0-9]*$"
                      }
                    },
                    "additionalProperties": false
                  },
                  "sequence": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "receivedAtEpochMs": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "createdJournalSequence": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "updatedJournalSequence": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "priceScale": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "quantityScale": {
                    "type": "integer",
                    "minimum": 0
                  }
                },
                "required": [
                  "orderId",
                  "accountId",
                  "marketId",
                  "side",
                  "status",
                  "priceAtoms",
                  "quantityAtoms",
                  "filledQuantityAtoms",
                  "remainingQuantityAtoms",
                  "reduceOnly",
                  "sequence",
                  "receivedAtEpochMs",
                  "createdJournalSequence",
                  "updatedJournalSequence",
                  "priceScale",
                  "quantityScale"
                ],
                "additionalProperties": false
              }
            ]
          }
        },
        "required": [
          "id",
          "symbol",
          "status",
          "info"
        ],
        "additionalProperties": false
      },
      "CcxtV2CancelOrderRequest": {
        "type": "object",
        "properties": {
          "symbol": {
            "type": "string",
            "minLength": 1
          }
        },
        "required": [
          "symbol"
        ],
        "additionalProperties": false
      },
      "CcxtV2CancelOrdersRequest": {
        "type": "object",
        "properties": {
          "ids": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "minItems": 1,
            "maxItems": 24
          },
          "symbol": {
            "type": "string",
            "minLength": 1
          }
        },
        "required": [
          "ids",
          "symbol"
        ],
        "additionalProperties": false
      },
      "CcxtV2CancelOrdersResponse": {
        "type": "array",
        "items": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1
                },
                "clientOrderId": {
                  "type": "string",
                  "minLength": 1
                },
                "symbol": {
                  "type": "string",
                  "minLength": 1
                },
                "timestamp": {
                  "type": "integer",
                  "minimum": 0
                },
                "datetime": {
                  "type": "string"
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "open",
                    "closed",
                    "canceled"
                  ]
                },
                "side": {
                  "type": "string",
                  "enum": [
                    "buy",
                    "sell"
                  ]
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "limit",
                    "market"
                  ]
                },
                "timeInForce": {
                  "type": "string",
                  "enum": [
                    "GTC",
                    "IOC"
                  ]
                },
                "price": {
                  "type": "number"
                },
                "amount": {
                  "type": "number",
                  "minimum": 0
                },
                "filled": {
                  "type": "number",
                  "minimum": 0
                },
                "remaining": {
                  "type": "number",
                  "minimum": 0
                },
                "reduceOnly": {
                  "type": "boolean"
                },
                "postOnly": {
                  "type": "boolean"
                },
                "info": {
                  "type": "object",
                  "properties": {
                    "index": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "accepted": {
                      "type": "boolean",
                      "const": true
                    },
                    "orderId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "accountId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "marketId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "open",
                        "partially_filled",
                        "filled",
                        "canceled",
                        "replaced"
                      ]
                    },
                    "lastSequence": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "idempotencyKey": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "required": [
                    "index",
                    "accepted",
                    "orderId",
                    "accountId",
                    "marketId",
                    "status",
                    "lastSequence",
                    "idempotencyKey"
                  ],
                  "additionalProperties": false
                },
                "index": {
                  "type": "integer",
                  "minimum": 0
                },
                "accepted": {
                  "type": "boolean",
                  "const": true
                }
              },
              "required": [
                "id",
                "symbol",
                "status",
                "info",
                "index",
                "accepted"
              ],
              "additionalProperties": false
            },
            {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "enum": [
                    "AccountNotEnabled",
                    "ArgumentsRequired",
                    "AuthenticationError",
                    "BadRequest",
                    "BadSymbol",
                    "DuplicateOrderId",
                    "ExchangeError",
                    "ExchangeNotAvailable",
                    "InsufficientFunds",
                    "InvalidOrder",
                    "MarketClosed",
                    "NotSupported",
                    "OrderNotFound",
                    "PermissionDenied",
                    "RateLimitExceeded"
                  ]
                },
                "message": {
                  "type": "string",
                  "minLength": 1
                },
                "code": {
                  "type": "string",
                  "enum": [
                    "invalid_request",
                    "unauthorized",
                    "forbidden",
                    "not_found",
                    "idempotency_key_required",
                    "rate_limited",
                    "operation_not_available",
                    "kyc_required",
                    "command_rejected",
                    "snapshot_unavailable",
                    "service_degraded",
                    "order_intake_stopped",
                    "account_intake_stopped",
                    "withdrawal_intake_stopped",
                    "deposit_intake_stopped",
                    "canton_offline",
                    "dependency_unavailable",
                    "account_legacy_excluded",
                    "bot_fence_stale",
                    "api_key_already_rotated",
                    "malformed_command",
                    "malformed_order_command",
                    "unsupported_order_command",
                    "duplicate_order_command",
                    "idempotency_key_conflict",
                    "unknown_market",
                    "unknown_order",
                    "invalid_account",
                    "invalid_side",
                    "invalid_order_id",
                    "invalid_order_type",
                    "market_order_unavailable",
                    "invalid_price",
                    "invalid_quantity",
                    "invalid_leverage",
                    "invalid_slippage",
                    "market_halted",
                    "duplicate_order_id",
                    "market_not_open",
                    "market_session_closed",
                    "market_pre_close_cutoff",
                    "reduce_only_required",
                    "reduce_only_position_unavailable",
                    "self_trade_prevented",
                    "post_only_would_cross",
                    "max_matches_exceeded",
                    "risk_reserve_unavailable",
                    "invalid_status_transition",
                    "sequencer_rejected",
                    "unknown_margin_account",
                    "invalid_order_size",
                    "withdrawals_blocked",
                    "liquidation_candidate",
                    "bad_debt",
                    "insufficient_margin",
                    "leverage_exceeds_market_max",
                    "reserve_id_conflict",
                    "unknown_reserve",
                    "mark_unavailable",
                    "insufficient_liquidity",
                    "invalid_preview_request",
                    "order_rejected_unmapped"
                  ]
                },
                "retryable": {
                  "type": "boolean"
                },
                "timestamp": {
                  "type": "integer",
                  "minimum": 0
                },
                "datetime": {
                  "type": "string"
                },
                "info": {
                  "type": "object",
                  "properties": {
                    "version": {
                      "type": "string",
                      "const": "external-rest-error/v1"
                    },
                    "requestId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "invalid_request",
                        "unauthorized",
                        "forbidden",
                        "not_found",
                        "idempotency_key_required",
                        "rate_limited",
                        "operation_not_available",
                        "kyc_required",
                        "command_rejected",
                        "snapshot_unavailable",
                        "service_degraded",
                        "order_intake_stopped",
                        "account_intake_stopped",
                        "withdrawal_intake_stopped",
                        "deposit_intake_stopped",
                        "canton_offline",
                        "dependency_unavailable",
                        "account_legacy_excluded",
                        "bot_fence_stale",
                        "api_key_already_rotated",
                        "malformed_command",
                        "malformed_order_command",
                        "unsupported_order_command",
                        "duplicate_order_command",
                        "idempotency_key_conflict",
                        "unknown_market",
                        "unknown_order",
                        "invalid_account",
                        "invalid_side",
                        "invalid_order_id",
                        "invalid_order_type",
                        "market_order_unavailable",
                        "invalid_price",
                        "invalid_quantity",
                        "invalid_leverage",
                        "invalid_slippage",
                        "market_halted",
                        "duplicate_order_id",
                        "market_not_open",
                        "market_session_closed",
                        "market_pre_close_cutoff",
                        "reduce_only_required",
                        "reduce_only_position_unavailable",
                        "self_trade_prevented",
                        "post_only_would_cross",
                        "max_matches_exceeded",
                        "risk_reserve_unavailable",
                        "invalid_status_transition",
                        "sequencer_rejected",
                        "unknown_margin_account",
                        "invalid_order_size",
                        "withdrawals_blocked",
                        "liquidation_candidate",
                        "bad_debt",
                        "insufficient_margin",
                        "leverage_exceeds_market_max",
                        "reserve_id_conflict",
                        "unknown_reserve",
                        "mark_unavailable",
                        "insufficient_liquidity",
                        "invalid_preview_request",
                        "order_rejected_unmapped"
                      ]
                    },
                    "safeMessage": {
                      "type": "string",
                      "minLength": 1
                    },
                    "retryable": {
                      "type": "boolean"
                    },
                    "recoveryActions": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "none",
                          "retry_after",
                          "observe_status",
                          "refresh_snapshot",
                          "resubscribe_stream",
                          "wait_for_projector",
                          "wait_for_operator_recovery",
                          "contact_support",
                          "request_approval",
                          "rerun_dry_run",
                          "do_not_retry"
                        ]
                      },
                      "minItems": 1
                    },
                    "realtimeTicketFailure": {
                      "type": "string",
                      "enum": [
                        "invalid",
                        "replayed",
                        "replaced",
                        "expired",
                        "revoked",
                        "store_unavailable"
                      ]
                    },
                    "apiKeyRejection": {
                      "type": "string",
                      "enum": [
                        "malformed",
                        "unknown",
                        "expired",
                        "revoked",
                        "principal_unavailable",
                        "store_unavailable",
                        "scope_insufficient",
                        "passkey_required",
                        "environment_forbidden",
                        "principal_mismatch",
                        "bot_fence_invalid",
                        "bot_fence_stale",
                        "already_rotated"
                      ]
                    },
                    "rejectionGuard": {
                      "type": "string",
                      "enum": [
                        "amount_atoms_invalid",
                        "command_act_as_invalid",
                        "command_field_required",
                        "command_value_missing",
                        "completion_synchronizer_mismatch",
                        "deposit_field_required",
                        "deposit_integer_invalid",
                        "deposit_timestamp_invalid",
                        "hashing_scheme_unspecified",
                        "ledger_node_id_invalid",
                        "ledger_offset_invalid",
                        "rejection_completion_status",
                        "signature_failure_reason_invalid",
                        "signature_field_hex",
                        "signature_field_required",
                        "submission_id_mismatch",
                        "successful_completion_evidence",
                        "consumed_replay_evidence",
                        "delegated_signing_key_binding",
                        "deposit_asset_unsupported",
                        "deposit_amount_invalid",
                        "deposit_amount_rail_unsupported",
                        "deposit_amount_scale_exceeded",
                        "deposit_missing",
                        "deposit_owner_binding",
                        "deposit_scope",
                        "dfns_confirmation_environment",
                        "funding_intent",
                        "funding_intent_advance",
                        "funding_intent_already_bound",
                        "funding_intent_cancelled",
                        "funding_intent_consumed_without_deposit",
                        "funding_intent_missing",
                        "intent_asset_unsupported",
                        "intent_owner_binding",
                        "local_confirmation_environment",
                        "owner_intent_scope",
                        "owner_kind_unsupported",
                        "planned_command_identities",
                        "request_owner_binding",
                        "local_authority_party_missing",
                        "local_confirmation_deposit_status",
                        "local_operator_replay_mismatch",
                        "local_recovery_step_mismatch",
                        "local_signer_failed",
                        "local_signing_key_mismatch",
                        "local_wallet_binding",
                        "operator_step_expected",
                        "owner_step_expected",
                        "owner_submission_command_binding",
                        "planned_command_missing",
                        "planned_command_not_unique",
                        "post_offer_step_expected",
                        "reconciliation_signature_scope",
                        "signature_completion_action",
                        "signature_hex_missing",
                        "signing_step_ahead_of_deposit",
                        "treasury_execution_restore",
                        "treasury_offer_contract_missing",
                        "unknown_command_candidates",
                        "completion_read_refused",
                        "completion_correlation",
                        "completion_not_unique",
                        "completion_transaction_correlation",
                        "interactive_act_as_missing",
                        "interactive_transaction_correlation",
                        "reconcile_binding_mismatch",
                        "rejected_completion_has_update",
                        "standard_submission_correlation",
                        "standard_submission_response_invalid",
                        "successful_completion_update_missing",
                        "unrecoverable_command_evidence",
                        "executed_evidence_correlation",
                        "executed_evidence_replay",
                        "executed_evidence_rows",
                        "executed_evidence_signature_status",
                        "execute_permit_rows",
                        "execute_permit_signature_status",
                        "ledger_rejection_correlation",
                        "ledger_rejection_replay",
                        "ledger_rejection_rows",
                        "ledger_rejection_signature_status",
                        "preparation_lock_busy",
                        "reconciliation_signature_state",
                        "signature_identity_binding",
                        "signature_identity_missing",
                        "signature_permitted_command",
                        "signature_preparable_state",
                        "signature_preparation_replay",
                        "signature_record_identity",
                        "signature_record_missing",
                        "signature_record_shape",
                        "signature_replay",
                        "signature_row_count",
                        "signature_scope_environment",
                        "signature_scope_fingerprint",
                        "signature_session_consistency",
                        "canton_command_identity",
                        "command_completion_evidence",
                        "command_confirm_rows",
                        "command_confirm_state",
                        "command_evidence_replay",
                        "command_permit_rows",
                        "command_permit_state",
                        "command_predecessors_unconfirmed",
                        "command_release_evidence",
                        "command_release_replay",
                        "command_release_rows",
                        "command_release_state",
                        "signature_restart_state",
                        "existing_receipt_replay",
                        "existing_receipt_rows",
                        "existing_receipt_state",
                        "local_replay_command_state",
                        "local_replay_fence_rows",
                        "local_replay_fence_state",
                        "local_replay_step",
                        "persisted_permit_mismatch",
                        "treasury_offer_command_identity",
                        "treasury_offer_confirm_rows",
                        "treasury_offer_confirm_state",
                        "treasury_offer_evidence_replay",
                        "treasury_offer_permit_rows",
                        "treasury_offer_permit_state",
                        "treasury_offer_reject_rows",
                        "treasury_offer_reject_state",
                        "treasury_offer_rejection_replay",
                        "treasury_offer_submission_id",
                        "treasury_input_amount_mismatch",
                        "treasury_input_release_rows",
                        "treasury_input_release_state",
                        "treasury_input_reservation_mismatch",
                        "treasury_input_reservation_rows",
                        "treasury_input_reservation_state"
                      ]
                    },
                    "withdrawalFailure": {
                      "type": "string",
                      "enum": [
                        "requested",
                        "margin_reserved",
                        "authorized",
                        "submitted",
                        "settled",
                        "rejected",
                        "expired",
                        "failed",
                        "invalid_transition",
                        "authorization_setup_failed",
                        "margin_blocked",
                        "co_sign_incomplete",
                        "co_sign_self_approval",
                        "ttl_expired",
                        "canton_submission_failed",
                        "withdrawal_payout_dfns_signature_failed",
                        "withdrawal_payout_canton_submit_refused",
                        "withdrawal_payout_ledger_time_expired",
                        "asset_unsupported",
                        "withdrawal_amount_invalid",
                        "withdrawal_amount_scale_exceeded",
                        "withdrawal_authorization_binding_mismatch",
                        "withdrawal_capability_unavailable",
                        "withdrawal_checkpoint_unavailable",
                        "withdrawal_destination_not_owned",
                        "withdrawal_not_found",
                        "withdrawal_operators_missing",
                        "withdrawal_operators_not_distinct",
                        "withdrawal_owner_party_invalid",
                        "withdrawal_owner_unavailable",
                        "withdrawal_request_invalid",
                        "withdrawal_request_ended",
                        "withdrawal_reservation_release_failed",
                        "withdrawal_unavailable",
                        "withdrawal_submission_unavailable",
                        "withdrawal_enqueue_failed",
                        "withdrawal_publish_failed"
                      ]
                    },
                    "dependency": {
                      "type": "string",
                      "enum": [
                        "dfns",
                        "engine"
                      ]
                    },
                    "occurredAtEpochMs": {
                      "type": "integer",
                      "minimum": 0
                    }
                  },
                  "required": [
                    "version",
                    "requestId",
                    "code",
                    "safeMessage",
                    "retryable",
                    "recoveryActions",
                    "occurredAtEpochMs"
                  ],
                  "additionalProperties": false
                },
                "index": {
                  "type": "integer",
                  "minimum": 0
                },
                "accepted": {
                  "type": "boolean",
                  "const": false
                },
                "orderId": {
                  "type": "string",
                  "minLength": 1
                },
                "field": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "required": [
                "name",
                "message",
                "code",
                "retryable",
                "timestamp",
                "datetime",
                "info",
                "index",
                "accepted",
                "orderId",
                "field"
              ],
              "additionalProperties": false
            }
          ]
        },
        "minItems": 1,
        "maxItems": 24
      },
      "CcxtV2OrdersResponse": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1
            },
            "clientOrderId": {
              "type": "string",
              "minLength": 1
            },
            "symbol": {
              "type": "string",
              "minLength": 1
            },
            "timestamp": {
              "type": "integer",
              "minimum": 0
            },
            "datetime": {
              "type": "string"
            },
            "status": {
              "type": "string",
              "enum": [
                "open",
                "closed",
                "canceled"
              ]
            },
            "side": {
              "type": "string",
              "enum": [
                "buy",
                "sell"
              ]
            },
            "type": {
              "type": "string",
              "enum": [
                "limit",
                "market"
              ]
            },
            "timeInForce": {
              "type": "string",
              "enum": [
                "GTC",
                "IOC"
              ]
            },
            "price": {
              "type": "number"
            },
            "amount": {
              "type": "number",
              "minimum": 0
            },
            "filled": {
              "type": "number",
              "minimum": 0
            },
            "remaining": {
              "type": "number",
              "minimum": 0
            },
            "reduceOnly": {
              "type": "boolean"
            },
            "postOnly": {
              "type": "boolean"
            },
            "info": {
              "anyOf": [
                {
                  "type": "object",
                  "properties": {
                    "version": {
                      "type": "string",
                      "const": "external-order/v1"
                    },
                    "orderId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "accountId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "marketId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "open",
                        "partially_filled",
                        "filled",
                        "canceled",
                        "replaced"
                      ]
                    },
                    "lastSequence": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "idempotencyKey": {
                      "type": "string",
                      "minLength": 1
                    },
                    "cancelReason": {
                      "type": "string",
                      "enum": [
                        "margin_unbacked",
                        "risk_evidence_incomplete",
                        "market_session_closed",
                        "reduce_only_position_unavailable"
                      ]
                    }
                  },
                  "required": [
                    "version",
                    "orderId",
                    "accountId",
                    "marketId",
                    "status",
                    "lastSequence",
                    "idempotencyKey"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "orderId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "accountId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "marketId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "configurationId": {
                      "type": "string",
                      "minLength": 1,
                      "pattern": "^[A-Za-z0-9_-]+$"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "open",
                        "partially_filled",
                        "filled",
                        "canceled",
                        "replaced"
                      ]
                    },
                    "side": {
                      "type": "string",
                      "enum": [
                        "buy",
                        "sell"
                      ]
                    },
                    "orderType": {
                      "type": "string",
                      "enum": [
                        "limit",
                        "market"
                      ]
                    },
                    "price": {
                      "type": "string",
                      "pattern": "^[0-9]+(?:\\.[0-9]+)?$"
                    },
                    "quantity": {
                      "type": "string",
                      "pattern": "^[0-9]+(?:\\.[0-9]+)?$"
                    },
                    "filledQuantity": {
                      "type": "string",
                      "pattern": "^[0-9]+(?:\\.[0-9]+)?$"
                    },
                    "remainingQuantity": {
                      "type": "string",
                      "pattern": "^[0-9]+(?:\\.[0-9]+)?$"
                    },
                    "reduceOnly": {
                      "type": "boolean"
                    },
                    "updatedAtEpochMs": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "lastSequence": {
                      "type": "integer",
                      "minimum": 0
                    }
                  },
                  "required": [
                    "orderId",
                    "accountId",
                    "marketId",
                    "status",
                    "updatedAtEpochMs",
                    "lastSequence"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "orderId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "accountId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "marketId": {
                      "type": "string",
                      "minLength": 1
                    },
                    "side": {
                      "type": "string",
                      "enum": [
                        "buy",
                        "sell"
                      ]
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "open",
                        "partially_filled"
                      ]
                    },
                    "priceAtoms": {
                      "type": "string",
                      "pattern": "^(0|[1-9][0-9]*)$"
                    },
                    "quantityAtoms": {
                      "type": "string",
                      "pattern": "^(0|[1-9][0-9]*)$"
                    },
                    "filledQuantityAtoms": {
                      "type": "string",
                      "pattern": "^(0|[1-9][0-9]*)$"
                    },
                    "remainingQuantityAtoms": {
                      "type": "string",
                      "pattern": "^(0|[1-9][0-9]*)$"
                    },
                    "reduceOnly": {
                      "type": "boolean"
                    },
                    "autoClose": {
                      "type": "object",
                      "properties": {
                        "takeProfitPriceAtoms": {
                          "type": "string",
                          "pattern": "^[1-9][0-9]*$"
                        },
                        "stopLossPriceAtoms": {
                          "type": "string",
                          "pattern": "^[1-9][0-9]*$"
                        }
                      },
                      "additionalProperties": false
                    },
                    "sequence": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "receivedAtEpochMs": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "createdJournalSequence": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "updatedJournalSequence": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "priceScale": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "quantityScale": {
                      "type": "integer",
                      "minimum": 0
                    }
                  },
                  "required": [
                    "orderId",
                    "accountId",
                    "marketId",
                    "side",
                    "status",
                    "priceAtoms",
                    "quantityAtoms",
                    "filledQuantityAtoms",
                    "remainingQuantityAtoms",
                    "reduceOnly",
                    "sequence",
                    "receivedAtEpochMs",
                    "createdJournalSequence",
                    "updatedJournalSequence",
                    "priceScale",
                    "quantityScale"
                  ],
                  "additionalProperties": false
                }
              ]
            }
          },
          "required": [
            "id",
            "symbol",
            "status",
            "info"
          ],
          "additionalProperties": false
        }
      },
      "CcxtV2TradesResponse": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1
            },
            "order": {
              "type": "string",
              "minLength": 1
            },
            "symbol": {
              "type": "string",
              "minLength": 1
            },
            "timestamp": {
              "type": "integer",
              "minimum": 0
            },
            "datetime": {
              "type": "string"
            },
            "side": {
              "type": "string",
              "enum": [
                "buy",
                "sell"
              ]
            },
            "takerOrMaker": {
              "type": "string",
              "enum": [
                "maker",
                "taker"
              ]
            },
            "price": {
              "type": "number"
            },
            "amount": {
              "type": "number",
              "minimum": 0
            },
            "fee": {
              "type": "object",
              "properties": {
                "cost": {
                  "type": "number",
                  "minimum": 0
                },
                "currency": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "required": [
                "cost",
                "currency"
              ],
              "additionalProperties": false
            },
            "info": {
              "type": "object",
              "properties": {
                "tradeId": {
                  "type": "string",
                  "minLength": 1
                },
                "accountId": {
                  "type": "string",
                  "minLength": 1
                },
                "marketId": {
                  "type": "string",
                  "minLength": 1
                },
                "role": {
                  "type": "string",
                  "enum": [
                    "maker",
                    "taker"
                  ]
                },
                "feePaidAtoms": {
                  "type": "string",
                  "pattern": "^[0-9]+$"
                },
                "feePaid": {
                  "type": "string",
                  "pattern": "^-?[0-9]+\\.[0-9]+$"
                },
                "feeRole": {
                  "type": "string",
                  "enum": [
                    "maker",
                    "taker"
                  ]
                },
                "side": {
                  "type": "string",
                  "enum": [
                    "buy",
                    "sell"
                  ]
                },
                "priceAtoms": {
                  "type": "string",
                  "pattern": "^[0-9]+$"
                },
                "price": {
                  "type": "string",
                  "pattern": "^-?[0-9]+\\.[0-9]+$"
                },
                "sizeAtoms": {
                  "type": "string",
                  "pattern": "^[0-9]+$"
                },
                "size": {
                  "type": "string",
                  "pattern": "^-?[0-9]+\\.[0-9]+$"
                },
                "orderId": {
                  "type": "string",
                  "minLength": 1
                },
                "counterpartyOrderId": {
                  "type": "string",
                  "minLength": 1
                },
                "realizedPnlAtoms": {
                  "type": "string",
                  "pattern": "^-?[0-9]+$"
                },
                "realizedPnl": {
                  "type": "string",
                  "pattern": "^-?[0-9]+\\.[0-9]+$"
                },
                "occurredAtEpochMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "lastSequence": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "required": [
                "tradeId",
                "accountId",
                "marketId",
                "role",
                "feePaidAtoms",
                "feePaid",
                "feeRole",
                "side",
                "priceAtoms",
                "price",
                "sizeAtoms",
                "size",
                "orderId",
                "counterpartyOrderId",
                "occurredAtEpochMs",
                "lastSequence"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "id",
            "order",
            "symbol",
            "timestamp",
            "datetime",
            "side",
            "takerOrMaker",
            "price",
            "amount",
            "fee",
            "info"
          ],
          "additionalProperties": false
        }
      },
      "CcxtV2NotImplementedResponse": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "const": "NotSupported"
          },
          "message": {
            "type": "string",
            "minLength": 1
          },
          "code": {
            "type": "string",
            "const": "operation_not_available"
          },
          "retryable": {
            "type": "boolean",
            "const": false
          },
          "timestamp": {
            "type": "integer",
            "minimum": 0
          },
          "datetime": {
            "type": "string"
          },
          "info": {
            "type": "object",
            "properties": {
              "version": {
                "type": "string",
                "const": "external-rest-error/v1"
              },
              "requestId": {
                "type": "string",
                "minLength": 1
              },
              "code": {
                "type": "string",
                "const": "operation_not_available"
              },
              "safeMessage": {
                "type": "string",
                "minLength": 1
              },
              "retryable": {
                "type": "boolean",
                "const": false
              },
              "recoveryActions": {
                "type": "array",
                "prefixItems": [
                  {
                    "type": "string",
                    "const": "do_not_retry"
                  }
                ],
                "items": false,
                "minItems": 1,
                "maxItems": 1
              },
              "apiKeyRejection": {
                "type": "string",
                "enum": [
                  "malformed",
                  "unknown",
                  "expired",
                  "revoked",
                  "principal_unavailable",
                  "store_unavailable",
                  "scope_insufficient",
                  "passkey_required",
                  "environment_forbidden",
                  "principal_mismatch",
                  "bot_fence_invalid",
                  "bot_fence_stale",
                  "already_rotated"
                ]
              },
              "rejectionGuard": {
                "type": "string",
                "enum": [
                  "amount_atoms_invalid",
                  "command_act_as_invalid",
                  "command_field_required",
                  "command_value_missing",
                  "completion_synchronizer_mismatch",
                  "deposit_field_required",
                  "deposit_integer_invalid",
                  "deposit_timestamp_invalid",
                  "hashing_scheme_unspecified",
                  "ledger_node_id_invalid",
                  "ledger_offset_invalid",
                  "rejection_completion_status",
                  "signature_failure_reason_invalid",
                  "signature_field_hex",
                  "signature_field_required",
                  "submission_id_mismatch",
                  "successful_completion_evidence",
                  "consumed_replay_evidence",
                  "delegated_signing_key_binding",
                  "deposit_asset_unsupported",
                  "deposit_amount_invalid",
                  "deposit_amount_rail_unsupported",
                  "deposit_amount_scale_exceeded",
                  "deposit_missing",
                  "deposit_owner_binding",
                  "deposit_scope",
                  "dfns_confirmation_environment",
                  "funding_intent",
                  "funding_intent_advance",
                  "funding_intent_already_bound",
                  "funding_intent_cancelled",
                  "funding_intent_consumed_without_deposit",
                  "funding_intent_missing",
                  "intent_asset_unsupported",
                  "intent_owner_binding",
                  "local_confirmation_environment",
                  "owner_intent_scope",
                  "owner_kind_unsupported",
                  "planned_command_identities",
                  "request_owner_binding",
                  "local_authority_party_missing",
                  "local_confirmation_deposit_status",
                  "local_operator_replay_mismatch",
                  "local_recovery_step_mismatch",
                  "local_signer_failed",
                  "local_signing_key_mismatch",
                  "local_wallet_binding",
                  "operator_step_expected",
                  "owner_step_expected",
                  "owner_submission_command_binding",
                  "planned_command_missing",
                  "planned_command_not_unique",
                  "post_offer_step_expected",
                  "reconciliation_signature_scope",
                  "signature_completion_action",
                  "signature_hex_missing",
                  "signing_step_ahead_of_deposit",
                  "treasury_execution_restore",
                  "treasury_offer_contract_missing",
                  "unknown_command_candidates",
                  "completion_read_refused",
                  "completion_correlation",
                  "completion_not_unique",
                  "completion_transaction_correlation",
                  "interactive_act_as_missing",
                  "interactive_transaction_correlation",
                  "reconcile_binding_mismatch",
                  "rejected_completion_has_update",
                  "standard_submission_correlation",
                  "standard_submission_response_invalid",
                  "successful_completion_update_missing",
                  "unrecoverable_command_evidence",
                  "executed_evidence_correlation",
                  "executed_evidence_replay",
                  "executed_evidence_rows",
                  "executed_evidence_signature_status",
                  "execute_permit_rows",
                  "execute_permit_signature_status",
                  "ledger_rejection_correlation",
                  "ledger_rejection_replay",
                  "ledger_rejection_rows",
                  "ledger_rejection_signature_status",
                  "preparation_lock_busy",
                  "reconciliation_signature_state",
                  "signature_identity_binding",
                  "signature_identity_missing",
                  "signature_permitted_command",
                  "signature_preparable_state",
                  "signature_preparation_replay",
                  "signature_record_identity",
                  "signature_record_missing",
                  "signature_record_shape",
                  "signature_replay",
                  "signature_row_count",
                  "signature_scope_environment",
                  "signature_scope_fingerprint",
                  "signature_session_consistency",
                  "canton_command_identity",
                  "command_completion_evidence",
                  "command_confirm_rows",
                  "command_confirm_state",
                  "command_evidence_replay",
                  "command_permit_rows",
                  "command_permit_state",
                  "command_predecessors_unconfirmed",
                  "command_release_evidence",
                  "command_release_replay",
                  "command_release_rows",
                  "command_release_state",
                  "signature_restart_state",
                  "existing_receipt_replay",
                  "existing_receipt_rows",
                  "existing_receipt_state",
                  "local_replay_command_state",
                  "local_replay_fence_rows",
                  "local_replay_fence_state",
                  "local_replay_step",
                  "persisted_permit_mismatch",
                  "treasury_offer_command_identity",
                  "treasury_offer_confirm_rows",
                  "treasury_offer_confirm_state",
                  "treasury_offer_evidence_replay",
                  "treasury_offer_permit_rows",
                  "treasury_offer_permit_state",
                  "treasury_offer_reject_rows",
                  "treasury_offer_reject_state",
                  "treasury_offer_rejection_replay",
                  "treasury_offer_submission_id",
                  "treasury_input_amount_mismatch",
                  "treasury_input_release_rows",
                  "treasury_input_release_state",
                  "treasury_input_reservation_mismatch",
                  "treasury_input_reservation_rows",
                  "treasury_input_reservation_state"
                ]
              },
              "withdrawalFailure": {
                "type": "string",
                "enum": [
                  "requested",
                  "margin_reserved",
                  "authorized",
                  "submitted",
                  "settled",
                  "rejected",
                  "expired",
                  "failed",
                  "invalid_transition",
                  "authorization_setup_failed",
                  "margin_blocked",
                  "co_sign_incomplete",
                  "co_sign_self_approval",
                  "ttl_expired",
                  "canton_submission_failed",
                  "withdrawal_payout_dfns_signature_failed",
                  "withdrawal_payout_canton_submit_refused",
                  "withdrawal_payout_ledger_time_expired",
                  "asset_unsupported",
                  "withdrawal_amount_invalid",
                  "withdrawal_amount_scale_exceeded",
                  "withdrawal_authorization_binding_mismatch",
                  "withdrawal_capability_unavailable",
                  "withdrawal_checkpoint_unavailable",
                  "withdrawal_destination_not_owned",
                  "withdrawal_not_found",
                  "withdrawal_operators_missing",
                  "withdrawal_operators_not_distinct",
                  "withdrawal_owner_party_invalid",
                  "withdrawal_owner_unavailable",
                  "withdrawal_request_invalid",
                  "withdrawal_request_ended",
                  "withdrawal_reservation_release_failed",
                  "withdrawal_unavailable",
                  "withdrawal_submission_unavailable",
                  "withdrawal_enqueue_failed",
                  "withdrawal_publish_failed"
                ]
              },
              "dependency": {
                "type": "string",
                "enum": [
                  "dfns",
                  "engine"
                ]
              },
              "occurredAtEpochMs": {
                "type": "integer",
                "minimum": 0
              }
            },
            "required": [
              "version",
              "requestId",
              "code",
              "safeMessage",
              "retryable",
              "recoveryActions",
              "occurredAtEpochMs"
            ],
            "additionalProperties": false
          },
          "method": {
            "type": "string",
            "enum": [
              "fetchTrades",
              "cancelAllOrders",
              "editOrder",
              "fetchFundingRateHistory",
              "fetchFundingHistory",
              "setLeverage",
              "setMarginMode"
            ]
          }
        },
        "required": [
          "name",
          "message",
          "code",
          "retryable",
          "timestamp",
          "datetime",
          "info",
          "method"
        ],
        "additionalProperties": false
      },
      "PartySetupRequest": {
        "type": "object",
        "properties": {
          "approval": {
            "type": "object",
            "properties": {
              "challengeIdentifier": {
                "type": "string",
                "minLength": 1
              },
              "firstFactor": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "Fido2"
                      },
                      "credentialAssertion": {
                        "type": "object",
                        "properties": {
                          "credId": {
                            "type": "string",
                            "minLength": 1
                          },
                          "clientData": {
                            "type": "string",
                            "minLength": 1
                          },
                          "signature": {
                            "type": "string",
                            "minLength": 1
                          },
                          "authenticatorData": {
                            "type": "string",
                            "minLength": 1
                          },
                          "algorithm": {
                            "type": "string",
                            "minLength": 1
                          },
                          "userHandle": {
                            "type": "string",
                            "minLength": 1
                          }
                        },
                        "required": [
                          "credId",
                          "clientData",
                          "signature",
                          "authenticatorData"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "required": [
                      "kind",
                      "credentialAssertion"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "Key"
                      },
                      "credentialAssertion": {
                        "type": "object",
                        "properties": {
                          "credId": {
                            "type": "string",
                            "minLength": 1
                          },
                          "clientData": {
                            "type": "string",
                            "minLength": 1
                          },
                          "signature": {
                            "type": "string",
                            "minLength": 1
                          }
                        },
                        "required": [
                          "credId",
                          "clientData",
                          "signature"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "required": [
                      "kind",
                      "credentialAssertion"
                    ],
                    "additionalProperties": false
                  }
                ]
              }
            },
            "required": [
              "challengeIdentifier",
              "firstFactor"
            ],
            "additionalProperties": false
          }
        },
        "additionalProperties": false
      },
      "PartySetupResponse": {
        "type": "object",
        "properties": {
          "consentState": {
            "type": "string",
            "enum": [
              "absent",
              "pending",
              "active",
              "revoked",
              "package_unavailable"
            ]
          },
          "challenge": {
            "type": "object",
            "properties": {
              "challenge": {
                "type": "string",
                "minLength": 1
              },
              "challengeIdentifier": {
                "type": "string",
                "minLength": 1
              },
              "allowCredentials": {
                "type": "object",
                "properties": {
                  "key": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "public-key"
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "required": [
                        "type",
                        "id"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "webauthn": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "public-key"
                        },
                        "id": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "required": [
                        "type",
                        "id"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "key",
                  "webauthn"
                ],
                "additionalProperties": false
              },
              "userVerification": {
                "type": "string",
                "enum": [
                  "required",
                  "preferred",
                  "discouraged"
                ]
              }
            },
            "required": [
              "challenge",
              "challengeIdentifier",
              "allowCredentials",
              "userVerification"
            ],
            "additionalProperties": false
          },
          "failure": {
            "type": "object",
            "properties": {
              "step": {
                "type": "string",
                "enum": [
                  "package_check",
                  "authority",
                  "ensure_account",
                  "create_consent",
                  "prepare",
                  "sign",
                  "sign_find",
                  "sign_init",
                  "sign_complete",
                  "execute",
                  "completion",
                  "consent_lifecycle",
                  "persist",
                  "lock",
                  "unknown"
                ]
              },
              "reason": {
                "type": "string",
                "enum": [
                  "approval_required",
                  "busy",
                  "submission_frozen",
                  "consent_ambiguous",
                  "binding_invalid",
                  "invalid_request",
                  "timeout",
                  "dfns_auth_endpoint_insecure",
                  "dfns_auth_request_failed",
                  "dfns_auth_response_invalid",
                  "dfns_unavailable",
                  "canton_unavailable",
                  "canton_deadline_exceeded",
                  "canton_permission_denied",
                  "canton_unauthenticated",
                  "canton_invalid_argument",
                  "canton_not_found",
                  "canton_already_exists",
                  "canton_failed_precondition",
                  "canton_aborted",
                  "canton_submission_rejected",
                  "unknown"
                ]
              }
            },
            "required": [
              "step",
              "reason"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "consentState"
        ],
        "additionalProperties": false
      },
      "DfnsPartyOnboardingInitResponse": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "version": {
                "type": "string",
                "const": "dfns-party-onboarding/v1"
              },
              "accountId": {
                "type": "string",
                "minLength": 1
              },
              "partyId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 255,
                "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*::[A-Za-z0-9][A-Za-z0-9._-]*$"
              },
              "status": {
                "type": "string",
                "const": "signing"
              },
              "challenges": {
                "anyOf": [
                  {
                    "type": "array",
                    "prefixItems": [
                      {
                        "type": "object",
                        "properties": {
                          "challenge": {
                            "type": "string",
                            "minLength": 1
                          },
                          "challengeIdentifier": {
                            "type": "string",
                            "minLength": 1
                          },
                          "allowCredentials": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "type": {
                                      "type": "string",
                                      "const": "public-key"
                                    },
                                    "id": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "type",
                                    "id"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "webauthn": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "type": {
                                      "type": "string",
                                      "const": "public-key"
                                    },
                                    "id": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "type",
                                    "id"
                                  ],
                                  "additionalProperties": false
                                }
                              }
                            },
                            "required": [
                              "key",
                              "webauthn"
                            ],
                            "additionalProperties": false
                          },
                          "userVerification": {
                            "type": "string",
                            "enum": [
                              "required",
                              "preferred",
                              "discouraged"
                            ]
                          },
                          "ordinal": {
                            "type": "number",
                            "const": 1
                          }
                        },
                        "required": [
                          "challenge",
                          "challengeIdentifier",
                          "allowCredentials",
                          "userVerification",
                          "ordinal"
                        ],
                        "additionalProperties": false
                      }
                    ],
                    "items": false,
                    "minItems": 1,
                    "maxItems": 1
                  },
                  {
                    "type": "array",
                    "prefixItems": [
                      {
                        "type": "object",
                        "properties": {
                          "challenge": {
                            "type": "string",
                            "minLength": 1
                          },
                          "challengeIdentifier": {
                            "type": "string",
                            "minLength": 1
                          },
                          "allowCredentials": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "type": {
                                      "type": "string",
                                      "const": "public-key"
                                    },
                                    "id": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "type",
                                    "id"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "webauthn": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "type": {
                                      "type": "string",
                                      "const": "public-key"
                                    },
                                    "id": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "type",
                                    "id"
                                  ],
                                  "additionalProperties": false
                                }
                              }
                            },
                            "required": [
                              "key",
                              "webauthn"
                            ],
                            "additionalProperties": false
                          },
                          "userVerification": {
                            "type": "string",
                            "enum": [
                              "required",
                              "preferred",
                              "discouraged"
                            ]
                          },
                          "ordinal": {
                            "type": "number",
                            "const": 1
                          }
                        },
                        "required": [
                          "challenge",
                          "challengeIdentifier",
                          "allowCredentials",
                          "userVerification",
                          "ordinal"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "challenge": {
                            "type": "string",
                            "minLength": 1
                          },
                          "challengeIdentifier": {
                            "type": "string",
                            "minLength": 1
                          },
                          "allowCredentials": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "type": {
                                      "type": "string",
                                      "const": "public-key"
                                    },
                                    "id": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "type",
                                    "id"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "webauthn": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "type": {
                                      "type": "string",
                                      "const": "public-key"
                                    },
                                    "id": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "type",
                                    "id"
                                  ],
                                  "additionalProperties": false
                                }
                              }
                            },
                            "required": [
                              "key",
                              "webauthn"
                            ],
                            "additionalProperties": false
                          },
                          "userVerification": {
                            "type": "string",
                            "enum": [
                              "required",
                              "preferred",
                              "discouraged"
                            ]
                          },
                          "ordinal": {
                            "type": "number",
                            "const": 2
                          }
                        },
                        "required": [
                          "challenge",
                          "challengeIdentifier",
                          "allowCredentials",
                          "userVerification",
                          "ordinal"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "challenge": {
                            "type": "string",
                            "minLength": 1
                          },
                          "challengeIdentifier": {
                            "type": "string",
                            "minLength": 1
                          },
                          "allowCredentials": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "type": {
                                      "type": "string",
                                      "const": "public-key"
                                    },
                                    "id": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "type",
                                    "id"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "webauthn": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "type": {
                                      "type": "string",
                                      "const": "public-key"
                                    },
                                    "id": {
                                      "type": "string",
                                      "minLength": 1
                                    }
                                  },
                                  "required": [
                                    "type",
                                    "id"
                                  ],
                                  "additionalProperties": false
                                }
                              }
                            },
                            "required": [
                              "key",
                              "webauthn"
                            ],
                            "additionalProperties": false
                          },
                          "userVerification": {
                            "type": "string",
                            "enum": [
                              "required",
                              "preferred",
                              "discouraged"
                            ]
                          },
                          "ordinal": {
                            "type": "number",
                            "const": 3
                          }
                        },
                        "required": [
                          "challenge",
                          "challengeIdentifier",
                          "allowCredentials",
                          "userVerification",
                          "ordinal"
                        ],
                        "additionalProperties": false
                      }
                    ],
                    "items": false,
                    "minItems": 3,
                    "maxItems": 3
                  }
                ]
              }
            },
            "required": [
              "version",
              "accountId",
              "partyId",
              "status",
              "challenges"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "version": {
                "type": "string",
                "const": "dfns-party-onboarding/v1"
              },
              "accountId": {
                "type": "string",
                "minLength": 1
              },
              "partyId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 255,
                "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*::[A-Za-z0-9][A-Za-z0-9._-]*$"
              },
              "status": {
                "type": "string",
                "const": "active"
              }
            },
            "required": [
              "version",
              "accountId",
              "partyId",
              "status"
            ],
            "additionalProperties": false
          }
        ]
      },
      "DfnsPartyOnboardingStatusResponse": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "version": {
                "type": "string",
                "const": "dfns-party-onboarding/v1"
              },
              "accountId": {
                "type": "string",
                "minLength": 1
              },
              "partyId": {
                "type": "null"
              },
              "status": {
                "type": "string",
                "const": "not_started"
              }
            },
            "required": [
              "version",
              "accountId",
              "partyId",
              "status"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "version": {
                "type": "string",
                "const": "dfns-party-onboarding/v1"
              },
              "accountId": {
                "type": "string",
                "minLength": 1
              },
              "partyId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 255,
                "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*::[A-Za-z0-9][A-Za-z0-9._-]*$"
              },
              "status": {
                "type": "string",
                "const": "generated"
              }
            },
            "required": [
              "version",
              "accountId",
              "partyId",
              "status"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "version": {
                "type": "string",
                "const": "dfns-party-onboarding/v1"
              },
              "accountId": {
                "type": "string",
                "minLength": 1
              },
              "partyId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 255,
                "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*::[A-Za-z0-9][A-Za-z0-9._-]*$"
              },
              "status": {
                "type": "string",
                "const": "signing"
              }
            },
            "required": [
              "version",
              "accountId",
              "partyId",
              "status"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "version": {
                "type": "string",
                "const": "dfns-party-onboarding/v1"
              },
              "accountId": {
                "type": "string",
                "minLength": 1
              },
              "partyId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 255,
                "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*::[A-Za-z0-9][A-Za-z0-9._-]*$"
              },
              "status": {
                "type": "string",
                "const": "submitted"
              }
            },
            "required": [
              "version",
              "accountId",
              "partyId",
              "status"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "version": {
                "type": "string",
                "const": "dfns-party-onboarding/v1"
              },
              "accountId": {
                "type": "string",
                "minLength": 1
              },
              "partyId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 255,
                "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*::[A-Za-z0-9][A-Za-z0-9._-]*$"
              },
              "status": {
                "type": "string",
                "const": "active"
              }
            },
            "required": [
              "version",
              "accountId",
              "partyId",
              "status"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "version": {
                "type": "string",
                "const": "dfns-party-onboarding/v1"
              },
              "accountId": {
                "type": "string",
                "minLength": 1
              },
              "partyId": {
                "type": [
                  "string",
                  "null"
                ],
                "minLength": 1,
                "maxLength": 255,
                "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*::[A-Za-z0-9][A-Za-z0-9._-]*$"
              },
              "status": {
                "type": "string",
                "const": "failed"
              },
              "rejectionReason": {
                "type": "string",
                "enum": [
                  "wallet_unavailable",
                  "wallet_mismatch",
                  "signature_rejected",
                  "signature_invalid",
                  "saxon_unavailable",
                  "saxon_response_invalid",
                  "party_not_active",
                  "binding_conflict"
                ]
              }
            },
            "required": [
              "version",
              "accountId",
              "partyId",
              "status",
              "rejectionReason"
            ],
            "additionalProperties": false
          }
        ]
      },
      "DfnsPartyOnboardingCompleteRequest": {
        "type": "object",
        "properties": {
          "approvals": {
            "anyOf": [
              {
                "type": "array",
                "prefixItems": [
                  {
                    "type": "object",
                    "properties": {
                      "ordinal": {
                        "type": "number",
                        "const": 1
                      },
                      "challengeIdentifier": {
                        "type": "string",
                        "minLength": 1
                      },
                      "firstFactor": {
                        "oneOf": [
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "const": "Fido2"
                              },
                              "credentialAssertion": {
                                "type": "object",
                                "properties": {
                                  "credId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "clientData": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "signature": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "authenticatorData": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "algorithm": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "userHandle": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "required": [
                                  "credId",
                                  "clientData",
                                  "signature",
                                  "authenticatorData"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "required": [
                              "kind",
                              "credentialAssertion"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "const": "Key"
                              },
                              "credentialAssertion": {
                                "type": "object",
                                "properties": {
                                  "credId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "clientData": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "signature": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "required": [
                                  "credId",
                                  "clientData",
                                  "signature"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "required": [
                              "kind",
                              "credentialAssertion"
                            ],
                            "additionalProperties": false
                          }
                        ]
                      }
                    },
                    "required": [
                      "ordinal",
                      "challengeIdentifier",
                      "firstFactor"
                    ],
                    "additionalProperties": false
                  }
                ],
                "items": false,
                "minItems": 1,
                "maxItems": 1
              },
              {
                "type": "array",
                "prefixItems": [
                  {
                    "type": "object",
                    "properties": {
                      "ordinal": {
                        "type": "number",
                        "const": 1
                      },
                      "challengeIdentifier": {
                        "type": "string",
                        "minLength": 1
                      },
                      "firstFactor": {
                        "oneOf": [
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "const": "Fido2"
                              },
                              "credentialAssertion": {
                                "type": "object",
                                "properties": {
                                  "credId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "clientData": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "signature": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "authenticatorData": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "algorithm": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "userHandle": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "required": [
                                  "credId",
                                  "clientData",
                                  "signature",
                                  "authenticatorData"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "required": [
                              "kind",
                              "credentialAssertion"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "const": "Key"
                              },
                              "credentialAssertion": {
                                "type": "object",
                                "properties": {
                                  "credId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "clientData": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "signature": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "required": [
                                  "credId",
                                  "clientData",
                                  "signature"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "required": [
                              "kind",
                              "credentialAssertion"
                            ],
                            "additionalProperties": false
                          }
                        ]
                      }
                    },
                    "required": [
                      "ordinal",
                      "challengeIdentifier",
                      "firstFactor"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "ordinal": {
                        "type": "number",
                        "const": 2
                      },
                      "challengeIdentifier": {
                        "type": "string",
                        "minLength": 1
                      },
                      "firstFactor": {
                        "oneOf": [
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "const": "Fido2"
                              },
                              "credentialAssertion": {
                                "type": "object",
                                "properties": {
                                  "credId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "clientData": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "signature": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "authenticatorData": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "algorithm": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "userHandle": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "required": [
                                  "credId",
                                  "clientData",
                                  "signature",
                                  "authenticatorData"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "required": [
                              "kind",
                              "credentialAssertion"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "const": "Key"
                              },
                              "credentialAssertion": {
                                "type": "object",
                                "properties": {
                                  "credId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "clientData": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "signature": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "required": [
                                  "credId",
                                  "clientData",
                                  "signature"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "required": [
                              "kind",
                              "credentialAssertion"
                            ],
                            "additionalProperties": false
                          }
                        ]
                      }
                    },
                    "required": [
                      "ordinal",
                      "challengeIdentifier",
                      "firstFactor"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "ordinal": {
                        "type": "number",
                        "const": 3
                      },
                      "challengeIdentifier": {
                        "type": "string",
                        "minLength": 1
                      },
                      "firstFactor": {
                        "oneOf": [
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "const": "Fido2"
                              },
                              "credentialAssertion": {
                                "type": "object",
                                "properties": {
                                  "credId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "clientData": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "signature": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "authenticatorData": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "algorithm": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "userHandle": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "required": [
                                  "credId",
                                  "clientData",
                                  "signature",
                                  "authenticatorData"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "required": [
                              "kind",
                              "credentialAssertion"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "const": "Key"
                              },
                              "credentialAssertion": {
                                "type": "object",
                                "properties": {
                                  "credId": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "clientData": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "signature": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "required": [
                                  "credId",
                                  "clientData",
                                  "signature"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "required": [
                              "kind",
                              "credentialAssertion"
                            ],
                            "additionalProperties": false
                          }
                        ]
                      }
                    },
                    "required": [
                      "ordinal",
                      "challengeIdentifier",
                      "firstFactor"
                    ],
                    "additionalProperties": false
                  }
                ],
                "items": false,
                "minItems": 3,
                "maxItems": 3
              }
            ]
          }
        },
        "required": [
          "approvals"
        ],
        "additionalProperties": false
      },
      "DfnsPartyOnboardingCompleteResponse": {
        "type": "object",
        "properties": {
          "version": {
            "type": "string",
            "const": "dfns-party-onboarding/v1"
          },
          "accountId": {
            "type": "string",
            "minLength": 1
          },
          "partyId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*::[A-Za-z0-9][A-Za-z0-9._-]*$"
          },
          "status": {
            "type": "string",
            "const": "active"
          }
        },
        "required": [
          "version",
          "accountId",
          "partyId",
          "status"
        ],
        "additionalProperties": false
      },
      "LocalSigningWalletResponse": {
        "type": "object",
        "properties": {
          "version": {
            "type": "string",
            "const": "local-signing/v1"
          },
          "environment": {
            "type": "string",
            "enum": [
              "local",
              "development"
            ]
          },
          "accountId": {
            "type": "string",
            "minLength": 1
          },
          "partyId": {
            "type": "string",
            "minLength": 1
          },
          "ownerKind": {
            "type": "string",
            "const": "local_signing"
          },
          "status": {
            "type": "string",
            "const": "ready"
          }
        },
        "required": [
          "version",
          "environment",
          "accountId",
          "partyId",
          "ownerKind",
          "status"
        ],
        "additionalProperties": false
      },
      "FaucetGrantResponse": {
        "type": "object",
        "properties": {
          "version": {
            "type": "string",
            "const": "faucet-grant/v1"
          },
          "accountId": {
            "type": "string",
            "minLength": 1
          },
          "asset": {
            "type": "string",
            "const": "USD.E"
          },
          "amountAtoms": {
            "type": "string",
            "pattern": "^[1-9][0-9]*$"
          },
          "fundingIntentId": {
            "type": "string",
            "minLength": 1
          },
          "status": {
            "type": "string",
            "enum": [
              "available",
              "deposit_bound",
              "consumed",
              "cancelled"
            ]
          },
          "replayed": {
            "type": "boolean"
          }
        },
        "required": [
          "version",
          "accountId",
          "asset",
          "amountAtoms",
          "fundingIntentId",
          "status",
          "replayed"
        ],
        "additionalProperties": false
      },
      "LocalSigningDepositDiscoveryResponse": {
        "type": "object",
        "properties": {
          "version": {
            "type": "string",
            "const": "local-signing/v2"
          },
          "environment": {
            "type": "string",
            "enum": [
              "local",
              "development",
              "staging"
            ]
          },
          "accountId": {
            "type": "string",
            "minLength": 1
          },
          "intents": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "adminCommandId": {
                  "type": "string",
                  "minLength": 1
                },
                "fundingIntentId": {
                  "type": "string",
                  "minLength": 1
                },
                "asset": {
                  "type": "string",
                  "enum": [
                    "USD.E",
                    "USDCx"
                  ]
                },
                "amountAtoms": {
                  "type": "string",
                  "pattern": "^[1-9][0-9]*$"
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "available",
                    "deposit_bound",
                    "consumed",
                    "cancelled"
                  ]
                },
                "deposit": {
                  "anyOf": [
                    {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "version": {
                              "type": "string",
                              "const": "local-signing/v2"
                            },
                            "environment": {
                              "type": "string",
                              "enum": [
                                "local",
                                "development",
                                "staging"
                              ]
                            },
                            "adminCommandId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "fundingIntentId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "depositId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "engineCommandId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "accountId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "partyId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "asset": {
                              "type": "string",
                              "enum": [
                                "USD.E",
                                "USDCx"
                              ]
                            },
                            "amountAtoms": {
                              "type": "string",
                              "pattern": "^[1-9][0-9]*$"
                            },
                            "plannedCantonCommands": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "step": {
                                    "type": "string",
                                    "enum": [
                                      "treasury_offer",
                                      "account_proposal",
                                      "owner_account_acceptance",
                                      "operator_account_acceptance",
                                      "owner_offer_acceptance",
                                      "deposit_proposal",
                                      "owner_deposit_authorization",
                                      "operator_deposit_execution"
                                    ]
                                  },
                                  "commandId": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "required": [
                                  "step",
                                  "commandId"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "cantonOutcome": {
                              "type": "object",
                              "properties": {
                                "step": {
                                  "type": "string",
                                  "enum": [
                                    "treasury_offer",
                                    "account_proposal",
                                    "owner_account_acceptance",
                                    "operator_account_acceptance",
                                    "owner_offer_acceptance",
                                    "deposit_proposal",
                                    "owner_deposit_authorization",
                                    "operator_deposit_execution"
                                  ]
                                },
                                "outcome": {
                                  "type": "string",
                                  "enum": [
                                    "sequenced_accepted",
                                    "sequenced_rejected",
                                    "not_sequenced",
                                    "outcome_pending"
                                  ]
                                },
                                "guard": {
                                  "type": "string",
                                  "enum": [
                                    "completion_accepted",
                                    "target_archive_accepted",
                                    "completion_rejected",
                                    "max_record_time_passed",
                                    "ledger_time_bound_passed",
                                    "submission_acknowledged",
                                    "submission_unacknowledged",
                                    "completion_wait_elapsed",
                                    "completion_stream_unavailable",
                                    "completion_record_unavailable",
                                    "completion_absent_window_open",
                                    "completion_duplicate_command",
                                    "completion_submission_in_flight",
                                    "record_time_unavailable",
                                    "target_contract_unavailable",
                                    "target_contract_archived_elsewhere"
                                  ]
                                }
                              },
                              "required": [
                                "step",
                                "outcome",
                                "guard"
                              ],
                              "additionalProperties": false
                            },
                            "status": {
                              "type": "string",
                              "const": "bound"
                            }
                          },
                          "required": [
                            "version",
                            "environment",
                            "adminCommandId",
                            "fundingIntentId",
                            "depositId",
                            "engineCommandId",
                            "accountId",
                            "partyId",
                            "asset",
                            "amountAtoms",
                            "plannedCantonCommands",
                            "status"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "version": {
                              "type": "string",
                              "const": "local-signing/v2"
                            },
                            "environment": {
                              "type": "string",
                              "enum": [
                                "local",
                                "development",
                                "staging"
                              ]
                            },
                            "adminCommandId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "fundingIntentId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "depositId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "engineCommandId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "accountId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "partyId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "asset": {
                              "type": "string",
                              "enum": [
                                "USD.E",
                                "USDCx"
                              ]
                            },
                            "amountAtoms": {
                              "type": "string",
                              "pattern": "^[1-9][0-9]*$"
                            },
                            "plannedCantonCommands": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "step": {
                                    "type": "string",
                                    "enum": [
                                      "treasury_offer",
                                      "account_proposal",
                                      "owner_account_acceptance",
                                      "operator_account_acceptance",
                                      "owner_offer_acceptance",
                                      "deposit_proposal",
                                      "owner_deposit_authorization",
                                      "operator_deposit_execution"
                                    ]
                                  },
                                  "commandId": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "required": [
                                  "step",
                                  "commandId"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "cantonOutcome": {
                              "type": "object",
                              "properties": {
                                "step": {
                                  "type": "string",
                                  "enum": [
                                    "treasury_offer",
                                    "account_proposal",
                                    "owner_account_acceptance",
                                    "operator_account_acceptance",
                                    "owner_offer_acceptance",
                                    "deposit_proposal",
                                    "owner_deposit_authorization",
                                    "operator_deposit_execution"
                                  ]
                                },
                                "outcome": {
                                  "type": "string",
                                  "enum": [
                                    "sequenced_accepted",
                                    "sequenced_rejected",
                                    "not_sequenced",
                                    "outcome_pending"
                                  ]
                                },
                                "guard": {
                                  "type": "string",
                                  "enum": [
                                    "completion_accepted",
                                    "target_archive_accepted",
                                    "completion_rejected",
                                    "max_record_time_passed",
                                    "ledger_time_bound_passed",
                                    "submission_acknowledged",
                                    "submission_unacknowledged",
                                    "completion_wait_elapsed",
                                    "completion_stream_unavailable",
                                    "completion_record_unavailable",
                                    "completion_absent_window_open",
                                    "completion_duplicate_command",
                                    "completion_submission_in_flight",
                                    "record_time_unavailable",
                                    "target_contract_unavailable",
                                    "target_contract_archived_elsewhere"
                                  ]
                                }
                              },
                              "required": [
                                "step",
                                "outcome",
                                "guard"
                              ],
                              "additionalProperties": false
                            },
                            "status": {
                              "type": "string",
                              "const": "prepared"
                            },
                            "offerContractId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "offerUpdateId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "offerLedgerOffset": {
                              "type": "string",
                              "minLength": 1
                            }
                          },
                          "required": [
                            "version",
                            "environment",
                            "adminCommandId",
                            "fundingIntentId",
                            "depositId",
                            "engineCommandId",
                            "accountId",
                            "partyId",
                            "asset",
                            "amountAtoms",
                            "plannedCantonCommands",
                            "status",
                            "offerContractId",
                            "offerUpdateId",
                            "offerLedgerOffset"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "version": {
                              "type": "string",
                              "const": "local-signing/v2"
                            },
                            "environment": {
                              "type": "string",
                              "enum": [
                                "local",
                                "development",
                                "staging"
                              ]
                            },
                            "adminCommandId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "fundingIntentId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "depositId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "engineCommandId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "accountId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "partyId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "asset": {
                              "type": "string",
                              "enum": [
                                "USD.E",
                                "USDCx"
                              ]
                            },
                            "amountAtoms": {
                              "type": "string",
                              "pattern": "^[1-9][0-9]*$"
                            },
                            "plannedCantonCommands": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "step": {
                                    "type": "string",
                                    "enum": [
                                      "treasury_offer",
                                      "account_proposal",
                                      "owner_account_acceptance",
                                      "operator_account_acceptance",
                                      "owner_offer_acceptance",
                                      "deposit_proposal",
                                      "owner_deposit_authorization",
                                      "operator_deposit_execution"
                                    ]
                                  },
                                  "commandId": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "required": [
                                  "step",
                                  "commandId"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "cantonOutcome": {
                              "type": "object",
                              "properties": {
                                "step": {
                                  "type": "string",
                                  "enum": [
                                    "treasury_offer",
                                    "account_proposal",
                                    "owner_account_acceptance",
                                    "operator_account_acceptance",
                                    "owner_offer_acceptance",
                                    "deposit_proposal",
                                    "owner_deposit_authorization",
                                    "operator_deposit_execution"
                                  ]
                                },
                                "outcome": {
                                  "type": "string",
                                  "enum": [
                                    "sequenced_accepted",
                                    "sequenced_rejected",
                                    "not_sequenced",
                                    "outcome_pending"
                                  ]
                                },
                                "guard": {
                                  "type": "string",
                                  "enum": [
                                    "completion_accepted",
                                    "target_archive_accepted",
                                    "completion_rejected",
                                    "max_record_time_passed",
                                    "ledger_time_bound_passed",
                                    "submission_acknowledged",
                                    "submission_unacknowledged",
                                    "completion_wait_elapsed",
                                    "completion_stream_unavailable",
                                    "completion_record_unavailable",
                                    "completion_absent_window_open",
                                    "completion_duplicate_command",
                                    "completion_submission_in_flight",
                                    "record_time_unavailable",
                                    "target_contract_unavailable",
                                    "target_contract_archived_elsewhere"
                                  ]
                                }
                              },
                              "required": [
                                "step",
                                "outcome",
                                "guard"
                              ],
                              "additionalProperties": false
                            },
                            "status": {
                              "type": "string",
                              "const": "submitted"
                            }
                          },
                          "required": [
                            "version",
                            "environment",
                            "adminCommandId",
                            "fundingIntentId",
                            "depositId",
                            "engineCommandId",
                            "accountId",
                            "partyId",
                            "asset",
                            "amountAtoms",
                            "plannedCantonCommands",
                            "status"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "version": {
                              "type": "string",
                              "const": "local-signing/v2"
                            },
                            "environment": {
                              "type": "string",
                              "enum": [
                                "local",
                                "development",
                                "staging"
                              ]
                            },
                            "adminCommandId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "fundingIntentId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "depositId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "engineCommandId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "accountId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "partyId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "asset": {
                              "type": "string",
                              "enum": [
                                "USD.E",
                                "USDCx"
                              ]
                            },
                            "amountAtoms": {
                              "type": "string",
                              "pattern": "^[1-9][0-9]*$"
                            },
                            "plannedCantonCommands": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "step": {
                                    "type": "string",
                                    "enum": [
                                      "treasury_offer",
                                      "account_proposal",
                                      "owner_account_acceptance",
                                      "operator_account_acceptance",
                                      "owner_offer_acceptance",
                                      "deposit_proposal",
                                      "owner_deposit_authorization",
                                      "operator_deposit_execution"
                                    ]
                                  },
                                  "commandId": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "required": [
                                  "step",
                                  "commandId"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "cantonOutcome": {
                              "type": "object",
                              "properties": {
                                "step": {
                                  "type": "string",
                                  "enum": [
                                    "treasury_offer",
                                    "account_proposal",
                                    "owner_account_acceptance",
                                    "operator_account_acceptance",
                                    "owner_offer_acceptance",
                                    "deposit_proposal",
                                    "owner_deposit_authorization",
                                    "operator_deposit_execution"
                                  ]
                                },
                                "outcome": {
                                  "type": "string",
                                  "enum": [
                                    "sequenced_accepted",
                                    "sequenced_rejected",
                                    "not_sequenced",
                                    "outcome_pending"
                                  ]
                                },
                                "guard": {
                                  "type": "string",
                                  "enum": [
                                    "completion_accepted",
                                    "target_archive_accepted",
                                    "completion_rejected",
                                    "max_record_time_passed",
                                    "ledger_time_bound_passed",
                                    "submission_acknowledged",
                                    "submission_unacknowledged",
                                    "completion_wait_elapsed",
                                    "completion_stream_unavailable",
                                    "completion_record_unavailable",
                                    "completion_absent_window_open",
                                    "completion_duplicate_command",
                                    "completion_submission_in_flight",
                                    "record_time_unavailable",
                                    "target_contract_unavailable",
                                    "target_contract_archived_elsewhere"
                                  ]
                                }
                              },
                              "required": [
                                "step",
                                "outcome",
                                "guard"
                              ],
                              "additionalProperties": false
                            },
                            "status": {
                              "type": "string",
                              "const": "submitted_unknown"
                            },
                            "uncertainCantonCommandId": {
                              "type": "string",
                              "minLength": 1
                            }
                          },
                          "required": [
                            "version",
                            "environment",
                            "adminCommandId",
                            "fundingIntentId",
                            "depositId",
                            "engineCommandId",
                            "accountId",
                            "partyId",
                            "asset",
                            "amountAtoms",
                            "plannedCantonCommands",
                            "status",
                            "uncertainCantonCommandId"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "version": {
                              "type": "string",
                              "const": "local-signing/v2"
                            },
                            "environment": {
                              "type": "string",
                              "enum": [
                                "local",
                                "development",
                                "staging"
                              ]
                            },
                            "adminCommandId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "fundingIntentId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "depositId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "engineCommandId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "accountId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "partyId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "asset": {
                              "type": "string",
                              "enum": [
                                "USD.E",
                                "USDCx"
                              ]
                            },
                            "amountAtoms": {
                              "type": "string",
                              "pattern": "^[1-9][0-9]*$"
                            },
                            "plannedCantonCommands": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "step": {
                                    "type": "string",
                                    "enum": [
                                      "treasury_offer",
                                      "account_proposal",
                                      "owner_account_acceptance",
                                      "operator_account_acceptance",
                                      "owner_offer_acceptance",
                                      "deposit_proposal",
                                      "owner_deposit_authorization",
                                      "operator_deposit_execution"
                                    ]
                                  },
                                  "commandId": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "required": [
                                  "step",
                                  "commandId"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "cantonOutcome": {
                              "type": "object",
                              "properties": {
                                "step": {
                                  "type": "string",
                                  "enum": [
                                    "treasury_offer",
                                    "account_proposal",
                                    "owner_account_acceptance",
                                    "operator_account_acceptance",
                                    "owner_offer_acceptance",
                                    "deposit_proposal",
                                    "owner_deposit_authorization",
                                    "operator_deposit_execution"
                                  ]
                                },
                                "outcome": {
                                  "type": "string",
                                  "enum": [
                                    "sequenced_accepted",
                                    "sequenced_rejected",
                                    "not_sequenced",
                                    "outcome_pending"
                                  ]
                                },
                                "guard": {
                                  "type": "string",
                                  "enum": [
                                    "completion_accepted",
                                    "target_archive_accepted",
                                    "completion_rejected",
                                    "max_record_time_passed",
                                    "ledger_time_bound_passed",
                                    "submission_acknowledged",
                                    "submission_unacknowledged",
                                    "completion_wait_elapsed",
                                    "completion_stream_unavailable",
                                    "completion_record_unavailable",
                                    "completion_absent_window_open",
                                    "completion_duplicate_command",
                                    "completion_submission_in_flight",
                                    "record_time_unavailable",
                                    "target_contract_unavailable",
                                    "target_contract_archived_elsewhere"
                                  ]
                                }
                              },
                              "required": [
                                "step",
                                "outcome",
                                "guard"
                              ],
                              "additionalProperties": false
                            },
                            "status": {
                              "type": "string",
                              "const": "ledger_confirmed"
                            },
                            "offerContractId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "offerUpdateId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "offerLedgerOffset": {
                              "type": "string",
                              "minLength": 1
                            },
                            "ledgerProofKind": {
                              "type": "string",
                              "enum": [
                                "command_chain",
                                "historical_receipt"
                              ]
                            },
                            "submissionCommandId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "submissionUpdateId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "depositReceiptContractId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "ledgerEventId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "ledgerOffset": {
                              "type": "string",
                              "minLength": 1
                            }
                          },
                          "required": [
                            "version",
                            "environment",
                            "adminCommandId",
                            "fundingIntentId",
                            "depositId",
                            "engineCommandId",
                            "accountId",
                            "partyId",
                            "asset",
                            "amountAtoms",
                            "plannedCantonCommands",
                            "status",
                            "offerContractId",
                            "offerUpdateId",
                            "offerLedgerOffset",
                            "ledgerProofKind",
                            "depositReceiptContractId",
                            "ledgerEventId",
                            "ledgerOffset"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "version": {
                              "type": "string",
                              "const": "local-signing/v2"
                            },
                            "environment": {
                              "type": "string",
                              "enum": [
                                "local",
                                "development",
                                "staging"
                              ]
                            },
                            "adminCommandId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "fundingIntentId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "depositId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "engineCommandId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "accountId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "partyId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "asset": {
                              "type": "string",
                              "enum": [
                                "USD.E",
                                "USDCx"
                              ]
                            },
                            "amountAtoms": {
                              "type": "string",
                              "pattern": "^[1-9][0-9]*$"
                            },
                            "plannedCantonCommands": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "step": {
                                    "type": "string",
                                    "enum": [
                                      "treasury_offer",
                                      "account_proposal",
                                      "owner_account_acceptance",
                                      "operator_account_acceptance",
                                      "owner_offer_acceptance",
                                      "deposit_proposal",
                                      "owner_deposit_authorization",
                                      "operator_deposit_execution"
                                    ]
                                  },
                                  "commandId": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "required": [
                                  "step",
                                  "commandId"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "cantonOutcome": {
                              "type": "object",
                              "properties": {
                                "step": {
                                  "type": "string",
                                  "enum": [
                                    "treasury_offer",
                                    "account_proposal",
                                    "owner_account_acceptance",
                                    "operator_account_acceptance",
                                    "owner_offer_acceptance",
                                    "deposit_proposal",
                                    "owner_deposit_authorization",
                                    "operator_deposit_execution"
                                  ]
                                },
                                "outcome": {
                                  "type": "string",
                                  "enum": [
                                    "sequenced_accepted",
                                    "sequenced_rejected",
                                    "not_sequenced",
                                    "outcome_pending"
                                  ]
                                },
                                "guard": {
                                  "type": "string",
                                  "enum": [
                                    "completion_accepted",
                                    "target_archive_accepted",
                                    "completion_rejected",
                                    "max_record_time_passed",
                                    "ledger_time_bound_passed",
                                    "submission_acknowledged",
                                    "submission_unacknowledged",
                                    "completion_wait_elapsed",
                                    "completion_stream_unavailable",
                                    "completion_record_unavailable",
                                    "completion_absent_window_open",
                                    "completion_duplicate_command",
                                    "completion_submission_in_flight",
                                    "record_time_unavailable",
                                    "target_contract_unavailable",
                                    "target_contract_archived_elsewhere"
                                  ]
                                }
                              },
                              "required": [
                                "step",
                                "outcome",
                                "guard"
                              ],
                              "additionalProperties": false
                            },
                            "status": {
                              "type": "string",
                              "const": "engine_projected"
                            },
                            "offerContractId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "offerUpdateId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "offerLedgerOffset": {
                              "type": "string",
                              "minLength": 1
                            },
                            "ledgerProofKind": {
                              "type": "string",
                              "enum": [
                                "command_chain",
                                "historical_receipt"
                              ]
                            },
                            "submissionCommandId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "submissionUpdateId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "depositReceiptContractId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "ledgerEventId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "ledgerOffset": {
                              "type": "string",
                              "minLength": 1
                            },
                            "engineProjectionEventId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "resultingBalanceAtoms": {
                              "type": "string",
                              "pattern": "^[1-9][0-9]*$"
                            }
                          },
                          "required": [
                            "version",
                            "environment",
                            "adminCommandId",
                            "fundingIntentId",
                            "depositId",
                            "engineCommandId",
                            "accountId",
                            "partyId",
                            "asset",
                            "amountAtoms",
                            "plannedCantonCommands",
                            "status",
                            "offerContractId",
                            "offerUpdateId",
                            "offerLedgerOffset",
                            "ledgerProofKind",
                            "depositReceiptContractId",
                            "ledgerEventId",
                            "ledgerOffset",
                            "engineProjectionEventId",
                            "resultingBalanceAtoms"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "version": {
                              "type": "string",
                              "const": "local-signing/v2"
                            },
                            "environment": {
                              "type": "string",
                              "enum": [
                                "local",
                                "development",
                                "staging"
                              ]
                            },
                            "adminCommandId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "fundingIntentId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "depositId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "engineCommandId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "accountId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "partyId": {
                              "type": "string",
                              "minLength": 1
                            },
                            "asset": {
                              "type": "string",
                              "enum": [
                                "USD.E",
                                "USDCx"
                              ]
                            },
                            "amountAtoms": {
                              "type": "string",
                              "pattern": "^[1-9][0-9]*$"
                            },
                            "plannedCantonCommands": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "step": {
                                    "type": "string",
                                    "enum": [
                                      "treasury_offer",
                                      "account_proposal",
                                      "owner_account_acceptance",
                                      "operator_account_acceptance",
                                      "owner_offer_acceptance",
                                      "deposit_proposal",
                                      "owner_deposit_authorization",
                                      "operator_deposit_execution"
                                    ]
                                  },
                                  "commandId": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "required": [
                                  "step",
                                  "commandId"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "cantonOutcome": {
                              "type": "object",
                              "properties": {
                                "step": {
                                  "type": "string",
                                  "enum": [
                                    "treasury_offer",
                                    "account_proposal",
                                    "owner_account_acceptance",
                                    "operator_account_acceptance",
                                    "owner_offer_acceptance",
                                    "deposit_proposal",
                                    "owner_deposit_authorization",
                                    "operator_deposit_execution"
                                  ]
                                },
                                "outcome": {
                                  "type": "string",
                                  "enum": [
                                    "sequenced_accepted",
                                    "sequenced_rejected",
                                    "not_sequenced",
                                    "outcome_pending"
                                  ]
                                },
                                "guard": {
                                  "type": "string",
                                  "enum": [
                                    "completion_accepted",
                                    "target_archive_accepted",
                                    "completion_rejected",
                                    "max_record_time_passed",
                                    "ledger_time_bound_passed",
                                    "submission_acknowledged",
                                    "submission_unacknowledged",
                                    "completion_wait_elapsed",
                                    "completion_stream_unavailable",
                                    "completion_record_unavailable",
                                    "completion_absent_window_open",
                                    "completion_duplicate_command",
                                    "completion_submission_in_flight",
                                    "record_time_unavailable",
                                    "target_contract_unavailable",
                                    "target_contract_archived_elsewhere"
                                  ]
                                }
                              },
                              "required": [
                                "step",
                                "outcome",
                                "guard"
                              ],
                              "additionalProperties": false
                            },
                            "status": {
                              "type": "string",
                              "const": "failed"
                            },
                            "failureReason": {
                              "type": "string",
                              "enum": [
                                "environment_forbidden",
                                "environment_mismatch",
                                "wallet_unavailable",
                                "wallet_not_ready",
                                "account_binding_conflict",
                                "ledger_account_binding_mismatch",
                                "custody_mismatch",
                                "owner_binding_mismatch",
                                "party_binding_mismatch",
                                "wallet_fingerprint_mismatch",
                                "participant_fingerprint_mismatch",
                                "asset_mismatch",
                                "invalid_amount",
                                "intent_unavailable",
                                "idempotency_conflict",
                                "command_busy",
                                "deposit_capability_unavailable",
                                "signing_failed",
                                "ledger_failed",
                                "payout_instruction_expired",
                                "withdrawal_authorization_expired"
                              ]
                            }
                          },
                          "required": [
                            "version",
                            "environment",
                            "adminCommandId",
                            "fundingIntentId",
                            "depositId",
                            "engineCommandId",
                            "accountId",
                            "partyId",
                            "asset",
                            "amountAtoms",
                            "plannedCantonCommands",
                            "status",
                            "failureReason"
                          ],
                          "additionalProperties": false
                        }
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "adminCommandId",
                "fundingIntentId",
                "asset",
                "amountAtoms",
                "status",
                "deposit"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "version",
          "environment",
          "accountId",
          "intents"
        ],
        "additionalProperties": false
      },
      "LocalSigningDepositPrepareRequest": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "fundingIntentId": {
                "type": "string",
                "minLength": 1
              }
            },
            "required": [
              "fundingIntentId"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "amount": {
                "type": "string",
                "maxLength": 64,
                "pattern": "^(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?$"
              }
            },
            "required": [
              "amount"
            ],
            "additionalProperties": false
          }
        ]
      },
      "LocalSigningDepositResponse": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "version": {
                "type": "string",
                "const": "local-signing/v2"
              },
              "environment": {
                "type": "string",
                "enum": [
                  "local",
                  "development",
                  "staging"
                ]
              },
              "adminCommandId": {
                "type": "string",
                "minLength": 1
              },
              "fundingIntentId": {
                "type": "string",
                "minLength": 1
              },
              "depositId": {
                "type": "string",
                "minLength": 1
              },
              "engineCommandId": {
                "type": "string",
                "minLength": 1
              },
              "accountId": {
                "type": "string",
                "minLength": 1
              },
              "partyId": {
                "type": "string",
                "minLength": 1
              },
              "asset": {
                "type": "string",
                "enum": [
                  "USD.E",
                  "USDCx"
                ]
              },
              "amountAtoms": {
                "type": "string",
                "pattern": "^[1-9][0-9]*$"
              },
              "plannedCantonCommands": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "step": {
                      "type": "string",
                      "enum": [
                        "treasury_offer",
                        "account_proposal",
                        "owner_account_acceptance",
                        "operator_account_acceptance",
                        "owner_offer_acceptance",
                        "deposit_proposal",
                        "owner_deposit_authorization",
                        "operator_deposit_execution"
                      ]
                    },
                    "commandId": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "required": [
                    "step",
                    "commandId"
                  ],
                  "additionalProperties": false
                }
              },
              "cantonOutcome": {
                "type": "object",
                "properties": {
                  "step": {
                    "type": "string",
                    "enum": [
                      "treasury_offer",
                      "account_proposal",
                      "owner_account_acceptance",
                      "operator_account_acceptance",
                      "owner_offer_acceptance",
                      "deposit_proposal",
                      "owner_deposit_authorization",
                      "operator_deposit_execution"
                    ]
                  },
                  "outcome": {
                    "type": "string",
                    "enum": [
                      "sequenced_accepted",
                      "sequenced_rejected",
                      "not_sequenced",
                      "outcome_pending"
                    ]
                  },
                  "guard": {
                    "type": "string",
                    "enum": [
                      "completion_accepted",
                      "target_archive_accepted",
                      "completion_rejected",
                      "max_record_time_passed",
                      "ledger_time_bound_passed",
                      "submission_acknowledged",
                      "submission_unacknowledged",
                      "completion_wait_elapsed",
                      "completion_stream_unavailable",
                      "completion_record_unavailable",
                      "completion_absent_window_open",
                      "completion_duplicate_command",
                      "completion_submission_in_flight",
                      "record_time_unavailable",
                      "target_contract_unavailable",
                      "target_contract_archived_elsewhere"
                    ]
                  }
                },
                "required": [
                  "step",
                  "outcome",
                  "guard"
                ],
                "additionalProperties": false
              },
              "status": {
                "type": "string",
                "const": "bound"
              }
            },
            "required": [
              "version",
              "environment",
              "adminCommandId",
              "fundingIntentId",
              "depositId",
              "engineCommandId",
              "accountId",
              "partyId",
              "asset",
              "amountAtoms",
              "plannedCantonCommands",
              "status"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "version": {
                "type": "string",
                "const": "local-signing/v2"
              },
              "environment": {
                "type": "string",
                "enum": [
                  "local",
                  "development",
                  "staging"
                ]
              },
              "adminCommandId": {
                "type": "string",
                "minLength": 1
              },
              "fundingIntentId": {
                "type": "string",
                "minLength": 1
              },
              "depositId": {
                "type": "string",
                "minLength": 1
              },
              "engineCommandId": {
                "type": "string",
                "minLength": 1
              },
              "accountId": {
                "type": "string",
                "minLength": 1
              },
              "partyId": {
                "type": "string",
                "minLength": 1
              },
              "asset": {
                "type": "string",
                "enum": [
                  "USD.E",
                  "USDCx"
                ]
              },
              "amountAtoms": {
                "type": "string",
                "pattern": "^[1-9][0-9]*$"
              },
              "plannedCantonCommands": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "step": {
                      "type": "string",
                      "enum": [
                        "treasury_offer",
                        "account_proposal",
                        "owner_account_acceptance",
                        "operator_account_acceptance",
                        "owner_offer_acceptance",
                        "deposit_proposal",
                        "owner_deposit_authorization",
                        "operator_deposit_execution"
                      ]
                    },
                    "commandId": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "required": [
                    "step",
                    "commandId"
                  ],
                  "additionalProperties": false
                }
              },
              "cantonOutcome": {
                "type": "object",
                "properties": {
                  "step": {
                    "type": "string",
                    "enum": [
                      "treasury_offer",
                      "account_proposal",
                      "owner_account_acceptance",
                      "operator_account_acceptance",
                      "owner_offer_acceptance",
                      "deposit_proposal",
                      "owner_deposit_authorization",
                      "operator_deposit_execution"
                    ]
                  },
                  "outcome": {
                    "type": "string",
                    "enum": [
                      "sequenced_accepted",
                      "sequenced_rejected",
                      "not_sequenced",
                      "outcome_pending"
                    ]
                  },
                  "guard": {
                    "type": "string",
                    "enum": [
                      "completion_accepted",
                      "target_archive_accepted",
                      "completion_rejected",
                      "max_record_time_passed",
                      "ledger_time_bound_passed",
                      "submission_acknowledged",
                      "submission_unacknowledged",
                      "completion_wait_elapsed",
                      "completion_stream_unavailable",
                      "completion_record_unavailable",
                      "completion_absent_window_open",
                      "completion_duplicate_command",
                      "completion_submission_in_flight",
                      "record_time_unavailable",
                      "target_contract_unavailable",
                      "target_contract_archived_elsewhere"
                    ]
                  }
                },
                "required": [
                  "step",
                  "outcome",
                  "guard"
                ],
                "additionalProperties": false
              },
              "status": {
                "type": "string",
                "const": "prepared"
              },
              "offerContractId": {
                "type": "string",
                "minLength": 1
              },
              "offerUpdateId": {
                "type": "string",
                "minLength": 1
              },
              "offerLedgerOffset": {
                "type": "string",
                "minLength": 1
              }
            },
            "required": [
              "version",
              "environment",
              "adminCommandId",
              "fundingIntentId",
              "depositId",
              "engineCommandId",
              "accountId",
              "partyId",
              "asset",
              "amountAtoms",
              "plannedCantonCommands",
              "status",
              "offerContractId",
              "offerUpdateId",
              "offerLedgerOffset"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "version": {
                "type": "string",
                "const": "local-signing/v2"
              },
              "environment": {
                "type": "string",
                "enum": [
                  "local",
                  "development",
                  "staging"
                ]
              },
              "adminCommandId": {
                "type": "string",
                "minLength": 1
              },
              "fundingIntentId": {
                "type": "string",
                "minLength": 1
              },
              "depositId": {
                "type": "string",
                "minLength": 1
              },
              "engineCommandId": {
                "type": "string",
                "minLength": 1
              },
              "accountId": {
                "type": "string",
                "minLength": 1
              },
              "partyId": {
                "type": "string",
                "minLength": 1
              },
              "asset": {
                "type": "string",
                "enum": [
                  "USD.E",
                  "USDCx"
                ]
              },
              "amountAtoms": {
                "type": "string",
                "pattern": "^[1-9][0-9]*$"
              },
              "plannedCantonCommands": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "step": {
                      "type": "string",
                      "enum": [
                        "treasury_offer",
                        "account_proposal",
                        "owner_account_acceptance",
                        "operator_account_acceptance",
                        "owner_offer_acceptance",
                        "deposit_proposal",
                        "owner_deposit_authorization",
                        "operator_deposit_execution"
                      ]
                    },
                    "commandId": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "required": [
                    "step",
                    "commandId"
                  ],
                  "additionalProperties": false
                }
              },
              "cantonOutcome": {
                "type": "object",
                "properties": {
                  "step": {
                    "type": "string",
                    "enum": [
                      "treasury_offer",
                      "account_proposal",
                      "owner_account_acceptance",
                      "operator_account_acceptance",
                      "owner_offer_acceptance",
                      "deposit_proposal",
                      "owner_deposit_authorization",
                      "operator_deposit_execution"
                    ]
                  },
                  "outcome": {
                    "type": "string",
                    "enum": [
                      "sequenced_accepted",
                      "sequenced_rejected",
                      "not_sequenced",
                      "outcome_pending"
                    ]
                  },
                  "guard": {
                    "type": "string",
                    "enum": [
                      "completion_accepted",
                      "target_archive_accepted",
                      "completion_rejected",
                      "max_record_time_passed",
                      "ledger_time_bound_passed",
                      "submission_acknowledged",
                      "submission_unacknowledged",
                      "completion_wait_elapsed",
                      "completion_stream_unavailable",
                      "completion_record_unavailable",
                      "completion_absent_window_open",
                      "completion_duplicate_command",
                      "completion_submission_in_flight",
                      "record_time_unavailable",
                      "target_contract_unavailable",
                      "target_contract_archived_elsewhere"
                    ]
                  }
                },
                "required": [
                  "step",
                  "outcome",
                  "guard"
                ],
                "additionalProperties": false
              },
              "status": {
                "type": "string",
                "const": "submitted"
              }
            },
            "required": [
              "version",
              "environment",
              "adminCommandId",
              "fundingIntentId",
              "depositId",
              "engineCommandId",
              "accountId",
              "partyId",
              "asset",
              "amountAtoms",
              "plannedCantonCommands",
              "status"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "version": {
                "type": "string",
                "const": "local-signing/v2"
              },
              "environment": {
                "type": "string",
                "enum": [
                  "local",
                  "development",
                  "staging"
                ]
              },
              "adminCommandId": {
                "type": "string",
                "minLength": 1
              },
              "fundingIntentId": {
                "type": "string",
                "minLength": 1
              },
              "depositId": {
                "type": "string",
                "minLength": 1
              },
              "engineCommandId": {
                "type": "string",
                "minLength": 1
              },
              "accountId": {
                "type": "string",
                "minLength": 1
              },
              "partyId": {
                "type": "string",
                "minLength": 1
              },
              "asset": {
                "type": "string",
                "enum": [
                  "USD.E",
                  "USDCx"
                ]
              },
              "amountAtoms": {
                "type": "string",
                "pattern": "^[1-9][0-9]*$"
              },
              "plannedCantonCommands": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "step": {
                      "type": "string",
                      "enum": [
                        "treasury_offer",
                        "account_proposal",
                        "owner_account_acceptance",
                        "operator_account_acceptance",
                        "owner_offer_acceptance",
                        "deposit_proposal",
                        "owner_deposit_authorization",
                        "operator_deposit_execution"
                      ]
                    },
                    "commandId": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "required": [
                    "step",
                    "commandId"
                  ],
                  "additionalProperties": false
                }
              },
              "cantonOutcome": {
                "type": "object",
                "properties": {
                  "step": {
                    "type": "string",
                    "enum": [
                      "treasury_offer",
                      "account_proposal",
                      "owner_account_acceptance",
                      "operator_account_acceptance",
                      "owner_offer_acceptance",
                      "deposit_proposal",
                      "owner_deposit_authorization",
                      "operator_deposit_execution"
                    ]
                  },
                  "outcome": {
                    "type": "string",
                    "enum": [
                      "sequenced_accepted",
                      "sequenced_rejected",
                      "not_sequenced",
                      "outcome_pending"
                    ]
                  },
                  "guard": {
                    "type": "string",
                    "enum": [
                      "completion_accepted",
                      "target_archive_accepted",
                      "completion_rejected",
                      "max_record_time_passed",
                      "ledger_time_bound_passed",
                      "submission_acknowledged",
                      "submission_unacknowledged",
                      "completion_wait_elapsed",
                      "completion_stream_unavailable",
                      "completion_record_unavailable",
                      "completion_absent_window_open",
                      "completion_duplicate_command",
                      "completion_submission_in_flight",
                      "record_time_unavailable",
                      "target_contract_unavailable",
                      "target_contract_archived_elsewhere"
                    ]
                  }
                },
                "required": [
                  "step",
                  "outcome",
                  "guard"
                ],
                "additionalProperties": false
              },
              "status": {
                "type": "string",
                "const": "submitted_unknown"
              },
              "uncertainCantonCommandId": {
                "type": "string",
                "minLength": 1
              }
            },
            "required": [
              "version",
              "environment",
              "adminCommandId",
              "fundingIntentId",
              "depositId",
              "engineCommandId",
              "accountId",
              "partyId",
              "asset",
              "amountAtoms",
              "plannedCantonCommands",
              "status",
              "uncertainCantonCommandId"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "version": {
                "type": "string",
                "const": "local-signing/v2"
              },
              "environment": {
                "type": "string",
                "enum": [
                  "local",
                  "development",
                  "staging"
                ]
              },
              "adminCommandId": {
                "type": "string",
                "minLength": 1
              },
              "fundingIntentId": {
                "type": "string",
                "minLength": 1
              },
              "depositId": {
                "type": "string",
                "minLength": 1
              },
              "engineCommandId": {
                "type": "string",
                "minLength": 1
              },
              "accountId": {
                "type": "string",
                "minLength": 1
              },
              "partyId": {
                "type": "string",
                "minLength": 1
              },
              "asset": {
                "type": "string",
                "enum": [
                  "USD.E",
                  "USDCx"
                ]
              },
              "amountAtoms": {
                "type": "string",
                "pattern": "^[1-9][0-9]*$"
              },
              "plannedCantonCommands": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "step": {
                      "type": "string",
                      "enum": [
                        "treasury_offer",
                        "account_proposal",
                        "owner_account_acceptance",
                        "operator_account_acceptance",
                        "owner_offer_acceptance",
                        "deposit_proposal",
                        "owner_deposit_authorization",
                        "operator_deposit_execution"
                      ]
                    },
                    "commandId": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "required": [
                    "step",
                    "commandId"
                  ],
                  "additionalProperties": false
                }
              },
              "cantonOutcome": {
                "type": "object",
                "properties": {
                  "step": {
                    "type": "string",
                    "enum": [
                      "treasury_offer",
                      "account_proposal",
                      "owner_account_acceptance",
                      "operator_account_acceptance",
                      "owner_offer_acceptance",
                      "deposit_proposal",
                      "owner_deposit_authorization",
                      "operator_deposit_execution"
                    ]
                  },
                  "outcome": {
                    "type": "string",
                    "enum": [
                      "sequenced_accepted",
                      "sequenced_rejected",
                      "not_sequenced",
                      "outcome_pending"
                    ]
                  },
                  "guard": {
                    "type": "string",
                    "enum": [
                      "completion_accepted",
                      "target_archive_accepted",
                      "completion_rejected",
                      "max_record_time_passed",
                      "ledger_time_bound_passed",
                      "submission_acknowledged",
                      "submission_unacknowledged",
                      "completion_wait_elapsed",
                      "completion_stream_unavailable",
                      "completion_record_unavailable",
                      "completion_absent_window_open",
                      "completion_duplicate_command",
                      "completion_submission_in_flight",
                      "record_time_unavailable",
                      "target_contract_unavailable",
                      "target_contract_archived_elsewhere"
                    ]
                  }
                },
                "required": [
                  "step",
                  "outcome",
                  "guard"
                ],
                "additionalProperties": false
              },
              "status": {
                "type": "string",
                "const": "ledger_confirmed"
              },
              "offerContractId": {
                "type": "string",
                "minLength": 1
              },
              "offerUpdateId": {
                "type": "string",
                "minLength": 1
              },
              "offerLedgerOffset": {
                "type": "string",
                "minLength": 1
              },
              "ledgerProofKind": {
                "type": "string",
                "enum": [
                  "command_chain",
                  "historical_receipt"
                ]
              },
              "submissionCommandId": {
                "type": "string",
                "minLength": 1
              },
              "submissionUpdateId": {
                "type": "string",
                "minLength": 1
              },
              "depositReceiptContractId": {
                "type": "string",
                "minLength": 1
              },
              "ledgerEventId": {
                "type": "string",
                "minLength": 1
              },
              "ledgerOffset": {
                "type": "string",
                "minLength": 1
              }
            },
            "required": [
              "version",
              "environment",
              "adminCommandId",
              "fundingIntentId",
              "depositId",
              "engineCommandId",
              "accountId",
              "partyId",
              "asset",
              "amountAtoms",
              "plannedCantonCommands",
              "status",
              "offerContractId",
              "offerUpdateId",
              "offerLedgerOffset",
              "ledgerProofKind",
              "depositReceiptContractId",
              "ledgerEventId",
              "ledgerOffset"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "version": {
                "type": "string",
                "const": "local-signing/v2"
              },
              "environment": {
                "type": "string",
                "enum": [
                  "local",
                  "development",
                  "staging"
                ]
              },
              "adminCommandId": {
                "type": "string",
                "minLength": 1
              },
              "fundingIntentId": {
                "type": "string",
                "minLength": 1
              },
              "depositId": {
                "type": "string",
                "minLength": 1
              },
              "engineCommandId": {
                "type": "string",
                "minLength": 1
              },
              "accountId": {
                "type": "string",
                "minLength": 1
              },
              "partyId": {
                "type": "string",
                "minLength": 1
              },
              "asset": {
                "type": "string",
                "enum": [
                  "USD.E",
                  "USDCx"
                ]
              },
              "amountAtoms": {
                "type": "string",
                "pattern": "^[1-9][0-9]*$"
              },
              "plannedCantonCommands": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "step": {
                      "type": "string",
                      "enum": [
                        "treasury_offer",
                        "account_proposal",
                        "owner_account_acceptance",
                        "operator_account_acceptance",
                        "owner_offer_acceptance",
                        "deposit_proposal",
                        "owner_deposit_authorization",
                        "operator_deposit_execution"
                      ]
                    },
                    "commandId": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "required": [
                    "step",
                    "commandId"
                  ],
                  "additionalProperties": false
                }
              },
              "cantonOutcome": {
                "type": "object",
                "properties": {
                  "step": {
                    "type": "string",
                    "enum": [
                      "treasury_offer",
                      "account_proposal",
                      "owner_account_acceptance",
                      "operator_account_acceptance",
                      "owner_offer_acceptance",
                      "deposit_proposal",
                      "owner_deposit_authorization",
                      "operator_deposit_execution"
                    ]
                  },
                  "outcome": {
                    "type": "string",
                    "enum": [
                      "sequenced_accepted",
                      "sequenced_rejected",
                      "not_sequenced",
                      "outcome_pending"
                    ]
                  },
                  "guard": {
                    "type": "string",
                    "enum": [
                      "completion_accepted",
                      "target_archive_accepted",
                      "completion_rejected",
                      "max_record_time_passed",
                      "ledger_time_bound_passed",
                      "submission_acknowledged",
                      "submission_unacknowledged",
                      "completion_wait_elapsed",
                      "completion_stream_unavailable",
                      "completion_record_unavailable",
                      "completion_absent_window_open",
                      "completion_duplicate_command",
                      "completion_submission_in_flight",
                      "record_time_unavailable",
                      "target_contract_unavailable",
                      "target_contract_archived_elsewhere"
                    ]
                  }
                },
                "required": [
                  "step",
                  "outcome",
                  "guard"
                ],
                "additionalProperties": false
              },
              "status": {
                "type": "string",
                "const": "engine_projected"
              },
              "offerContractId": {
                "type": "string",
                "minLength": 1
              },
              "offerUpdateId": {
                "type": "string",
                "minLength": 1
              },
              "offerLedgerOffset": {
                "type": "string",
                "minLength": 1
              },
              "ledgerProofKind": {
                "type": "string",
                "enum": [
                  "command_chain",
                  "historical_receipt"
                ]
              },
              "submissionCommandId": {
                "type": "string",
                "minLength": 1
              },
              "submissionUpdateId": {
                "type": "string",
                "minLength": 1
              },
              "depositReceiptContractId": {
                "type": "string",
                "minLength": 1
              },
              "ledgerEventId": {
                "type": "string",
                "minLength": 1
              },
              "ledgerOffset": {
                "type": "string",
                "minLength": 1
              },
              "engineProjectionEventId": {
                "type": "string",
                "minLength": 1
              },
              "resultingBalanceAtoms": {
                "type": "string",
                "pattern": "^[1-9][0-9]*$"
              }
            },
            "required": [
              "version",
              "environment",
              "adminCommandId",
              "fundingIntentId",
              "depositId",
              "engineCommandId",
              "accountId",
              "partyId",
              "asset",
              "amountAtoms",
              "plannedCantonCommands",
              "status",
              "offerContractId",
              "offerUpdateId",
              "offerLedgerOffset",
              "ledgerProofKind",
              "depositReceiptContractId",
              "ledgerEventId",
              "ledgerOffset",
              "engineProjectionEventId",
              "resultingBalanceAtoms"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "version": {
                "type": "string",
                "const": "local-signing/v2"
              },
              "environment": {
                "type": "string",
                "enum": [
                  "local",
                  "development",
                  "staging"
                ]
              },
              "adminCommandId": {
                "type": "string",
                "minLength": 1
              },
              "fundingIntentId": {
                "type": "string",
                "minLength": 1
              },
              "depositId": {
                "type": "string",
                "minLength": 1
              },
              "engineCommandId": {
                "type": "string",
                "minLength": 1
              },
              "accountId": {
                "type": "string",
                "minLength": 1
              },
              "partyId": {
                "type": "string",
                "minLength": 1
              },
              "asset": {
                "type": "string",
                "enum": [
                  "USD.E",
                  "USDCx"
                ]
              },
              "amountAtoms": {
                "type": "string",
                "pattern": "^[1-9][0-9]*$"
              },
              "plannedCantonCommands": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "step": {
                      "type": "string",
                      "enum": [
                        "treasury_offer",
                        "account_proposal",
                        "owner_account_acceptance",
                        "operator_account_acceptance",
                        "owner_offer_acceptance",
                        "deposit_proposal",
                        "owner_deposit_authorization",
                        "operator_deposit_execution"
                      ]
                    },
                    "commandId": {
                      "type": "string",
                      "minLength": 1
                    }
                  },
                  "required": [
                    "step",
                    "commandId"
                  ],
                  "additionalProperties": false
                }
              },
              "cantonOutcome": {
                "type": "object",
                "properties": {
                  "step": {
                    "type": "string",
                    "enum": [
                      "treasury_offer",
                      "account_proposal",
                      "owner_account_acceptance",
                      "operator_account_acceptance",
                      "owner_offer_acceptance",
                      "deposit_proposal",
                      "owner_deposit_authorization",
                      "operator_deposit_execution"
                    ]
                  },
                  "outcome": {
                    "type": "string",
                    "enum": [
                      "sequenced_accepted",
                      "sequenced_rejected",
                      "not_sequenced",
                      "outcome_pending"
                    ]
                  },
                  "guard": {
                    "type": "string",
                    "enum": [
                      "completion_accepted",
                      "target_archive_accepted",
                      "completion_rejected",
                      "max_record_time_passed",
                      "ledger_time_bound_passed",
                      "submission_acknowledged",
                      "submission_unacknowledged",
                      "completion_wait_elapsed",
                      "completion_stream_unavailable",
                      "completion_record_unavailable",
                      "completion_absent_window_open",
                      "completion_duplicate_command",
                      "completion_submission_in_flight",
                      "record_time_unavailable",
                      "target_contract_unavailable",
                      "target_contract_archived_elsewhere"
                    ]
                  }
                },
                "required": [
                  "step",
                  "outcome",
                  "guard"
                ],
                "additionalProperties": false
              },
              "status": {
                "type": "string",
                "const": "failed"
              },
              "failureReason": {
                "type": "string",
                "enum": [
                  "environment_forbidden",
                  "environment_mismatch",
                  "wallet_unavailable",
                  "wallet_not_ready",
                  "account_binding_conflict",
                  "ledger_account_binding_mismatch",
                  "custody_mismatch",
                  "owner_binding_mismatch",
                  "party_binding_mismatch",
                  "wallet_fingerprint_mismatch",
                  "participant_fingerprint_mismatch",
                  "asset_mismatch",
                  "invalid_amount",
                  "intent_unavailable",
                  "idempotency_conflict",
                  "command_busy",
                  "deposit_capability_unavailable",
                  "signing_failed",
                  "ledger_failed",
                  "payout_instruction_expired",
                  "withdrawal_authorization_expired"
                ]
              }
            },
            "required": [
              "version",
              "environment",
              "adminCommandId",
              "fundingIntentId",
              "depositId",
              "engineCommandId",
              "accountId",
              "partyId",
              "asset",
              "amountAtoms",
              "plannedCantonCommands",
              "status",
              "failureReason"
            ],
            "additionalProperties": false
          }
        ]
      },
      "DfnsDepositConfirmRequest": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "action": {
                "type": "string",
                "const": "initiate"
              },
              "depositId": {
                "type": "string",
                "minLength": 1
              }
            },
            "required": [
              "action",
              "depositId"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "action": {
                "type": "string",
                "const": "complete"
              },
              "depositId": {
                "type": "string",
                "minLength": 1
              },
              "signingStep": {
                "type": "string",
                "enum": [
                  "owner_account_acceptance",
                  "owner_offer_acceptance",
                  "owner_deposit_authorization"
                ]
              },
              "challengeIdentifier": {
                "type": "string",
                "minLength": 1
              },
              "firstFactor": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "Fido2"
                      },
                      "credentialAssertion": {
                        "type": "object",
                        "properties": {
                          "credId": {
                            "type": "string",
                            "minLength": 1
                          },
                          "clientData": {
                            "type": "string",
                            "minLength": 1
                          },
                          "signature": {
                            "type": "string",
                            "minLength": 1
                          },
                          "authenticatorData": {
                            "type": "string",
                            "minLength": 1
                          },
                          "algorithm": {
                            "type": "string",
                            "minLength": 1
                          },
                          "userHandle": {
                            "type": "string",
                            "minLength": 1
                          }
                        },
                        "required": [
                          "credId",
                          "clientData",
                          "signature",
                          "authenticatorData"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "required": [
                      "kind",
                      "credentialAssertion"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "Key"
                      },
                      "credentialAssertion": {
                        "type": "object",
                        "properties": {
                          "credId": {
                            "type": "string",
                            "minLength": 1
                          },
                          "clientData": {
                            "type": "string",
                            "minLength": 1
                          },
                          "signature": {
                            "type": "string",
                            "minLength": 1
                          }
                        },
                        "required": [
                          "credId",
                          "clientData",
                          "signature"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "required": [
                      "kind",
                      "credentialAssertion"
                    ],
                    "additionalProperties": false
                  }
                ]
              }
            },
            "required": [
              "action",
              "depositId",
              "signingStep",
              "challengeIdentifier",
              "firstFactor"
            ],
            "additionalProperties": false
          }
        ]
      },
      "DfnsDepositConfirmResponse": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "version": {
                "type": "string",
                "const": "local-signing/v2"
              },
              "status": {
                "type": "string",
                "const": "approval_required"
              },
              "signingStep": {
                "type": "string",
                "enum": [
                  "owner_account_acceptance",
                  "owner_offer_acceptance",
                  "owner_deposit_authorization"
                ]
              },
              "challenge": {
                "type": "object",
                "properties": {
                  "challenge": {
                    "type": "string",
                    "minLength": 1
                  },
                  "challengeIdentifier": {
                    "type": "string",
                    "minLength": 1
                  },
                  "allowCredentials": {
                    "type": "object",
                    "properties": {
                      "key": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "type": {
                              "type": "string",
                              "const": "public-key"
                            },
                            "id": {
                              "type": "string",
                              "minLength": 1
                            }
                          },
                          "required": [
                            "type",
                            "id"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "webauthn": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "type": {
                              "type": "string",
                              "const": "public-key"
                            },
                            "id": {
                              "type": "string",
                              "minLength": 1
                            }
                          },
                          "required": [
                            "type",
                            "id"
                          ],
                          "additionalProperties": false
                        }
                      }
                    },
                    "required": [
                      "key",
                      "webauthn"
                    ],
                    "additionalProperties": false
                  },
                  "userVerification": {
                    "type": "string",
                    "enum": [
                      "required",
                      "preferred",
                      "discouraged"
                    ]
                  }
                },
                "required": [
                  "challenge",
                  "challengeIdentifier",
                  "allowCredentials",
                  "userVerification"
                ],
                "additionalProperties": false
              },
              "deposit": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "version": {
                        "type": "string",
                        "const": "local-signing/v2"
                      },
                      "environment": {
                        "type": "string",
                        "enum": [
                          "local",
                          "development",
                          "staging"
                        ]
                      },
                      "adminCommandId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "fundingIntentId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "depositId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "engineCommandId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "accountId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "partyId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "asset": {
                        "type": "string",
                        "enum": [
                          "USD.E",
                          "USDCx"
                        ]
                      },
                      "amountAtoms": {
                        "type": "string",
                        "pattern": "^[1-9][0-9]*$"
                      },
                      "plannedCantonCommands": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "step": {
                              "type": "string",
                              "enum": [
                                "treasury_offer",
                                "account_proposal",
                                "owner_account_acceptance",
                                "operator_account_acceptance",
                                "owner_offer_acceptance",
                                "deposit_proposal",
                                "owner_deposit_authorization",
                                "operator_deposit_execution"
                              ]
                            },
                            "commandId": {
                              "type": "string",
                              "minLength": 1
                            }
                          },
                          "required": [
                            "step",
                            "commandId"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "cantonOutcome": {
                        "type": "object",
                        "properties": {
                          "step": {
                            "type": "string",
                            "enum": [
                              "treasury_offer",
                              "account_proposal",
                              "owner_account_acceptance",
                              "operator_account_acceptance",
                              "owner_offer_acceptance",
                              "deposit_proposal",
                              "owner_deposit_authorization",
                              "operator_deposit_execution"
                            ]
                          },
                          "outcome": {
                            "type": "string",
                            "enum": [
                              "sequenced_accepted",
                              "sequenced_rejected",
                              "not_sequenced",
                              "outcome_pending"
                            ]
                          },
                          "guard": {
                            "type": "string",
                            "enum": [
                              "completion_accepted",
                              "target_archive_accepted",
                              "completion_rejected",
                              "max_record_time_passed",
                              "ledger_time_bound_passed",
                              "submission_acknowledged",
                              "submission_unacknowledged",
                              "completion_wait_elapsed",
                              "completion_stream_unavailable",
                              "completion_record_unavailable",
                              "completion_absent_window_open",
                              "completion_duplicate_command",
                              "completion_submission_in_flight",
                              "record_time_unavailable",
                              "target_contract_unavailable",
                              "target_contract_archived_elsewhere"
                            ]
                          }
                        },
                        "required": [
                          "step",
                          "outcome",
                          "guard"
                        ],
                        "additionalProperties": false
                      },
                      "status": {
                        "type": "string",
                        "const": "bound"
                      }
                    },
                    "required": [
                      "version",
                      "environment",
                      "adminCommandId",
                      "fundingIntentId",
                      "depositId",
                      "engineCommandId",
                      "accountId",
                      "partyId",
                      "asset",
                      "amountAtoms",
                      "plannedCantonCommands",
                      "status"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "version": {
                        "type": "string",
                        "const": "local-signing/v2"
                      },
                      "environment": {
                        "type": "string",
                        "enum": [
                          "local",
                          "development",
                          "staging"
                        ]
                      },
                      "adminCommandId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "fundingIntentId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "depositId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "engineCommandId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "accountId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "partyId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "asset": {
                        "type": "string",
                        "enum": [
                          "USD.E",
                          "USDCx"
                        ]
                      },
                      "amountAtoms": {
                        "type": "string",
                        "pattern": "^[1-9][0-9]*$"
                      },
                      "plannedCantonCommands": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "step": {
                              "type": "string",
                              "enum": [
                                "treasury_offer",
                                "account_proposal",
                                "owner_account_acceptance",
                                "operator_account_acceptance",
                                "owner_offer_acceptance",
                                "deposit_proposal",
                                "owner_deposit_authorization",
                                "operator_deposit_execution"
                              ]
                            },
                            "commandId": {
                              "type": "string",
                              "minLength": 1
                            }
                          },
                          "required": [
                            "step",
                            "commandId"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "cantonOutcome": {
                        "type": "object",
                        "properties": {
                          "step": {
                            "type": "string",
                            "enum": [
                              "treasury_offer",
                              "account_proposal",
                              "owner_account_acceptance",
                              "operator_account_acceptance",
                              "owner_offer_acceptance",
                              "deposit_proposal",
                              "owner_deposit_authorization",
                              "operator_deposit_execution"
                            ]
                          },
                          "outcome": {
                            "type": "string",
                            "enum": [
                              "sequenced_accepted",
                              "sequenced_rejected",
                              "not_sequenced",
                              "outcome_pending"
                            ]
                          },
                          "guard": {
                            "type": "string",
                            "enum": [
                              "completion_accepted",
                              "target_archive_accepted",
                              "completion_rejected",
                              "max_record_time_passed",
                              "ledger_time_bound_passed",
                              "submission_acknowledged",
                              "submission_unacknowledged",
                              "completion_wait_elapsed",
                              "completion_stream_unavailable",
                              "completion_record_unavailable",
                              "completion_absent_window_open",
                              "completion_duplicate_command",
                              "completion_submission_in_flight",
                              "record_time_unavailable",
                              "target_contract_unavailable",
                              "target_contract_archived_elsewhere"
                            ]
                          }
                        },
                        "required": [
                          "step",
                          "outcome",
                          "guard"
                        ],
                        "additionalProperties": false
                      },
                      "status": {
                        "type": "string",
                        "const": "prepared"
                      },
                      "offerContractId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "offerUpdateId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "offerLedgerOffset": {
                        "type": "string",
                        "minLength": 1
                      }
                    },
                    "required": [
                      "version",
                      "environment",
                      "adminCommandId",
                      "fundingIntentId",
                      "depositId",
                      "engineCommandId",
                      "accountId",
                      "partyId",
                      "asset",
                      "amountAtoms",
                      "plannedCantonCommands",
                      "status",
                      "offerContractId",
                      "offerUpdateId",
                      "offerLedgerOffset"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "version": {
                        "type": "string",
                        "const": "local-signing/v2"
                      },
                      "environment": {
                        "type": "string",
                        "enum": [
                          "local",
                          "development",
                          "staging"
                        ]
                      },
                      "adminCommandId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "fundingIntentId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "depositId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "engineCommandId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "accountId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "partyId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "asset": {
                        "type": "string",
                        "enum": [
                          "USD.E",
                          "USDCx"
                        ]
                      },
                      "amountAtoms": {
                        "type": "string",
                        "pattern": "^[1-9][0-9]*$"
                      },
                      "plannedCantonCommands": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "step": {
                              "type": "string",
                              "enum": [
                                "treasury_offer",
                                "account_proposal",
                                "owner_account_acceptance",
                                "operator_account_acceptance",
                                "owner_offer_acceptance",
                                "deposit_proposal",
                                "owner_deposit_authorization",
                                "operator_deposit_execution"
                              ]
                            },
                            "commandId": {
                              "type": "string",
                              "minLength": 1
                            }
                          },
                          "required": [
                            "step",
                            "commandId"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "cantonOutcome": {
                        "type": "object",
                        "properties": {
                          "step": {
                            "type": "string",
                            "enum": [
                              "treasury_offer",
                              "account_proposal",
                              "owner_account_acceptance",
                              "operator_account_acceptance",
                              "owner_offer_acceptance",
                              "deposit_proposal",
                              "owner_deposit_authorization",
                              "operator_deposit_execution"
                            ]
                          },
                          "outcome": {
                            "type": "string",
                            "enum": [
                              "sequenced_accepted",
                              "sequenced_rejected",
                              "not_sequenced",
                              "outcome_pending"
                            ]
                          },
                          "guard": {
                            "type": "string",
                            "enum": [
                              "completion_accepted",
                              "target_archive_accepted",
                              "completion_rejected",
                              "max_record_time_passed",
                              "ledger_time_bound_passed",
                              "submission_acknowledged",
                              "submission_unacknowledged",
                              "completion_wait_elapsed",
                              "completion_stream_unavailable",
                              "completion_record_unavailable",
                              "completion_absent_window_open",
                              "completion_duplicate_command",
                              "completion_submission_in_flight",
                              "record_time_unavailable",
                              "target_contract_unavailable",
                              "target_contract_archived_elsewhere"
                            ]
                          }
                        },
                        "required": [
                          "step",
                          "outcome",
                          "guard"
                        ],
                        "additionalProperties": false
                      },
                      "status": {
                        "type": "string",
                        "const": "submitted"
                      }
                    },
                    "required": [
                      "version",
                      "environment",
                      "adminCommandId",
                      "fundingIntentId",
                      "depositId",
                      "engineCommandId",
                      "accountId",
                      "partyId",
                      "asset",
                      "amountAtoms",
                      "plannedCantonCommands",
                      "status"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "version": {
                        "type": "string",
                        "const": "local-signing/v2"
                      },
                      "environment": {
                        "type": "string",
                        "enum": [
                          "local",
                          "development",
                          "staging"
                        ]
                      },
                      "adminCommandId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "fundingIntentId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "depositId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "engineCommandId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "accountId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "partyId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "asset": {
                        "type": "string",
                        "enum": [
                          "USD.E",
                          "USDCx"
                        ]
                      },
                      "amountAtoms": {
                        "type": "string",
                        "pattern": "^[1-9][0-9]*$"
                      },
                      "plannedCantonCommands": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "step": {
                              "type": "string",
                              "enum": [
                                "treasury_offer",
                                "account_proposal",
                                "owner_account_acceptance",
                                "operator_account_acceptance",
                                "owner_offer_acceptance",
                                "deposit_proposal",
                                "owner_deposit_authorization",
                                "operator_deposit_execution"
                              ]
                            },
                            "commandId": {
                              "type": "string",
                              "minLength": 1
                            }
                          },
                          "required": [
                            "step",
                            "commandId"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "cantonOutcome": {
                        "type": "object",
                        "properties": {
                          "step": {
                            "type": "string",
                            "enum": [
                              "treasury_offer",
                              "account_proposal",
                              "owner_account_acceptance",
                              "operator_account_acceptance",
                              "owner_offer_acceptance",
                              "deposit_proposal",
                              "owner_deposit_authorization",
                              "operator_deposit_execution"
                            ]
                          },
                          "outcome": {
                            "type": "string",
                            "enum": [
                              "sequenced_accepted",
                              "sequenced_rejected",
                              "not_sequenced",
                              "outcome_pending"
                            ]
                          },
                          "guard": {
                            "type": "string",
                            "enum": [
                              "completion_accepted",
                              "target_archive_accepted",
                              "completion_rejected",
                              "max_record_time_passed",
                              "ledger_time_bound_passed",
                              "submission_acknowledged",
                              "submission_unacknowledged",
                              "completion_wait_elapsed",
                              "completion_stream_unavailable",
                              "completion_record_unavailable",
                              "completion_absent_window_open",
                              "completion_duplicate_command",
                              "completion_submission_in_flight",
                              "record_time_unavailable",
                              "target_contract_unavailable",
                              "target_contract_archived_elsewhere"
                            ]
                          }
                        },
                        "required": [
                          "step",
                          "outcome",
                          "guard"
                        ],
                        "additionalProperties": false
                      },
                      "status": {
                        "type": "string",
                        "const": "submitted_unknown"
                      },
                      "uncertainCantonCommandId": {
                        "type": "string",
                        "minLength": 1
                      }
                    },
                    "required": [
                      "version",
                      "environment",
                      "adminCommandId",
                      "fundingIntentId",
                      "depositId",
                      "engineCommandId",
                      "accountId",
                      "partyId",
                      "asset",
                      "amountAtoms",
                      "plannedCantonCommands",
                      "status",
                      "uncertainCantonCommandId"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "version": {
                        "type": "string",
                        "const": "local-signing/v2"
                      },
                      "environment": {
                        "type": "string",
                        "enum": [
                          "local",
                          "development",
                          "staging"
                        ]
                      },
                      "adminCommandId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "fundingIntentId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "depositId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "engineCommandId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "accountId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "partyId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "asset": {
                        "type": "string",
                        "enum": [
                          "USD.E",
                          "USDCx"
                        ]
                      },
                      "amountAtoms": {
                        "type": "string",
                        "pattern": "^[1-9][0-9]*$"
                      },
                      "plannedCantonCommands": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "step": {
                              "type": "string",
                              "enum": [
                                "treasury_offer",
                                "account_proposal",
                                "owner_account_acceptance",
                                "operator_account_acceptance",
                                "owner_offer_acceptance",
                                "deposit_proposal",
                                "owner_deposit_authorization",
                                "operator_deposit_execution"
                              ]
                            },
                            "commandId": {
                              "type": "string",
                              "minLength": 1
                            }
                          },
                          "required": [
                            "step",
                            "commandId"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "cantonOutcome": {
                        "type": "object",
                        "properties": {
                          "step": {
                            "type": "string",
                            "enum": [
                              "treasury_offer",
                              "account_proposal",
                              "owner_account_acceptance",
                              "operator_account_acceptance",
                              "owner_offer_acceptance",
                              "deposit_proposal",
                              "owner_deposit_authorization",
                              "operator_deposit_execution"
                            ]
                          },
                          "outcome": {
                            "type": "string",
                            "enum": [
                              "sequenced_accepted",
                              "sequenced_rejected",
                              "not_sequenced",
                              "outcome_pending"
                            ]
                          },
                          "guard": {
                            "type": "string",
                            "enum": [
                              "completion_accepted",
                              "target_archive_accepted",
                              "completion_rejected",
                              "max_record_time_passed",
                              "ledger_time_bound_passed",
                              "submission_acknowledged",
                              "submission_unacknowledged",
                              "completion_wait_elapsed",
                              "completion_stream_unavailable",
                              "completion_record_unavailable",
                              "completion_absent_window_open",
                              "completion_duplicate_command",
                              "completion_submission_in_flight",
                              "record_time_unavailable",
                              "target_contract_unavailable",
                              "target_contract_archived_elsewhere"
                            ]
                          }
                        },
                        "required": [
                          "step",
                          "outcome",
                          "guard"
                        ],
                        "additionalProperties": false
                      },
                      "status": {
                        "type": "string",
                        "const": "ledger_confirmed"
                      },
                      "offerContractId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "offerUpdateId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "offerLedgerOffset": {
                        "type": "string",
                        "minLength": 1
                      },
                      "ledgerProofKind": {
                        "type": "string",
                        "enum": [
                          "command_chain",
                          "historical_receipt"
                        ]
                      },
                      "submissionCommandId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "submissionUpdateId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "depositReceiptContractId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "ledgerEventId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "ledgerOffset": {
                        "type": "string",
                        "minLength": 1
                      }
                    },
                    "required": [
                      "version",
                      "environment",
                      "adminCommandId",
                      "fundingIntentId",
                      "depositId",
                      "engineCommandId",
                      "accountId",
                      "partyId",
                      "asset",
                      "amountAtoms",
                      "plannedCantonCommands",
                      "status",
                      "offerContractId",
                      "offerUpdateId",
                      "offerLedgerOffset",
                      "ledgerProofKind",
                      "depositReceiptContractId",
                      "ledgerEventId",
                      "ledgerOffset"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "version": {
                        "type": "string",
                        "const": "local-signing/v2"
                      },
                      "environment": {
                        "type": "string",
                        "enum": [
                          "local",
                          "development",
                          "staging"
                        ]
                      },
                      "adminCommandId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "fundingIntentId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "depositId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "engineCommandId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "accountId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "partyId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "asset": {
                        "type": "string",
                        "enum": [
                          "USD.E",
                          "USDCx"
                        ]
                      },
                      "amountAtoms": {
                        "type": "string",
                        "pattern": "^[1-9][0-9]*$"
                      },
                      "plannedCantonCommands": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "step": {
                              "type": "string",
                              "enum": [
                                "treasury_offer",
                                "account_proposal",
                                "owner_account_acceptance",
                                "operator_account_acceptance",
                                "owner_offer_acceptance",
                                "deposit_proposal",
                                "owner_deposit_authorization",
                                "operator_deposit_execution"
                              ]
                            },
                            "commandId": {
                              "type": "string",
                              "minLength": 1
                            }
                          },
                          "required": [
                            "step",
                            "commandId"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "cantonOutcome": {
                        "type": "object",
                        "properties": {
                          "step": {
                            "type": "string",
                            "enum": [
                              "treasury_offer",
                              "account_proposal",
                              "owner_account_acceptance",
                              "operator_account_acceptance",
                              "owner_offer_acceptance",
                              "deposit_proposal",
                              "owner_deposit_authorization",
                              "operator_deposit_execution"
                            ]
                          },
                          "outcome": {
                            "type": "string",
                            "enum": [
                              "sequenced_accepted",
                              "sequenced_rejected",
                              "not_sequenced",
                              "outcome_pending"
                            ]
                          },
                          "guard": {
                            "type": "string",
                            "enum": [
                              "completion_accepted",
                              "target_archive_accepted",
                              "completion_rejected",
                              "max_record_time_passed",
                              "ledger_time_bound_passed",
                              "submission_acknowledged",
                              "submission_unacknowledged",
                              "completion_wait_elapsed",
                              "completion_stream_unavailable",
                              "completion_record_unavailable",
                              "completion_absent_window_open",
                              "completion_duplicate_command",
                              "completion_submission_in_flight",
                              "record_time_unavailable",
                              "target_contract_unavailable",
                              "target_contract_archived_elsewhere"
                            ]
                          }
                        },
                        "required": [
                          "step",
                          "outcome",
                          "guard"
                        ],
                        "additionalProperties": false
                      },
                      "status": {
                        "type": "string",
                        "const": "engine_projected"
                      },
                      "offerContractId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "offerUpdateId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "offerLedgerOffset": {
                        "type": "string",
                        "minLength": 1
                      },
                      "ledgerProofKind": {
                        "type": "string",
                        "enum": [
                          "command_chain",
                          "historical_receipt"
                        ]
                      },
                      "submissionCommandId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "submissionUpdateId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "depositReceiptContractId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "ledgerEventId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "ledgerOffset": {
                        "type": "string",
                        "minLength": 1
                      },
                      "engineProjectionEventId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "resultingBalanceAtoms": {
                        "type": "string",
                        "pattern": "^[1-9][0-9]*$"
                      }
                    },
                    "required": [
                      "version",
                      "environment",
                      "adminCommandId",
                      "fundingIntentId",
                      "depositId",
                      "engineCommandId",
                      "accountId",
                      "partyId",
                      "asset",
                      "amountAtoms",
                      "plannedCantonCommands",
                      "status",
                      "offerContractId",
                      "offerUpdateId",
                      "offerLedgerOffset",
                      "ledgerProofKind",
                      "depositReceiptContractId",
                      "ledgerEventId",
                      "ledgerOffset",
                      "engineProjectionEventId",
                      "resultingBalanceAtoms"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "version": {
                        "type": "string",
                        "const": "local-signing/v2"
                      },
                      "environment": {
                        "type": "string",
                        "enum": [
                          "local",
                          "development",
                          "staging"
                        ]
                      },
                      "adminCommandId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "fundingIntentId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "depositId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "engineCommandId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "accountId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "partyId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "asset": {
                        "type": "string",
                        "enum": [
                          "USD.E",
                          "USDCx"
                        ]
                      },
                      "amountAtoms": {
                        "type": "string",
                        "pattern": "^[1-9][0-9]*$"
                      },
                      "plannedCantonCommands": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "step": {
                              "type": "string",
                              "enum": [
                                "treasury_offer",
                                "account_proposal",
                                "owner_account_acceptance",
                                "operator_account_acceptance",
                                "owner_offer_acceptance",
                                "deposit_proposal",
                                "owner_deposit_authorization",
                                "operator_deposit_execution"
                              ]
                            },
                            "commandId": {
                              "type": "string",
                              "minLength": 1
                            }
                          },
                          "required": [
                            "step",
                            "commandId"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "cantonOutcome": {
                        "type": "object",
                        "properties": {
                          "step": {
                            "type": "string",
                            "enum": [
                              "treasury_offer",
                              "account_proposal",
                              "owner_account_acceptance",
                              "operator_account_acceptance",
                              "owner_offer_acceptance",
                              "deposit_proposal",
                              "owner_deposit_authorization",
                              "operator_deposit_execution"
                            ]
                          },
                          "outcome": {
                            "type": "string",
                            "enum": [
                              "sequenced_accepted",
                              "sequenced_rejected",
                              "not_sequenced",
                              "outcome_pending"
                            ]
                          },
                          "guard": {
                            "type": "string",
                            "enum": [
                              "completion_accepted",
                              "target_archive_accepted",
                              "completion_rejected",
                              "max_record_time_passed",
                              "ledger_time_bound_passed",
                              "submission_acknowledged",
                              "submission_unacknowledged",
                              "completion_wait_elapsed",
                              "completion_stream_unavailable",
                              "completion_record_unavailable",
                              "completion_absent_window_open",
                              "completion_duplicate_command",
                              "completion_submission_in_flight",
                              "record_time_unavailable",
                              "target_contract_unavailable",
                              "target_contract_archived_elsewhere"
                            ]
                          }
                        },
                        "required": [
                          "step",
                          "outcome",
                          "guard"
                        ],
                        "additionalProperties": false
                      },
                      "status": {
                        "type": "string",
                        "const": "failed"
                      },
                      "failureReason": {
                        "type": "string",
                        "enum": [
                          "environment_forbidden",
                          "environment_mismatch",
                          "wallet_unavailable",
                          "wallet_not_ready",
                          "account_binding_conflict",
                          "ledger_account_binding_mismatch",
                          "custody_mismatch",
                          "owner_binding_mismatch",
                          "party_binding_mismatch",
                          "wallet_fingerprint_mismatch",
                          "participant_fingerprint_mismatch",
                          "asset_mismatch",
                          "invalid_amount",
                          "intent_unavailable",
                          "idempotency_conflict",
                          "command_busy",
                          "deposit_capability_unavailable",
                          "signing_failed",
                          "ledger_failed",
                          "payout_instruction_expired",
                          "withdrawal_authorization_expired"
                        ]
                      }
                    },
                    "required": [
                      "version",
                      "environment",
                      "adminCommandId",
                      "fundingIntentId",
                      "depositId",
                      "engineCommandId",
                      "accountId",
                      "partyId",
                      "asset",
                      "amountAtoms",
                      "plannedCantonCommands",
                      "status",
                      "failureReason"
                    ],
                    "additionalProperties": false
                  }
                ]
              }
            },
            "required": [
              "version",
              "status",
              "signingStep",
              "challenge",
              "deposit"
            ],
            "additionalProperties": false
          },
          {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "version": {
                    "type": "string",
                    "const": "local-signing/v2"
                  },
                  "environment": {
                    "type": "string",
                    "enum": [
                      "local",
                      "development",
                      "staging"
                    ]
                  },
                  "adminCommandId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "fundingIntentId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "depositId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "engineCommandId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "accountId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "partyId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "asset": {
                    "type": "string",
                    "enum": [
                      "USD.E",
                      "USDCx"
                    ]
                  },
                  "amountAtoms": {
                    "type": "string",
                    "pattern": "^[1-9][0-9]*$"
                  },
                  "plannedCantonCommands": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "step": {
                          "type": "string",
                          "enum": [
                            "treasury_offer",
                            "account_proposal",
                            "owner_account_acceptance",
                            "operator_account_acceptance",
                            "owner_offer_acceptance",
                            "deposit_proposal",
                            "owner_deposit_authorization",
                            "operator_deposit_execution"
                          ]
                        },
                        "commandId": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "required": [
                        "step",
                        "commandId"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "cantonOutcome": {
                    "type": "object",
                    "properties": {
                      "step": {
                        "type": "string",
                        "enum": [
                          "treasury_offer",
                          "account_proposal",
                          "owner_account_acceptance",
                          "operator_account_acceptance",
                          "owner_offer_acceptance",
                          "deposit_proposal",
                          "owner_deposit_authorization",
                          "operator_deposit_execution"
                        ]
                      },
                      "outcome": {
                        "type": "string",
                        "enum": [
                          "sequenced_accepted",
                          "sequenced_rejected",
                          "not_sequenced",
                          "outcome_pending"
                        ]
                      },
                      "guard": {
                        "type": "string",
                        "enum": [
                          "completion_accepted",
                          "target_archive_accepted",
                          "completion_rejected",
                          "max_record_time_passed",
                          "ledger_time_bound_passed",
                          "submission_acknowledged",
                          "submission_unacknowledged",
                          "completion_wait_elapsed",
                          "completion_stream_unavailable",
                          "completion_record_unavailable",
                          "completion_absent_window_open",
                          "completion_duplicate_command",
                          "completion_submission_in_flight",
                          "record_time_unavailable",
                          "target_contract_unavailable",
                          "target_contract_archived_elsewhere"
                        ]
                      }
                    },
                    "required": [
                      "step",
                      "outcome",
                      "guard"
                    ],
                    "additionalProperties": false
                  },
                  "status": {
                    "type": "string",
                    "const": "bound"
                  }
                },
                "required": [
                  "version",
                  "environment",
                  "adminCommandId",
                  "fundingIntentId",
                  "depositId",
                  "engineCommandId",
                  "accountId",
                  "partyId",
                  "asset",
                  "amountAtoms",
                  "plannedCantonCommands",
                  "status"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "version": {
                    "type": "string",
                    "const": "local-signing/v2"
                  },
                  "environment": {
                    "type": "string",
                    "enum": [
                      "local",
                      "development",
                      "staging"
                    ]
                  },
                  "adminCommandId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "fundingIntentId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "depositId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "engineCommandId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "accountId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "partyId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "asset": {
                    "type": "string",
                    "enum": [
                      "USD.E",
                      "USDCx"
                    ]
                  },
                  "amountAtoms": {
                    "type": "string",
                    "pattern": "^[1-9][0-9]*$"
                  },
                  "plannedCantonCommands": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "step": {
                          "type": "string",
                          "enum": [
                            "treasury_offer",
                            "account_proposal",
                            "owner_account_acceptance",
                            "operator_account_acceptance",
                            "owner_offer_acceptance",
                            "deposit_proposal",
                            "owner_deposit_authorization",
                            "operator_deposit_execution"
                          ]
                        },
                        "commandId": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "required": [
                        "step",
                        "commandId"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "cantonOutcome": {
                    "type": "object",
                    "properties": {
                      "step": {
                        "type": "string",
                        "enum": [
                          "treasury_offer",
                          "account_proposal",
                          "owner_account_acceptance",
                          "operator_account_acceptance",
                          "owner_offer_acceptance",
                          "deposit_proposal",
                          "owner_deposit_authorization",
                          "operator_deposit_execution"
                        ]
                      },
                      "outcome": {
                        "type": "string",
                        "enum": [
                          "sequenced_accepted",
                          "sequenced_rejected",
                          "not_sequenced",
                          "outcome_pending"
                        ]
                      },
                      "guard": {
                        "type": "string",
                        "enum": [
                          "completion_accepted",
                          "target_archive_accepted",
                          "completion_rejected",
                          "max_record_time_passed",
                          "ledger_time_bound_passed",
                          "submission_acknowledged",
                          "submission_unacknowledged",
                          "completion_wait_elapsed",
                          "completion_stream_unavailable",
                          "completion_record_unavailable",
                          "completion_absent_window_open",
                          "completion_duplicate_command",
                          "completion_submission_in_flight",
                          "record_time_unavailable",
                          "target_contract_unavailable",
                          "target_contract_archived_elsewhere"
                        ]
                      }
                    },
                    "required": [
                      "step",
                      "outcome",
                      "guard"
                    ],
                    "additionalProperties": false
                  },
                  "status": {
                    "type": "string",
                    "const": "prepared"
                  },
                  "offerContractId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "offerUpdateId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "offerLedgerOffset": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "version",
                  "environment",
                  "adminCommandId",
                  "fundingIntentId",
                  "depositId",
                  "engineCommandId",
                  "accountId",
                  "partyId",
                  "asset",
                  "amountAtoms",
                  "plannedCantonCommands",
                  "status",
                  "offerContractId",
                  "offerUpdateId",
                  "offerLedgerOffset"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "version": {
                    "type": "string",
                    "const": "local-signing/v2"
                  },
                  "environment": {
                    "type": "string",
                    "enum": [
                      "local",
                      "development",
                      "staging"
                    ]
                  },
                  "adminCommandId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "fundingIntentId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "depositId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "engineCommandId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "accountId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "partyId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "asset": {
                    "type": "string",
                    "enum": [
                      "USD.E",
                      "USDCx"
                    ]
                  },
                  "amountAtoms": {
                    "type": "string",
                    "pattern": "^[1-9][0-9]*$"
                  },
                  "plannedCantonCommands": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "step": {
                          "type": "string",
                          "enum": [
                            "treasury_offer",
                            "account_proposal",
                            "owner_account_acceptance",
                            "operator_account_acceptance",
                            "owner_offer_acceptance",
                            "deposit_proposal",
                            "owner_deposit_authorization",
                            "operator_deposit_execution"
                          ]
                        },
                        "commandId": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "required": [
                        "step",
                        "commandId"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "cantonOutcome": {
                    "type": "object",
                    "properties": {
                      "step": {
                        "type": "string",
                        "enum": [
                          "treasury_offer",
                          "account_proposal",
                          "owner_account_acceptance",
                          "operator_account_acceptance",
                          "owner_offer_acceptance",
                          "deposit_proposal",
                          "owner_deposit_authorization",
                          "operator_deposit_execution"
                        ]
                      },
                      "outcome": {
                        "type": "string",
                        "enum": [
                          "sequenced_accepted",
                          "sequenced_rejected",
                          "not_sequenced",
                          "outcome_pending"
                        ]
                      },
                      "guard": {
                        "type": "string",
                        "enum": [
                          "completion_accepted",
                          "target_archive_accepted",
                          "completion_rejected",
                          "max_record_time_passed",
                          "ledger_time_bound_passed",
                          "submission_acknowledged",
                          "submission_unacknowledged",
                          "completion_wait_elapsed",
                          "completion_stream_unavailable",
                          "completion_record_unavailable",
                          "completion_absent_window_open",
                          "completion_duplicate_command",
                          "completion_submission_in_flight",
                          "record_time_unavailable",
                          "target_contract_unavailable",
                          "target_contract_archived_elsewhere"
                        ]
                      }
                    },
                    "required": [
                      "step",
                      "outcome",
                      "guard"
                    ],
                    "additionalProperties": false
                  },
                  "status": {
                    "type": "string",
                    "const": "submitted"
                  }
                },
                "required": [
                  "version",
                  "environment",
                  "adminCommandId",
                  "fundingIntentId",
                  "depositId",
                  "engineCommandId",
                  "accountId",
                  "partyId",
                  "asset",
                  "amountAtoms",
                  "plannedCantonCommands",
                  "status"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "version": {
                    "type": "string",
                    "const": "local-signing/v2"
                  },
                  "environment": {
                    "type": "string",
                    "enum": [
                      "local",
                      "development",
                      "staging"
                    ]
                  },
                  "adminCommandId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "fundingIntentId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "depositId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "engineCommandId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "accountId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "partyId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "asset": {
                    "type": "string",
                    "enum": [
                      "USD.E",
                      "USDCx"
                    ]
                  },
                  "amountAtoms": {
                    "type": "string",
                    "pattern": "^[1-9][0-9]*$"
                  },
                  "plannedCantonCommands": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "step": {
                          "type": "string",
                          "enum": [
                            "treasury_offer",
                            "account_proposal",
                            "owner_account_acceptance",
                            "operator_account_acceptance",
                            "owner_offer_acceptance",
                            "deposit_proposal",
                            "owner_deposit_authorization",
                            "operator_deposit_execution"
                          ]
                        },
                        "commandId": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "required": [
                        "step",
                        "commandId"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "cantonOutcome": {
                    "type": "object",
                    "properties": {
                      "step": {
                        "type": "string",
                        "enum": [
                          "treasury_offer",
                          "account_proposal",
                          "owner_account_acceptance",
                          "operator_account_acceptance",
                          "owner_offer_acceptance",
                          "deposit_proposal",
                          "owner_deposit_authorization",
                          "operator_deposit_execution"
                        ]
                      },
                      "outcome": {
                        "type": "string",
                        "enum": [
                          "sequenced_accepted",
                          "sequenced_rejected",
                          "not_sequenced",
                          "outcome_pending"
                        ]
                      },
                      "guard": {
                        "type": "string",
                        "enum": [
                          "completion_accepted",
                          "target_archive_accepted",
                          "completion_rejected",
                          "max_record_time_passed",
                          "ledger_time_bound_passed",
                          "submission_acknowledged",
                          "submission_unacknowledged",
                          "completion_wait_elapsed",
                          "completion_stream_unavailable",
                          "completion_record_unavailable",
                          "completion_absent_window_open",
                          "completion_duplicate_command",
                          "completion_submission_in_flight",
                          "record_time_unavailable",
                          "target_contract_unavailable",
                          "target_contract_archived_elsewhere"
                        ]
                      }
                    },
                    "required": [
                      "step",
                      "outcome",
                      "guard"
                    ],
                    "additionalProperties": false
                  },
                  "status": {
                    "type": "string",
                    "const": "submitted_unknown"
                  },
                  "uncertainCantonCommandId": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "version",
                  "environment",
                  "adminCommandId",
                  "fundingIntentId",
                  "depositId",
                  "engineCommandId",
                  "accountId",
                  "partyId",
                  "asset",
                  "amountAtoms",
                  "plannedCantonCommands",
                  "status",
                  "uncertainCantonCommandId"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "version": {
                    "type": "string",
                    "const": "local-signing/v2"
                  },
                  "environment": {
                    "type": "string",
                    "enum": [
                      "local",
                      "development",
                      "staging"
                    ]
                  },
                  "adminCommandId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "fundingIntentId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "depositId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "engineCommandId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "accountId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "partyId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "asset": {
                    "type": "string",
                    "enum": [
                      "USD.E",
                      "USDCx"
                    ]
                  },
                  "amountAtoms": {
                    "type": "string",
                    "pattern": "^[1-9][0-9]*$"
                  },
                  "plannedCantonCommands": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "step": {
                          "type": "string",
                          "enum": [
                            "treasury_offer",
                            "account_proposal",
                            "owner_account_acceptance",
                            "operator_account_acceptance",
                            "owner_offer_acceptance",
                            "deposit_proposal",
                            "owner_deposit_authorization",
                            "operator_deposit_execution"
                          ]
                        },
                        "commandId": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "required": [
                        "step",
                        "commandId"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "cantonOutcome": {
                    "type": "object",
                    "properties": {
                      "step": {
                        "type": "string",
                        "enum": [
                          "treasury_offer",
                          "account_proposal",
                          "owner_account_acceptance",
                          "operator_account_acceptance",
                          "owner_offer_acceptance",
                          "deposit_proposal",
                          "owner_deposit_authorization",
                          "operator_deposit_execution"
                        ]
                      },
                      "outcome": {
                        "type": "string",
                        "enum": [
                          "sequenced_accepted",
                          "sequenced_rejected",
                          "not_sequenced",
                          "outcome_pending"
                        ]
                      },
                      "guard": {
                        "type": "string",
                        "enum": [
                          "completion_accepted",
                          "target_archive_accepted",
                          "completion_rejected",
                          "max_record_time_passed",
                          "ledger_time_bound_passed",
                          "submission_acknowledged",
                          "submission_unacknowledged",
                          "completion_wait_elapsed",
                          "completion_stream_unavailable",
                          "completion_record_unavailable",
                          "completion_absent_window_open",
                          "completion_duplicate_command",
                          "completion_submission_in_flight",
                          "record_time_unavailable",
                          "target_contract_unavailable",
                          "target_contract_archived_elsewhere"
                        ]
                      }
                    },
                    "required": [
                      "step",
                      "outcome",
                      "guard"
                    ],
                    "additionalProperties": false
                  },
                  "status": {
                    "type": "string",
                    "const": "ledger_confirmed"
                  },
                  "offerContractId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "offerUpdateId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "offerLedgerOffset": {
                    "type": "string",
                    "minLength": 1
                  },
                  "ledgerProofKind": {
                    "type": "string",
                    "enum": [
                      "command_chain",
                      "historical_receipt"
                    ]
                  },
                  "submissionCommandId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "submissionUpdateId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "depositReceiptContractId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "ledgerEventId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "ledgerOffset": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "version",
                  "environment",
                  "adminCommandId",
                  "fundingIntentId",
                  "depositId",
                  "engineCommandId",
                  "accountId",
                  "partyId",
                  "asset",
                  "amountAtoms",
                  "plannedCantonCommands",
                  "status",
                  "offerContractId",
                  "offerUpdateId",
                  "offerLedgerOffset",
                  "ledgerProofKind",
                  "depositReceiptContractId",
                  "ledgerEventId",
                  "ledgerOffset"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "version": {
                    "type": "string",
                    "const": "local-signing/v2"
                  },
                  "environment": {
                    "type": "string",
                    "enum": [
                      "local",
                      "development",
                      "staging"
                    ]
                  },
                  "adminCommandId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "fundingIntentId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "depositId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "engineCommandId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "accountId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "partyId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "asset": {
                    "type": "string",
                    "enum": [
                      "USD.E",
                      "USDCx"
                    ]
                  },
                  "amountAtoms": {
                    "type": "string",
                    "pattern": "^[1-9][0-9]*$"
                  },
                  "plannedCantonCommands": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "step": {
                          "type": "string",
                          "enum": [
                            "treasury_offer",
                            "account_proposal",
                            "owner_account_acceptance",
                            "operator_account_acceptance",
                            "owner_offer_acceptance",
                            "deposit_proposal",
                            "owner_deposit_authorization",
                            "operator_deposit_execution"
                          ]
                        },
                        "commandId": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "required": [
                        "step",
                        "commandId"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "cantonOutcome": {
                    "type": "object",
                    "properties": {
                      "step": {
                        "type": "string",
                        "enum": [
                          "treasury_offer",
                          "account_proposal",
                          "owner_account_acceptance",
                          "operator_account_acceptance",
                          "owner_offer_acceptance",
                          "deposit_proposal",
                          "owner_deposit_authorization",
                          "operator_deposit_execution"
                        ]
                      },
                      "outcome": {
                        "type": "string",
                        "enum": [
                          "sequenced_accepted",
                          "sequenced_rejected",
                          "not_sequenced",
                          "outcome_pending"
                        ]
                      },
                      "guard": {
                        "type": "string",
                        "enum": [
                          "completion_accepted",
                          "target_archive_accepted",
                          "completion_rejected",
                          "max_record_time_passed",
                          "ledger_time_bound_passed",
                          "submission_acknowledged",
                          "submission_unacknowledged",
                          "completion_wait_elapsed",
                          "completion_stream_unavailable",
                          "completion_record_unavailable",
                          "completion_absent_window_open",
                          "completion_duplicate_command",
                          "completion_submission_in_flight",
                          "record_time_unavailable",
                          "target_contract_unavailable",
                          "target_contract_archived_elsewhere"
                        ]
                      }
                    },
                    "required": [
                      "step",
                      "outcome",
                      "guard"
                    ],
                    "additionalProperties": false
                  },
                  "status": {
                    "type": "string",
                    "const": "engine_projected"
                  },
                  "offerContractId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "offerUpdateId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "offerLedgerOffset": {
                    "type": "string",
                    "minLength": 1
                  },
                  "ledgerProofKind": {
                    "type": "string",
                    "enum": [
                      "command_chain",
                      "historical_receipt"
                    ]
                  },
                  "submissionCommandId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "submissionUpdateId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "depositReceiptContractId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "ledgerEventId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "ledgerOffset": {
                    "type": "string",
                    "minLength": 1
                  },
                  "engineProjectionEventId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "resultingBalanceAtoms": {
                    "type": "string",
                    "pattern": "^[1-9][0-9]*$"
                  }
                },
                "required": [
                  "version",
                  "environment",
                  "adminCommandId",
                  "fundingIntentId",
                  "depositId",
                  "engineCommandId",
                  "accountId",
                  "partyId",
                  "asset",
                  "amountAtoms",
                  "plannedCantonCommands",
                  "status",
                  "offerContractId",
                  "offerUpdateId",
                  "offerLedgerOffset",
                  "ledgerProofKind",
                  "depositReceiptContractId",
                  "ledgerEventId",
                  "ledgerOffset",
                  "engineProjectionEventId",
                  "resultingBalanceAtoms"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "version": {
                    "type": "string",
                    "const": "local-signing/v2"
                  },
                  "environment": {
                    "type": "string",
                    "enum": [
                      "local",
                      "development",
                      "staging"
                    ]
                  },
                  "adminCommandId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "fundingIntentId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "depositId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "engineCommandId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "accountId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "partyId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "asset": {
                    "type": "string",
                    "enum": [
                      "USD.E",
                      "USDCx"
                    ]
                  },
                  "amountAtoms": {
                    "type": "string",
                    "pattern": "^[1-9][0-9]*$"
                  },
                  "plannedCantonCommands": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "step": {
                          "type": "string",
                          "enum": [
                            "treasury_offer",
                            "account_proposal",
                            "owner_account_acceptance",
                            "operator_account_acceptance",
                            "owner_offer_acceptance",
                            "deposit_proposal",
                            "owner_deposit_authorization",
                            "operator_deposit_execution"
                          ]
                        },
                        "commandId": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "required": [
                        "step",
                        "commandId"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "cantonOutcome": {
                    "type": "object",
                    "properties": {
                      "step": {
                        "type": "string",
                        "enum": [
                          "treasury_offer",
                          "account_proposal",
                          "owner_account_acceptance",
                          "operator_account_acceptance",
                          "owner_offer_acceptance",
                          "deposit_proposal",
                          "owner_deposit_authorization",
                          "operator_deposit_execution"
                        ]
                      },
                      "outcome": {
                        "type": "string",
                        "enum": [
                          "sequenced_accepted",
                          "sequenced_rejected",
                          "not_sequenced",
                          "outcome_pending"
                        ]
                      },
                      "guard": {
                        "type": "string",
                        "enum": [
                          "completion_accepted",
                          "target_archive_accepted",
                          "completion_rejected",
                          "max_record_time_passed",
                          "ledger_time_bound_passed",
                          "submission_acknowledged",
                          "submission_unacknowledged",
                          "completion_wait_elapsed",
                          "completion_stream_unavailable",
                          "completion_record_unavailable",
                          "completion_absent_window_open",
                          "completion_duplicate_command",
                          "completion_submission_in_flight",
                          "record_time_unavailable",
                          "target_contract_unavailable",
                          "target_contract_archived_elsewhere"
                        ]
                      }
                    },
                    "required": [
                      "step",
                      "outcome",
                      "guard"
                    ],
                    "additionalProperties": false
                  },
                  "status": {
                    "type": "string",
                    "const": "failed"
                  },
                  "failureReason": {
                    "type": "string",
                    "enum": [
                      "environment_forbidden",
                      "environment_mismatch",
                      "wallet_unavailable",
                      "wallet_not_ready",
                      "account_binding_conflict",
                      "ledger_account_binding_mismatch",
                      "custody_mismatch",
                      "owner_binding_mismatch",
                      "party_binding_mismatch",
                      "wallet_fingerprint_mismatch",
                      "participant_fingerprint_mismatch",
                      "asset_mismatch",
                      "invalid_amount",
                      "intent_unavailable",
                      "idempotency_conflict",
                      "command_busy",
                      "deposit_capability_unavailable",
                      "signing_failed",
                      "ledger_failed",
                      "payout_instruction_expired",
                      "withdrawal_authorization_expired"
                    ]
                  }
                },
                "required": [
                  "version",
                  "environment",
                  "adminCommandId",
                  "fundingIntentId",
                  "depositId",
                  "engineCommandId",
                  "accountId",
                  "partyId",
                  "asset",
                  "amountAtoms",
                  "plannedCantonCommands",
                  "status",
                  "failureReason"
                ],
                "additionalProperties": false
              }
            ]
          }
        ]
      },
      "ExternalMarketFavoriteResponse": {
        "type": "object",
        "properties": {
          "version": {
            "type": "string",
            "const": "external-market-favorite/v1"
          },
          "accountId": {
            "type": "string",
            "minLength": 1
          },
          "marketId": {
            "type": "string",
            "minLength": 1
          },
          "favorite": {
            "type": "boolean"
          }
        },
        "required": [
          "version",
          "accountId",
          "marketId",
          "favorite"
        ],
        "additionalProperties": false
      },
      "AgentConnectStartRequest": {
        "type": "object",
        "properties": {
          "clientName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "read",
                "trade"
              ]
            },
            "minItems": 1,
            "maxItems": 2
          },
          "lifetimeSeconds": {
            "type": "integer",
            "minimum": 300,
            "maximum": 604800
          }
        },
        "required": [
          "clientName",
          "scopes"
        ],
        "additionalProperties": false
      },
      "AgentConnectStartResponse": {
        "type": "object",
        "properties": {
          "version": {
            "type": "string",
            "const": "agent-connect-start/v1"
          },
          "connectCode": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{43}$"
          },
          "userCode": {
            "type": "string",
            "pattern": "^[BCDFGHJKLMNPQRSTVWXZ]{4}-[BCDFGHJKLMNPQRSTVWXZ]{4}$"
          },
          "verificationUrl": {
            "type": "string"
          },
          "expiresInSeconds": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "intervalSeconds": {
            "type": "integer",
            "exclusiveMinimum": 0
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "read",
                "trade"
              ]
            },
            "minItems": 1,
            "maxItems": 2
          },
          "keyLifetimeSeconds": {
            "type": "integer",
            "minimum": 300,
            "maximum": 604800
          }
        },
        "required": [
          "version",
          "connectCode",
          "userCode",
          "verificationUrl",
          "expiresInSeconds",
          "intervalSeconds",
          "scopes",
          "keyLifetimeSeconds"
        ],
        "additionalProperties": false
      },
      "AgentConnectCompleteRequest": {
        "type": "object",
        "properties": {
          "connectCode": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{43}$"
          }
        },
        "required": [
          "connectCode"
        ],
        "additionalProperties": false
      },
      "AgentConnectCompleteResponse": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "version": {
                "type": "string",
                "const": "agent-connect-complete/v1"
              },
              "status": {
                "type": "string",
                "const": "authorization_pending"
              }
            },
            "required": [
              "version",
              "status"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "version": {
                "type": "string",
                "const": "agent-connect-complete/v1"
              },
              "status": {
                "type": "string",
                "const": "slow_down"
              }
            },
            "required": [
              "version",
              "status"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "version": {
                "type": "string",
                "const": "agent-connect-complete/v1"
              },
              "status": {
                "type": "string",
                "const": "expired"
              }
            },
            "required": [
              "version",
              "status"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "version": {
                "type": "string",
                "const": "agent-connect-complete/v1"
              },
              "status": {
                "type": "string",
                "const": "approved"
              },
              "apiKey": {
                "type": "string",
                "pattern": "^(?:edel_ak_|edel_bk_|edel_tk_)[A-Za-z0-9_-]{43}$",
                "description": "The API key. Returned exactly once; store it in a private file and send it as `Authorization: Bearer`."
              },
              "key": {
                "type": "object",
                "properties": {
                  "keyId": {
                    "type": "string"
                  },
                  "accountId": {
                    "type": "string",
                    "minLength": 1
                  },
                  "principalKind": {
                    "type": "string",
                    "enum": [
                      "agent",
                      "bot",
                      "test_client"
                    ]
                  },
                  "displayPrefix": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{8}$"
                  },
                  "scopes": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "read",
                        "trade"
                      ]
                    },
                    "minItems": 1,
                    "maxItems": 2
                  },
                  "state": {
                    "type": "string",
                    "enum": [
                      "active",
                      "expired",
                      "revoked"
                    ]
                  },
                  "createdAtEpochMs": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "expiresAtEpochMs": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "revokedAtEpochMs": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "minimum": 0
                  },
                  "lastUsedAtEpochMs": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "minimum": 0
                  }
                },
                "required": [
                  "keyId",
                  "accountId",
                  "principalKind",
                  "displayPrefix",
                  "scopes",
                  "state",
                  "createdAtEpochMs",
                  "expiresAtEpochMs",
                  "revokedAtEpochMs",
                  "lastUsedAtEpochMs"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "version",
              "status",
              "apiKey",
              "key"
            ],
            "additionalProperties": false
          }
        ]
      },
      "AgentConnectApproveRequest": {
        "type": "object",
        "properties": {
          "userCode": {
            "type": "string",
            "pattern": "^[BCDFGHJKLMNPQRSTVWXZ]{4}-[BCDFGHJKLMNPQRSTVWXZ]{4}$"
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "read",
                "trade"
              ]
            },
            "minItems": 1,
            "maxItems": 2
          }
        },
        "required": [
          "userCode",
          "scopes"
        ],
        "additionalProperties": false
      },
      "AgentConnectApproveResponse": {
        "type": "object",
        "properties": {
          "version": {
            "type": "string",
            "const": "agent-connect-approve/v1"
          },
          "accountId": {
            "type": "string",
            "minLength": 1
          },
          "clientName": {
            "type": "string",
            "minLength": 1
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "read",
                "trade"
              ]
            },
            "minItems": 1,
            "maxItems": 2
          },
          "keyLifetimeSeconds": {
            "type": "integer",
            "minimum": 300,
            "maximum": 604800
          },
          "approvedAtEpochMs": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "version",
          "accountId",
          "clientName",
          "scopes",
          "keyLifetimeSeconds",
          "approvedAtEpochMs"
        ],
        "additionalProperties": false
      },
      "ApiKeySummary": {
        "type": "object",
        "properties": {
          "keyId": {
            "type": "string"
          },
          "accountId": {
            "type": "string",
            "minLength": 1
          },
          "principalKind": {
            "type": "string",
            "enum": [
              "agent",
              "bot",
              "test_client"
            ]
          },
          "displayPrefix": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{8}$"
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "read",
                "trade"
              ]
            },
            "minItems": 1,
            "maxItems": 2
          },
          "state": {
            "type": "string",
            "enum": [
              "active",
              "expired",
              "revoked"
            ]
          },
          "createdAtEpochMs": {
            "type": "integer",
            "minimum": 0
          },
          "expiresAtEpochMs": {
            "type": "integer",
            "minimum": 0
          },
          "revokedAtEpochMs": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "lastUsedAtEpochMs": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          }
        },
        "required": [
          "keyId",
          "accountId",
          "principalKind",
          "displayPrefix",
          "scopes",
          "state",
          "createdAtEpochMs",
          "expiresAtEpochMs",
          "revokedAtEpochMs",
          "lastUsedAtEpochMs"
        ],
        "additionalProperties": false
      },
      "ApiKeyListResponse": {
        "type": "object",
        "properties": {
          "version": {
            "type": "string",
            "const": "api-key-list/v1"
          },
          "keys": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "keyId": {
                  "type": "string"
                },
                "accountId": {
                  "type": "string",
                  "minLength": 1
                },
                "principalKind": {
                  "type": "string",
                  "enum": [
                    "agent",
                    "bot",
                    "test_client"
                  ]
                },
                "displayPrefix": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{8}$"
                },
                "scopes": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "enum": [
                      "read",
                      "trade"
                    ]
                  },
                  "minItems": 1,
                  "maxItems": 2
                },
                "state": {
                  "type": "string",
                  "enum": [
                    "active",
                    "expired",
                    "revoked"
                  ]
                },
                "createdAtEpochMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "expiresAtEpochMs": {
                  "type": "integer",
                  "minimum": 0
                },
                "revokedAtEpochMs": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "minimum": 0
                },
                "lastUsedAtEpochMs": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "minimum": 0
                }
              },
              "required": [
                "keyId",
                "accountId",
                "principalKind",
                "displayPrefix",
                "scopes",
                "state",
                "createdAtEpochMs",
                "expiresAtEpochMs",
                "revokedAtEpochMs",
                "lastUsedAtEpochMs"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "version",
          "keys"
        ],
        "additionalProperties": false
      },
      "ApiKeyRevokeResponse": {
        "type": "object",
        "properties": {
          "version": {
            "type": "string",
            "const": "api-key-revoke/v1"
          },
          "key": {
            "type": "object",
            "properties": {
              "keyId": {
                "type": "string"
              },
              "accountId": {
                "type": "string",
                "minLength": 1
              },
              "principalKind": {
                "type": "string",
                "enum": [
                  "agent",
                  "bot",
                  "test_client"
                ]
              },
              "displayPrefix": {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{8}$"
              },
              "scopes": {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "read",
                    "trade"
                  ]
                },
                "minItems": 1,
                "maxItems": 2
              },
              "state": {
                "type": "string",
                "enum": [
                  "active",
                  "expired",
                  "revoked"
                ]
              },
              "createdAtEpochMs": {
                "type": "integer",
                "minimum": 0
              },
              "expiresAtEpochMs": {
                "type": "integer",
                "minimum": 0
              },
              "revokedAtEpochMs": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0
              },
              "lastUsedAtEpochMs": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0
              }
            },
            "required": [
              "keyId",
              "accountId",
              "principalKind",
              "displayPrefix",
              "scopes",
              "state",
              "createdAtEpochMs",
              "expiresAtEpochMs",
              "revokedAtEpochMs",
              "lastUsedAtEpochMs"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "version",
          "key"
        ],
        "additionalProperties": false
      }
    }
  }
}
