{
  "openapi": "3.1.0",
  "info": {
    "title": "True Markets API",
    "version": "auth 1.3.3, account 1.21.1, gateway 1.39.0, cefi-direct v1.0.8, marketdata 0.18.0",
    "description": "Every public True Markets REST API in one document. Each is also published on its own:\n\n- [Authentication REST spec](https://docs.truemarkets.co/openapi/auth.yaml): Exchange an API key signature for a token, and refresh it.\n- [Accounts REST spec](https://docs.truemarkets.co/openapi/account.yaml): Create the users your organization trades for, with their wallets, and read deposit details.\n- [Trading REST spec](https://docs.truemarkets.co/openapi/gateway.yaml): Quotes, orders, transfers, balances and transactions, for your own account or for a user you act for.\n- [CeFi direct REST spec](https://docs.truemarkets.co/openapi/cefi-direct.yaml): Order entry, balances and market data on the CeFi venue, for firms with direct access.\n- [Market data REST spec](https://docs.truemarkets.co/openapi/marketdata.yaml): Prices, candles and history across venues, without a token."
  },
  "externalDocs": {
    "url": "https://docs.truemarkets.co"
  },
  "servers": [
    {
      "url": "https://api.truemarkets.co",
      "description": "Production"
    },
    {
      "url": "https://api.uat.truemarkets.co",
      "description": "UAT (sandbox)"
    }
  ],
  "tags": [
    {
      "name": "Account: Agreements",
      "description": "User acceptance of third-party and platform agreements."
    },
    {
      "name": "Account: Organizations",
      "description": "The users an organization trades for. Each user is created with wallets and addressed on trading routes through `TM-On-Behalf-Of`."
    },
    {
      "name": "Account: Trading Setup",
      "description": "How a user is set up to trade and to settle what they trade, separate from their KYC status."
    },
    {
      "name": "Gateway: Quotes",
      "description": "Request real-time market quotes for trading pairs without creating an order."
    },
    {
      "name": "Gateway: Orders",
      "description": "Create, execute, cancel, and monitor orders across CeFi and DeFi."
    },
    {
      "name": "Gateway: Transfers",
      "description": "Create, execute, and monitor transfers across CeFi and DeFi."
    },
    {
      "name": "Gateway: Ramps",
      "description": "Sell stablecoin balances for fiat through Coinbase or PayPal, funded from CeFi when needed."
    },
    {
      "name": "Gateway: Custody",
      "description": "Set aside part of the caller's DeFi wallet balance for CeFi trading, and release it again. Tokens stay in the caller's wallet. Nothing is sent on chain or to a bank; for that, see Transfers and Ramps."
    },
    {
      "name": "Gateway: Paper Trading",
      "description": "Add and remove test funds in a paper-trading environment. These endpoints exist only in non-production paper-trading environments such as UAT; production answers `404`."
    },
    {
      "name": "Gateway: Transactions",
      "description": "One unified feed of the caller's orders, transfers, and ramps."
    },
    {
      "name": "Gateway: Assets",
      "description": "Browse the unified catalog of tradeable assets across DeFi and CeFi venues."
    },
    {
      "name": "Gateway: Balances",
      "description": "Query account balances for the authenticated user."
    },
    {
      "name": "Gateway: Positions",
      "description": "Query a user's open Hyperliquid perpetual positions."
    },
    {
      "name": "Institutional: Service",
      "description": "Health checks and API version discovery endpoints. These endpoints are publicly accessible and do not require authentication."
    },
    {
      "name": "Institutional: Assets",
      "description": "Query available assets on the exchange by ID or name."
    },
    {
      "name": "Institutional: Instruments",
      "description": "Query tradeable instruments (market definitions) and their statistics."
    },
    {
      "name": "Institutional: Market Data",
      "description": "Real-time market quotes and VWAP computations. These endpoints are publicly accessible and do not require authentication."
    },
    {
      "name": "Institutional: Clients",
      "description": "Retrieve and update client account information and settings."
    },
    {
      "name": "Institutional: Orders",
      "description": "Create, modify, cancel, and query orders including status, trades, and activity history."
    },
    {
      "name": "Institutional: Balances",
      "description": "Query account balances across all assets."
    },
    {
      "name": "Institutional: Transfers",
      "description": "Initiate and track fund transfers between accounts."
    },
    {
      "name": "Market data: Prices",
      "description": "Current price candles and historical price points for spot assets."
    },
    {
      "name": "Market data: Market Cap",
      "description": "Latest market capitalization for individual assets and ranked listings."
    },
    {
      "name": "Market data: Market Feed",
      "description": "Assets ranked by trending ratio or by the size of their recent price move."
    },
    {
      "name": "Market data: Streams",
      "description": "Server-sent quote streams."
    }
  ],
  "x-tagGroups": [
    {
      "name": "Auth",
      "tags": [
        "Auth: Authentication",
        "Auth: OAuth"
      ]
    },
    {
      "name": "Account",
      "tags": [
        "Account: Agreements",
        "Account: Organizations",
        "Account: Trading Setup"
      ]
    },
    {
      "name": "Gateway",
      "tags": [
        "Gateway: Quotes",
        "Gateway: Orders",
        "Gateway: Transfers",
        "Gateway: Ramps",
        "Gateway: Custody",
        "Gateway: Paper Trading",
        "Gateway: Transactions",
        "Gateway: Assets",
        "Gateway: Balances",
        "Gateway: Positions"
      ]
    },
    {
      "name": "Institutional",
      "tags": [
        "Institutional: Service",
        "Institutional: Assets",
        "Institutional: Instruments",
        "Institutional: Market Data",
        "Institutional: Clients",
        "Institutional: Orders",
        "Institutional: Balances",
        "Institutional: Transfers"
      ]
    },
    {
      "name": "Market data",
      "tags": [
        "Market data: Prices",
        "Market data: Market Cap",
        "Market data: Market Feed",
        "Market data: Streams",
        "Market data: CeFi"
      ]
    }
  ],
  "paths": {
    "/v1/auth/token/refresh": {
      "post": {
        "summary": "Refresh access token",
        "description": "Exchange a valid refresh token for a new access/refresh token pair",
        "operationId": "refreshToken",
        "tags": [
          "Auth: Authentication"
        ],
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RefreshTokenRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Tokens refreshed successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccessTokensResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request body or missing refresh token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthError"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or expired refresh token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/auth/api-key/token": {
      "post": {
        "summary": "Exchange API key for tokens",
        "description": "Verify an ECDSA P-256 signature and issue JWT tokens. The client signs\nthe message `{key_id}.{unix_timestamp}` with their private key using ES256.\nThe timestamp must be within ±30 seconds of the server time.\n\nA personal key returns an access token and a refresh token. An organization key\nreturns an access token only, with no `refresh_token` field: mint a new token from\nthe key before `expires_in`.\n",
        "operationId": "exchangeAPIKeyToken",
        "tags": [
          "Auth: Authentication"
        ],
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/APIKeyTokenExchangeRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Tokens issued successfully. A user key yields an access and refresh token; an organization key yields an access token only.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/AccessTokensResponse"
                    },
                    {
                      "$ref": "#/components/schemas/OrganizationTokenResponse"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid request (missing fields)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthError"
                }
              }
            }
          },
          "401": {
            "description": "Invalid API key, expired, revoked, invalid signature, or timestamp out of range",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/auth/oauth/authorize": {
      "get": {
        "summary": "Start an authorization request",
        "description": "The authorization endpoint (RFC 6749 4.1.1). A valid request is\nredirected to the consent screen with its parameters intact; the\nsigned-in user's decision comes back through `/oauth/consent`.\n\nWhere a failure is reported depends on what failed. An unknown client\nor an unregistered `redirect_uri` is answered here, because the only\ntarget we could redirect to is the one we just refused to trust.\nEverything else redirects back to the client with `error` and `state`\n(RFC 6749 4.1.2.1).\n\nPKCE is required and `code_challenge_method` must be `S256`.\n",
        "operationId": "oauthAuthorize",
        "tags": [
          "Auth: OAuth"
        ],
        "security": [],
        "parameters": [
          {
            "name": "client_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "redirect_uri",
            "in": "query",
            "required": true,
            "description": "Must match one the client registered, byte-for-byte outside loopback.",
            "schema": {
              "type": "string",
              "format": "uri"
            }
          },
          {
            "name": "response_type",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "code"
              ]
            }
          },
          {
            "name": "code_challenge",
            "in": "query",
            "required": true,
            "description": "base64url SHA-256 of the client's code verifier.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "code_challenge_method",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "S256"
              ]
            }
          },
          {
            "name": "resource",
            "in": "query",
            "required": true,
            "description": "RFC 8707 resource indicator; becomes the access token's audience.",
            "schema": {
              "type": "string",
              "format": "uri"
            }
          },
          {
            "name": "scope",
            "in": "query",
            "required": false,
            "description": "Space-delimited. Defaults to every scope the client registered for.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "description": "Echoed back unchanged so the client can detect an unsolicited response.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "302": {
            "description": "Redirect to the consent screen, or back to the client's\n`redirect_uri` carrying `error` and `state`.\n",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string",
                  "format": "uri"
                }
              }
            }
          },
          "400": {
            "description": "Unknown client, or a redirect_uri the client did not register.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthError"
                }
              }
            }
          },
          "401": {
            "description": "The client is unknown or disabled.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/auth/oauth/consent": {
      "post": {
        "summary": "Record a consent decision",
        "description": "The signed-in user's answer to the consent screen. Approving records\nthe grant and mints an authorization code; denying returns the client\nto its redirect with `error=access_denied`.\n\nThe authorize parameters are repeated here and validated again, because\nnothing but the user's browser carries them between the two requests.\n\nReturns where the browser should go rather than redirecting, since the\nconsent screen issues this as a fetch.\n",
        "operationId": "oauthConsent",
        "tags": [
          "Auth: OAuth"
        ],
        "security": [
          {
            "AuthBearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConsentRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Decision recorded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConsentResponse"
                }
              }
            }
          },
          "400": {
            "description": "The authorize parameters no longer validate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthError"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthError"
                }
              }
            }
          },
          "403": {
            "description": "`error=login_required` — approving a sensitive scope such as\n`mcp:trade` needs a credential presented within the last few\nminutes, and this session's is older.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/auth/oauth/token": {
      "post": {
        "summary": "Exchange a grant for tokens",
        "description": "The token endpoint (RFC 6749 4.1.3 and 6), form encoded.\n\n`authorization_code` consumes the code atomically, checks it was issued\nto this client and this `redirect_uri`, and verifies PKCE. A code is\nsingle-use: unknown, expired and already-redeemed are one answer, so a\ncaller cannot tell them apart.\n\n`refresh_token` rotates: the presented token is consumed and the\nresponse carries its replacement, minted with the stored audience and\nscopes, so neither can widen on refresh. Refresh tokens are opaque and\nsingle-use; replaying a consumed one revokes every token descended\nfrom the same grant.\n",
        "operationId": "oauthToken",
        "tags": [
          "Auth: OAuth"
        ],
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "required": [
                  "grant_type",
                  "client_id"
                ],
                "properties": {
                  "grant_type": {
                    "type": "string",
                    "enum": [
                      "authorization_code",
                      "refresh_token"
                    ]
                  },
                  "client_id": {
                    "type": "string"
                  },
                  "code": {
                    "type": "string",
                    "description": "Required for authorization_code."
                  },
                  "redirect_uri": {
                    "type": "string",
                    "format": "uri",
                    "description": "Required for authorization_code; must match the authorize request."
                  },
                  "code_verifier": {
                    "type": "string",
                    "description": "Required for authorization_code."
                  },
                  "refresh_token": {
                    "type": "string",
                    "description": "Required for refresh_token."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Tokens issued",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthTokenResponse"
                }
              }
            }
          },
          "400": {
            "description": "`invalid_grant` for a bad, expired, replayed or mismatched code or\nPKCE verifier; `unsupported_grant_type` otherwise.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthError"
                }
              }
            }
          },
          "401": {
            "description": "The client is unknown or disabled.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/auth/.well-known/oauth-resource-jwks.json": {
      "get": {
        "summary": "OAuth resource token key set",
        "description": "The key set for OAuth resource tokens, served separately from\n`/.well-known/jwks.json`.\n\nResource tokens are signed with their own key, so a resource token\npresented to a first-party verifier fails signature verification.\nOnly resource servers fetch this document.\n",
        "operationId": "oauthResourceJWKS",
        "tags": [
          "Auth: OAuth"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "The resource token key set",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JWKSResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/auth/oauth/authorize/details": {
      "get": {
        "summary": "Describe an authorization request",
        "description": "What the consent screen renders: who is asking, for what, and whether\nwe vouch for the name.\n\nIt validates the same request `/oauth/authorize` did, so the screen\ncannot be made to describe a grant that would not actually be issued.\n\n`unverified` is true for a client that registered itself and chose its\nown name. `redirect_host` is shown beside the name because the host is\nthe part a client cannot assert freely.\n",
        "operationId": "oauthAuthorizeDetails",
        "tags": [
          "Auth: OAuth"
        ],
        "security": [],
        "parameters": [
          {
            "name": "client_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "redirect_uri",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uri"
            }
          },
          {
            "name": "response_type",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "code"
              ]
            }
          },
          {
            "name": "code_challenge",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "code_challenge_method",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "S256"
              ]
            }
          },
          {
            "name": "resource",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uri"
            }
          },
          {
            "name": "scope",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The request as the consent screen should present it",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthorizeClientResponse"
                }
              }
            }
          },
          "400": {
            "description": "The authorize request does not validate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthError"
                }
              }
            }
          },
          "401": {
            "description": "The client is unknown or disabled.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/auth/oauth/consents": {
      "get": {
        "summary": "List connected apps",
        "description": "The user's standing OAuth grants, newest first.",
        "operationId": "listOAuthConsents",
        "tags": [
          "Auth: OAuth"
        ],
        "security": [
          {
            "AuthBearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The user's live grants",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ConsentGrantResponse"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/auth/oauth/consents/{client_id}": {
      "delete": {
        "summary": "Revoke a connected app",
        "description": "Withdraws the grant and revokes the refresh tokens minted from it, so\nthe client cannot mint a fresh access token once its current one\nlapses. An access token already issued stays valid until it expires.\n",
        "operationId": "revokeOAuthConsent",
        "tags": [
          "Auth: OAuth"
        ],
        "security": [
          {
            "AuthBearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "client_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Grant revoked"
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthError"
                }
              }
            }
          },
          "404": {
            "description": "The user has no live grant for this client.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/auth/oauth/register": {
      "post": {
        "summary": "Register an OAuth client",
        "description": "Dynamic client registration (RFC 7591). A remote MCP client — Claude,\nMeta Muse, MCP Inspector — calls this itself before starting an\nauthorization flow; none of them can be handed a `client_id` out of\nband.\n\nRegistration is open in mechanism and closed in reach: every\n`redirect_uri` must belong to one known client vendor, and a caller\nwhose callback belongs to none is refused. Clients registered here are\npublic, use PKCE with S256, and are marked unverified on the consent\nscreen because their name is self-asserted.\n\nErrors answer in the OAuth envelope (RFC 6749 5.2), not the usual one.\n",
        "operationId": "registerOAuthClient",
        "tags": [
          "Auth: OAuth"
        ],
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RegisterOAuthClientRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Client registered",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegisterOAuthClientResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid client metadata, or a redirect_uri belonging to no known\nvendor. `error` is `invalid_redirect_uri`, `invalid_client_metadata`\nor `invalid_scope`.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthError"
                }
              }
            }
          }
        }
      }
    },
    "/.well-known/oauth-authorization-server": {
      "servers": [
        {
          "url": "https://api.truemarkets.co",
          "description": "Production"
        },
        {
          "url": "https://api.uat.truemarkets.co",
          "description": "UAT"
        }
      ],
      "get": {
        "summary": "Authorization server metadata",
        "description": "RFC 8414 discovery. A remote MCP client fetches this to learn where to\nregister and authorize, having been configured with nothing but the\nMCP server URL.\n\n`issuer` must equal the origin this document is served from, which is\nwhy it is mounted at the root rather than under `/v1/auth`. The\nendpoints it names do sit under that base path; RFC 8414 does not\nrequire them to share the issuer's prefix.\n\nServed `no-store`: a client that cached this across a key or endpoint\nrotation would fail in a way that looks like our outage.\n",
        "operationId": "oauthAuthorizationServerMetadata",
        "tags": [
          "Auth: OAuth"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "The authorization server's published identity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthorizationServerMetadata"
                }
              }
            }
          }
        }
      }
    },
    "/v1/account/me/trading": {
      "get": {
        "operationId": "getTradingSetup",
        "tags": [
          "Account: Trading Setup"
        ],
        "summary": "Get the user's trading setup",
        "description": "Returns how the user is set up to trade and to settle, independent of their KYC status.\n\n- `wallets` lists the wallets the user holds: `main`, their own wallet, and `strategies`,\n  the wallet strategies trade from. A wallet the user does not hold is omitted. Each\n  `main` address reports `settlement_authority`: whether the user has authorized\n  settlement of CeFi trades on that chain.\n- `trading.cefi` is enabled once the user has a CeFi trading account; `accounts` lists\n  them, each naming the wallet it settles against and its `client_id`.\n- `trading.defi` is enabled once the user holds a `main` wallet.\n- `settlement.defi` is enabled when CeFi trading is enabled and every `main` address has\n  settlement authority. `settlement.paxos` is enabled once the user has a Paxos account.\n\nA CeFi listing can be traded when `trading.cefi.enabled` and the `settlement` rail the\nlisting settles on are both enabled.\n\nAn organization token reads one of its users' setup with `TM-On-Behalf-Of`.\n",
        "security": [
          {
            "AccountBearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/AccountOnBehalfOf"
          }
        ],
        "responses": {
          "200": {
            "description": "The user's trading setup",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TradingSetupResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationError"
          },
          "401": {
            "$ref": "#/components/responses/AccountUnauthorized"
          },
          "403": {
            "$ref": "#/components/responses/AccountForbidden"
          },
          "500": {
            "$ref": "#/components/responses/AccountInternalError"
          },
          "503": {
            "description": "Service unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/account/organizations/{organization_id}/users": {
      "post": {
        "x-internal": false,
        "operationId": "createOrganizationUser",
        "tags": [
          "Account: Organizations"
        ],
        "summary": "Create a user your organization trades for",
        "description": "Creates the user your organization trades for under the reference you name them by, with\ntheir wallets, or returns the existing one. Re-sending the same request is safe: a 503 means\nthe wallet step did not finish, and repeating the request completes it. Once your organization\nreaches its user limit a new reference is refused, while re-sending an existing one still works.\nUse the returned `user_id` as the `TM-On-Behalf-Of` value on trading routes.\n",
        "security": [
          {
            "AccountBearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OrganizationIdParam"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateOrganizationUserRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "User already existed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationUser"
                }
              }
            }
          },
          "201": {
            "description": "User created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationUser"
                }
              }
            }
          },
          "400": {
            "description": "Malformed organization id, external reference or signer public key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/AccountUnauthorized"
          },
          "403": {
            "$ref": "#/components/responses/AccountForbidden"
          },
          "409": {
            "description": "The reference names a member of the organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountError"
                }
              }
            }
          },
          "422": {
            "description": "The organization has reached its user limit; contact support to raise it",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/AccountInternalError"
          },
          "503": {
            "description": "Service unavailable; retry the same request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountError"
                }
              }
            }
          }
        }
      },
      "get": {
        "x-internal": false,
        "operationId": "listOrganizationUsers",
        "tags": [
          "Account: Organizations"
        ],
        "summary": "List the users your organization trades for",
        "description": "Returns your organization's users, newest first. Page with the opaque `cursor` from\n`pagination.next_cursor`. Supply `external_ref_id` instead to look up a single user by the\nreference you created them with; a reference matching nothing is an empty page.\n",
        "security": [
          {
            "AccountBearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OrganizationIdParam"
          },
          {
            "name": "external_ref_id",
            "in": "query",
            "required": false,
            "description": "Narrow the page to the user created under this reference.",
            "schema": {
              "$ref": "#/components/schemas/ExternalRefId"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque cursor from a prior page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum users to return; above 100 is clamped to 100 and echoed back.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of users",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationUserPage"
                }
              }
            }
          },
          "400": {
            "description": "Malformed organization id, external reference, cursor or limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/AccountUnauthorized"
          },
          "403": {
            "$ref": "#/components/responses/AccountForbidden"
          },
          "500": {
            "$ref": "#/components/responses/AccountInternalError"
          },
          "503": {
            "description": "Service unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/account/organizations/{organization_id}/users/{user_id}": {
      "get": {
        "x-internal": false,
        "operationId": "getOrganizationUser",
        "tags": [
          "Account: Organizations"
        ],
        "summary": "Get a user your organization trades for",
        "description": "Returns one of your organization's users, with the wallets held for them.",
        "security": [
          {
            "AccountBearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OrganizationIdParam"
          },
          {
            "name": "user_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The user your organization trades for",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationUser"
                }
              }
            }
          },
          "400": {
            "description": "Malformed organization id or user id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountError"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/AccountUnauthorized"
          },
          "403": {
            "$ref": "#/components/responses/AccountForbidden"
          },
          "404": {
            "description": "Your organization does not trade for this user",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountError"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/AccountInternalError"
          },
          "503": {
            "description": "Service unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/gateway/quotes": {
      "post": {
        "operationId": "computeQuote",
        "summary": "Compute market quote (CeFi only)",
        "description": "Non-binding price preview for a CeFi market order. For DeFi, the quote is returned by `POST /orders` (see `CreateOrderResponse.quote`).\n",
        "tags": [
          "Gateway: Quotes"
        ],
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuoteRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Quote computed successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuoteResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/GatewayBadRequest"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "500": {
            "$ref": "#/components/responses/GatewayInternalError"
          },
          "503": {
            "$ref": "#/components/responses/GatewayServiceUnavailable"
          }
        }
      }
    },
    "/v1/gateway/orders": {
      "post": {
        "operationId": "createOrder",
        "summary": "Create new order",
        "description": "Creates a new order. For DeFi orders, returns unsigned payloads for client signing.",
        "tags": [
          "Gateway: Orders"
        ],
        "security": [
          {
            "GatewayBearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/GatewayOnBehalfOf"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateOrderRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Order created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateOrderResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/GatewayBadRequest"
          },
          "401": {
            "$ref": "#/components/responses/GatewayUnauthorized"
          },
          "403": {
            "$ref": "#/components/responses/GatewayForbidden"
          },
          "404": {
            "$ref": "#/components/responses/GatewayNotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "500": {
            "$ref": "#/components/responses/GatewayInternalError"
          },
          "503": {
            "$ref": "#/components/responses/GatewayServiceUnavailable"
          }
        }
      },
      "get": {
        "operationId": "listOrders",
        "summary": "List user orders",
        "description": "Returns a paginated list of the authenticated user's orders with execution data. All statuses are returned by default; narrow the results with the `status` query parameter.\n",
        "tags": [
          "Gateway: Orders"
        ],
        "security": [
          {
            "GatewayBearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/GatewayOnBehalfOf"
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum number of orders to return",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Opaque pagination cursor from the previous page's `next_cursor`",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Comma-separated list of order statuses to filter by",
            "required": false,
            "schema": {
              "type": "string",
              "example": "pending,canceled"
            }
          },
          {
            "name": "venue",
            "in": "query",
            "description": "Comma-separated list of trading venues to filter by (`defi`, `cefi`). Defaults to all venues (`cefi,defi`) when omitted.\n",
            "required": false,
            "schema": {
              "type": "string",
              "default": "cefi,defi",
              "example": "cefi,defi"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Orders retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetOrdersResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/GatewayBadRequest"
          },
          "401": {
            "$ref": "#/components/responses/GatewayUnauthorized"
          },
          "403": {
            "$ref": "#/components/responses/GatewayForbidden"
          },
          "500": {
            "$ref": "#/components/responses/GatewayInternalError"
          }
        }
      }
    },
    "/v1/gateway/orders/{id}/execute": {
      "post": {
        "operationId": "executeOrder",
        "summary": "Execute pending order",
        "description": "Executes a pending order using client-provided signatures for the unsigned payloads",
        "tags": [
          "Gateway: Orders"
        ],
        "security": [
          {
            "GatewayBearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/GatewayOnBehalfOf"
          },
          {
            "name": "id",
            "in": "path",
            "description": "Order ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExecuteOrderRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Order execution initiated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExecuteOrderResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/GatewayBadRequest"
          },
          "401": {
            "$ref": "#/components/responses/GatewayUnauthorized"
          },
          "403": {
            "$ref": "#/components/responses/GatewayForbidden"
          },
          "404": {
            "$ref": "#/components/responses/GatewayNotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "500": {
            "$ref": "#/components/responses/GatewayInternalError"
          },
          "503": {
            "$ref": "#/components/responses/GatewayServiceUnavailable"
          }
        }
      }
    },
    "/v1/gateway/orders/all/cancel": {
      "post": {
        "operationId": "cancelAllOrders",
        "summary": "Cancel all open orders on a venue",
        "description": "Cancels all of your open orders on the given venue and returns how many\nwere canceled. Cancellation is asynchronous — confirm final per-order\nstate via `GET /orders`. Only `cefi` is supported today; `defi` returns\n`501 Not Implemented`.\n",
        "tags": [
          "Gateway: Orders"
        ],
        "security": [
          {
            "GatewayBearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/GatewayOnBehalfOf"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CancelAllOrdersRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Cancellation accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CancelAllOrdersResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/GatewayBadRequest"
          },
          "401": {
            "$ref": "#/components/responses/GatewayUnauthorized"
          },
          "403": {
            "$ref": "#/components/responses/GatewayForbidden"
          },
          "500": {
            "$ref": "#/components/responses/GatewayInternalError"
          }
        }
      }
    },
    "/v1/gateway/orders/{id}/cancel": {
      "post": {
        "operationId": "prepareCancelOrder",
        "summary": "Cancel a limit or TP/SL order (CeFi or DeFi)",
        "description": "Venue-polymorphic cancel. The `payloads` field is the signal:\n- **CeFi** orders are canceled immediately and return `202 Accepted` with no\n  `payloads`. Poll `GET /orders/{id}/status` for the terminal state.\n- **DeFi** (Hyperliquid) resting orders return `200 OK` with unsigned\n  `payloads`. Sign each locally and post the signatures to\n  `POST /orders/{id}/cancel/execute`.\n\nOnly cancellable orders (CeFi `pending`/`active` limit orders, DeFi\n`active` limit or TP/SL trigger orders) can be canceled; others return 400.\nAn order with `strategy_managed` set is cancelled by its strategy, not\nhere, and returns 422.\n",
        "tags": [
          "Gateway: Orders"
        ],
        "security": [
          {
            "GatewayBearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/GatewayOnBehalfOf"
          },
          {
            "name": "id",
            "in": "path",
            "description": "Order ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Resting DeFi order; unsigned cancel payloads to sign and execute",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CancelOrderResponse"
                }
              }
            }
          },
          "202": {
            "description": "CeFi cancel accepted; poll order status for the terminal state"
          },
          "400": {
            "$ref": "#/components/responses/GatewayBadRequest"
          },
          "401": {
            "$ref": "#/components/responses/GatewayUnauthorized"
          },
          "403": {
            "$ref": "#/components/responses/GatewayForbidden"
          },
          "404": {
            "$ref": "#/components/responses/GatewayNotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "500": {
            "$ref": "#/components/responses/GatewayInternalError"
          },
          "503": {
            "$ref": "#/components/responses/GatewayServiceUnavailable"
          }
        }
      }
    },
    "/v1/gateway/orders/{id}/cancel/execute": {
      "post": {
        "operationId": "executeCancelOrder",
        "summary": "Execute a resting DeFi order cancellation",
        "description": "Submits the client's signatures over the payloads returned by\n`POST /orders/{id}/cancel` to cancel a resting DeFi limit or TP/SL order.\nThe order moves to `canceled` once the venue confirms, keeping any\nquantity that filled before the cancel in `executed_qty`/`executed_vwap`.\nAn order that filled before the cancel landed moves to `complete`.\n",
        "tags": [
          "Gateway: Orders"
        ],
        "security": [
          {
            "GatewayBearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/GatewayOnBehalfOf"
          },
          {
            "name": "id",
            "in": "path",
            "description": "Order ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExecuteOrderRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Cancellation submitted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExecuteOrderResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/GatewayBadRequest"
          },
          "401": {
            "$ref": "#/components/responses/GatewayUnauthorized"
          },
          "403": {
            "$ref": "#/components/responses/GatewayForbidden"
          },
          "404": {
            "$ref": "#/components/responses/GatewayNotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "500": {
            "$ref": "#/components/responses/GatewayInternalError"
          },
          "503": {
            "$ref": "#/components/responses/GatewayServiceUnavailable"
          }
        }
      }
    },
    "/v1/gateway/orders/{id}": {
      "get": {
        "operationId": "getOrder",
        "tags": [
          "Gateway: Orders"
        ],
        "summary": "Get a single order",
        "description": "Returns full execution details for an order owned by the authenticated user.",
        "security": [
          {
            "GatewayBearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/GatewayOnBehalfOf"
          },
          {
            "name": "id",
            "in": "path",
            "description": "Order ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Order retrieved",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderDetail"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/GatewayBadRequest"
          },
          "401": {
            "$ref": "#/components/responses/GatewayUnauthorized"
          },
          "403": {
            "$ref": "#/components/responses/GatewayForbidden"
          },
          "404": {
            "$ref": "#/components/responses/GatewayNotFound"
          },
          "500": {
            "$ref": "#/components/responses/GatewayInternalError"
          }
        }
      },
      "delete": {
        "operationId": "cancelOrder",
        "deprecated": true,
        "tags": [
          "Gateway: Orders"
        ],
        "summary": "Cancel a pending limit order (CeFi)",
        "description": "Deprecated: use `POST /orders/{id}/cancel`, the venue-polymorphic entry.\n\nAccepts a CeFi limit-order cancel and returns `202 Accepted`. Poll\n`GET /orders/{id}/status` for the terminal state (`canceled`, or `complete`\nif it filled before the cancel landed).\n",
        "security": [
          {
            "GatewayBearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/GatewayOnBehalfOf"
          },
          {
            "name": "id",
            "in": "path",
            "description": "Order ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Cancellation request accepted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/GatewayBadRequest"
          },
          "401": {
            "$ref": "#/components/responses/GatewayUnauthorized"
          },
          "403": {
            "$ref": "#/components/responses/GatewayForbidden"
          },
          "404": {
            "$ref": "#/components/responses/GatewayNotFound"
          },
          "500": {
            "$ref": "#/components/responses/GatewayInternalError"
          }
        }
      },
      "patch": {
        "operationId": "modifyOrder",
        "tags": [
          "Gateway: Orders"
        ],
        "summary": "Modify an active limit order",
        "description": "Changes the price and/or quantity of an active CeFi limit order. The change\nis asynchronous: the order's stored price and quantity update once the\nexchange confirms the modification. Only active limit orders are modifiable.\n",
        "security": [
          {
            "GatewayBearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/GatewayOnBehalfOf"
          },
          {
            "name": "id",
            "in": "path",
            "description": "Order ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ModifyOrderRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Modification request accepted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/GatewayBadRequest"
          },
          "401": {
            "$ref": "#/components/responses/GatewayUnauthorized"
          },
          "403": {
            "$ref": "#/components/responses/GatewayForbidden"
          },
          "404": {
            "$ref": "#/components/responses/GatewayNotFound"
          },
          "500": {
            "$ref": "#/components/responses/GatewayInternalError"
          },
          "503": {
            "$ref": "#/components/responses/GatewayServiceUnavailable"
          }
        }
      }
    },
    "/v1/gateway/orders/{id}/status": {
      "get": {
        "operationId": "getOrderStatus",
        "summary": "Get order status",
        "description": "Returns the current status of an order",
        "tags": [
          "Gateway: Orders"
        ],
        "security": [
          {
            "GatewayBearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/GatewayOnBehalfOf"
          },
          {
            "name": "id",
            "in": "path",
            "description": "Order ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Order status retrieved",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetOrderStatusResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/GatewayBadRequest"
          },
          "401": {
            "$ref": "#/components/responses/GatewayUnauthorized"
          },
          "403": {
            "$ref": "#/components/responses/GatewayForbidden"
          },
          "404": {
            "$ref": "#/components/responses/GatewayNotFound"
          },
          "500": {
            "$ref": "#/components/responses/GatewayInternalError"
          }
        }
      }
    },
    "/v1/gateway/transfers": {
      "post": {
        "operationId": "createTransfer",
        "summary": "Create new transfer",
        "description": "Creates a new on-chain transfer. Returns unsigned payloads for the client to sign before executing.\n\nFor CeFi transfers, `network` is required — retrieve the supported values from `GET /assets` (see the `network` field below). Omit it for DeFi transfers, which derive the network from the asset's chain.",
        "tags": [
          "Gateway: Transfers"
        ],
        "security": [
          {
            "GatewayBearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/GatewayOnBehalfOf"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTransferRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Transfer created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransferDetail"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/GatewayBadRequest"
          },
          "401": {
            "$ref": "#/components/responses/GatewayUnauthorized"
          },
          "403": {
            "$ref": "#/components/responses/GatewayForbidden"
          },
          "404": {
            "$ref": "#/components/responses/GatewayNotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "500": {
            "$ref": "#/components/responses/GatewayInternalError"
          },
          "503": {
            "$ref": "#/components/responses/GatewayServiceUnavailable"
          }
        }
      },
      "get": {
        "operationId": "listTransfers",
        "summary": "List user transfers",
        "description": "Returns a paginated list of transfers for the authenticated user",
        "tags": [
          "Gateway: Transfers"
        ],
        "security": [
          {
            "GatewayBearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/GatewayOnBehalfOf"
          },
          {
            "name": "status",
            "in": "query",
            "description": "Filter by transfer status",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/TransferStatus"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Opaque pagination cursor from the previous page's `next_cursor`",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum number of transfers to return",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Transfers retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListTransfersResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/GatewayBadRequest"
          },
          "401": {
            "$ref": "#/components/responses/GatewayUnauthorized"
          },
          "403": {
            "$ref": "#/components/responses/GatewayForbidden"
          },
          "500": {
            "$ref": "#/components/responses/GatewayInternalError"
          }
        }
      }
    },
    "/v1/gateway/transfers/{id}/execute": {
      "post": {
        "operationId": "executeTransfer",
        "summary": "Execute pending transfer",
        "description": "Executes a transfer in `awaiting_signature` status using client-provided signatures",
        "tags": [
          "Gateway: Transfers"
        ],
        "security": [
          {
            "GatewayBearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/GatewayOnBehalfOf"
          },
          {
            "name": "id",
            "in": "path",
            "description": "Transfer ID (UUID)",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExecuteTransferRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Transfer execution initiated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransferDetail"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/GatewayBadRequest"
          },
          "401": {
            "$ref": "#/components/responses/GatewayUnauthorized"
          },
          "403": {
            "$ref": "#/components/responses/GatewayForbidden"
          },
          "404": {
            "$ref": "#/components/responses/GatewayNotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "500": {
            "$ref": "#/components/responses/GatewayInternalError"
          },
          "503": {
            "$ref": "#/components/responses/GatewayServiceUnavailable"
          }
        }
      }
    },
    "/v1/gateway/transfers/{id}": {
      "get": {
        "operationId": "getTransfer",
        "summary": "Get transfer by ID",
        "description": "Returns the current state of a transfer",
        "tags": [
          "Gateway: Transfers"
        ],
        "security": [
          {
            "GatewayBearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/GatewayOnBehalfOf"
          },
          {
            "name": "id",
            "in": "path",
            "description": "Transfer ID (UUID)",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Transfer retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransferDetail"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/GatewayBadRequest"
          },
          "401": {
            "$ref": "#/components/responses/GatewayUnauthorized"
          },
          "403": {
            "$ref": "#/components/responses/GatewayForbidden"
          },
          "404": {
            "$ref": "#/components/responses/GatewayNotFound"
          },
          "500": {
            "$ref": "#/components/responses/GatewayInternalError"
          }
        }
      }
    },
    "/v1/gateway/ramps": {
      "post": {
        "operationId": "createRamp",
        "summary": "Create a ramp",
        "description": "Creates an onramp that buys crypto with fiat, or an offramp that converts the user's stablecoin balance to fiat, through the given provider. The response's `redirect_url` is the provider page the user completes the ramp on.\n\nAn offramp tops any shortfall up from the user's CeFi balance first, which requires completed KYC and enough CeFi PYUSD, and returns a `bridge_plan` when the user's own cross-chain funds must move first: sign its payloads, submit them to `POST /ramps/{id}/bridge/execute`, then call `POST /ramps/{id}/prepare`.\n\nAn onramp has nothing to sign, and is subject to provider preconditions: phone verification, accepted provider terms, an active wallet, and amount limits.",
        "tags": [
          "Gateway: Ramps"
        ],
        "security": [
          {
            "GatewayBearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/GatewayOnBehalfOf"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateRampRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Ramp created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateRampResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/GatewayBadRequest"
          },
          "401": {
            "$ref": "#/components/responses/GatewayUnauthorized"
          },
          "403": {
            "$ref": "#/components/responses/GatewayForbidden"
          },
          "404": {
            "$ref": "#/components/responses/GatewayNotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "500": {
            "$ref": "#/components/responses/GatewayInternalError"
          },
          "503": {
            "$ref": "#/components/responses/GatewayServiceUnavailable"
          }
        }
      },
      "get": {
        "operationId": "listRamps",
        "summary": "List user ramps",
        "description": "Returns a paginated list of ramps for the authenticated user, newest first",
        "tags": [
          "Gateway: Ramps"
        ],
        "security": [
          {
            "GatewayBearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/GatewayOnBehalfOf"
          },
          {
            "name": "status",
            "in": "query",
            "description": "Filter by ramp status",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/RampStatus"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Opaque pagination cursor from the previous page's `next_cursor`",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum number of ramps to return",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ramps retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListRampsResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/GatewayBadRequest"
          },
          "401": {
            "$ref": "#/components/responses/GatewayUnauthorized"
          },
          "403": {
            "$ref": "#/components/responses/GatewayForbidden"
          },
          "500": {
            "$ref": "#/components/responses/GatewayInternalError"
          }
        }
      }
    },
    "/v1/gateway/ramps/{id}": {
      "get": {
        "operationId": "getRamp",
        "summary": "Get ramp by ID",
        "description": "Returns the current state of a ramp",
        "tags": [
          "Gateway: Ramps"
        ],
        "security": [
          {
            "GatewayBearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/GatewayOnBehalfOf"
          },
          {
            "name": "id",
            "in": "path",
            "description": "Ramp ID (UUID)",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ramp retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RampDetail"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/GatewayBadRequest"
          },
          "401": {
            "$ref": "#/components/responses/GatewayUnauthorized"
          },
          "403": {
            "$ref": "#/components/responses/GatewayForbidden"
          },
          "404": {
            "$ref": "#/components/responses/GatewayNotFound"
          },
          "500": {
            "$ref": "#/components/responses/GatewayInternalError"
          }
        }
      }
    },
    "/v1/gateway/ramps/{id}/bridge/execute": {
      "post": {
        "operationId": "executeRampBridge",
        "summary": "Execute a ramp's bridge plan",
        "description": "Executes the `bridge_plan` returned by ramp creation, moving the user's own funds from other chains or stablecoins onto the settlement chain. Sign every payload in the plan and submit the signatures in the same order. Offramps only.",
        "tags": [
          "Gateway: Ramps"
        ],
        "security": [
          {
            "GatewayBearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/GatewayOnBehalfOf"
          },
          {
            "name": "id",
            "in": "path",
            "description": "Ramp ID (UUID)",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RampBridgeExecuteRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Bridge executed successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RampBridgeExecuteResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/GatewayBadRequest"
          },
          "401": {
            "$ref": "#/components/responses/GatewayUnauthorized"
          },
          "403": {
            "$ref": "#/components/responses/GatewayForbidden"
          },
          "404": {
            "$ref": "#/components/responses/GatewayNotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "500": {
            "$ref": "#/components/responses/GatewayInternalError"
          },
          "503": {
            "$ref": "#/components/responses/GatewayServiceUnavailable"
          }
        }
      }
    },
    "/v1/gateway/ramps/{id}/prepare": {
      "post": {
        "operationId": "prepareRampTransfer",
        "summary": "Prepare a ramp's on-chain transfer",
        "description": "Returns the unsigned payloads that send the user's stablecoin to the provider's deposit address. Call this once the provider page has been completed, and after the bridge plan if the create response returned one. Offramps only.",
        "tags": [
          "Gateway: Ramps"
        ],
        "security": [
          {
            "GatewayBearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/GatewayOnBehalfOf"
          },
          {
            "name": "id",
            "in": "path",
            "description": "Ramp ID (UUID)",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Transfer prepared successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RampTransferPrepareResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/GatewayBadRequest"
          },
          "401": {
            "$ref": "#/components/responses/GatewayUnauthorized"
          },
          "403": {
            "$ref": "#/components/responses/GatewayForbidden"
          },
          "404": {
            "$ref": "#/components/responses/GatewayNotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "500": {
            "$ref": "#/components/responses/GatewayInternalError"
          },
          "503": {
            "$ref": "#/components/responses/GatewayServiceUnavailable"
          }
        }
      }
    },
    "/v1/gateway/ramps/{id}/execute": {
      "post": {
        "operationId": "executeRampTransfer",
        "summary": "Execute a ramp's on-chain transfer",
        "description": "Submits the signed transfer, sending the stablecoin to the provider. Once it lands, the provider settles the fiat leg and the ramp's status follows. Offramps only.",
        "tags": [
          "Gateway: Ramps"
        ],
        "security": [
          {
            "GatewayBearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/GatewayOnBehalfOf"
          },
          {
            "name": "id",
            "in": "path",
            "description": "Ramp ID (UUID)",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RampTransferExecuteRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Transfer executed successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RampTransferExecuteResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/GatewayBadRequest"
          },
          "401": {
            "$ref": "#/components/responses/GatewayUnauthorized"
          },
          "403": {
            "$ref": "#/components/responses/GatewayForbidden"
          },
          "404": {
            "$ref": "#/components/responses/GatewayNotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "500": {
            "$ref": "#/components/responses/GatewayInternalError"
          },
          "503": {
            "$ref": "#/components/responses/GatewayServiceUnavailable"
          }
        }
      }
    },
    "/v1/gateway/custody/allocations": {
      "get": {
        "operationId": "listAllocations",
        "summary": "List allocations",
        "description": "Returns a paginated list of the caller's allocations, newest first.",
        "tags": [
          "Gateway: Custody"
        ],
        "security": [
          {
            "GatewayBearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/GatewayOnBehalfOf"
          },
          {
            "name": "status",
            "in": "query",
            "description": "Filter by allocation status",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/AllocationStatus"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Opaque pagination cursor from the previous page's `next_cursor`",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum number of allocations to return",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Allocations retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListAllocationsResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/GatewayBadRequest"
          },
          "401": {
            "$ref": "#/components/responses/GatewayUnauthorized"
          },
          "403": {
            "$ref": "#/components/responses/GatewayForbidden"
          },
          "500": {
            "$ref": "#/components/responses/GatewayInternalError"
          }
        }
      },
      "post": {
        "operationId": "createAllocation",
        "summary": "Allocate funds to CeFi",
        "description": "Allocates `amount` of the caller's DeFi wallet balance to CeFi trading. This does not move tokens; to send funds out of the wallet, use `POST /transfers`. The tokens stay in the caller's wallet, but the allocated amount can't leave it until it is released with `POST /custody/releases`. The wallet must cover everything the caller has allocated of the asset.\n\nAnswers `202` with the allocation in `crediting`. Poll `GET /custody/allocations/{id}` until it is `completed` or `rejected`.\n\nOnly one allocation per `asset_id` can be in progress at a time. Another request for the same `asset_id` answers `409`, so retrying after a lost response can't allocate twice.\n\n`asset_id` is a DeFi listing from `GET /assets` that also trades on CeFi. A CeFi listing answers `404`.",
        "tags": [
          "Gateway: Custody"
        ],
        "security": [
          {
            "GatewayBearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/GatewayOnBehalfOf"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAllocationRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Allocation accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Allocation"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/GatewayBadRequest"
          },
          "401": {
            "$ref": "#/components/responses/GatewayUnauthorized"
          },
          "403": {
            "$ref": "#/components/responses/GatewayForbidden"
          },
          "404": {
            "$ref": "#/components/responses/GatewayNotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "500": {
            "$ref": "#/components/responses/GatewayInternalError"
          },
          "503": {
            "$ref": "#/components/responses/GatewayServiceUnavailable"
          }
        }
      }
    },
    "/v1/gateway/custody/allocations/{id}": {
      "get": {
        "operationId": "getAllocation",
        "summary": "Get allocation",
        "description": "Returns the current state of an allocation.",
        "tags": [
          "Gateway: Custody"
        ],
        "security": [
          {
            "GatewayBearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/GatewayOnBehalfOf"
          },
          {
            "name": "id",
            "in": "path",
            "description": "Allocation ID (UUID)",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Allocation retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Allocation"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/GatewayBadRequest"
          },
          "401": {
            "$ref": "#/components/responses/GatewayUnauthorized"
          },
          "403": {
            "$ref": "#/components/responses/GatewayForbidden"
          },
          "404": {
            "$ref": "#/components/responses/GatewayNotFound"
          },
          "500": {
            "$ref": "#/components/responses/GatewayInternalError"
          }
        }
      }
    },
    "/v1/gateway/custody/releases": {
      "get": {
        "operationId": "listReleases",
        "summary": "List releases",
        "description": "Returns a paginated list of the caller's releases, newest first.",
        "tags": [
          "Gateway: Custody"
        ],
        "security": [
          {
            "GatewayBearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/GatewayOnBehalfOf"
          },
          {
            "name": "status",
            "in": "query",
            "description": "Filter by release status",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ReleaseStatus"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Opaque pagination cursor from the previous page's `next_cursor`",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum number of releases to return",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Releases retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListReleasesResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/GatewayBadRequest"
          },
          "401": {
            "$ref": "#/components/responses/GatewayUnauthorized"
          },
          "403": {
            "$ref": "#/components/responses/GatewayForbidden"
          },
          "500": {
            "$ref": "#/components/responses/GatewayInternalError"
          }
        }
      },
      "post": {
        "operationId": "createRelease",
        "summary": "Release funds from CeFi",
        "description": "Releases `amount` of the caller's allocated balance from CeFi trading, so it is free to leave the caller's DeFi wallet again. This does not move tokens; to send funds out of the wallet, use `POST /transfers`.\n\nAnswers `202` with the release in `debiting`. Poll `GET /custody/releases/{id}` until it is `completed` or `rejected`.\n\nOnly one release per `asset_id` can be in progress at a time. Another request for the same `asset_id` answers `409`, so retrying after a lost response can't release twice.\n\n`asset_id` is a DeFi listing from `GET /assets` that also trades on CeFi. A CeFi listing answers `404`.",
        "tags": [
          "Gateway: Custody"
        ],
        "security": [
          {
            "GatewayBearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/GatewayOnBehalfOf"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateReleaseRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Release accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Release"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/GatewayBadRequest"
          },
          "401": {
            "$ref": "#/components/responses/GatewayUnauthorized"
          },
          "403": {
            "$ref": "#/components/responses/GatewayForbidden"
          },
          "404": {
            "$ref": "#/components/responses/GatewayNotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "500": {
            "$ref": "#/components/responses/GatewayInternalError"
          },
          "503": {
            "$ref": "#/components/responses/GatewayServiceUnavailable"
          }
        }
      }
    },
    "/v1/gateway/custody/releases/{id}": {
      "get": {
        "operationId": "getRelease",
        "summary": "Get release",
        "description": "Returns the current state of a release.",
        "tags": [
          "Gateway: Custody"
        ],
        "security": [
          {
            "GatewayBearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/GatewayOnBehalfOf"
          },
          {
            "name": "id",
            "in": "path",
            "description": "Release ID (UUID)",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Release retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Release"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/GatewayBadRequest"
          },
          "401": {
            "$ref": "#/components/responses/GatewayUnauthorized"
          },
          "403": {
            "$ref": "#/components/responses/GatewayForbidden"
          },
          "404": {
            "$ref": "#/components/responses/GatewayNotFound"
          },
          "500": {
            "$ref": "#/components/responses/GatewayInternalError"
          }
        }
      }
    },
    "/v1/gateway/paper/deposits": {
      "post": {
        "operationId": "createPaperDeposit",
        "summary": "Add test funds (paper trading only)",
        "description": "**Paper-trading environments only.** This endpoint is not served in production, where it answers `404`. It exists so integrations can be exercised end to end in a sandbox without moving real money.\n\nMints `amount` of the DeFi listing `asset_id` into the caller's paper wallet. When the funds are allocated, the caller's CeFi trading account is set up if it has none and the same amount is allocated to CeFi trading through `POST /custody/allocations`, returned in `allocation`. With `allocate` unset, only a listing with a CeFi market is allocated; a DeFi-only listing stays in the wallet. `allocate: true` on a DeFi-only listing answers `400` before anything is minted. The allocation settles in the background exactly like any other; poll `GET /custody/allocations/{id}` for its outcome.\n\nIf the allocation step fails, the minted funds stay in the wallet unallocated.",
        "tags": [
          "Gateway: Paper Trading"
        ],
        "security": [
          {
            "GatewayBearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/GatewayOnBehalfOf"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaperDepositRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Test funds added, and allocated to CeFi trading when `allocation` is present",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaperDepositResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/GatewayBadRequest"
          },
          "401": {
            "$ref": "#/components/responses/GatewayUnauthorized"
          },
          "403": {
            "$ref": "#/components/responses/GatewayForbidden"
          },
          "404": {
            "$ref": "#/components/responses/GatewayNotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "500": {
            "$ref": "#/components/responses/GatewayInternalError"
          },
          "503": {
            "$ref": "#/components/responses/GatewayServiceUnavailable"
          }
        }
      }
    },
    "/v1/gateway/paper/withdrawals": {
      "post": {
        "operationId": "createPaperWithdrawal",
        "summary": "Remove test funds (paper trading only)",
        "description": "**Paper-trading environments only.** This endpoint is not served in production, where it answers `404`.\n\nSends test funds of the DeFi listing `asset_id` out of the caller's paper wallet. Only the wallet's unallocated balance can leave it, so when the wallet cannot cover the request, allocated balance is first released from CeFi trading through `POST /custody/releases`, returned in `release`, and the request waits up to 20 seconds for it to free the funds.\n\nWith `amount` omitted, the wallet is emptied: everything the caller has allocated of the listing on CeFi is released first, then the whole wallet balance leaves. With `amount` given, CeFi is released from only when the wallet's unallocated balance falls short, and by at most `amount`. The CeFi release is capped at the caller's allocation of the listing; when omitting `amount`, any CeFi balance beyond that allocation stays on CeFi and is reported in `cefi_unbacked`.\n\nWhen the release has not freed the funds within the wait, the request answers `409` with code `release_settling` and `metadata.release_id`; retry shortly. A wallet that still cannot cover the request with nothing left on CeFi answers `422` with code `insufficient_balance` or `funds_allocated`.",
        "tags": [
          "Gateway: Paper Trading"
        ],
        "security": [
          {
            "GatewayBearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/GatewayOnBehalfOf"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaperWithdrawalRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Test funds removed from the wallet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaperWithdrawalResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/GatewayBadRequest"
          },
          "401": {
            "$ref": "#/components/responses/GatewayUnauthorized"
          },
          "403": {
            "$ref": "#/components/responses/GatewayForbidden"
          },
          "404": {
            "$ref": "#/components/responses/GatewayNotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "500": {
            "$ref": "#/components/responses/GatewayInternalError"
          },
          "503": {
            "$ref": "#/components/responses/GatewayServiceUnavailable"
          }
        }
      }
    },
    "/v1/gateway/assets/availability": {
      "get": {
        "operationId": "getAssetAvailability",
        "tags": [
          "Gateway: Assets"
        ],
        "summary": "Get asset availability for the caller's country",
        "description": "Returns the product types and asset classes the caller may trade, based on the country the request originates from. Both lists are allowlists, so a product type that is absent is not available. The response varies per caller, so it is not edge-cached, and the bearer token is optional but should be sent when the caller has one.\n\nThese lists describe the venues we run. DeFi spot crypto is held on the caller's own keys and stays tradeable regardless of country, so empty lists do not mean nothing can be traded — a country that is fully restricted, or one that cannot be resolved at all, returns empty lists while DeFi spot crypto orders are still accepted.",
        "security": [
          {},
          {
            "GatewayBearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Availability retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AssetAvailability"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/GatewayInternalError"
          }
        }
      }
    },
    "/v1/gateway/assets": {
      "get": {
        "operationId": "listAssets",
        "tags": [
          "Gateway: Assets"
        ],
        "summary": "List tradeable assets",
        "description": "Returns a unified catalog of tradeable assets across DeFi and CeFi venues, listing those with `status` `active` or `sell_only`. Spot assets only by default, so perps and tokenized stocks are opt-in via `type`. Each asset's `networks` lists the rails accepted as the `network` field when creating a CeFi transfer.",
        "security": [],
        "parameters": [
          {
            "name": "venue",
            "in": "query",
            "description": "Filter by trading venue",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/Venue"
            }
          },
          {
            "name": "product_type",
            "in": "query",
            "description": "Comma-separated list of product types to include (`spot`, `perp`), case-insensitive. Defaults to `spot` when omitted, so perp assets are returned only when requested explicitly.",
            "required": false,
            "schema": {
              "type": "string",
              "default": "spot",
              "example": "spot,perp"
            }
          },
          {
            "name": "type",
            "in": "query",
            "deprecated": true,
            "description": "Deprecated alias for `product_type`, kept for shipped app builds. Ignored when `product_type` is also supplied.",
            "required": false,
            "schema": {
              "type": "string",
              "example": "spot,perp"
            }
          },
          {
            "name": "asset_class",
            "in": "query",
            "description": "Comma-separated list of asset classes to include (`crypto`, `stock`), case-insensitive. Defaults to `crypto` when omitted, so tokenized stocks are returned only when requested explicitly. Orthogonal to `product_type`: a tokenized stock is a spot or perp listing whose asset class is `stock`.",
            "required": false,
            "schema": {
              "type": "string",
              "default": "crypto",
              "example": "crypto,stock"
            }
          },
          {
            "name": "address",
            "in": "query",
            "description": "Only the listings held at this token address, on whichever chain they sit. Matches case-insensitively, so a checksummed and a lowercased EVM address find the same listing.",
            "required": false,
            "schema": {
              "type": "string",
              "example": "0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Assets retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListAssetsResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/GatewayBadRequest"
          },
          "500": {
            "$ref": "#/components/responses/GatewayInternalError"
          }
        }
      }
    },
    "/v1/gateway/assets/{chain}/{address}": {
      "get": {
        "operationId": "getAsset",
        "tags": [
          "Gateway: Assets"
        ],
        "summary": "Get one asset by chain and address",
        "description": "Returns the single catalog listing held at `address` on `chain`, in the same shape a `GET /assets` row takes. Both parameters match case-insensitively, so a checksummed and a lowercased EVM address resolve to the same listing.\n\nUnlike `GET /assets`, this lookup applies no status, venue, or asset class filter, so a listing the browse list hides for its `status` (for example `transfer_only`) is still returned here and a client holding the asset can read its real state. Deactivated listings are not returned.",
        "security": [],
        "parameters": [
          {
            "name": "chain",
            "in": "path",
            "required": true,
            "description": "Blockchain network the listing sits on, or `hypercore-perp` for a perp.",
            "schema": {
              "type": "string",
              "example": "base"
            }
          },
          {
            "name": "address",
            "in": "path",
            "required": true,
            "description": "Token contract/mint address, or the symbol for a perp listing.",
            "schema": {
              "type": "string",
              "example": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Asset retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AssetItem"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/GatewayNotFound"
          },
          "500": {
            "$ref": "#/components/responses/GatewayInternalError"
          }
        }
      }
    },
    "/v1/gateway/balances/unified": {
      "get": {
        "operationId": "listBalances",
        "tags": [
          "Gateway: Balances"
        ],
        "summary": "List balances",
        "description": "Returns unified balances across CeFi and DeFi for the authenticated user",
        "security": [
          {
            "GatewayBearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/GatewayOnBehalfOf"
          }
        ],
        "responses": {
          "200": {
            "description": "Balances retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListBalancesResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/GatewayBadRequest"
          },
          "401": {
            "$ref": "#/components/responses/GatewayUnauthorized"
          },
          "403": {
            "$ref": "#/components/responses/GatewayForbidden"
          },
          "500": {
            "$ref": "#/components/responses/GatewayInternalError"
          }
        }
      }
    },
    "/v1/gateway/balances": {
      "get": {
        "operationId": "getBalances",
        "summary": "Get user balances",
        "description": "Returns unified balances across CeFi and DeFi for the authenticated user",
        "tags": [
          "Gateway: Balances"
        ],
        "security": [
          {
            "GatewayBearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/GatewayOnBehalfOf"
          }
        ],
        "responses": {
          "200": {
            "description": "Balances retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListBalancesResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/GatewayBadRequest"
          },
          "401": {
            "$ref": "#/components/responses/GatewayUnauthorized"
          },
          "403": {
            "$ref": "#/components/responses/GatewayForbidden"
          },
          "500": {
            "$ref": "#/components/responses/GatewayInternalError"
          }
        }
      }
    },
    "/v1/gateway/positions": {
      "get": {
        "operationId": "listPositions",
        "tags": [
          "Gateway: Positions"
        ],
        "summary": "List open positions",
        "description": "Returns a read-only list of the authenticated user's open positions. Data is fetched on demand from the venue; nothing is persisted.\n",
        "security": [
          {
            "GatewayBearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/GatewayOnBehalfOf"
          }
        ],
        "responses": {
          "200": {
            "description": "Positions retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListPositionsResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/GatewayBadRequest"
          },
          "401": {
            "$ref": "#/components/responses/GatewayUnauthorized"
          },
          "403": {
            "$ref": "#/components/responses/GatewayForbidden"
          },
          "500": {
            "$ref": "#/components/responses/GatewayInternalError"
          }
        }
      }
    },
    "/v1/gateway/portfolio": {
      "get": {
        "operationId": "getPortfolio",
        "tags": [
          "Gateway: Balances"
        ],
        "summary": "Get the authenticated user's portfolio",
        "description": "Unified portfolio across CeFi and DeFi venues: valued balances, open positions, and PnL in a single call.\n\n`total_usd` is total account equity: `balances_usd` plus the margin committed to open positions, counted once. A Hyperliquid unified account's spot USDC balance already holds that margin, so none is added for it. Unrealized PnL is deliberately not added, because balances and margin are already marked to market. `balances_usd` on its own is the value of balances, which excludes collateral committed to perps except on a unified account.\n\nA balance with no live price returns `price`, `value` and `change_24h_pct` as null and is excluded from every total.\n\n`cost_basis` is present only for non-quote assets acquired on platform. Quote and stable assets omit it, and so does any quantity received by deposit or bridge. Unlike `/balances`, an upstream failure fails the request: equity depends on both venues, so a partial total would be wrong rather than merely incomplete.\n",
        "security": [
          {
            "GatewayBearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/GatewayOnBehalfOf"
          },
          {
            "name": "venue",
            "in": "query",
            "required": false,
            "description": "Restrict the portfolio to one venue (`defi`, `cefi`). Defaults to all venues when omitted.\n",
            "schema": {
              "$ref": "#/components/schemas/Venue"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The user's portfolio",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PortfolioResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/GatewayBadRequest"
          },
          "401": {
            "$ref": "#/components/responses/GatewayUnauthorized"
          },
          "403": {
            "$ref": "#/components/responses/GatewayForbidden"
          },
          "500": {
            "$ref": "#/components/responses/GatewayInternalError"
          },
          "503": {
            "$ref": "#/components/responses/GatewayServiceUnavailable"
          }
        }
      }
    },
    "/v1/gateway/transactions": {
      "get": {
        "operationId": "listTransactions",
        "summary": "List user transactions",
        "description": "Returns the caller's orders, transfers, and ramps as one paginated feed, newest first. Each row pairs a type-agnostic envelope with the full typed object named by `type`, so the per-type endpoints do not need merging client-side.\n\nCovers platform-originated activity only; inbound transfers and external deposits are not included. Open Hyperliquid orders are served live by `GET /orders` and appear here once terminal.\n\nPaginate with the previous page's `next_cursor`.\n",
        "tags": [
          "Gateway: Transactions"
        ],
        "security": [
          {
            "GatewayBearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/GatewayOnBehalfOf"
          },
          {
            "name": "type",
            "in": "query",
            "description": "Comma-separated types to include. Defaults to all.",
            "required": false,
            "schema": {
              "type": "string",
              "example": "order,transfer"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Opaque pagination cursor from the previous page's `next_cursor`",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum number of transactions to return",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Transactions retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListTransactionsResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/GatewayBadRequest"
          },
          "401": {
            "$ref": "#/components/responses/GatewayUnauthorized"
          },
          "403": {
            "$ref": "#/components/responses/GatewayForbidden"
          },
          "500": {
            "$ref": "#/components/responses/GatewayInternalError"
          },
          "503": {
            "$ref": "#/components/responses/GatewayServiceUnavailable"
          }
        }
      }
    },
    "/v1/gateway/organizations/{organization_id}/transactions": {
      "get": {
        "operationId": "listOrganizationTransactions",
        "summary": "List organization transactions",
        "description": "Orders and transfers of every user the organization serves, newest first, each row naming its user. Ramps are not included.\n\nRequires an organization token for this organization, or an admin member of it. `TM-On-Behalf-Of` is rejected.\n",
        "tags": [
          "Gateway: Transactions"
        ],
        "security": [
          {
            "GatewayBearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "organization_id",
            "in": "path",
            "required": true,
            "description": "Your organization's id: the `tm.organization_id` claim of an organization token, also shown on the console Overview. The token must be this organization's, or belong to one of its admins.\n",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "user_id",
            "in": "query",
            "description": "Comma-separated user ids, at most 100. Defaults to every user served.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "in": "query",
            "description": "Comma-separated: `order`, `transfer`. Defaults to both.",
            "required": false,
            "schema": {
              "type": "string",
              "example": "order,transfer"
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Comma-separated statuses. Defaults to all.",
            "required": false,
            "schema": {
              "type": "string",
              "example": "completed,failed"
            }
          },
          {
            "name": "from",
            "in": "query",
            "description": "Created at or after this instant.",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "description": "Created before this instant. Must be after `from`.",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Opaque pagination cursor from the previous page's `next_cursor`",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum number of transactions to return",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Transactions retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListOrganizationTransactionsResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/GatewayBadRequest"
          },
          "401": {
            "$ref": "#/components/responses/GatewayUnauthorized"
          },
          "403": {
            "$ref": "#/components/responses/GatewayForbidden"
          },
          "500": {
            "$ref": "#/components/responses/GatewayInternalError"
          },
          "503": {
            "$ref": "#/components/responses/GatewayServiceUnavailable"
          }
        }
      }
    },
    "/v1/cefi/health": {
      "get": {
        "tags": [
          "Institutional: Service"
        ],
        "summary": "Get service health",
        "description": "Returns the current readiness status for the REST API Gateway. The response includes a human-readable status indicator, the service name, and the timestamp when the status was generated.\n",
        "operationId": "getServiceHealthCefi",
        "responses": {
          "200": {
            "description": "Service is ready to handle requests.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServiceHealth"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InstitutionalBadRequest"
          },
          "503": {
            "description": "Service is degraded or unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServiceHealth"
                }
              }
            }
          }
        },
        "security": [
          {}
        ]
      },
      "servers": [
        {
          "url": "https://api.truex.co",
          "description": "Production"
        },
        {
          "url": "https://api.uat.truex.co",
          "description": "UAT (sandbox)"
        }
      ]
    },
    "/v1/cefi/versions": {
      "get": {
        "tags": [
          "Institutional: Service"
        ],
        "summary": "Get supported API versions",
        "description": "Returns a list of supported API versions with their deprecation status. Use this endpoint to discover available versions and plan migrations when versions are deprecated.\n",
        "operationId": "getApiVersionsCefi",
        "responses": {
          "200": {
            "description": "List of supported API versions.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiVersions"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InstitutionalBadRequest"
          }
        },
        "security": [
          {}
        ]
      },
      "servers": [
        {
          "url": "https://api.truex.co",
          "description": "Production"
        },
        {
          "url": "https://api.uat.truex.co",
          "description": "UAT (sandbox)"
        }
      ]
    },
    "/v1/cefi/assets": {
      "get": {
        "tags": [
          "Institutional: Assets"
        ],
        "summary": "Get assets",
        "description": "Query for assets available on the exchange by specific asset ID or name.  If no query parameters are supplied than ALL available assets will be returned.",
        "operationId": "getAssetsCefi",
        "responses": {
          "200": {
            "description": "Successful operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Asset"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InstitutionalBadRequest"
          },
          "500": {
            "$ref": "#/components/responses/InstitutionalInternalError"
          },
          "503": {
            "$ref": "#/components/responses/InstitutionalServiceUnavailable"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "description": "ID of asset to query for.",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "pattern": "^[1-9][0-9]*$"
            }
          },
          {
            "name": "name",
            "in": "query",
            "description": "Filters assets by name. Returns assets where the name is an exact match or contains the provided substring. Matching is case-sensitive.\n",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "security": [
          {}
        ]
      },
      "servers": [
        {
          "url": "https://api.truex.co",
          "description": "Production"
        },
        {
          "url": "https://api.uat.truex.co",
          "description": "UAT (sandbox)"
        }
      ]
    },
    "/v1/cefi/instruments": {
      "get": {
        "tags": [
          "Institutional: Instruments"
        ],
        "summary": "Get instruments",
        "description": "Query for instruments available on the exchange by specific instrument ID or symbol.  If no query parameters are supplied than ALL available instruments will be returned.",
        "operationId": "getInstrumentsCefi",
        "responses": {
          "200": {
            "description": "Successful operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Instrument"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InstitutionalBadRequest"
          },
          "500": {
            "$ref": "#/components/responses/InstitutionalInternalError"
          },
          "503": {
            "$ref": "#/components/responses/InstitutionalServiceUnavailable"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "description": "ID of instrument to query for.",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "pattern": "^[1-9][0-9]*$"
            }
          },
          {
            "name": "symbol",
            "in": "query",
            "description": "Filters instruments by symbol. Returns instruments where the symbol is an exact match or contains the provided substring. Matching is case-sensitive.\n",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "security": [
          {}
        ]
      },
      "servers": [
        {
          "url": "https://api.truex.co",
          "description": "Production"
        },
        {
          "url": "https://api.uat.truex.co",
          "description": "UAT (sandbox)"
        }
      ]
    },
    "/v1/cefi/market/quote": {
      "get": {
        "tags": [
          "Institutional: Market Data"
        ],
        "summary": "Get markets",
        "description": "Query for the exchange best bid/offer (EBBO) by instrument ID. If no query parameters are supplied then ALL available EBBOs will be returned.",
        "operationId": "getMarketDataCefi",
        "parameters": [
          {
            "name": "instrument_id",
            "in": "query",
            "description": "Instrument ID of the market to query for. Must be a valid non-zero numeric ID.",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "pattern": "^[1-9][0-9]*$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MarketData"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InstitutionalBadRequest"
          },
          "500": {
            "$ref": "#/components/responses/InstitutionalInternalError"
          },
          "503": {
            "$ref": "#/components/responses/InstitutionalServiceUnavailable"
          }
        },
        "security": [
          {}
        ]
      },
      "servers": [
        {
          "url": "https://api.truex.co",
          "description": "Production"
        },
        {
          "url": "https://api.uat.truex.co",
          "description": "UAT (sandbox)"
        }
      ]
    },
    "/v1/cefi/market/auction": {
      "get": {
        "tags": [
          "Institutional: Market Data"
        ],
        "summary": "Get auction state and indicative",
        "description": "Query for the opening-auction state (and, while in an opening auction, the indicative) by instrument ID. If no query parameters are supplied then the state for ALL available instruments is returned. `auction_mode` is always present; the `auction_indicative` object is included only while the instrument is in an opening auction (OPENING or LOCKED) and omitted otherwise.",
        "operationId": "getMarketAuctionCefi",
        "parameters": [
          {
            "name": "instrument_id",
            "in": "query",
            "description": "Instrument ID of the market to query for. Must be a valid non-zero numeric ID.",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "pattern": "^[1-9][0-9]*$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AuctionState"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InstitutionalBadRequest"
          },
          "500": {
            "$ref": "#/components/responses/InstitutionalInternalError"
          },
          "503": {
            "$ref": "#/components/responses/InstitutionalServiceUnavailable"
          }
        },
        "security": [
          {}
        ]
      },
      "servers": [
        {
          "url": "https://api.truex.co",
          "description": "Production"
        },
        {
          "url": "https://api.uat.truex.co",
          "description": "UAT (sandbox)"
        }
      ]
    },
    "/v1/cefi/markets/quote": {
      "post": {
        "tags": [
          "Institutional: Market Data"
        ],
        "summary": "Compute market quote",
        "description": "Calculate a quote preview for an asset using current visible order book depth. Supports both base quantity and quote (notional) quantity via the required qty_unit parameter.\nIn schema `v2024_01_01`, successful responses contain only `qty` and `price`.\nFor `qty_unit=QUOTE`, the exchange computes the largest executable base quantity that fits within the requested quote amount while respecting the instrument's base increment at the final consumed price level. As a result, in schema `v2026_01_23` the returned `notional` may be slightly less than the requested quote amount and the difference is reported in `notional_residual`.\n",
        "operationId": "postMarketsQuoteCefi",
        "requestBody": {
          "description": "Quote request parameters. qty_unit is required and has no default.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MarketsQuoteRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketsQuoteResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InstitutionalBadRequest"
          },
          "404": {
            "$ref": "#/components/responses/InstitutionalNotFound"
          },
          "500": {
            "$ref": "#/components/responses/InstitutionalInternalError"
          },
          "503": {
            "$ref": "#/components/responses/InstitutionalServiceUnavailable"
          }
        },
        "security": [
          {}
        ]
      },
      "servers": [
        {
          "url": "https://api.truex.co",
          "description": "Production"
        },
        {
          "url": "https://api.uat.truex.co",
          "description": "UAT (sandbox)"
        }
      ]
    },
    "/v1/cefi/clients": {
      "get": {
        "tags": [
          "Institutional: Clients"
        ],
        "summary": "Get clients",
        "description": "Query for a user's information.",
        "operationId": "getClientsCefi",
        "parameters": [
          {
            "$ref": "#/components/parameters/XAuthTimestamp"
          },
          {
            "$ref": "#/components/parameters/XAuthToken"
          },
          {
            "$ref": "#/components/parameters/XAuthSignature"
          },
          {
            "name": "id",
            "in": "query",
            "description": "ID of client to query for.",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "pattern": "^[1-9][0-9]*$"
            }
          },
          {
            "name": "mnemonic",
            "in": "query",
            "description": "Filters clients by mnemonic (human readable text). Returns clients where the mnemonic is an exact match or contains the provided substring. Matching is case-sensitive.\n",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Client"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InstitutionalBadRequest"
          },
          "401": {
            "$ref": "#/components/responses/InstitutionalUnauthorized"
          },
          "403": {
            "$ref": "#/components/responses/InstitutionalForbidden"
          },
          "408": {
            "$ref": "#/components/responses/Timeout"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMedia"
          },
          "500": {
            "$ref": "#/components/responses/InstitutionalInternalError"
          },
          "503": {
            "$ref": "#/components/responses/InstitutionalServiceUnavailable"
          }
        },
        "security": [
          {
            "HMAC": []
          },
          {
            "JWT": []
          }
        ]
      },
      "patch": {
        "tags": [
          "Institutional: Clients"
        ],
        "summary": "Update settings",
        "description": "Update client level settings.",
        "operationId": "patchClientsCefi",
        "parameters": [
          {
            "$ref": "#/components/parameters/XAuthUserId"
          },
          {
            "$ref": "#/components/parameters/XAuthTimestamp"
          },
          {
            "$ref": "#/components/parameters/XAuthToken"
          },
          {
            "$ref": "#/components/parameters/XAuthSignature"
          }
        ],
        "requestBody": {
          "description": "Client settings context.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClientPatch"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Client"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InstitutionalBadRequest"
          },
          "401": {
            "$ref": "#/components/responses/InstitutionalUnauthorized"
          },
          "403": {
            "$ref": "#/components/responses/InstitutionalForbidden"
          },
          "404": {
            "$ref": "#/components/responses/InstitutionalNotFound"
          },
          "408": {
            "$ref": "#/components/responses/Timeout"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMedia"
          },
          "500": {
            "$ref": "#/components/responses/InstitutionalInternalError"
          },
          "503": {
            "$ref": "#/components/responses/InstitutionalServiceUnavailable"
          }
        },
        "security": [
          {
            "HMAC": []
          },
          {
            "JWT": []
          }
        ]
      },
      "servers": [
        {
          "url": "https://api.truex.co",
          "description": "Production"
        },
        {
          "url": "https://api.uat.truex.co",
          "description": "UAT (sandbox)"
        }
      ]
    },
    "/v1/cefi/clients/fees": {
      "get": {
        "tags": [
          "Institutional: Clients"
        ],
        "summary": "Get client fees",
        "description": "Returns a client's maker and taker fee tiers and the fee rates those tiers currently resolve to. Rates are decimal fractions of trade notional (`\"0.003\"` is 0.3%). A tier with no configured fee resolves to `\"0\"`. JWT callers may omit `client_id` to read their own client; an HMAC caller without `client_id` reads the client named by `X-Truex-Auth-UserId`.\n",
        "operationId": "getClientFeesCefi",
        "parameters": [
          {
            "$ref": "#/components/parameters/XAuthUserId"
          },
          {
            "$ref": "#/components/parameters/XAuthTimestamp"
          },
          {
            "$ref": "#/components/parameters/XAuthToken"
          },
          {
            "$ref": "#/components/parameters/XAuthSignature"
          },
          {
            "name": "client_id",
            "in": "query",
            "description": "Exchange generated client ID to query fees for. Must be a client the caller may access.\n",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "pattern": "^[1-9][0-9]*$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientFees"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InstitutionalBadRequest"
          },
          "401": {
            "$ref": "#/components/responses/InstitutionalUnauthorized"
          },
          "403": {
            "$ref": "#/components/responses/InstitutionalForbidden"
          },
          "404": {
            "$ref": "#/components/responses/InstitutionalNotFound"
          },
          "408": {
            "$ref": "#/components/responses/Timeout"
          },
          "500": {
            "$ref": "#/components/responses/InstitutionalInternalError"
          },
          "503": {
            "$ref": "#/components/responses/InstitutionalServiceUnavailable"
          }
        },
        "security": [
          {
            "HMAC": []
          },
          {
            "JWT": []
          }
        ]
      },
      "servers": [
        {
          "url": "https://api.truex.co",
          "description": "Production"
        },
        {
          "url": "https://api.uat.truex.co",
          "description": "UAT (sandbox)"
        }
      ]
    },
    "/v1/cefi/orders": {
      "get": {
        "tags": [
          "Institutional: Orders"
        ],
        "summary": "Get orders",
        "description": "Fetches all orders for a client entered within the past 24 hours on the exchange. A filter can be provided to limit the results.",
        "operationId": "getOrdersPluralCefi",
        "parameters": [
          {
            "$ref": "#/components/parameters/XAuthUserId"
          },
          {
            "$ref": "#/components/parameters/XAuthTimestamp"
          },
          {
            "$ref": "#/components/parameters/XAuthToken"
          },
          {
            "$ref": "#/components/parameters/XAuthSignature"
          },
          {
            "name": "size",
            "in": "query",
            "description": "Number of records to return per page. Maximum allowed value is 100.",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 10,
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "skip",
            "in": "query",
            "description": "Number of records to skip before returning results. Used for offset-based pagination.",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 2147483647
            }
          },
          {
            "name": "timestamp",
            "in": "query",
            "description": "A Unix UTC timestamp in nanoseconds used as a reference point for fetching orders. The query will retrieve results created **before** this timestamp, enabling precise time-based filtering and ensuring stable pagination. If omitted, the server responds with **400 BAD REQUEST**.\n",
            "required": true,
            "schema": {
              "type": "string",
              "example": "1741523275598727336",
              "pattern": "^[0-9]{19}$"
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Comma-separated list of order statuses to filter by.",
            "required": false,
            "schema": {
              "type": "string"
            },
            "examples": {
              "single": {
                "summary": "Filter for active orders",
                "value": "ACTIVE"
              },
              "multiple": {
                "summary": "Filter for filled and canceled orders",
                "value": "FILLED,CANCELED"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/OrderTrade"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InstitutionalBadRequest"
          },
          "401": {
            "$ref": "#/components/responses/InstitutionalUnauthorized"
          },
          "403": {
            "$ref": "#/components/responses/InstitutionalForbidden"
          },
          "408": {
            "$ref": "#/components/responses/Timeout"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMedia"
          },
          "500": {
            "$ref": "#/components/responses/InstitutionalInternalError"
          },
          "503": {
            "$ref": "#/components/responses/InstitutionalServiceUnavailable"
          }
        },
        "security": [
          {
            "HMAC": []
          },
          {
            "JWT": []
          }
        ]
      },
      "post": {
        "tags": [
          "Institutional: Orders"
        ],
        "summary": "Create order",
        "description": "Create a new order for a specific instrument.",
        "operationId": "addOrdersCefi",
        "parameters": [
          {
            "$ref": "#/components/parameters/XAuthUserId"
          },
          {
            "$ref": "#/components/parameters/XAuthTimestamp"
          },
          {
            "$ref": "#/components/parameters/XAuthToken"
          },
          {
            "$ref": "#/components/parameters/XAuthSignature"
          }
        ],
        "requestBody": {
          "description": "Order new request context.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrderNew"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderActive"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InstitutionalBadRequest"
          },
          "401": {
            "$ref": "#/components/responses/InstitutionalUnauthorized"
          },
          "403": {
            "$ref": "#/components/responses/InstitutionalForbidden"
          },
          "408": {
            "$ref": "#/components/responses/Timeout"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMedia"
          },
          "500": {
            "$ref": "#/components/responses/InstitutionalInternalError"
          },
          "503": {
            "$ref": "#/components/responses/InstitutionalServiceUnavailable"
          }
        },
        "security": [
          {
            "HMAC": []
          },
          {
            "JWT": []
          }
        ]
      },
      "patch": {
        "tags": [
          "Institutional: Orders"
        ],
        "summary": "Modify order",
        "description": "Modify an existing active order request.",
        "operationId": "modifyOrdersCefi",
        "parameters": [
          {
            "$ref": "#/components/parameters/XAuthUserId"
          },
          {
            "$ref": "#/components/parameters/XAuthTimestamp"
          },
          {
            "$ref": "#/components/parameters/XAuthToken"
          },
          {
            "$ref": "#/components/parameters/XAuthSignature"
          }
        ],
        "requestBody": {
          "description": "Order modify request context.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrderModify"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderActive"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InstitutionalBadRequest"
          },
          "401": {
            "$ref": "#/components/responses/InstitutionalUnauthorized"
          },
          "403": {
            "$ref": "#/components/responses/InstitutionalForbidden"
          },
          "404": {
            "$ref": "#/components/responses/InstitutionalNotFound"
          },
          "408": {
            "$ref": "#/components/responses/Timeout"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMedia"
          },
          "500": {
            "$ref": "#/components/responses/InstitutionalInternalError"
          },
          "503": {
            "$ref": "#/components/responses/InstitutionalServiceUnavailable"
          }
        },
        "security": [
          {
            "HMAC": []
          },
          {
            "JWT": []
          }
        ]
      },
      "servers": [
        {
          "url": "https://api.truex.co",
          "description": "Production"
        },
        {
          "url": "https://api.uat.truex.co",
          "description": "UAT (sandbox)"
        }
      ]
    },
    "/v1/cefi/orders/{ref_id}": {
      "delete": {
        "tags": [
          "Institutional: Orders"
        ],
        "summary": "Cancel order",
        "description": "Begins the cancellation process of an existing active order from the exchange. N.B. it is still possible to receive trades on the order that is being canceled.\n",
        "operationId": "cancelOrdersCefi",
        "responses": {
          "200": {
            "description": "Successful operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderActive"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InstitutionalBadRequest"
          },
          "401": {
            "$ref": "#/components/responses/InstitutionalUnauthorized"
          },
          "403": {
            "$ref": "#/components/responses/InstitutionalForbidden"
          },
          "404": {
            "$ref": "#/components/responses/InstitutionalNotFound"
          },
          "408": {
            "$ref": "#/components/responses/Timeout"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMedia"
          },
          "500": {
            "$ref": "#/components/responses/InstitutionalInternalError"
          },
          "503": {
            "$ref": "#/components/responses/InstitutionalServiceUnavailable"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/XAuthUserId"
          },
          {
            "$ref": "#/components/parameters/XAuthTimestamp"
          },
          {
            "$ref": "#/components/parameters/XAuthToken"
          },
          {
            "$ref": "#/components/parameters/XAuthSignature"
          },
          {
            "name": "ref_id",
            "in": "path",
            "description": "ID of order to cancel. For id_type=exchange (default): positive integer. For id_type=client: 1-18 char ASCII string or 36-char UUID.",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "pattern": "^(?!^0$)[a-zA-Z0-9-]+$"
            }
          },
          {
            "name": "id_type",
            "in": "query",
            "description": "Type of ID the ref_id is, must be either 'client' or 'exchange'. If omitted will default to 'exchange'",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "client",
                "exchange"
              ]
            }
          }
        ],
        "security": [
          {
            "HMAC": []
          },
          {
            "JWT": []
          }
        ]
      },
      "servers": [
        {
          "url": "https://api.truex.co",
          "description": "Production"
        },
        {
          "url": "https://api.uat.truex.co",
          "description": "UAT (sandbox)"
        }
      ]
    },
    "/v1/cefi/orders/all": {
      "delete": {
        "tags": [
          "Institutional: Orders"
        ],
        "summary": "Cancel all orders",
        "description": "Requests cancellation of every active order belonging to the authenticated client. Processed asynchronously: the gateway dispatches a cancel per order and returns **202 Accepted** immediately, listing the orders a cancel was dispatched for in `accepted`. Per-order completion is reported on the order event stream (cancel reports), not in this response. N.B. it is still possible to receive trades on an order while it is being canceled.\n",
        "operationId": "cancelAllOrdersCefi",
        "responses": {
          "202": {
            "description": "Request accepted; cancellations are processed asynchronously.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CancelAllOrdersAccepted"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/InstitutionalUnauthorized"
          },
          "403": {
            "$ref": "#/components/responses/InstitutionalForbidden"
          },
          "500": {
            "$ref": "#/components/responses/InstitutionalInternalError"
          },
          "503": {
            "$ref": "#/components/responses/InstitutionalServiceUnavailable"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/XAuthUserId"
          },
          {
            "$ref": "#/components/parameters/XAuthTimestamp"
          },
          {
            "$ref": "#/components/parameters/XAuthToken"
          },
          {
            "$ref": "#/components/parameters/XAuthSignature"
          }
        ],
        "security": [
          {
            "HMAC": []
          },
          {
            "JWT": []
          }
        ]
      },
      "servers": [
        {
          "url": "https://api.truex.co",
          "description": "Production"
        },
        {
          "url": "https://api.uat.truex.co",
          "description": "UAT (sandbox)"
        }
      ]
    },
    "/v1/cefi/orders/active": {
      "get": {
        "tags": [
          "Institutional: Orders"
        ],
        "summary": "Active orders",
        "description": "Query for orders currently active on the exchange.",
        "operationId": "getOrdersActiveCefi",
        "responses": {
          "200": {
            "description": "Successful operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/OrderActive"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InstitutionalBadRequest"
          },
          "401": {
            "$ref": "#/components/responses/InstitutionalUnauthorized"
          },
          "403": {
            "$ref": "#/components/responses/InstitutionalForbidden"
          },
          "404": {
            "$ref": "#/components/responses/InstitutionalNotFound"
          },
          "408": {
            "$ref": "#/components/responses/Timeout"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMedia"
          },
          "500": {
            "$ref": "#/components/responses/InstitutionalInternalError"
          },
          "503": {
            "$ref": "#/components/responses/InstitutionalServiceUnavailable"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/XAuthUserId"
          },
          {
            "$ref": "#/components/parameters/XAuthTimestamp"
          },
          {
            "$ref": "#/components/parameters/XAuthToken"
          },
          {
            "$ref": "#/components/parameters/XAuthSignature"
          },
          {
            "name": "id",
            "in": "query",
            "description": "ID of order to query for.",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "pattern": "^[1-9][0-9]*$"
            }
          }
        ],
        "security": [
          {
            "HMAC": []
          },
          {
            "JWT": []
          }
        ]
      },
      "servers": [
        {
          "url": "https://api.truex.co",
          "description": "Production"
        },
        {
          "url": "https://api.uat.truex.co",
          "description": "UAT (sandbox)"
        }
      ]
    },
    "/v1/cefi/orders/trade": {
      "get": {
        "tags": [
          "Institutional: Orders"
        ],
        "summary": "All order trades",
        "description": "Fetches all trades for a client executed within the past 24 hours on the exchange.",
        "operationId": "getOrdersTradesPluralCefi",
        "parameters": [
          {
            "$ref": "#/components/parameters/XAuthUserId"
          },
          {
            "$ref": "#/components/parameters/XAuthTimestamp"
          },
          {
            "$ref": "#/components/parameters/XAuthToken"
          },
          {
            "$ref": "#/components/parameters/XAuthSignature"
          },
          {
            "name": "size",
            "in": "query",
            "description": "Number of records to return per page. Maximum allowed value is 100.",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 10,
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "skip",
            "in": "query",
            "description": "Number of records to skip before returning results.",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 2147483647
            }
          },
          {
            "name": "timestamp",
            "in": "query",
            "description": "A Unix UTC timestamp in nanoseconds used as a reference point for fetching trades.\n",
            "required": true,
            "schema": {
              "type": "string",
              "example": "1741523275598727336",
              "pattern": "^[0-9]{19}$"
            }
          },
          {
            "name": "client_id",
            "in": "query",
            "description": "Comma-separated list of client IDs to filter results. Only returns trades for the specified clients.",
            "required": false,
            "schema": {
              "type": "string",
              "example": "78901968715907076"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/OrderActivityReportTrade"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InstitutionalBadRequest"
          },
          "401": {
            "$ref": "#/components/responses/InstitutionalUnauthorized"
          },
          "403": {
            "$ref": "#/components/responses/InstitutionalForbidden"
          },
          "408": {
            "$ref": "#/components/responses/Timeout"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMedia"
          },
          "500": {
            "$ref": "#/components/responses/InstitutionalInternalError"
          },
          "503": {
            "$ref": "#/components/responses/InstitutionalServiceUnavailable"
          }
        },
        "security": [
          {
            "HMAC": []
          },
          {
            "JWT": []
          }
        ]
      },
      "servers": [
        {
          "url": "https://api.truex.co",
          "description": "Production"
        },
        {
          "url": "https://api.uat.truex.co",
          "description": "UAT (sandbox)"
        }
      ]
    },
    "/v1/cefi/orders/activity": {
      "get": {
        "tags": [
          "Institutional: Orders"
        ],
        "summary": "All order activity",
        "description": "Fetches all activity (trades, confirms, rejects, cancels, modifications) for a client's orders.",
        "operationId": "getOrdersActivityPluralCefi",
        "parameters": [
          {
            "$ref": "#/components/parameters/XAuthUserId"
          },
          {
            "$ref": "#/components/parameters/XAuthTimestamp"
          },
          {
            "$ref": "#/components/parameters/XAuthToken"
          },
          {
            "$ref": "#/components/parameters/XAuthSignature"
          },
          {
            "name": "size",
            "in": "query",
            "description": "Number of records to return per page. Maximum allowed value is 100.",
            "required": false,
            "schema": {
              "type": "string",
              "default": 10,
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "skip",
            "in": "query",
            "description": "Number of records to skip before returning results.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "timestamp",
            "in": "query",
            "description": "A Unix UTC timestamp in nanoseconds used as a reference point for fetching activity.\n",
            "required": true,
            "schema": {
              "type": "string",
              "example": "1741523275598727336",
              "pattern": "^[0-9]{19}$"
            }
          },
          {
            "name": "client_id",
            "in": "query",
            "description": "Comma-separated list of client IDs to filter results.",
            "required": false,
            "schema": {
              "type": "string",
              "example": "78901968715907076"
            }
          },
          {
            "name": "order_id",
            "in": "query",
            "description": "Comma-separated list of order IDs to filter results.",
            "required": false,
            "schema": {
              "type": "string",
              "example": "8005237327190949926"
            }
          },
          {
            "name": "msg_type",
            "in": "query",
            "description": "Comma-separated list of activity message types to filter results (e.g., REPORT_TRADE,REPORT_CONFIRM).",
            "required": false,
            "schema": {
              "type": "string",
              "example": "REPORT_TRADE"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/OrderActivity"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InstitutionalBadRequest"
          },
          "401": {
            "$ref": "#/components/responses/InstitutionalUnauthorized"
          },
          "403": {
            "$ref": "#/components/responses/InstitutionalForbidden"
          },
          "408": {
            "$ref": "#/components/responses/Timeout"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMedia"
          },
          "500": {
            "$ref": "#/components/responses/InstitutionalInternalError"
          },
          "503": {
            "$ref": "#/components/responses/InstitutionalServiceUnavailable"
          }
        },
        "security": [
          {
            "HMAC": []
          },
          {
            "JWT": []
          }
        ]
      },
      "servers": [
        {
          "url": "https://api.truex.co",
          "description": "Production"
        },
        {
          "url": "https://api.uat.truex.co",
          "description": "UAT (sandbox)"
        }
      ]
    },
    "/v1/cefi/orders/status/{ref_id}": {
      "get": {
        "tags": [
          "Institutional: Orders"
        ],
        "summary": "Status order",
        "description": "Fetches the current status of a specific order identified by `ref_id`.\n",
        "operationId": "getOrdersStatusCefi",
        "responses": {
          "200": {
            "description": "Successful operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Order"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InstitutionalBadRequest"
          },
          "401": {
            "$ref": "#/components/responses/InstitutionalUnauthorized"
          },
          "403": {
            "$ref": "#/components/responses/InstitutionalForbidden"
          },
          "404": {
            "$ref": "#/components/responses/InstitutionalNotFound"
          },
          "408": {
            "$ref": "#/components/responses/Timeout"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMedia"
          },
          "500": {
            "$ref": "#/components/responses/InstitutionalInternalError"
          },
          "503": {
            "$ref": "#/components/responses/InstitutionalServiceUnavailable"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/XAuthUserId"
          },
          {
            "$ref": "#/components/parameters/XAuthTimestamp"
          },
          {
            "$ref": "#/components/parameters/XAuthToken"
          },
          {
            "$ref": "#/components/parameters/XAuthSignature"
          },
          {
            "name": "ref_id",
            "in": "path",
            "description": "ID of order to status. For id_type=exchange (default): positive integer. For id_type=client: 1-18 char ASCII string or 36-char UUID.",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "pattern": "^(?!^0$)[a-zA-Z0-9-]+$"
            },
            "example": "123456789"
          },
          {
            "name": "id_type",
            "in": "query",
            "description": "Type of ID the ref_id is, must be either 'client' or 'exchange'. If omitted will default to 'exchange'",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "client",
                "exchange"
              ]
            }
          }
        ],
        "security": [
          {
            "HMAC": []
          },
          {
            "JWT": []
          }
        ]
      },
      "servers": [
        {
          "url": "https://api.truex.co",
          "description": "Production"
        },
        {
          "url": "https://api.uat.truex.co",
          "description": "UAT (sandbox)"
        }
      ]
    },
    "/v1/cefi/balances": {
      "get": {
        "tags": [
          "Institutional: Balances"
        ],
        "summary": "Get balance",
        "description": "Query for balance information current allocated to the exchange.",
        "operationId": "getBalancesCefi",
        "parameters": [
          {
            "$ref": "#/components/parameters/XAuthUserId"
          },
          {
            "$ref": "#/components/parameters/XAuthTimestamp"
          },
          {
            "$ref": "#/components/parameters/XAuthToken"
          },
          {
            "$ref": "#/components/parameters/XAuthSignature"
          },
          {
            "name": "asset_id",
            "in": "query",
            "description": "ID of asset to query balance information for.",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "pattern": "^[1-9][0-9]*$"
            }
          },
          {
            "name": "asset_name",
            "in": "query",
            "description": "Name of asset to query balance information for. ASCII alphanumeric only.",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "pattern": "^[a-zA-Z0-9_-]+$"
            }
          },
          {
            "name": "client_id",
            "in": "query",
            "description": "Exchange generated client ID to query balance information for.",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "pattern": "^[1-9][0-9]*$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Balances"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InstitutionalBadRequest"
          },
          "401": {
            "$ref": "#/components/responses/InstitutionalUnauthorized"
          },
          "403": {
            "$ref": "#/components/responses/InstitutionalForbidden"
          },
          "408": {
            "$ref": "#/components/responses/Timeout"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMedia"
          },
          "500": {
            "$ref": "#/components/responses/InstitutionalInternalError"
          },
          "503": {
            "$ref": "#/components/responses/InstitutionalServiceUnavailable"
          }
        },
        "security": [
          {
            "HMAC": []
          },
          {
            "JWT": []
          }
        ]
      },
      "servers": [
        {
          "url": "https://api.truex.co",
          "description": "Production"
        },
        {
          "url": "https://api.uat.truex.co",
          "description": "UAT (sandbox)"
        }
      ]
    },
    "/v1/cefi/balances/activity": {
      "get": {
        "tags": [
          "Institutional: Balances"
        ],
        "summary": "Get balance activity",
        "description": "Query balance update activity (settlements and adjustments) for a specific client and/or asset. Returns only balance update messages, ordered by timestamp.",
        "operationId": "getBalanceActivityCefi",
        "parameters": [
          {
            "$ref": "#/components/parameters/XAuthUserId"
          },
          {
            "$ref": "#/components/parameters/XAuthTimestamp"
          },
          {
            "$ref": "#/components/parameters/XAuthToken"
          },
          {
            "$ref": "#/components/parameters/XAuthSignature"
          },
          {
            "name": "client_id",
            "in": "query",
            "description": "Exchange generated client ID to filter activity for.",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "pattern": "^[1-9][0-9]*$"
            }
          },
          {
            "name": "asset_id",
            "in": "query",
            "description": "Exchange generated asset ID to filter activity for.",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "pattern": "^[1-9][0-9]*$"
            }
          },
          {
            "name": "skip",
            "in": "query",
            "description": "Number of records to skip for pagination.",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          },
          {
            "name": "size",
            "in": "query",
            "description": "Maximum number of records to return.",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/BalanceActivity"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InstitutionalBadRequest"
          },
          "401": {
            "$ref": "#/components/responses/InstitutionalUnauthorized"
          },
          "403": {
            "$ref": "#/components/responses/InstitutionalForbidden"
          },
          "408": {
            "$ref": "#/components/responses/Timeout"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMedia"
          },
          "500": {
            "$ref": "#/components/responses/InstitutionalInternalError"
          },
          "503": {
            "$ref": "#/components/responses/InstitutionalServiceUnavailable"
          }
        },
        "security": [
          {
            "HMAC": []
          },
          {
            "JWT": []
          }
        ]
      },
      "servers": [
        {
          "url": "https://api.truex.co",
          "description": "Production"
        },
        {
          "url": "https://api.uat.truex.co",
          "description": "UAT (sandbox)"
        }
      ]
    },
    "/v1/cefi/transfers": {
      "get": {
        "tags": [
          "Institutional: Transfers"
        ],
        "summary": "Get transfer",
        "description": "Fetches all transfers for a client within the past 24 hours on the exchange.",
        "operationId": "getTransfersPluralCefi",
        "parameters": [
          {
            "$ref": "#/components/parameters/XAuthUserId"
          },
          {
            "$ref": "#/components/parameters/XAuthTimestamp"
          },
          {
            "$ref": "#/components/parameters/XAuthToken"
          },
          {
            "$ref": "#/components/parameters/XAuthSignature"
          },
          {
            "name": "size",
            "in": "query",
            "description": "Number of transfers to return per page. Maximum allowed value is 100.",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 10,
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "skip",
            "in": "query",
            "description": "Number of records to skip before returning results. Used for offset-based pagination.",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 2147483647
            }
          },
          {
            "name": "timestamp",
            "in": "query",
            "description": "A Unix UTC timestamp in nanoseconds used as a reference point for fetching transfers.\n",
            "required": true,
            "schema": {
              "type": "string",
              "example": "1741523275598727336",
              "pattern": "^[0-9]{19}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response with a list of transfers.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/HistoricalTransfer"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InstitutionalBadRequest"
          },
          "401": {
            "$ref": "#/components/responses/InstitutionalUnauthorized"
          },
          "403": {
            "$ref": "#/components/responses/InstitutionalForbidden"
          },
          "408": {
            "$ref": "#/components/responses/Timeout"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMedia"
          },
          "500": {
            "$ref": "#/components/responses/InstitutionalInternalError"
          },
          "503": {
            "$ref": "#/components/responses/InstitutionalServiceUnavailable"
          }
        },
        "security": [
          {
            "HMAC": []
          },
          {
            "JWT": []
          }
        ]
      },
      "post": {
        "tags": [
          "Institutional: Transfers"
        ],
        "summary": "Initiate transfer",
        "description": "Initiate a new transfer of assets to/from the exchange.",
        "operationId": "addTransfersPluralCefi",
        "parameters": [
          {
            "$ref": "#/components/parameters/XAuthUserId"
          },
          {
            "$ref": "#/components/parameters/XAuthTimestamp"
          },
          {
            "$ref": "#/components/parameters/XAuthToken"
          },
          {
            "$ref": "#/components/parameters/XAuthSignature"
          }
        ],
        "requestBody": {
          "description": "Transfer request object.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Transfer"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransferDetails"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InstitutionalBadRequest"
          },
          "401": {
            "$ref": "#/components/responses/InstitutionalUnauthorized"
          },
          "403": {
            "$ref": "#/components/responses/InstitutionalForbidden"
          },
          "408": {
            "$ref": "#/components/responses/Timeout"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMedia"
          },
          "500": {
            "$ref": "#/components/responses/InstitutionalInternalError"
          },
          "503": {
            "$ref": "#/components/responses/InstitutionalServiceUnavailable"
          }
        },
        "security": [
          {
            "HMAC": []
          },
          {
            "JWT": []
          }
        ]
      },
      "servers": [
        {
          "url": "https://api.truex.co",
          "description": "Production"
        },
        {
          "url": "https://api.uat.truex.co",
          "description": "UAT (sandbox)"
        }
      ]
    },
    "/v1/cefi/transfers/active": {
      "get": {
        "tags": [
          "Institutional: Transfers"
        ],
        "summary": "Get Active transfers",
        "description": "Fetches all currently active transfers on the exchange.",
        "operationId": "getActiveTransfersPluralCefi",
        "parameters": [
          {
            "$ref": "#/components/parameters/XAuthUserId"
          },
          {
            "$ref": "#/components/parameters/XAuthTimestamp"
          },
          {
            "$ref": "#/components/parameters/XAuthToken"
          },
          {
            "$ref": "#/components/parameters/XAuthSignature"
          },
          {
            "name": "transfer_id",
            "in": "query",
            "description": "Unique identifier of a specific transfer. If omitted, all active transfers for the client will be returned.",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "pattern": "^[1-9][0-9]*$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response with active transfers.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TransferDetails"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InstitutionalBadRequest"
          },
          "401": {
            "$ref": "#/components/responses/InstitutionalUnauthorized"
          },
          "403": {
            "$ref": "#/components/responses/InstitutionalForbidden"
          },
          "404": {
            "$ref": "#/components/responses/InstitutionalNotFound"
          },
          "408": {
            "$ref": "#/components/responses/Timeout"
          },
          "415": {
            "$ref": "#/components/responses/UnsupportedMedia"
          },
          "500": {
            "$ref": "#/components/responses/InstitutionalInternalError"
          },
          "503": {
            "$ref": "#/components/responses/InstitutionalServiceUnavailable"
          }
        },
        "security": [
          {
            "HMAC": []
          },
          {
            "JWT": []
          }
        ]
      },
      "servers": [
        {
          "url": "https://api.truex.co",
          "description": "Production"
        },
        {
          "url": "https://api.uat.truex.co",
          "description": "UAT (sandbox)"
        }
      ]
    },
    "/v1/defi/market/prices": {
      "get": {
        "summary": "Get price candles by symbol",
        "operationId": "getPrices",
        "tags": [
          "Market data: Prices"
        ],
        "description": "Returns the latest price candles (open/high/low/close) for an asset across\nmultiple standard intervals (1h, 4h, 24h). Useful for rendering at-a-glance\nprice summaries.\n",
        "security": [],
        "parameters": [
          {
            "name": "symbol",
            "in": "query",
            "description": "Asset symbol to fetch candles for (e.g. `SOL`, `BTC`).",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "asset_class",
            "in": "query",
            "description": "Asset class to resolve the symbol in. Defaults to `spot`; if the\nsymbol has no spot listing at all, falls back to `perp`.\n",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "spot",
                "perp"
              ],
              "default": "spot"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Price candle data for the requested symbol",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PriceResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - symbol parameter is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketDataError"
                }
              }
            }
          },
          "404": {
            "description": "Symbol not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketDataError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/defi/market/prices/history": {
      "get": {
        "summary": "Get price history for a symbol",
        "operationId": "getPriceHistory",
        "tags": [
          "Market data: Prices"
        ],
        "description": "Returns historical price points for an asset over a configurable lookback\nwindow, sampled at a configurable resolution. Use for charting and\ntime-series analysis.\n\nSee the [Time Window & Resolution](#section/Time-Window-and-Resolution)\nsection for the format of `window` and `resolution`.\n",
        "security": [],
        "parameters": [
          {
            "name": "asset_id",
            "in": "query",
            "description": "Backend asset ID. Mutually exclusive with `symbol`: exactly one of\nthe two is required, and naming both is a 400.\n",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "symbol",
            "in": "query",
            "description": "Asset symbol to fetch history for (e.g. `SOL`, `BTC`).",
            "required": false,
            "deprecated": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "window",
            "in": "query",
            "description": "Lookback period (e.g. `1h`, `4h`, `1d`, `7d`, `1M`).",
            "required": false,
            "schema": {
              "type": "string",
              "default": "1h"
            }
          },
          {
            "name": "as_of",
            "in": "query",
            "description": "Ends the window at this instant instead of now, so a past period can be read. RFC3339, and must not be in the future or the zero time. Absent reads live data.",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "example": "2026-01-02T03:04:05Z"
            }
          },
          {
            "name": "resolution",
            "in": "query",
            "description": "Gap between consecutive data points (e.g. `5s`, `1m`, `5m`, `1h`).",
            "required": false,
            "schema": {
              "type": "string",
              "default": "5s"
            }
          },
          {
            "name": "asset_class",
            "in": "query",
            "description": "Asset class to resolve the symbol in. Defaults to `spot`.",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "spot",
                "perp"
              ],
              "default": "spot"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Price history data for the requested symbol",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PriceHistoryResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - invalid parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketDataError"
                }
              }
            }
          },
          "404": {
            "description": "Symbol not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketDataError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketDataError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/defi/market/prices/history/point": {
      "get": {
        "summary": "Get price at a point in time",
        "operationId": "getPriceAtTime",
        "tags": [
          "Market data: Prices"
        ],
        "description": "Returns the last known price for an asset at or before the given timestamp.\nUse this to value a position, settle a trade, or anchor a calculation to a\nspecific moment in time.\n",
        "security": [],
        "parameters": [
          {
            "name": "asset_id",
            "in": "query",
            "description": "Backend asset ID. Mutually exclusive with `symbol`: exactly one of\nthe two is required, and naming both is a 400.\n",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "symbol",
            "in": "query",
            "description": "Asset symbol to look up (e.g. `SOL`, `BTC`).",
            "required": false,
            "deprecated": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "timestamp",
            "in": "query",
            "description": "Unix timestamp in seconds. The response returns the most recent price at or before this moment.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "asset_class",
            "in": "query",
            "description": "Asset class to resolve the symbol in. Defaults to `spot`.",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "spot",
                "perp"
              ],
              "default": "spot"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Price at the requested point in time",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PricePointResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - invalid parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketDataError"
                }
              }
            }
          },
          "404": {
            "description": "No price data found for the given symbol and timestamp",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketDataError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketDataError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/defi/market/prices/history/batch": {
      "get": {
        "summary": "Get price history for multiple symbols",
        "operationId": "getPriceHistoryBatch",
        "tags": [
          "Market data: Prices"
        ],
        "description": "Returns price history for multiple symbols in a single request. Each symbol\nis resolved independently — an unknown or failing symbol returns a per-symbol\nerror in its result entry instead of failing the whole batch, so partial\nresults are still returned.\n\nSee the [Time Window & Resolution](#section/Time-Window-and-Resolution)\nsection for the format of `window` and `resolution`.\n",
        "security": [],
        "parameters": [
          {
            "name": "asset_ids",
            "in": "query",
            "description": "Comma-separated list of backend asset IDs. Mutually exclusive with\n`symbols`: exactly one of the two is required, and naming both is a\n400.\n",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "symbols",
            "in": "query",
            "description": "Comma-separated list of asset symbols (e.g. `SOL,BTC,ETH`).",
            "required": false,
            "deprecated": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "window",
            "in": "query",
            "description": "Lookback period (e.g. `1h`, `4h`, `1d`, `7d`, `1M`).",
            "required": false,
            "schema": {
              "type": "string",
              "default": "1h"
            }
          },
          {
            "name": "resolution",
            "in": "query",
            "description": "Gap between consecutive data points (e.g. `5s`, `1m`, `5m`, `1h`).",
            "required": false,
            "schema": {
              "type": "string",
              "default": "5s"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Batch price history data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BatchPriceHistoryResponse"
                },
                "example": {
                  "window": "1h",
                  "resolution": "5s",
                  "results": [
                    {
                      "symbol": "SOL",
                      "points": [
                        {
                          "t": "2025-01-20T12:00:00Z",
                          "price": "100.50"
                        },
                        {
                          "t": "2025-01-20T12:00:05Z",
                          "price": "101.00"
                        }
                      ]
                    },
                    {
                      "symbol": "BTC",
                      "points": [
                        {
                          "t": "2025-01-20T12:00:00Z",
                          "price": "42000.00"
                        }
                      ]
                    },
                    {
                      "symbol": "UNKNOWN",
                      "error": "unknown symbol"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request - invalid parameters or missing symbols",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketDataError"
                },
                "examples": {
                  "missing_symbols": {
                    "summary": "No symbols provided",
                    "value": {
                      "type": "invalid_argument",
                      "message": "symbols required",
                      "request_id": "01JX2K7WQ4Z8N3RTMV9CE5A0BF"
                    }
                  },
                  "invalid_window": {
                    "summary": "Invalid window parameter",
                    "value": {
                      "type": "invalid_argument",
                      "message": "invalid window parameter",
                      "request_id": "01JX2K7WQ4Z8N3RTMV9CE5A0BF"
                    }
                  },
                  "invalid_resolution": {
                    "summary": "Invalid resolution parameter",
                    "value": {
                      "type": "invalid_argument",
                      "message": "invalid resolution parameter",
                      "request_id": "01JX2K7WQ4Z8N3RTMV9CE5A0BF"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketDataError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/defi/market/prices/indicators": {
      "get": {
        "operationId": "getPriceIndicators",
        "security": [],
        "tags": [
          "Market data: Prices"
        ],
        "summary": "Get a technical indicator series",
        "description": "Returns one or more technical indicator lines computed from the asset's\nclose prices.\n\nThe requested `window` is widened internally by the indicator's warm-up\ndepth and trimmed back before responding, so the first returned point is\nalready converged rather than carrying seed bias. The window is measured\nback from the most recent available point, so a feed lagging behind the\ncurrent time still returns a full window.\n\n`lines` is keyed by line name. Single-line indicators (`sma`, `ema`,\n`rsi`, `atr`) return one entry named after the indicator. `macd`\nreturns `macd`, `signal` and `histogram`; `bollinger` returns `upper`,\n`middle`, `lower` and `percent_b`.\n\n`atr` reads OHLC candles rather than closes, so it is only available\nfor assets whose price source stores individual ticks; anything else\nreturns `400`. It is Wilder-smoothed and defaults to a period of 14.\n\nThe momentum measures cover fixed spans rather than a caller-supplied\n`period`, which is rejected for them. `surging_1h`, `surging_4h` and\n`surging_24h` are the percent price change over that span, so the\n`resolution` must be coarse enough for the span to fit in 400 buckets —\nthe same bound a supplied `period` carries.\n`trending_ratio` is average reported 24h volume over the last 6 hours\ndivided by its 30-day average, so it needs a CoinGecko-mapped asset and\na `resolution` of at least `1h`.\n\nVWAP is not offered: it needs per-bucket traded volume, which no price\nseries carries.\n",
        "parameters": [
          {
            "name": "asset_id",
            "in": "query",
            "description": "Backend asset ID. Mutually exclusive with `symbol`: exactly one of\nthe two is required, and naming both is a 400.\n",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "symbol",
            "in": "query",
            "required": false,
            "deprecated": true,
            "description": "Asset symbol (e.g. SOL, BTC)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "indicator",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "sma",
                "ema",
                "rsi",
                "macd",
                "bollinger",
                "atr",
                "surging_1h",
                "surging_4h",
                "surging_24h",
                "trending_ratio"
              ]
            }
          },
          {
            "name": "window",
            "in": "query",
            "description": "Time window for the series (e.g. 1d, 7d, 1M)",
            "schema": {
              "type": "string",
              "default": "1h"
            }
          },
          {
            "name": "resolution",
            "in": "query",
            "description": "Candle size the period counts in (e.g. 1m, 1h, 1d)",
            "schema": {
              "type": "string",
              "default": "1m"
            }
          },
          {
            "name": "period",
            "in": "query",
            "description": "Lookback in candles. Required for sma, ema and rsi; defaults to 20\nfor bollinger and 14 for atr, and is not used by macd. Rejected\nfor the momentum measures, which cover a fixed span.\n",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 400
            }
          },
          {
            "name": "fast_period",
            "in": "query",
            "description": "MACD fast EMA length. Defaults to 12.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 400
            }
          },
          {
            "name": "slow_period",
            "in": "query",
            "description": "MACD slow EMA length. Defaults to 26; must exceed fast_period.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 400
            }
          },
          {
            "name": "signal_period",
            "in": "query",
            "description": "MACD signal EMA length. Defaults to 9.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 400
            }
          },
          {
            "name": "std_dev",
            "in": "query",
            "description": "Bollinger band width in standard deviations. Defaults to 2.",
            "schema": {
              "type": "number",
              "minimum": 0
            }
          },
          {
            "name": "asset_class",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Indicator lines",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IndicatorHistoryResponse"
                }
              }
            }
          },
          "400": {
            "description": "Unknown indicator, or a parameter out of range",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketDataError"
                }
              }
            }
          },
          "404": {
            "description": "Not enough price history to compute the indicator",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketDataError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketDataError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/defi/market/prices/range": {
      "get": {
        "summary": "Get min/max price over a window",
        "operationId": "getPriceRange",
        "tags": [
          "Market data: Prices"
        ],
        "description": "Returns the minimum and maximum price observed for an asset within a\nconfigurable lookback window, along with the timestamps at which each\nextreme occurred. Useful for surfacing 24h highs/lows or computing\nperiod-over-period statistics.\n\nSee the [Time Window & Resolution](#section/Time-Window-and-Resolution)\nsection for the format of `window`.\n",
        "security": [],
        "parameters": [
          {
            "name": "asset_id",
            "in": "query",
            "description": "Backend asset ID. Mutually exclusive with `symbol`: exactly one of\nthe two is required, and naming both is a 400.\n",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "symbol",
            "in": "query",
            "description": "Asset symbol to fetch the range for (e.g. `SOL`, `BTC`).",
            "required": false,
            "deprecated": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "window",
            "in": "query",
            "description": "Lookback period (e.g. `1h`, `4h`, `1d`, `7d`, `1M`).",
            "required": false,
            "schema": {
              "type": "string",
              "default": "1h"
            }
          },
          {
            "name": "asset_class",
            "in": "query",
            "description": "Asset class to resolve the symbol in. Defaults to `spot`.",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "spot",
                "perp"
              ],
              "default": "spot"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Price range data for the requested symbol",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PriceRangeResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - invalid parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketDataError"
                }
              }
            }
          },
          "404": {
            "description": "Symbol not found or no price data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketDataError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketDataError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/defi/market/prices/candles": {
      "get": {
        "summary": "Get OHLC candles for a symbol",
        "operationId": "getCandles",
        "tags": [
          "Market data: Prices"
        ],
        "description": "Returns open/high/low/close buckets for an asset over a configurable\nlookback window, sampled at a configurable resolution. Use for\ncandlestick charts and volatility measures that need the intra-bucket\nrange rather than a single close.\n\nOnly sources that store individual ticks can produce OHLC. Requesting\ncandles for an asset priced from a derived or snapshot source returns\n`400`.\n\nSee the [Time Window & Resolution](#section/Time-Window-and-Resolution)\nsection for the format of `window` and `resolution`.\n",
        "security": [],
        "parameters": [
          {
            "name": "asset_id",
            "in": "query",
            "description": "Backend asset ID. Mutually exclusive with `symbol`: exactly one of\nthe two is required, and naming both is a 400.\n",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "symbol",
            "in": "query",
            "description": "Asset symbol to fetch candles for (e.g. `SOL`, `BTC`).",
            "required": false,
            "deprecated": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "window",
            "in": "query",
            "description": "Lookback period (e.g. `1h`, `4h`, `1d`, `7d`, `1M`).",
            "required": false,
            "schema": {
              "type": "string",
              "default": "1h"
            }
          },
          {
            "name": "as_of",
            "in": "query",
            "description": "Ends the window at this instant instead of now, so a past period can be read. RFC3339, and must not be in the future or the zero time. Absent reads live data.",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "example": "2026-01-02T03:04:05Z"
            }
          },
          {
            "name": "resolution",
            "in": "query",
            "description": "Candle size (e.g. `1m`, `5m`, `1h`).",
            "required": false,
            "schema": {
              "type": "string",
              "default": "5s"
            }
          },
          {
            "name": "asset_class",
            "in": "query",
            "description": "Asset class to resolve the symbol in. Defaults to `spot`.",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "spot",
                "perp"
              ],
              "default": "spot"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Candle series for the requested symbol",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CandleHistoryResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - invalid parameters, or candles unavailable for the asset's price source",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketDataError"
                }
              }
            }
          },
          "404": {
            "description": "Symbol not found or no price data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketDataError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketDataError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/defi/market/market-data/market-cap": {
      "get": {
        "summary": "Get market cap by symbol",
        "operationId": "getMarketCap",
        "tags": [
          "Market data: Market Cap"
        ],
        "description": "Returns the latest market capitalization (in USD) for an asset.",
        "security": [],
        "parameters": [
          {
            "name": "symbol",
            "in": "query",
            "description": "Asset symbol to fetch the market cap for (e.g. `BTC`, `ETH`, `SOL`).",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Market cap data for the requested symbol",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketCapResponse"
                },
                "example": {
                  "symbol": "BTC",
                  "market_cap": "1234567890000"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - symbol parameter is required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketDataError"
                }
              }
            }
          },
          "404": {
            "description": "No market cap data found for the symbol",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketDataError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketDataError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/defi/market/market-data/market-caps": {
      "get": {
        "summary": "List top assets by market cap",
        "operationId": "listMarketCaps",
        "tags": [
          "Market data: Market Cap"
        ],
        "description": "Returns the top assets ranked by market capitalization, in descending order. Use `limit` to control how many entries are returned.",
        "security": [],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum number of assets to return. Defaults to `10`; maximum is `50`.",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of assets with market cap data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketCapListResponse"
                },
                "example": {
                  "assets": [
                    {
                      "symbol": "BTC",
                      "market_cap": "1234567890000"
                    },
                    {
                      "symbol": "ETH",
                      "market_cap": "500000000000"
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketDataError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/defi/market/market-data/perp/history": {
      "get": {
        "summary": "Get perp funding rate and open interest history",
        "operationId": "getPerpMarketHistory",
        "tags": [
          "Market data: Market Feed"
        ],
        "description": "Returns a perpetual future's funding rate and open interest over a\nconfigurable lookback window, sampled at a configurable resolution.\nBoth series come from the same venue snapshot row, so a caller reading\nthem together never compares values sampled at different times.\n\n`funding_rate` is the venue's hourly rate as a decimal fraction, so\n`0.0000125` is 0.00125% per hour. `open_interest` is a coin count of the\nbase asset (`35984.2` for BTC), not a USD notional.\n\nSee the [Time Window & Resolution](#section/Time-Window-and-Resolution)\nsection for the format of `window` and `resolution`.\n",
        "security": [],
        "parameters": [
          {
            "name": "asset_id",
            "in": "query",
            "description": "Backend asset ID. Mutually exclusive with `symbol`: exactly one of\nthe two is required, and naming both is a 400.\n",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "symbol",
            "in": "query",
            "description": "Perp symbol to fetch the snapshot series for (e.g. `BTC`).",
            "required": false,
            "deprecated": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "window",
            "in": "query",
            "description": "Lookback period (e.g. `1h`, `4h`, `1d`, `7d`, `1M`).",
            "required": false,
            "schema": {
              "type": "string",
              "default": "1h"
            }
          },
          {
            "name": "resolution",
            "in": "query",
            "description": "Bucket size (e.g. `5m`, `1h`, `1d`). Must be at least `1h` for windows over `1d`.",
            "required": false,
            "schema": {
              "type": "string",
              "default": "5s"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Funding rate and open interest series for the requested perp",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PerpMarketHistoryResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - invalid parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketDataError"
                }
              }
            }
          },
          "404": {
            "description": "Unknown perp, or no snapshot in the window",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketDataError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketDataError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/defi/market/market-data/volume/history": {
      "get": {
        "summary": "Get reported 24h volume history",
        "operationId": "getVolumeHistory",
        "tags": [
          "Market data: Market Feed"
        ],
        "description": "Returns an asset's reported 24h volume in USD over a configurable\nlookback window, sampled at a configurable resolution.\n\nEach point is the rolling 24h figure the data provider reported at that\ntimestamp, not the volume traded inside the bucket. Two adjacent points\ntherefore overlap by almost a full day.\n\nSee the [Time Window & Resolution](#section/Time-Window-and-Resolution)\nsection for the format of `window` and `resolution`.\n",
        "security": [],
        "parameters": [
          {
            "name": "asset_id",
            "in": "query",
            "description": "Backend asset ID. Mutually exclusive with `symbol`: exactly one of\nthe two is required, and naming both is a 400.\n",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "symbol",
            "in": "query",
            "description": "Asset symbol to fetch reported volume for (e.g. `SOL`, `BTC`).",
            "required": false,
            "deprecated": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "window",
            "in": "query",
            "description": "Lookback period (e.g. `1h`, `4h`, `1d`, `7d`, `1M`).",
            "required": false,
            "schema": {
              "type": "string",
              "default": "1h"
            }
          },
          {
            "name": "resolution",
            "in": "query",
            "description": "Bucket size (e.g. `5m`, `1h`, `1d`). Must be at least `1h` for windows over `1d`.",
            "required": false,
            "schema": {
              "type": "string",
              "default": "5s"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Reported 24h volume series for the requested asset",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VolumeHistoryResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - invalid parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketDataError"
                }
              }
            }
          },
          "404": {
            "description": "Unknown asset, no reported-volume source, or no data in the window",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketDataError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketDataError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/defi/market/market-data/scans/history": {
      "get": {
        "summary": "Get a market ranking at every bucket of a window",
        "operationId": "getScanHistory",
        "tags": [
          "Market data: Market Feed"
        ],
        "description": "Returns the ranking a scanner or a universe rotation is built on, taken\nat every bucket across a lookback window rather than only at now.\n\nEvery span a ranking measures is read backwards from its own bucket, so\nno bucket reflects a figure the market had not reported yet. Ranking a\nmonth of hourly buckets over the whole tracked universe would be\nhundreds of thousands of rows, so each bucket carries only its top\n`per_bucket` assets, ordered best first on the requested `source`.\nAssets without a symbol or without a spot price source are dropped, the\nsame way the live feeds drop them.\n\n`value` is the figure the source ranks on: a trending ratio, a recent\nvolume in USD, or a signed price change percentage. Ranking is on that\nsigned figure, so `sort=desc` on a `surging_*` source is the gainers and\n`sort=asc` is the fallers.\n\nSee the [Time Window & Resolution](#section/Time-Window-and-Resolution)\nsection for the format of `window` and `resolution`.\n",
        "security": [],
        "parameters": [
          {
            "name": "source",
            "in": "query",
            "description": "Which ranking to take.",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "trending_ratio",
                "volume",
                "surging_1h",
                "surging_4h",
                "surging_24h"
              ]
            }
          },
          {
            "name": "sort",
            "in": "query",
            "description": "Which end of the ranking each bucket keeps. Buckets are capped before they are served, so this must match the sort the caller will rank by: a \"biggest dippers\" scanner asking for `desc` would be handed the gainers it was never going to buy.",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "desc",
                "asc"
              ],
              "default": "desc"
            }
          },
          {
            "name": "window",
            "in": "query",
            "description": "Lookback period (e.g. `1h`, `4h`, `1d`, `7d`, `1M`).",
            "required": false,
            "schema": {
              "type": "string",
              "default": "1h"
            }
          },
          {
            "name": "resolution",
            "in": "query",
            "description": "Bucket size (e.g. `5m`, `1h`, `1d`). Must be at least `1h` for windows over `1d`.",
            "required": false,
            "schema": {
              "type": "string",
              "default": "5s"
            }
          },
          {
            "name": "per_bucket",
            "in": "query",
            "description": "How many assets each bucket carries, capped at 200.",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The ranking at each bucket of the window",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScanHistoryResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - unknown source or invalid parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketDataError"
                }
              }
            }
          },
          "404": {
            "description": "No ranking data in the window",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketDataError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketDataError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/defi/market/market-data/market-cap/history": {
      "get": {
        "summary": "Get reported market-cap history",
        "operationId": "getMarketCapHistory",
        "tags": [
          "Market data: Market Cap"
        ],
        "description": "Returns an asset's reported market capitalisation in USD over a\nconfigurable lookback window, sampled at a configurable resolution.\n\nEach point is the figure the data provider reported at that timestamp.\nThe snapshot is written on the provider's ingest cadence, which is\ncoarser than a minute, so a `resolution` of at least `1h` is what the\nseries can actually fill. Buckets with no snapshot behind them are\nabsent rather than zero.\n\nSee the [Time Window & Resolution](#section/Time-Window-and-Resolution)\nsection for the format of `window` and `resolution`.\n",
        "security": [],
        "parameters": [
          {
            "name": "symbol",
            "in": "query",
            "description": "Asset symbol to fetch market cap for (e.g. `SOL`, `BTC`).",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "window",
            "in": "query",
            "description": "Lookback period (e.g. `1h`, `4h`, `1d`, `7d`, `1M`).",
            "required": false,
            "schema": {
              "type": "string",
              "default": "1h"
            }
          },
          {
            "name": "resolution",
            "in": "query",
            "description": "Bucket size (e.g. `5m`, `1h`, `1d`). Must be at least `1h` for windows over `1d`.",
            "required": false,
            "schema": {
              "type": "string",
              "default": "5s"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Reported market-cap series for the requested asset",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketCapHistoryResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - invalid parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketDataError"
                }
              }
            }
          },
          "404": {
            "description": "Unknown symbol, or no market-cap data in the window",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketDataError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketDataError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/defi/market/market-data/trending": {
      "get": {
        "summary": "List trending assets",
        "operationId": "listTrendingAssets",
        "tags": [
          "Market data: Market Feed"
        ],
        "description": "Assets ranked by trending ratio, the recent traded volume measured against its historical baseline.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/FeedLimit"
          },
          {
            "$ref": "#/components/parameters/FeedSort"
          }
        ],
        "responses": {
          "200": {
            "description": "Trending assets, ranked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrendingResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/defi/market/market-data/surging": {
      "get": {
        "summary": "List surging assets",
        "operationId": "listSurgingAssets",
        "tags": [
          "Market data: Market Feed"
        ],
        "description": "Assets ranked by the size of their 1-hour price move, in either direction.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/FeedLimit"
          },
          {
            "$ref": "#/components/parameters/FeedSort"
          }
        ],
        "responses": {
          "200": {
            "description": "Surging assets, ranked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SurgingResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/defi/market/stream/bbo": {
      "get": {
        "summary": "Stream BBO quotes",
        "operationId": "streamBboQuotes",
        "tags": [
          "Market data: Streams"
        ],
        "description": "Server-sent stream of best bid and offer quotes as each source publishes them, one `bbo` event per update and a comment frame between updates to keep the connection open.",
        "security": [],
        "responses": {
          "200": {
            "description": "The quote stream. Held open until the client disconnects.",
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "The per-IP or global concurrent stream limit is already reached.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketDataError"
                }
              }
            }
          },
          "500": {
            "description": "The connection cannot be streamed over.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketDataError"
                }
              }
            }
          },
          "503": {
            "description": "The quote source is unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketDataError"
                }
              }
            }
          }
        }
      },
      "head": {
        "summary": "Probe the BBO stream",
        "operationId": "probeBboStream",
        "tags": [
          "Market data: Streams"
        ],
        "description": "Returns the stream's headers with no body, without opening a subscription or counting against the connection limits.",
        "security": [],
        "responses": {
          "200": {
            "description": "The stream is reachable."
          }
        }
      }
    },
    "/v1/assets/prices/history": {
      "get": {
        "summary": "Get price history for an asset",
        "operationId": "getAssetPriceHistory",
        "tags": [
          "Market data: Prices"
        ],
        "description": "Returns historical price points for an asset over a configurable lookback\nwindow, sampled at a configurable resolution.\n\nThe same series as `/v1/defi/market/prices/history`, mounted under the\nasset-oriented path. This mount stores no individual ticks, so candle\nendpoints and candle-input indicators are unavailable here.\n\nSee the [Time Window & Resolution](#section/Time-Window-and-Resolution)\nsection for the format of `window` and `resolution`.\n",
        "security": [],
        "parameters": [
          {
            "name": "asset_id",
            "in": "query",
            "description": "Backend asset ID. Mutually exclusive with `symbol`: exactly one of\nthe two is required, and naming both is a 400.\n",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "symbol",
            "in": "query",
            "description": "Asset symbol (e.g. `SOL`, `BTC`).",
            "required": false,
            "deprecated": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "window",
            "in": "query",
            "description": "Lookback period (e.g. `1h`, `4h`, `1d`, `7d`, `1M`).",
            "required": false,
            "schema": {
              "type": "string",
              "default": "1h"
            }
          },
          {
            "name": "as_of",
            "in": "query",
            "description": "Ends the window at this instant instead of now, so a past period can be read. RFC3339, and must not be in the future or the zero time. Absent reads live data.",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "example": "2026-01-02T03:04:05Z"
            }
          },
          {
            "name": "resolution",
            "in": "query",
            "description": "Gap between consecutive data points (e.g. `5s`, `1m`, `5m`, `1h`).",
            "required": false,
            "schema": {
              "type": "string",
              "default": "5s"
            }
          },
          {
            "name": "asset_class",
            "in": "query",
            "description": "Asset class to resolve the asset in. Defaults to `spot`.",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "spot",
                "perp"
              ],
              "default": "spot"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Price history data for the requested asset",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PriceHistoryResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - invalid parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketDataError"
                }
              }
            }
          },
          "404": {
            "description": "Asset not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketDataError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketDataError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/assets/prices/range": {
      "get": {
        "summary": "Get the min and max price for an asset",
        "operationId": "getAssetPriceRange",
        "tags": [
          "Market data: Prices"
        ],
        "description": "Returns the lowest and highest price an asset traded at within the\nwindow, each with the timestamp it occurred.\n\nSee the [Time Window & Resolution](#section/Time-Window-and-Resolution)\nsection for the format of `window`.\n",
        "security": [],
        "parameters": [
          {
            "name": "asset_id",
            "in": "query",
            "description": "Backend asset ID. Mutually exclusive with `symbol`: exactly one of\nthe two is required, and naming both is a 400.\n",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "symbol",
            "in": "query",
            "description": "Asset symbol (e.g. `SOL`, `BTC`).",
            "required": false,
            "deprecated": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "window",
            "in": "query",
            "description": "Lookback period (e.g. `1h`, `4h`, `1d`, `7d`, `1M`).",
            "required": false,
            "schema": {
              "type": "string",
              "default": "1h"
            }
          },
          {
            "name": "asset_class",
            "in": "query",
            "description": "Asset class to resolve the asset in. Defaults to `spot`.",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "spot",
                "perp"
              ],
              "default": "spot"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Price range data for the requested asset",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PriceRangeResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - invalid parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketDataError"
                }
              }
            }
          },
          "404": {
            "description": "Asset not found, or no price data in the window",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketDataError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketDataError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/assets/prices/indicators": {
      "get": {
        "summary": "Get technical indicator lines for an asset",
        "operationId": "getAssetPriceIndicators",
        "tags": [
          "Market data: Prices"
        ],
        "description": "Returns the requested indicator's lines over the window. The series is\nwidened internally by the indicator's own lookback so the first returned\npoint is already warm.\n\nCandle-input and volume-input indicators are unavailable on this mount:\nit stores no individual ticks to build candles from, and reads no\nreported-volume series.\n\nSee the [Time Window & Resolution](#section/Time-Window-and-Resolution)\nsection for the format of `window` and `resolution`.\n",
        "security": [],
        "parameters": [
          {
            "name": "asset_id",
            "in": "query",
            "description": "Backend asset ID. Mutually exclusive with `symbol`: exactly one of\nthe two is required, and naming both is a 400.\n",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "symbol",
            "in": "query",
            "description": "Asset symbol (e.g. `SOL`, `BTC`).",
            "required": false,
            "deprecated": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "indicator",
            "in": "query",
            "required": true,
            "description": "Indicator kind to compute.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "window",
            "in": "query",
            "description": "Lookback period (e.g. `1h`, `4h`, `1d`, `7d`, `1M`).",
            "required": false,
            "schema": {
              "type": "string",
              "default": "1h"
            }
          },
          {
            "name": "resolution",
            "in": "query",
            "description": "Gap between consecutive data points (e.g. `5s`, `1m`, `5m`, `1h`).",
            "required": false,
            "schema": {
              "type": "string",
              "default": "5s"
            }
          },
          {
            "name": "asset_class",
            "in": "query",
            "description": "Asset class to resolve the asset in. Defaults to `spot`.",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "spot",
                "perp"
              ],
              "default": "spot"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Indicator lines",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IndicatorHistoryResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - invalid parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketDataError"
                }
              }
            }
          },
          "404": {
            "description": "Asset not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketDataError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketDataError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/cefi/market/prices/history": {
      "get": {
        "summary": "Get CeFi instrument price history",
        "operationId": "getCefiPriceHistory",
        "tags": [
          "Market data: CeFi"
        ],
        "description": "Returns historical bid/ask midpoint prices for a CeFi instrument\nover a configurable lookback window, sampled at a configurable\nresolution. Each price is `(bid + ask) / 2` from the latest EBBO\nsnapshot in the bucket; buckets without both a bid and an ask are\nexcluded.\n\nThe `symbol` parameter is the venue-native instrument symbol (e.g.\n`BTC-USD`) — there is no registry translation today.\n\nSee the [Time Window & Resolution](#section/Time-Window-and-Resolution)\nsection for the format of `window` and `resolution`.\n",
        "security": [],
        "parameters": [
          {
            "name": "symbol",
            "in": "query",
            "description": "Venue-native CeFi instrument symbol (e.g. `BTC-USD`). Required here:\n`asset_id` is rejected with a 400 on the CeFi routes, since CeFi\ninstruments carry no price-source mapping to resolve one against.\n",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "window",
            "in": "query",
            "description": "Lookback period (e.g. `1h`, `4h`, `1d`, `7d`, `1M`).",
            "required": false,
            "schema": {
              "type": "string",
              "default": "1h"
            }
          },
          {
            "name": "resolution",
            "in": "query",
            "description": "Gap between consecutive data points (e.g. `5s`, `1m`, `5m`, `1h`).",
            "required": false,
            "schema": {
              "type": "string",
              "default": "5s"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "CeFi price history data for the requested symbol",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PriceHistoryResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - invalid parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketDataError"
                }
              }
            }
          },
          "404": {
            "description": "No price data found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketDataError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketDataError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/cefi/market/prices/indicators": {
      "get": {
        "operationId": "getCefiPriceIndicators",
        "security": [],
        "tags": [
          "Market data: CeFi"
        ],
        "summary": "Get a technical indicator series for a CeFi instrument",
        "description": "Same parameters, response shape and warm-up behaviour as\n[`/v1/defi/market/prices/indicators`](#operation/getPriceIndicators),\ncomputed over bid/ask midpoints rather than close prices.\n\nThe `symbol` parameter is the venue-native instrument symbol (e.g.\n`BTC-USD`) — there is no registry translation today.\n\n`atr` and `trending_ratio` are not served here: this mount stores no\nindividual ticks to build candles from, and a venue-native instrument\ncarries no CoinGecko mapping to read reported volume from.\n",
        "parameters": [
          {
            "name": "symbol",
            "in": "query",
            "required": true,
            "description": "Venue-native CeFi instrument symbol (e.g. `BTC-USD`). Required here:\n`asset_id` is rejected with a 400 on the CeFi routes, since CeFi\ninstruments carry no price-source mapping to resolve one against.\n",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "indicator",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "sma",
                "ema",
                "rsi",
                "macd",
                "bollinger",
                "surging_1h",
                "surging_4h",
                "surging_24h"
              ]
            }
          },
          {
            "name": "window",
            "in": "query",
            "description": "Lookback period (e.g. `1h`, `4h`, `1d`, `7d`, `1M`).",
            "schema": {
              "type": "string",
              "default": "1h"
            }
          },
          {
            "name": "resolution",
            "in": "query",
            "description": "Candle size the period counts in (e.g. `5s`, `1m`, `1h`).",
            "schema": {
              "type": "string",
              "default": "5s"
            }
          },
          {
            "name": "period",
            "in": "query",
            "description": "Lookback in candles. Required for sma, ema and rsi; defaults to 20\nfor bollinger and is not used by macd. Rejected for the momentum\nmeasures, which cover a fixed span.\n",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 400
            }
          },
          {
            "name": "fast_period",
            "in": "query",
            "description": "MACD fast EMA length. Defaults to 12.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 400
            }
          },
          {
            "name": "slow_period",
            "in": "query",
            "description": "MACD slow EMA length. Defaults to 26.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 400
            }
          },
          {
            "name": "signal_period",
            "in": "query",
            "description": "MACD signal EMA length. Defaults to 9.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 400
            }
          },
          {
            "name": "std_dev",
            "in": "query",
            "description": "Bollinger band width in standard deviations. Defaults to 2.",
            "schema": {
              "type": "number",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Indicator lines",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IndicatorHistoryResponse"
                }
              }
            }
          },
          "400": {
            "description": "Unknown indicator, or a parameter out of range",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketDataError"
                }
              }
            }
          },
          "404": {
            "description": "Not enough price history to compute the indicator",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketDataError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketDataError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/cefi/market/prices/range": {
      "get": {
        "summary": "Get CeFi min/max price over a window",
        "operationId": "getCefiPriceRange",
        "tags": [
          "Market data: CeFi"
        ],
        "description": "Returns the minimum and maximum bid/ask midpoint price observed for\na CeFi instrument within a configurable lookback window, along with\nthe timestamps at which each extreme occurred.\n\nSee the [Time Window & Resolution](#section/Time-Window-and-Resolution)\nsection for the format of `window`.\n",
        "security": [],
        "parameters": [
          {
            "name": "symbol",
            "in": "query",
            "description": "Venue-native CeFi instrument symbol (e.g. `BTC-USD`). Required here:\n`asset_id` is rejected with a 400 on the CeFi routes, since CeFi\ninstruments carry no price-source mapping to resolve one against.\n",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "window",
            "in": "query",
            "description": "Lookback period (e.g. `1h`, `4h`, `1d`, `7d`, `1M`).",
            "required": false,
            "schema": {
              "type": "string",
              "default": "1h"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Price range data for the requested CeFi symbol",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PriceRangeResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - invalid parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketDataError"
                }
              }
            }
          },
          "404": {
            "description": "No price data found for the symbol within the window",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketDataError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketDataError"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "AuthBearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "An access token from `POST /api-key/token`. An organization token lasts one hour and has no refresh token; a personal token can be refreshed.\n"
      },
      "AccountBearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "An access token from `POST /v1/auth/api-key/token`. An organization token lasts one hour and has no refresh token; a personal token can be refreshed.\n"
      },
      "GatewayBearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "An access token from `POST /v1/auth/api-key/token`. An organization token lasts one hour and has no refresh token; a personal token can be refreshed.\n"
      },
      "HMAC": {
        "type": "apiKey",
        "in": "header",
        "name": "x-truex-auth-token",
        "description": "Legacy authentication, being phased out in favour of `JWT`. Clients must compute and send an HMAC signature in `x-truex-auth-signature`.\n\nCompute the payload exactly as:\n\n`timestamp + method + path + body`\n\nThen compute the signature as:\n\n`Base64( HMAC_SHA256(secret, payload) )`\n\nRules:\n* `timestamp` is `x-truex-auth-timestamp` in **seconds since Unix epoch**.\n* `timestamp` must be no older than 15 seconds and no more than 1 second in the future.\n* `method` is uppercase HTTP method (`GET`, `POST`, `DELETE`, etc.).\n* `path` is everything after the domain, including leading `/` (e.g. `/v1/cefi/orders`) and excludes query string parameters.\n* `body` is the exact raw request body string. Use an empty string for requests with no body.\n\nExample payload:\n* `1700000000POST/v1/cefi/orders{\"client_id\":\"7\",\"instrument_id\":\"1\",\"qty\":\"1\",\"price\":\"100\"}`\n\nExample signature (shell):\n* `printf '%s' \"$PAYLOAD\" | openssl dgst -sha256 -hmac \"$SECRET\" -binary | base64`\n\nNote, method is all upper case and path is everything after the domain name including the / (e.g. /v1/cefi/orders).\nRequired headers:\n* `x-truex-auth-token`: The ID of the HMAC key being used (API key).\n* `x-truex-auth-signature`: The signature generated from processing the payload with the HMAC key.\n* `x-truex-auth-timestamp`: Current time as seconds since epoch.\n* `x-truex-auth-userid`: Client identifier.\n"
      },
      "JWT": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "Recommended authentication. Present a True Markets-issued JWT access\ntoken as `Authorization: Bearer <token>`, together with\n`x-truex-auth-timestamp` (current Unix seconds, which guards against\nreplays). No request signing is required.\n\nObtain a token pair by exchanging a signed challenge for your\nregistered ES256 (EC P-256) API key at `POST /v1/auth/api-key/token`\n(see the Auth API); the same token is issued by the standard sign-in\nflows.\n\nThe token must carry a `client_id` claim, which scopes every request\nto your CeFi client. The claim is present only once your account is\nenabled for CeFi trading; a JWT without a `client_id` claim is\nrejected with `401 Unauthorized`.\n"
      }
    },
    "schemas": {
      "AuthorizationServerMetadata": {
        "type": "object",
        "required": [
          "issuer",
          "authorization_endpoint",
          "token_endpoint",
          "registration_endpoint",
          "jwks_uri",
          "scopes_supported",
          "response_types_supported",
          "grant_types_supported",
          "code_challenge_methods_supported",
          "token_endpoint_auth_methods_supported"
        ],
        "properties": {
          "issuer": {
            "type": "string",
            "format": "uri",
            "description": "Equals the origin this document is served from."
          },
          "authorization_endpoint": {
            "type": "string",
            "format": "uri"
          },
          "token_endpoint": {
            "type": "string",
            "format": "uri"
          },
          "registration_endpoint": {
            "type": "string",
            "format": "uri",
            "description": "Dynamic client registration (RFC 7591)."
          },
          "jwks_uri": {
            "type": "string",
            "format": "uri"
          },
          "scopes_supported": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "response_types_supported": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "grant_types_supported": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "code_challenge_methods_supported": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "S256 only; OAuth 2.1 drops \"plain\"."
          },
          "token_endpoint_auth_methods_supported": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "resources_supported": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uri"
            },
            "description": "RFC 8707 resource identifiers tokens may be minted for."
          }
        }
      },
      "AuthorizeClientResponse": {
        "type": "object",
        "required": [
          "client_id",
          "client_name",
          "redirect_host",
          "scopes",
          "vendor",
          "verification",
          "dynamically_registered"
        ],
        "properties": {
          "client_id": {
            "type": "string"
          },
          "client_name": {
            "type": "string",
            "description": "Always the client's own claim; the callback host is not."
          },
          "redirect_host": {
            "type": "string",
            "description": "Host of the callback this grant would be returned to."
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "vendor": {
            "type": "string",
            "description": "The allowlist family whose rule admitted this client."
          },
          "verification": {
            "type": "string",
            "enum": [
              "vendor",
              "local"
            ],
            "description": "What the authorization server can vouch for, based on where the\ngrant is delivered rather than on the name. `vendor` — the callback\nbelongs to a recognised host, so only that vendor can receive the\ncode. `local` — a loopback callback, so a program on the user's own\nmachine, which cannot be identified further.\n"
          },
          "dynamically_registered": {
            "type": "boolean",
            "description": "True for a self-registered client, whose name is its own unvetted\nclaim; the consent screen labels the name accordingly.\n"
          }
        }
      },
      "ConsentGrantResponse": {
        "type": "object",
        "required": [
          "client_id",
          "client_name",
          "vendor",
          "scopes",
          "granted_at",
          "verification",
          "dynamically_registered"
        ],
        "properties": {
          "client_id": {
            "type": "string"
          },
          "client_name": {
            "type": "string"
          },
          "vendor": {
            "type": "string"
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "granted_at": {
            "type": "string",
            "format": "date-time"
          },
          "last_used_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "verification": {
            "type": "string",
            "enum": [
              "vendor",
              "local"
            ]
          },
          "dynamically_registered": {
            "type": "boolean"
          }
        }
      },
      "ConsentRequest": {
        "type": "object",
        "required": [
          "client_id",
          "redirect_uri",
          "response_type",
          "code_challenge",
          "code_challenge_method",
          "resource"
        ],
        "properties": {
          "approved": {
            "type": "boolean",
            "description": "False returns the client to its redirect with access_denied."
          },
          "client_id": {
            "type": "string"
          },
          "redirect_uri": {
            "type": "string",
            "format": "uri"
          },
          "response_type": {
            "type": "string",
            "enum": [
              "code"
            ]
          },
          "scope": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "code_challenge": {
            "type": "string"
          },
          "code_challenge_method": {
            "type": "string",
            "enum": [
              "S256"
            ]
          },
          "resource": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "ConsentResponse": {
        "type": "object",
        "required": [
          "redirect_to"
        ],
        "properties": {
          "redirect_to": {
            "type": "string",
            "format": "uri",
            "description": "Where the browser should go next, approved or denied."
          }
        }
      },
      "OAuthTokenResponse": {
        "type": "object",
        "required": [
          "access_token",
          "token_type",
          "expires_in",
          "scope"
        ],
        "properties": {
          "access_token": {
            "type": "string",
            "description": "Audience-bound to the resource named in the authorize request."
          },
          "token_type": {
            "type": "string",
            "enum": [
              "Bearer"
            ]
          },
          "expires_in": {
            "type": "integer",
            "format": "int64",
            "description": "Seconds until the access token expires."
          },
          "refresh_token": {
            "type": "string",
            "description": "Opaque and single-use; each refresh response replaces it."
          },
          "scope": {
            "type": "string",
            "description": "Space-delimited scopes the grant carries."
          }
        }
      },
      "RegisterOAuthClientRequest": {
        "type": "object",
        "required": [
          "redirect_uris"
        ],
        "properties": {
          "redirect_uris": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "string",
              "format": "uri"
            },
            "description": "Exact callback URLs. Matched byte-for-byte at /oauth/authorize,\nexcept for loopback, where the port is ignored (RFC 8252 7.3).\nMust be https outside loopback, and carry no fragment or userinfo.\n",
            "example": [
              "https://claude.ai/api/mcp/auth_callback"
            ]
          },
          "client_name": {
            "type": "string",
            "description": "Self-asserted; shown on the consent screen as unverified.",
            "example": "Claude"
          },
          "client_uri": {
            "type": "string",
            "format": "uri"
          },
          "scope": {
            "type": "string",
            "description": "Space-delimited. Defaults to every supported scope when omitted.",
            "example": "mcp:read mcp:trade"
          },
          "grant_types": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "authorization_code",
                "refresh_token"
              ]
            }
          },
          "response_types": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "code"
              ]
            }
          },
          "token_endpoint_auth_method": {
            "type": "string",
            "enum": [
              "none"
            ],
            "description": "Only public clients are supported."
          }
        }
      },
      "RegisterOAuthClientResponse": {
        "type": "object",
        "required": [
          "client_id",
          "client_id_issued_at",
          "redirect_uris",
          "scope",
          "grant_types",
          "response_types",
          "token_endpoint_auth_method"
        ],
        "properties": {
          "client_id": {
            "type": "string"
          },
          "client_id_issued_at": {
            "type": "integer",
            "format": "int64",
            "description": "Seconds since the epoch."
          },
          "redirect_uris": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uri"
            }
          },
          "client_name": {
            "type": "string"
          },
          "client_uri": {
            "type": "string"
          },
          "scope": {
            "type": "string"
          },
          "grant_types": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "response_types": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "token_endpoint_auth_method": {
            "type": "string"
          }
        }
      },
      "OAuthError": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string",
            "description": "RFC 6749 5.2 error code, which clients branch on.",
            "enum": [
              "invalid_request",
              "invalid_client",
              "invalid_grant",
              "invalid_scope",
              "unauthorized_client",
              "unsupported_grant_type",
              "access_denied",
              "server_error",
              "invalid_redirect_uri",
              "invalid_client_metadata"
            ]
          },
          "error_description": {
            "type": "string"
          }
        }
      },
      "AuthError": {
        "type": "object",
        "description": "Shared API error envelope",
        "required": [
          "type",
          "message",
          "request_id"
        ],
        "properties": {
          "type": {
            "type": "string",
            "description": "Closed error category fixing the HTTP status",
            "enum": [
              "invalid_argument",
              "unauthenticated",
              "permission_denied",
              "not_found",
              "method_not_allowed",
              "conflict",
              "failed_precondition",
              "resource_exhausted",
              "unavailable",
              "internal"
            ]
          },
          "code": {
            "type": "string",
            "description": "Specific error condition from the fleet code registry. Extensible: clients MUST tolerate values not listed here and fall back to type-based handling. Omitted when no code applies."
          },
          "message": {
            "type": "string",
            "description": "Human-readable description of the failure"
          },
          "metadata": {
            "type": "object",
            "description": "Machine-readable context scoped to `code`; values are always strings. Which keys appear is determined by `code`.",
            "additionalProperties": {
              "type": "string"
            }
          },
          "field_violations": {
            "type": "array",
            "description": "Per-field rejections, present on `invalid_argument` when the request failed field validation.",
            "items": {
              "type": "object",
              "required": [
                "field",
                "message"
              ],
              "properties": {
                "field": {
                  "type": "string",
                  "description": "Dotted path to the offending field, as the client sent it"
                },
                "message": {
                  "type": "string",
                  "description": "Human-readable reason the field was rejected"
                }
              }
            }
          },
          "request_id": {
            "type": "string",
            "description": "Identifier of the request that produced the error"
          }
        }
      },
      "AccessTokensResponse": {
        "type": "object",
        "required": [
          "access_token",
          "refresh_token",
          "expires_in",
          "token_type"
        ],
        "properties": {
          "access_token": {
            "type": "string",
            "description": "JWT access token"
          },
          "refresh_token": {
            "type": "string",
            "description": "JWT refresh token"
          },
          "expires_in": {
            "type": "string",
            "format": "date-time",
            "description": "Access token expiration timestamp"
          },
          "token_type": {
            "type": "string",
            "description": "Token type (always \"Bearer\")",
            "example": "Bearer"
          },
          "turnkey_session": {
            "$ref": "#/components/schemas/TurnkeySession"
          }
        }
      },
      "TurnkeySession": {
        "type": "object",
        "description": "A Turnkey session on the public key a provider sign-in sent. Absent when none was asked for or none could be issued.",
        "required": [
          "expires_at"
        ],
        "properties": {
          "expires_at": {
            "type": "integer",
            "format": "int64",
            "description": "Session expiry, unix seconds"
          }
        }
      },
      "OrganizationTokenResponse": {
        "type": "object",
        "description": "Returned for an organization key. The access token lasts one hour and carries the organization's id in its `tm.organization_id` claim. There is no refresh token, so mint a new one from the key before it expires.\n",
        "required": [
          "access_token",
          "token_type",
          "expires_in"
        ],
        "properties": {
          "access_token": {
            "type": "string",
            "description": "JWT access token"
          },
          "token_type": {
            "type": "string",
            "description": "Token type (always \"Bearer\")",
            "example": "Bearer"
          },
          "expires_in": {
            "type": "string",
            "format": "date-time",
            "description": "Access token expiration timestamp"
          }
        }
      },
      "JWKSResponse": {
        "type": "object",
        "required": [
          "keys"
        ],
        "properties": {
          "keys": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/JWK"
            },
            "description": "Array of JSON Web Keys"
          }
        }
      },
      "JWK": {
        "type": "object",
        "required": [
          "kty",
          "kid",
          "use",
          "alg"
        ],
        "properties": {
          "kty": {
            "type": "string",
            "description": "Key type",
            "example": "RSA"
          },
          "kid": {
            "type": "string",
            "description": "Key ID"
          },
          "use": {
            "type": "string",
            "description": "Key use (sig for signature)",
            "example": "sig"
          },
          "alg": {
            "type": "string",
            "description": "Algorithm",
            "example": "RS256"
          },
          "n": {
            "type": "string",
            "description": "RSA modulus (base64url encoded)"
          },
          "e": {
            "type": "string",
            "description": "RSA exponent (base64url encoded)"
          }
        }
      },
      "RefreshTokenRequest": {
        "type": "object",
        "required": [
          "refresh_token"
        ],
        "properties": {
          "refresh_token": {
            "type": "string",
            "description": "The refresh token to exchange"
          }
        }
      },
      "APIKeyTokenExchangeRequest": {
        "type": "object",
        "required": [
          "key_id",
          "timestamp",
          "signature"
        ],
        "properties": {
          "key_id": {
            "type": "string",
            "format": "uuid",
            "description": "The API key ID"
          },
          "timestamp": {
            "type": "integer",
            "format": "int64",
            "description": "Current Unix timestamp (must be within ±30s of server time)"
          },
          "signature": {
            "type": "string",
            "description": "Base64url-encoded ECDSA P-256 signature of `{key_id}.{timestamp}`"
          }
        }
      },
      "ExternalRefId": {
        "type": "string",
        "pattern": "^[A-Za-z0-9_-]{1,64}$",
        "description": "The reference the client names a served user by, unique within the organization. Compared exactly as sent, with no case or format normalisation, so send the same string every time (a UUID in one consistent case)."
      },
      "CreateOrganizationUserRequest": {
        "type": "object",
        "description": "Creates or finds a user the organization trades for",
        "required": [
          "external_ref_id",
          "signer_public_key"
        ],
        "properties": {
          "external_ref_id": {
            "$ref": "#/components/schemas/ExternalRefId"
          },
          "signer_public_key": {
            "type": "string",
            "description": "Turnkey signer key, a 33-byte compressed P-256 point as 66 hex characters"
          }
        }
      },
      "OrganizationUser": {
        "type": "object",
        "description": "A user the organization trades for",
        "required": [
          "user_id",
          "external_ref_id",
          "created_at",
          "wallets"
        ],
        "properties": {
          "user_id": {
            "type": "string",
            "format": "uuid"
          },
          "external_ref_id": {
            "$ref": "#/components/schemas/ExternalRefId"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "wallets": {
            "type": "array",
            "description": "Empty only while the wallet step has not completed; re-send the create to finish it.",
            "items": {
              "$ref": "#/components/schemas/OrganizationUserWallet"
            }
          }
        }
      },
      "OrganizationUserPage": {
        "type": "object",
        "required": [
          "data",
          "pagination"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrganizationUser"
            }
          },
          "pagination": {
            "$ref": "#/components/schemas/AccountPagination"
          }
        }
      },
      "OrganizationUserWallet": {
        "type": "object",
        "required": [
          "address",
          "chain_family"
        ],
        "properties": {
          "address": {
            "type": "string"
          },
          "chain_family": {
            "type": "string",
            "enum": [
              "evm",
              "solana"
            ],
            "description": "The family of chains this address serves. An `evm` address is the same on every EVM chain (base, arbitrum, robinhood); a `solana` address serves solana."
          }
        }
      },
      "TradingSetupResponse": {
        "type": "object",
        "description": "How a user is set up to trade and to settle what they trade",
        "required": [
          "id",
          "wallets",
          "trading",
          "settlement"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The user's id"
          },
          "wallets": {
            "type": "array",
            "description": "The wallets the user holds, `main` first; empty when they hold none",
            "items": {
              "$ref": "#/components/schemas/TradingWallet"
            }
          },
          "trading": {
            "$ref": "#/components/schemas/TradingSetupTrading"
          },
          "settlement": {
            "$ref": "#/components/schemas/TradingSetupSettlement"
          }
        },
        "example": {
          "id": "9f1c2a4e-3b7d-4e1a-8c2f-5d6e7f8a9b0c",
          "wallets": [
            {
              "name": "main",
              "provider": "turnkey",
              "addresses": [
                {
                  "chain": "solana",
                  "address": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
                  "settlement_authority": true
                },
                {
                  "chain": "evm",
                  "address": "0x3f1eA2C5fE0f8eB7dB1c9a1F9c3B0b5C1d2E3f40",
                  "settlement_authority": true
                }
              ]
            },
            {
              "name": "strategies",
              "provider": "turnkey",
              "addresses": [
                {
                  "chain": "solana",
                  "address": "4mPqzVZ8r1Tq6Yd3dS5bVb1h7cS2kJ9uWm8xL3nQe2Pf"
                },
                {
                  "chain": "evm",
                  "address": "0x9d2B4e6F8a0C1d3E5f7A9b0C2d4E6f8A0b1C3d5E"
                }
              ]
            }
          ],
          "trading": {
            "cefi": {
              "enabled": true,
              "accounts": [
                {
                  "wallet": "main",
                  "client_id": "79054348114451737"
                }
              ]
            },
            "defi": {
              "enabled": true
            }
          },
          "settlement": {
            "defi": {
              "enabled": true
            },
            "paxos": {
              "enabled": false
            }
          }
        }
      },
      "TradingWallet": {
        "type": "object",
        "description": "One of the user's wallets with its address on each chain",
        "required": [
          "name",
          "provider",
          "addresses"
        ],
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "main",
              "strategies"
            ],
            "description": "`main` is the user's own wallet; `strategies` is the wallet strategies trade from.\n"
          },
          "provider": {
            "type": "string",
            "enum": [
              "turnkey"
            ],
            "description": "Who holds the wallet's keys"
          },
          "addresses": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TradingWalletAddress"
            }
          }
        }
      },
      "TradingWalletAddress": {
        "type": "object",
        "description": "A wallet's address on one chain",
        "required": [
          "chain",
          "address"
        ],
        "properties": {
          "chain": {
            "type": "string",
            "enum": [
              "solana",
              "evm"
            ]
          },
          "address": {
            "type": "string"
          },
          "settlement_authority": {
            "type": "boolean",
            "description": "Whether the user has authorized settlement of CeFi trades on this chain. Present only on `main` wallet addresses.\n"
          }
        }
      },
      "TradingSetupTrading": {
        "type": "object",
        "description": "The venues the user can trade on",
        "required": [
          "cefi",
          "defi"
        ],
        "properties": {
          "cefi": {
            "$ref": "#/components/schemas/CefiTradingSetup"
          },
          "defi": {
            "$ref": "#/components/schemas/EnabledStatus"
          }
        }
      },
      "CefiTradingSetup": {
        "type": "object",
        "description": "Whether the user can trade on CeFi, and their CeFi trading accounts",
        "required": [
          "enabled",
          "accounts"
        ],
        "properties": {
          "enabled": {
            "type": "boolean",
            "description": "True once the user has a CeFi trading account"
          },
          "accounts": {
            "type": "array",
            "description": "The user's CeFi trading accounts; empty when they have none",
            "items": {
              "$ref": "#/components/schemas/CefiTradingAccount"
            }
          }
        }
      },
      "CefiTradingAccount": {
        "type": "object",
        "description": "A CeFi trading account and the wallet it settles against",
        "required": [
          "wallet",
          "client_id"
        ],
        "properties": {
          "wallet": {
            "type": "string",
            "enum": [
              "main"
            ],
            "description": "The wallet the account settles against"
          },
          "client_id": {
            "type": "string",
            "description": "The account's CeFi trading client id"
          }
        }
      },
      "TradingSetupSettlement": {
        "type": "object",
        "description": "The custody rails the user's CeFi trades can settle on",
        "required": [
          "defi",
          "paxos"
        ],
        "properties": {
          "defi": {
            "$ref": "#/components/schemas/EnabledStatus"
          },
          "paxos": {
            "$ref": "#/components/schemas/EnabledStatus"
          }
        }
      },
      "EnabledStatus": {
        "type": "object",
        "required": [
          "enabled"
        ],
        "properties": {
          "enabled": {
            "type": "boolean"
          }
        }
      },
      "AccountPagination": {
        "type": "object",
        "description": "Pagination metadata",
        "required": [
          "next_cursor",
          "limit"
        ],
        "properties": {
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Cursor for the next page of results, null if no more pages"
          },
          "limit": {
            "type": "integer",
            "description": "Number of results returned in this page"
          }
        }
      },
      "AccountError": {
        "type": "object",
        "description": "Shared API error envelope",
        "required": [
          "type",
          "message",
          "request_id"
        ],
        "properties": {
          "type": {
            "type": "string",
            "description": "Closed error category fixing the HTTP status",
            "enum": [
              "invalid_argument",
              "unauthenticated",
              "permission_denied",
              "not_found",
              "method_not_allowed",
              "conflict",
              "failed_precondition",
              "resource_exhausted",
              "unavailable",
              "internal"
            ]
          },
          "code": {
            "type": "string",
            "description": "Specific error condition from the fleet code registry, which is shared across services rather than owned by this one. Extensible: clients MUST tolerate any value and fall back to type-based handling. Omitted when no code applies."
          },
          "message": {
            "type": "string",
            "description": "Human-readable error message"
          },
          "metadata": {
            "type": "object",
            "description": "Machine-readable context scoped to `code`; values are always strings. Which keys appear is determined by `code`.",
            "additionalProperties": {
              "type": "string"
            }
          },
          "field_violations": {
            "type": "array",
            "description": "Per-field rejections, present on `invalid_argument` when the request failed field validation.",
            "items": {
              "type": "object",
              "required": [
                "field",
                "message"
              ],
              "properties": {
                "field": {
                  "type": "string",
                  "description": "Dotted path to the offending field, as the client sent it"
                },
                "message": {
                  "type": "string",
                  "description": "Human-readable reason the field was rejected"
                }
              }
            }
          },
          "request_id": {
            "type": "string",
            "description": "Per-request correlation ID, empty when unavailable"
          }
        }
      },
      "OrderSide": {
        "type": "string",
        "enum": [
          "buy",
          "sell"
        ],
        "example": "buy",
        "description": "The side of the order.\n* **buy** — Purchase the base asset using the quote asset.\n* **sell** — Sell the base asset in exchange for the quote asset.\n"
      },
      "OrderType": {
        "type": "string",
        "enum": [
          "market",
          "limit"
        ],
        "example": "market",
        "description": "The type of order to place — how the order executes.\n* **market** — Execute immediately at the best available price. Buy orders require `qty_unit: quote`. Price must not be specified.\n* **limit** — Place an order at a specific price. Requires `price` and `qty_unit: base`. `chain` is optional: omit it for a CeFi limit order, or supply a DeFi chain (e.g. `hypercore-spot`) to rest the order on-chain.\nWith a `trigger`, the type is how the fired order executes and must be `market`.\n"
      },
      "Trigger": {
        "type": "object",
        "description": "Makes the order a TP/SL trigger: a reduce-only market close that rests off-book and fires when the mark price crosses `price`. Perp-only (`hypercore-perp`). A `take_profit` must rest on the profitable side of the position and a `stop_loss` on the losing side, or the order is rejected. The order `type` must be `market`, and `price`/`leverage` must not be specified; `reduce_only` is implied.\n",
        "required": [
          "type",
          "price"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "take_profit",
              "stop_loss"
            ],
            "description": "Trigger direction relative to the position."
          },
          "price": {
            "type": "string",
            "description": "Trigger price per unit of base asset as a decimal string.",
            "example": "70000.00"
          }
        }
      },
      "OrderStatus": {
        "type": "string",
        "enum": [
          "initialized",
          "pending",
          "cancel_pending",
          "complete",
          "canceled",
          "active",
          "failed"
        ],
        "example": "complete",
        "description": "The current status of the order.\n* **initialized** — Order has been created but not yet submitted. For DeFi orders, the client must sign the returned payloads and call the execute endpoint. For CeFi buy orders with insufficient balance, a funding bridge is prepared first.\n* **pending** — Order has been submitted but is not yet confirmed by the CeFi exchange or on-chain.\n* **active** — Order was accepted by the CeFi exchange and is open for trading. Applies to limit orders that are working in the order book.\n* **cancel_pending** — A cancellation request has been sent to the CeFi exchange and is awaiting confirmation.\n* **complete** — Order has been fully executed. For CeFi orders this means the CeFi exchange reported a fill; for DeFi orders the on-chain swap was confirmed.\n* **canceled** — Order was successfully canceled via a cancel request or by exchange/market conditions.\n* **failed** — Order was rejected by the CeFi exchange or DeFi execution failed (e.g. on-chain transaction reverted, balance check failed).\n"
      },
      "SigningMethod": {
        "type": "string",
        "enum": [
          "web_authn",
          "api_key"
        ],
        "example": "api_key",
        "description": "The authentication method used to sign transaction payloads.\n* **web_authn** — Signed using a passkey (WebAuthn/FIDO2 credential) via the browser.\n* **api_key** — Signed using an API key. Suitable for programmatic/headless access.\n"
      },
      "Chain": {
        "type": "string",
        "enum": [
          "solana",
          "base",
          "robinhood",
          "hypercore-spot",
          "hypercore-perp"
        ],
        "example": "solana",
        "description": "The blockchain network for DeFi orders. Omit for CeFi orders.\n* **solana** — Execute the swap on the Solana blockchain.\n* **base** — Execute the swap on the Base (Ethereum L2) blockchain.\n* **robinhood** — Execute the swap on Robinhood Chain (Arbitrum-based Ethereum L2).\n* **hypercore-spot** — Execute the order on the Hyperliquid spot order book.\n* **hypercore-perp** — Execute the order on the Hyperliquid perpetuals order book.\n"
      },
      "Venue": {
        "type": "string",
        "enum": [
          "defi",
          "cefi"
        ],
        "example": "defi",
        "description": "The trading venue to filter by.\n* **defi** — Decentralized exchange (on-chain swaps).\n* **cefi** — Centralized exchange (off-chain order book).\n"
      },
      "ProductType": {
        "type": "string",
        "enum": [
          "spot",
          "perp"
        ],
        "example": "spot",
        "description": "Whether the asset is spot or a perpetual (perp)."
      },
      "AssetClass": {
        "type": "string",
        "enum": [
          "crypto",
          "stock"
        ],
        "example": "crypto",
        "description": "The underlying instrument, orthogonal to product type. A `stock` is a tokenized equity, which is an ordinary spot or perp listing and quotes and executes as one. Absent on servers predating the field, which list crypto only.\n"
      },
      "QuoteRequest": {
        "type": "object",
        "description": "Request to compute a market quote",
        "required": [
          "base_asset",
          "quote_asset",
          "qty",
          "qty_unit",
          "side"
        ],
        "properties": {
          "base_asset": {
            "type": "string",
            "description": "Base asset identifier (e.g. `BTC`, `ETH`, `SOL`)",
            "example": "BTC"
          },
          "quote_asset": {
            "type": "string",
            "description": "Quote asset identifier (e.g. `USD`, `USDC`)",
            "example": "USD"
          },
          "qty": {
            "type": "string",
            "description": "Quantity as a positive decimal string",
            "example": "0.5"
          },
          "qty_unit": {
            "type": "string",
            "enum": [
              "base",
              "quote"
            ],
            "description": "Unit of the quantity.\n* **base** — Quantity is denominated in the base asset (e.g. 0.5 BTC).\n* **quote** — Quantity is denominated in the quote asset (e.g. 1000 USD).\n",
            "example": "quote"
          },
          "side": {
            "$ref": "#/components/schemas/OrderSide"
          }
        }
      },
      "QuoteResponse": {
        "type": "object",
        "description": "Quote computation result with the expected quantity, execution price, notional and fee",
        "properties": {
          "qty": {
            "type": "string",
            "description": "Expected base asset quantity as a decimal string, for buys and sells and for both `qty_unit` values. With `qty_unit=quote` it is rounded down to the base increment.",
            "example": "0.00156"
          },
          "price": {
            "type": "string",
            "description": "Effective execution price per unit of base asset as a decimal string",
            "example": "64000"
          },
          "notional": {
            "type": "string",
            "description": "Expected quote asset amount the order executes, before fees, as a decimal string. With `qty_unit=quote` it can be slightly less than the requested amount after base increment rounding.",
            "example": "99.84"
          },
          "fee": {
            "type": "string",
            "description": "Expected taker fee in `quote_asset` units as a decimal string. Added to the cost on a buy and deducted from the proceeds on a sell.",
            "example": "0.039936"
          }
        }
      },
      "CreateOrderRequest": {
        "type": "object",
        "description": "Request to create a new order.\n\n**Identifying the asset** — provide exactly one of `asset_id` or `base_asset`\n(supplying both or neither is a `400`). `asset_id` is the id from\n`GET /assets` and is preferred; `base_asset` is the legacy identifier.\n\n**Choosing the venue** — `venue` defaults to `smart`. For an asset that trades on\nboth venues, `cefi` or `defi` sends the order to that venue's listing whichever\nlisting `asset_id` names, and `smart` lets the conductor choose; the response says\nwhich venue it used.\n\n**Limit orders** (`type: limit`):\n- `price` is required and must be a positive decimal string\n- `qty_unit` must be `base`\n- `chain` is optional (omit for CeFi; include a DeFi chain such as `hypercore-spot` to rest the order on-chain)\n\n**Market orders** (`type: market`):\n- `price` is not accepted\n- Buy orders require `qty_unit: quote`\n- Sell orders accept `qty_unit: base` or `qty_unit: quote`\n- `chain` is optional (omit for CeFi, include for DeFi)\n\n**Perp orders** (a perp `asset_id`, or `chain: hypercore-perp` with `base_asset`):\n- `leverage` is required to open a position (buy = long, sell = short) and must be between 1 and 50; it must be omitted for non-perp assets\n- `reduce_only: true` marks the order as a close of the opposite position; `leverage` is then ignored\n- `qty` is the isolated margin to commit; position notional = `qty` × `leverage`\n- `qty_unit` may be `quote` (margin) or `base` (position size) on either side\n\n**Trigger orders** (a `trigger` object, perp-only):\n- the order rests off-book and fires as a reduce-only market close when the mark price crosses `trigger.price`\n- a take-profit must rest on the profitable side of the position and a stop-loss on the losing side, or the quote is rejected\n- `type` must be `market`; `price` and `leverage` must not be sent; `reduce_only` is implied\n",
        "required": [
          "qty",
          "qty_unit",
          "type",
          "side"
        ],
        "properties": {
          "asset_id": {
            "type": "string",
            "format": "uuid",
            "description": "Asset id from `GET /assets`. Preferred way to identify the asset; chain and venue are derived from it. Provide exactly one of `asset_id` or `base_asset`.\n",
            "example": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"
          },
          "base_asset": {
            "type": "string",
            "description": "Legacy asset identifier: asset symbol for CeFi (e.g. `BTC`); token contract address on `chain` for DeFi. Provide exactly one of `asset_id` or `base_asset`.\n",
            "example": "BTC"
          },
          "qty": {
            "type": "string",
            "description": "Quantity as a positive decimal string",
            "example": "100"
          },
          "price": {
            "type": "string",
            "description": "Limit price per unit of base asset as a decimal string. Required for limit orders; must not be sent for market orders.\n",
            "example": "67500.00"
          },
          "trigger": {
            "$ref": "#/components/schemas/Trigger"
          },
          "qty_unit": {
            "type": "string",
            "enum": [
              "base",
              "quote"
            ],
            "description": "Unit of the quantity.\n* **base** — Quantity is denominated in the base asset. Required for limit orders. Supported for market sell orders.\n* **quote** — Quantity is denominated in the quote asset. Required for market buy orders. For DeFi sell orders, `base` must be used instead.\n",
            "example": "quote"
          },
          "type": {
            "$ref": "#/components/schemas/OrderType"
          },
          "side": {
            "$ref": "#/components/schemas/OrderSide"
          },
          "chain": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Chain"
              }
            ],
            "description": "Blockchain network for DeFi orders. Omit for CeFi orders.\n"
          },
          "leverage": {
            "type": "integer",
            "format": "uint16",
            "minimum": 1,
            "maximum": 50,
            "description": "Isolated-margin leverage for a perp order. Required when the resolved asset is a perp (a perp `asset_id`, or `chain: hypercore-perp`) and the order opens a position (not reduce-only); must not be sent for non-perp assets.\n",
            "example": 10
          },
          "reduce_only": {
            "type": "boolean",
            "description": "Marks a perp order as a reduce-only close — it only reduces an existing position and never opens one. Only valid for perp assets.\n",
            "example": false
          },
          "venue": {
            "type": "string",
            "enum": [
              "smart",
              "cefi",
              "defi"
            ],
            "default": "smart",
            "description": "Venue the order should trade on.\n* **smart** — The conductor chooses. For an asset that trades on both venues\n  (a CeFi listing that settles to DeFi and the DeFi listing it settles on), a\n  market order goes to the better price after fees and a limit order to CeFi;\n  when only one venue is open to the user, the order goes there. Otherwise the\n  order goes to the listing `asset_id` names.\n* **cefi** — The asset's CeFi listing, whichever listing `asset_id` names. `400`\n  when the asset has no CeFi listing.\n* **defi** — The asset's DeFi listing, whichever listing `asset_id` names. `400`\n  when the asset has no DeFi listing.\n",
            "example": "smart"
          }
        }
      },
      "UnsignedPayload": {
        "type": "object",
        "description": "An unsigned payload the client must sign before executing. Sign each one with the key that controls the wallet: a Gateway user's signer key, or a Trading API account's own API key or passkey. Submit the stamps to the execute endpoint in the same order.\n",
        "required": [
          "digest",
          "payload"
        ],
        "properties": {
          "digest": {
            "type": "string",
            "description": "Lowercase hex SHA-256 of the `payload` bytes. A signing API that takes a pre-hashed input signs the hex-decoded digest; a library that hashes its input takes `payload` instead. Passing the hex digest to a library that hashes signs the wrong bytes.\n"
          },
          "payload": {
            "type": "string",
            "description": "The exact text to sign: a Turnkey activity as JSON, including its trailing newline. Sign its UTF-8 bytes as-is with ECDSA P-256 and SHA-256; never decode, reformat or re-serialize it.\n"
          }
        }
      },
      "QuoteDetails": {
        "type": "object",
        "description": "Detailed quote information returned with DeFi order creation, showing expected swap output and fees",
        "properties": {
          "base_asset": {
            "type": "string",
            "description": "Base asset identifier (e.g. `SOL`, `ETH`)"
          },
          "quote_asset": {
            "type": "string",
            "description": "Quote asset identifier (e.g. `USDC`)"
          },
          "qty": {
            "type": "string",
            "description": "Input quantity as a decimal string — the amount being swapped from"
          },
          "qty_out": {
            "type": "string",
            "description": "Expected output quantity as a decimal string — the amount the user will receive after fees"
          },
          "fee": {
            "type": "string",
            "description": "Platform fee amount as a decimal string"
          },
          "fee_asset": {
            "type": "string",
            "description": "Asset in which the fee is denominated (e.g. `USDC`)"
          },
          "issues": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Warnings about the quote (e.g. high price impact, low liquidity, `Insufficient balance`). Empty when there are no issues. An `Insufficient balance` entry means the account cannot fund the trade, in which case the response is quote-only (empty `order_id`, no `payloads`).\n"
          }
        }
      },
      "CreateOrderResponse": {
        "type": "object",
        "description": "Response from creating an order. For DeFi orders (and CeFi buy orders requiring a funding bridge), the response includes unsigned payloads that must be signed by the client and submitted via the execute endpoint. For CeFi sell orders and sufficiently funded CeFi buy orders, the order is submitted immediately and no payloads are returned. When a DeFi order cannot be funded, the response is quote-only: it carries the `quote` (with an `Insufficient balance` entry in `quote.issues`), an empty `order_id`, and no `payloads`, and no order is created.\n",
        "properties": {
          "order_id": {
            "type": "string",
            "description": "Unique order identifier. Empty when no order was created, e.g. a DeFi quote the account cannot fund."
          },
          "status": {
            "$ref": "#/components/schemas/OrderStatus"
          },
          "venue": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Venue"
              }
            ],
            "description": "Venue the order went to. For a user released to smart order routing it can differ from the venue of the listing the order named.\n"
          },
          "route_reason": {
            "type": "string",
            "enum": [
              "limit_order",
              "best_price",
              "cefi_no_market",
              "cefi_unavailable",
              "defi_unavailable",
              "no_market",
              "only_venue"
            ],
            "description": "Why the smart order router chose `venue`; absent when the order was not routed. `limit_order` (limit orders rest on CeFi), `best_price` (the better price after fees), `cefi_no_market` / `cefi_unavailable` (CeFi could not price the order, so DeFi), `defi_unavailable` (DeFi could not price it, so CeFi), `no_market` (neither venue could, so the venue the order named), `only_venue` (the only venue of the pair open to the user).\n"
          },
          "payloads": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UnsignedPayload"
            },
            "description": "Unsigned transaction payloads that the client must sign and return via the execute endpoint. Present for DeFi orders and CeFi buy orders that require a funding bridge. Empty or absent when the order is submitted immediately (e.g. CeFi sell orders).\n"
          },
          "quote": {
            "allOf": [
              {
                "$ref": "#/components/schemas/QuoteDetails"
              }
            ],
            "description": "DeFi orders only. For CeFi price previews, use `POST /quotes`. When `issues` reports an insufficient-balance problem, the response is quote-only: `order_id` is empty and there are no `payloads`.\n"
          },
          "web_authn_payload": {
            "type": "string",
            "description": "WebAuthn payload (deprecated, use payloads instead)",
            "deprecated": true
          }
        }
      },
      "ExecuteOrderRequest": {
        "type": "object",
        "description": "Request to execute an order that is in `initialized` status. The client must sign each payload returned by the create endpoint and submit the signatures in the same order.\n",
        "required": [
          "signatures",
          "auth_type"
        ],
        "properties": {
          "signatures": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "minItems": 1,
            "description": "One stamp per payload, in the same order as the payloads returned by the create endpoint. With `auth_type: api_key`, an entry is the base64url encoding, without padding, of the JSON `{\"publicKey\": \"<compressed P-256 public key, hex>\", \"signature\": \"<DER signature, hex>\", \"scheme\": \"SIGNATURE_SCHEME_TK_API_P256\"}`, signed as `UnsignedPayload` describes. With `auth_type: web_authn`, an entry is the browser's WebAuthn stamp.\n"
          },
          "auth_type": {
            "$ref": "#/components/schemas/SigningMethod"
          }
        }
      },
      "ExecuteOrderResponse": {
        "type": "object",
        "description": "Response from executing an order. For DeFi orders, a successful execution transitions the order to `complete` (an immediate fill) or `active` (a limit order resting on-chain). For CeFi orders, the order moves to `pending` while it is processed by the CeFi exchange.\n",
        "properties": {
          "status": {
            "$ref": "#/components/schemas/OrderStatus"
          }
        }
      },
      "CancelOrderResponse": {
        "type": "object",
        "description": "Response from the cancel endpoint. A resting DeFi order returns unsigned payloads the client must sign and submit to the cancel-execute endpoint. A CeFi order is canceled immediately and returns 202 with no payloads.\n",
        "properties": {
          "payloads": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UnsignedPayload"
            },
            "description": "Unsigned cancel payloads the client signs and returns via the cancel-execute endpoint. Present for resting DeFi orders, absent for CeFi orders.\n"
          }
        }
      },
      "CancelAllOrdersRequest": {
        "type": "object",
        "description": "Request to cancel all open orders on a venue.",
        "required": [
          "venue"
        ],
        "properties": {
          "venue": {
            "$ref": "#/components/schemas/Venue"
          }
        }
      },
      "CancelAllOrdersResponse": {
        "type": "object",
        "description": "Result of a cancel-all request.",
        "properties": {
          "canceled_count": {
            "type": "integer",
            "description": "Number of open orders canceled by this request.",
            "example": 3
          }
        }
      },
      "ModifyOrderRequest": {
        "type": "object",
        "description": "Request to modify an active limit order. At least one of `price` or `qty` must be supplied; any field that is omitted is left unchanged.\n",
        "properties": {
          "price": {
            "type": "string",
            "description": "New limit price per unit of base asset as a positive decimal string.",
            "example": "67500.00"
          },
          "qty": {
            "type": "string",
            "description": "New quantity as a positive decimal string.",
            "example": "0.5"
          }
        }
      },
      "GetOrderStatusResponse": {
        "type": "object",
        "description": "Order status response",
        "properties": {
          "status": {
            "$ref": "#/components/schemas/OrderStatus"
          }
        }
      },
      "OrderDetail": {
        "type": "object",
        "description": "Order with execution data, returned by the list-orders and get-order endpoints for orders of any status. Includes fill information from the CeFi exchange for CeFi orders.\n",
        "properties": {
          "order_id": {
            "type": "string",
            "description": "Unique order identifier"
          },
          "asset_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Asset id the order was placed against. May be null for orders sourced directly from the venue."
          },
          "asset_symbol": {
            "type": [
              "string",
              "null"
            ],
            "description": "Asset symbol the order was placed against. May be null for orders sourced directly from the venue."
          },
          "base_asset": {
            "type": "string",
            "description": "Base asset symbol (e.g. `BTC`, `ETH`, `SOL`)"
          },
          "quote_asset": {
            "type": "string",
            "description": "Quote asset symbol (the CeFi listing's instrument quote, e.g. `PYUSD` or `USDC`; `USDC` for DeFi)"
          },
          "type": {
            "$ref": "#/components/schemas/OrderType"
          },
          "side": {
            "$ref": "#/components/schemas/OrderSide"
          },
          "price": {
            "type": [
              "string",
              "null"
            ],
            "description": "For limit orders, the limit price submitted. For market orders, the reference price at order creation. Null when no price was recorded.\n"
          },
          "qty": {
            "type": "string",
            "description": "Original order quantity in the denomination specified by `qty_unit` at creation"
          },
          "qty_unit": {
            "type": "string",
            "enum": [
              "base",
              "quote"
            ],
            "description": "Denomination of `qty` at creation"
          },
          "executed_qty": {
            "type": "string",
            "description": "Quantity of the base asset that has been filled so far"
          },
          "leaves_qty": {
            "type": "string",
            "description": "Remaining base asset quantity yet to be filled. Zero when the order is complete."
          },
          "executed_vwap": {
            "type": "string",
            "description": "Volume-weighted average price across all fills for this order"
          },
          "fee": {
            "type": "string",
            "description": "Total fee charged for this order in the quote asset. For CeFi orders this is the cumulative `trade_fee` across all fills; for DeFi orders it is the service fee captured at quote time, written once on confirmation.\n"
          },
          "tx_hash": {
            "type": "string",
            "description": "On-chain transaction hash for DeFi orders. Omitted for CeFi orders."
          },
          "explorer_url": {
            "type": "string",
            "description": "Public block-explorer page for the order. Hyperliquid orders link to the wallet's address page on the Hyperliquid explorer, since only the venue order id is recorded. Set on `GET /orders` and the transaction feed, like `asset_type`; omitted for CeFi orders and until the venue has acknowledged the order.\n"
          },
          "failure_reason": {
            "type": "string",
            "description": "Human-readable reason a failed order failed, sourced from the venue (e.g. insufficient balance, below minimum size). Present only on failed CeFi orders; omitted otherwise.\n"
          },
          "venue": {
            "$ref": "#/components/schemas/Venue"
          },
          "status": {
            "$ref": "#/components/schemas/OrderStatus"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "Timestamp when the order was created (RFC 3339)"
          },
          "asset_type": {
            "type": "string",
            "enum": [
              "spot",
              "perp"
            ],
            "description": "Product type of the traded asset. `perp` for Hyperliquid perpetuals, `spot` otherwise. Lets clients tell perp orders apart from spot ones sharing the same symbol.\n"
          },
          "trigger": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Trigger"
              }
            ],
            "description": "Set on a TP/SL trigger order, the same shape it was created with. Such an order is a `market` close, so `price` is null while it rests.\n"
          },
          "strategy_managed": {
            "type": "boolean",
            "description": "True on a live open order a strategy placed from the user's strategy sub-account. Its `order_id` is the DeFi order id; it is read-only here, and `POST /orders/{id}/cancel` returns 422. Omitted otherwise.\n"
          }
        }
      },
      "GatewayPagination": {
        "type": "object",
        "description": "Cursor-based pagination metadata. The cursor is opaque and must be passed back verbatim; never parse or construct one.\n",
        "properties": {
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Opaque cursor for the next page, null when the feed is exhausted"
          },
          "limit": {
            "type": "integer",
            "description": "Number of items per page"
          }
        }
      },
      "GetOrdersResponse": {
        "type": "object",
        "description": "Paginated list of orders with execution data",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrderDetail"
            },
            "description": "List of orders"
          },
          "pagination": {
            "$ref": "#/components/schemas/GatewayPagination"
          }
        }
      },
      "ListBalancesResponse": {
        "type": "object",
        "description": "Unified balances across CeFi and DeFi venues",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BalanceItem"
            },
            "description": "List of asset balances"
          }
        }
      },
      "BalanceItem": {
        "type": "object",
        "description": "A single asset balance on a specific venue",
        "properties": {
          "asset_id": {
            "type": "string",
            "format": "uuid",
            "description": "Unique asset identifier; pass as `asset_id` when creating an order. Empty when the asset is not in the catalog."
          },
          "economic_asset_id": {
            "type": "string",
            "format": "uuid",
            "description": "Economic asset this listing belongs to, shared across chains; omitted for CeFi rows"
          },
          "venue": {
            "$ref": "#/components/schemas/Venue"
          },
          "symbol": {
            "type": "string",
            "description": "Asset ticker symbol (e.g. BTC, USDC)"
          },
          "name": {
            "type": "string",
            "description": "Human-readable asset name"
          },
          "chain": {
            "type": [
              "string",
              "null"
            ],
            "description": "Blockchain network (\"solana\", \"base\"), or null for exchange-held assets"
          },
          "address": {
            "type": [
              "string",
              "null"
            ],
            "description": "Token contract/mint address, or null for exchange-held assets"
          },
          "decimals": {
            "type": "integer",
            "description": "Display precision (e.g. 8 for BTC, 6 for USDC)"
          },
          "total": {
            "type": "string",
            "description": "Gross balance including held amounts (decimal string)"
          },
          "available": {
            "type": "string",
            "description": "Usable balance after holds (decimal string)"
          },
          "held": {
            "type": "string",
            "description": "Amount locked in orders or transfers (decimal string)"
          },
          "stable": {
            "type": "boolean",
            "description": "Whether this is a stablecoin"
          },
          "tradeable": {
            "type": "boolean",
            "description": "Whether this asset is active for trading"
          }
        }
      },
      "ListPositionsResponse": {
        "type": "object",
        "description": "A user's open positions",
        "required": [
          "positions"
        ],
        "properties": {
          "positions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Position"
            },
            "description": "Open positions"
          }
        }
      },
      "Position": {
        "type": "object",
        "description": "A single open position",
        "properties": {
          "asset_id": {
            "type": "string",
            "format": "uuid",
            "description": "Unique asset identifier for the perp; pass as `asset_id` when creating an order. Empty when the coin is not listed."
          },
          "venue": {
            "$ref": "#/components/schemas/Venue"
          },
          "symbol": {
            "type": "string",
            "description": "Asset ticker symbol (e.g. BTC)"
          },
          "side": {
            "type": "string",
            "enum": [
              "long",
              "short"
            ],
            "description": "Position direction"
          },
          "size": {
            "type": "string",
            "description": "Absolute position size in the base asset (decimal string)"
          },
          "entry_price": {
            "type": "string",
            "description": "Average entry price (decimal string)"
          },
          "mark_price": {
            "type": "string",
            "description": "Current mark price used to value the position (decimal string)"
          },
          "liquidation_price": {
            "type": [
              "string",
              "null"
            ],
            "description": "Estimated liquidation price, or null when none is reported"
          },
          "margin_used": {
            "type": "string",
            "description": "Margin committed to this position (decimal string)"
          },
          "unrealized_pnl": {
            "type": "string",
            "description": "Signed unrealized PnL at mark (decimal string). Reported but never added into a portfolio total; balances and margin are already marked to market."
          },
          "return_on_equity": {
            "type": "string",
            "description": "Unrealized PnL as a fraction of margin used (decimal string)"
          },
          "leverage": {
            "type": "integer",
            "description": "Configured leverage for the position"
          }
        }
      },
      "PortfolioResponse": {
        "type": "object",
        "description": "The user's portfolio across the venues in scope: valued balances, open positions, and PnL.",
        "required": [
          "total_usd",
          "balances_usd",
          "cash_usd",
          "change_24h_usd",
          "change_24h_pct",
          "unrealized_pnl_usd",
          "realized_pnl_usd",
          "balances",
          "positions"
        ],
        "properties": {
          "total_usd": {
            "type": "string",
            "description": "Total account equity (decimal string): balances_usd plus the margin committed to open positions, counted once. A Hyperliquid unified account's spot USDC balance already holds that margin, so none is added for it. Unrealized PnL is not added; balances and margin are already marked to market."
          },
          "balances_usd": {
            "type": "string",
            "description": "Value of balances (decimal string), excluding unpriced assets. Collateral committed to open perps is excluded, except on a Hyperliquid unified account, whose spot USDC balance holds it."
          },
          "cash_usd": {
            "type": "string",
            "description": "Value of stablecoin and quote-asset balances at the venues in scope (decimal string)."
          },
          "change_24h_usd": {
            "type": "string",
            "description": "Rolling 24h change in balance value (decimal string)"
          },
          "change_24h_pct": {
            "type": "string",
            "description": "Rolling 24h change as a percent (decimal string)"
          },
          "unrealized_pnl_usd": {
            "type": "string",
            "description": "Spot unrealized PnL plus position unrealized PnL (decimal string). Spot covers on-platform acquisitions only."
          },
          "realized_pnl_usd": {
            "type": "string",
            "description": "Realized PnL from on-platform spot sells (decimal string)"
          },
          "balances": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PortfolioBalance"
            }
          },
          "positions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Position"
            }
          }
        }
      },
      "PortfolioBalance": {
        "type": "object",
        "description": "A single asset balance with USD valuation. price, value and change_24h_pct are null when the asset has no live price.",
        "required": [
          "symbol",
          "venue",
          "decimals",
          "total",
          "available",
          "held",
          "stable",
          "tradeable"
        ],
        "properties": {
          "asset_id": {
            "type": "string",
            "format": "uuid",
            "description": "Unique asset identifier; pass as `asset_id` when creating an order. Absent when the asset is not in the catalog."
          },
          "symbol": {
            "type": "string",
            "description": "Asset ticker symbol (e.g. BTC, USDC)"
          },
          "name": {
            "type": "string",
            "description": "Human-readable asset name"
          },
          "venue": {
            "$ref": "#/components/schemas/Venue"
          },
          "chain": {
            "type": [
              "string",
              "null"
            ],
            "description": "Blockchain network, or null for exchange-held assets"
          },
          "address": {
            "type": [
              "string",
              "null"
            ],
            "description": "Token contract/mint address, or null for exchange-held assets"
          },
          "decimals": {
            "type": "integer",
            "description": "Display precision"
          },
          "icon": {
            "type": [
              "string",
              "null"
            ],
            "description": "Icon image URL"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "preview",
              "sell_only",
              "transfer_only",
              "disabled"
            ],
            "description": "Per-listing trading status"
          },
          "stable": {
            "type": "boolean",
            "description": "Whether this is a stablecoin"
          },
          "tradeable": {
            "type": "boolean",
            "description": "Whether this asset is active for trading"
          },
          "total": {
            "type": "string",
            "description": "Gross balance including held amounts (decimal string)"
          },
          "available": {
            "type": "string",
            "description": "Usable balance after holds (decimal string)"
          },
          "held": {
            "type": "string",
            "description": "Amount locked in orders or transfers (decimal string)"
          },
          "price": {
            "type": [
              "string",
              "null"
            ],
            "description": "Current USD price per unit; null when unpriced"
          },
          "value": {
            "type": [
              "string",
              "null"
            ],
            "description": "USD value of total; null when unpriced and excluded from totals"
          },
          "change_24h_pct": {
            "type": [
              "string",
              "null"
            ],
            "description": "Rolling 24h price change as a percent (decimal string)"
          },
          "cost_basis": {
            "$ref": "#/components/schemas/PortfolioCostBasis"
          }
        }
      },
      "PortfolioCostBasis": {
        "type": "object",
        "description": "On-platform cost basis for one asset symbol, FIFO over buys. Absent for quote and stable assets and when the holding was acquired entirely off platform.",
        "required": [
          "avg_entry_price",
          "cost_usd",
          "qty",
          "realized_pnl",
          "unrealized_pnl"
        ],
        "properties": {
          "avg_entry_price": {
            "type": "string",
            "description": "FIFO average entry price of the still-held on-platform quantity"
          },
          "cost_usd": {
            "type": "string",
            "description": "USD cost of the still-held on-platform quantity"
          },
          "qty": {
            "type": "string",
            "description": "Still-held quantity acquired on platform, clamped so it never exceeds the row's total."
          },
          "realized_pnl": {
            "type": "string",
            "description": "Realized PnL from sells; sell fees reduce proceeds"
          },
          "unrealized_pnl": {
            "type": "string",
            "description": "Mark-to-market PnL on the still-held on-platform quantity"
          }
        }
      },
      "AssetImage": {
        "type": "object",
        "description": "Asset image URLs at various resolutions",
        "properties": {
          "thumb": {
            "type": "string"
          },
          "small": {
            "type": "string"
          },
          "large": {
            "type": "string"
          }
        }
      },
      "AssetMarketData": {
        "type": "object",
        "description": "Supply-side market data",
        "properties": {
          "circulating_supply": {
            "type": "integer",
            "format": "int64"
          },
          "total_supply": {
            "type": "integer",
            "format": "int64"
          },
          "max_supply": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "AssetPerpData": {
        "type": "object",
        "description": "Perp-only market data, present only for perp assets. Values are decimal strings for precision and are null until a market snapshot has populated them.\n",
        "properties": {
          "funding_rate": {
            "type": [
              "string",
              "null"
            ],
            "description": "Current hourly funding rate."
          },
          "open_interest": {
            "type": [
              "string",
              "null"
            ],
            "description": "Open interest in base units."
          },
          "volume_24h": {
            "type": [
              "string",
              "null"
            ],
            "description": "24h notional volume."
          },
          "max_leverage": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Maximum leverage supported for this perp."
          }
        }
      },
      "AssetSocials": {
        "type": "object",
        "description": "Social media links",
        "properties": {
          "x_username": {
            "type": "string"
          },
          "facebook_username": {
            "type": "string"
          },
          "subreddit_url": {
            "type": "string"
          },
          "official_forum_url": {
            "type": "string"
          }
        }
      },
      "AssetNetwork": {
        "type": "object",
        "description": "A deposit/withdrawal network supported for a CeFi asset, together with any additional networks whose deposits route to the same address. This is the source of truth for the `network` field when creating a CeFi transfer via [`createTransfer`](#operation/createTransfer): that field must match this `network` or one of its `compatible_networks` (case-insensitive).\n",
        "required": [
          "network",
          "compatible_networks"
        ],
        "properties": {
          "network": {
            "type": "string",
            "description": "Canonical network name for this deposit/withdrawal rail (e.g. `bitcoin`).",
            "example": "bitcoin"
          },
          "compatible_networks": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Additional network names whose deposits route to the same address as `network`, including `network` itself. Any of these is an accepted `network` value for a CeFi transfer.\n"
          }
        }
      },
      "AssetItem": {
        "type": "object",
        "description": "A single tradeable asset",
        "required": [
          "networks"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Unique asset identifier; pass as `asset_id` when creating an order."
          },
          "chain": {
            "type": [
              "string",
              "null"
            ],
            "description": "Blockchain network (null for CeFi assets)"
          },
          "address": {
            "type": [
              "string",
              "null"
            ],
            "description": "Token contract address (null for CeFi assets)"
          },
          "symbol": {
            "type": "string",
            "description": "Asset ticker symbol (e.g. BTC, SOL)"
          },
          "name": {
            "type": "string",
            "description": "Human-readable asset name"
          },
          "decimals": {
            "type": "integer",
            "minimum": 0,
            "maximum": 255,
            "description": "Token decimal precision"
          },
          "slug": {
            "type": "string",
            "description": "URL-safe asset identifier"
          },
          "is_active": {
            "type": "boolean"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "preview",
              "sell_only",
              "transfer_only",
              "disabled"
            ],
            "description": "Per-listing trading status. `GET /assets` lists `active` and `sell_only` listings, while `GET /assets/{chain}/{address}` returns any status, so clients gate on this field directly.\n"
          },
          "description": {
            "type": "string"
          },
          "website": {
            "type": "string"
          },
          "icon": {
            "type": [
              "string",
              "null"
            ],
            "description": "Icon image URL"
          },
          "tradeable": {
            "type": "boolean",
            "description": "Whether this asset can be traded directly"
          },
          "stable": {
            "type": "boolean",
            "description": "Whether this is a stablecoin"
          },
          "venue": {
            "$ref": "#/components/schemas/Venue"
          },
          "type": {
            "$ref": "#/components/schemas/ProductType"
          },
          "asset_class": {
            "$ref": "#/components/schemas/AssetClass"
          },
          "image": {
            "$ref": "#/components/schemas/AssetImage"
          },
          "market_data": {
            "$ref": "#/components/schemas/AssetMarketData"
          },
          "perp": {
            "description": "Perp-only market data; present only for perp assets.",
            "anyOf": [
              {
                "type": "object",
                "allOf": [
                  {
                    "$ref": "#/components/schemas/AssetPerpData"
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "socials": {
            "$ref": "#/components/schemas/AssetSocials"
          },
          "networks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AssetNetwork"
            }
          },
          "settlement": {
            "type": "string",
            "enum": [
              "paxos",
              "defi"
            ],
            "description": "Custody rail a CeFi spot listing settles on; absent for any other listing. Trading a `paxos` listing requires Paxos KYC, a `defi` listing only a CeFi trading account.\n"
          },
          "cefi_instrument": {
            "type": "string",
            "example": "NVDAC-USDC",
            "description": "TrueX instrument symbol a CeFi spot listing trades on; absent for any other listing and while the instrument is not yet resolved.\n"
          }
        }
      },
      "AssetAvailability": {
        "type": "object",
        "description": "Asset families the caller's country is allowed to trade",
        "required": [
          "country",
          "allowed_product_types",
          "allowed_asset_classes"
        ],
        "properties": {
          "country": {
            "type": "string",
            "pattern": "^[A-Z]{2}$",
            "description": "ISO 3166-1 alpha-2 country the request resolved to, or `XX` when it could not be resolved.",
            "example": "US"
          },
          "allowed_product_types": {
            "type": "array",
            "description": "Product types the country may trade. Empty means none.",
            "example": [
              "spot",
              "perp"
            ],
            "items": {
              "$ref": "#/components/schemas/ProductType"
            }
          },
          "allowed_asset_classes": {
            "type": "array",
            "description": "Asset classes the country may trade. Empty means none.",
            "example": [
              "crypto"
            ],
            "items": {
              "$ref": "#/components/schemas/AssetClass"
            }
          }
        }
      },
      "ListAssetsResponse": {
        "type": "object",
        "description": "Paginated list of tradeable assets",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AssetItem"
            }
          },
          "pagination": {
            "$ref": "#/components/schemas/GatewayPagination"
          }
        }
      },
      "TransferStatus": {
        "type": "string",
        "enum": [
          "awaiting_signature",
          "pending",
          "completed",
          "failed"
        ],
        "example": "pending",
        "description": "The current status of the transfer.\n* **awaiting_signature** — Transfer has been created and is waiting for the client to sign the unsigned payloads and call the execute endpoint.\n* **pending** — Signed transaction has been submitted and is awaiting on-chain confirmation.\n* **completed** — Transfer has been confirmed on-chain.\n* **failed** — Transfer failed due to an on-chain error or rejection.\n"
      },
      "CreateAllocationRequest": {
        "type": "object",
        "description": "Request to allocate wallet balance to CeFi trading",
        "required": [
          "asset_id",
          "amount"
        ],
        "properties": {
          "asset_id": {
            "type": "string",
            "format": "uuid",
            "description": "DeFi listing identifier (UUID)",
            "example": "b3d9e5f2-1a4c-4e7b-9f0d-2c8a6b3e5f91"
          },
          "amount": {
            "type": "string",
            "description": "Amount to allocate, as a positive decimal string",
            "example": "100.00"
          }
        }
      },
      "AllocationStatus": {
        "type": "string",
        "enum": [
          "allocating",
          "crediting",
          "releasing",
          "completed",
          "rejected",
          "stranded"
        ],
        "example": "crediting",
        "description": "Where the allocation stands.\n* **allocating** — The amount is being allocated in the wallet.\n* **crediting** — The amount is allocated and is being credited to CeFi.\n* **releasing** — The allocation was refused and the amount is being freed in the wallet.\n* **completed** — The amount is available to trade on CeFi.\n* **rejected** — The allocation was refused and the amount is free in the wallet again.\n* **stranded** — The outcome is unknown and support has to resolve it.\n"
      },
      "Allocation": {
        "type": "object",
        "description": "An allocation and what it has left behind on each side so far.",
        "required": [
          "id",
          "status",
          "asset_id",
          "asset_symbol",
          "amount",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Allocation identifier",
            "example": "c1d2e3f4-5a6b-4c7d-8e9f-0a1b2c3d4e5f"
          },
          "status": {
            "$ref": "#/components/schemas/AllocationStatus"
          },
          "asset_id": {
            "type": "string",
            "format": "uuid",
            "description": "DeFi listing identifier (UUID)",
            "example": "b3d9e5f2-1a4c-4e7b-9f0d-2c8a6b3e5f91"
          },
          "asset_symbol": {
            "type": "string",
            "description": "Symbol of the listing",
            "example": "USDC"
          },
          "amount": {
            "type": "string",
            "description": "Amount this allocation sets aside, as a decimal string",
            "example": "100.00"
          },
          "allocated_total": {
            "type": "string",
            "description": "Everything the caller has allocated of the listing after this allocation, as a decimal string",
            "example": "250.00"
          },
          "transfer": {
            "$ref": "#/components/schemas/CustodyTransfer"
          },
          "failure_reason": {
            "type": "string",
            "description": "Why the allocation was refused or stranded",
            "example": "cefi REJECTED"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "CustodyTransfer": {
        "type": "object",
        "description": "The CeFi transfer an allocation or release started, under the exchange's id",
        "required": [
          "id",
          "status"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Exchange transfer identifier",
            "example": "a7f3c2e1-9b4d-4e6f-8a1c-3d5e7f9b2c4a"
          },
          "status": {
            "type": "string",
            "enum": [
              "INITIALIZED",
              "PENDING",
              "PROCESSING",
              "COMPLETED",
              "REJECTED",
              "FAILED"
            ],
            "description": "Status as last seen from the exchange",
            "example": "COMPLETED"
          }
        }
      },
      "ListAllocationsResponse": {
        "type": "object",
        "description": "Paginated list of allocations",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Allocation"
            },
            "description": "List of allocations"
          },
          "pagination": {
            "$ref": "#/components/schemas/GatewayPagination"
          }
        }
      },
      "CreateReleaseRequest": {
        "type": "object",
        "description": "Request to release allocated balance from CeFi trading",
        "required": [
          "asset_id",
          "amount"
        ],
        "properties": {
          "asset_id": {
            "type": "string",
            "format": "uuid",
            "description": "DeFi listing identifier (UUID)",
            "example": "b3d9e5f2-1a4c-4e7b-9f0d-2c8a6b3e5f91"
          },
          "amount": {
            "type": "string",
            "description": "Amount to release, as a positive decimal string",
            "example": "100.00"
          }
        }
      },
      "ReleaseStatus": {
        "type": "string",
        "enum": [
          "debiting",
          "completed",
          "rejected",
          "stranded"
        ],
        "example": "debiting",
        "description": "Where the release stands.\n* **debiting** — The amount is being taken out of CeFi.\n* **completed** — The amount is out of CeFi and free in the wallet again.\n* **rejected** — The release was refused; the amount stays allocated.\n* **stranded** — The outcome is unknown and support has to resolve it.\n"
      },
      "Release": {
        "type": "object",
        "description": "A release and the CeFi transfer it started.",
        "required": [
          "id",
          "status",
          "asset_id",
          "asset_symbol",
          "amount",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Release identifier",
            "example": "c1d2e3f4-5a6b-4c7d-8e9f-0a1b2c3d4e5f"
          },
          "status": {
            "$ref": "#/components/schemas/ReleaseStatus"
          },
          "asset_id": {
            "type": "string",
            "format": "uuid",
            "description": "DeFi listing identifier (UUID)",
            "example": "b3d9e5f2-1a4c-4e7b-9f0d-2c8a6b3e5f91"
          },
          "asset_symbol": {
            "type": "string",
            "description": "Symbol of the listing",
            "example": "USDC"
          },
          "amount": {
            "type": "string",
            "description": "Amount freed by this release, as a decimal string",
            "example": "100.00"
          },
          "transfer": {
            "$ref": "#/components/schemas/CustodyTransfer"
          },
          "failure_reason": {
            "type": "string",
            "description": "Why the release was refused or stranded",
            "example": "cefi REJECTED"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "PaperDepositRequest": {
        "type": "object",
        "description": "Request to add test funds to the caller's paper wallet",
        "required": [
          "asset_id",
          "amount"
        ],
        "properties": {
          "asset_id": {
            "type": "string",
            "format": "uuid",
            "description": "DeFi listing identifier (UUID)",
            "example": "b3d9e5f2-1a4c-4e7b-9f0d-2c8a6b3e5f91"
          },
          "amount": {
            "type": "string",
            "description": "Amount to add, as a positive decimal string in asset units",
            "example": "1000"
          },
          "allocate": {
            "type": "boolean",
            "description": "Whether to also allocate the added funds to CeFi trading through an allocation. Unset allocates them when the listing has a CeFi market."
          }
        }
      },
      "PaperDepositResponse": {
        "type": "object",
        "description": "The test funds added and the allocation setting them aside for CeFi, if any",
        "required": [
          "asset_id",
          "amount",
          "wallet_balance"
        ],
        "properties": {
          "asset_id": {
            "type": "string",
            "format": "uuid",
            "description": "DeFi listing identifier (UUID)",
            "example": "b3d9e5f2-1a4c-4e7b-9f0d-2c8a6b3e5f91"
          },
          "amount": {
            "type": "string",
            "description": "Amount added, as a decimal string",
            "example": "1000"
          },
          "wallet_balance": {
            "type": "string",
            "description": "The paper wallet's balance of the listing after the funds were added",
            "example": "1000"
          },
          "allocation": {
            "$ref": "#/components/schemas/Allocation"
          }
        }
      },
      "PaperWithdrawalRequest": {
        "type": "object",
        "description": "Request to remove test funds from the caller's paper wallet",
        "required": [
          "asset_id"
        ],
        "properties": {
          "asset_id": {
            "type": "string",
            "format": "uuid",
            "description": "DeFi listing identifier (UUID)",
            "example": "b3d9e5f2-1a4c-4e7b-9f0d-2c8a6b3e5f91"
          },
          "amount": {
            "type": "string",
            "description": "Amount to remove, as a positive decimal string; omit to empty the wallet",
            "example": "250"
          }
        }
      },
      "PaperWithdrawalResponse": {
        "type": "object",
        "description": "The test funds removed and the CeFi release that freed them, if any",
        "required": [
          "asset_id",
          "debited",
          "wallet_balance"
        ],
        "properties": {
          "asset_id": {
            "type": "string",
            "format": "uuid",
            "description": "DeFi listing identifier (UUID)",
            "example": "b3d9e5f2-1a4c-4e7b-9f0d-2c8a6b3e5f91"
          },
          "debited": {
            "type": "string",
            "description": "Amount removed from the wallet, as a decimal string",
            "example": "250"
          },
          "wallet_balance": {
            "type": "string",
            "description": "The paper wallet's balance of the listing after the funds were removed",
            "example": "750"
          },
          "release": {
            "$ref": "#/components/schemas/Release"
          },
          "cefi_unbacked": {
            "type": "string",
            "description": "CeFi balance of the listing beyond the caller's allocation, which has no allocation behind it and so was left on CeFi, as a decimal string. Present only when positive.",
            "example": "1.877"
          }
        }
      },
      "ListReleasesResponse": {
        "type": "object",
        "description": "Paginated list of releases",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Release"
            },
            "description": "List of releases"
          },
          "pagination": {
            "$ref": "#/components/schemas/GatewayPagination"
          }
        }
      },
      "CreateTransferRequest": {
        "type": "object",
        "description": "Request to create a new on-chain transfer",
        "required": [
          "asset_id",
          "qty",
          "qty_unit",
          "to"
        ],
        "properties": {
          "asset_id": {
            "type": "string",
            "format": "uuid",
            "description": "Asset identifier (UUID)",
            "example": "b3d9e5f2-1a4c-4e7b-9f0d-2c8a6b3e5f91"
          },
          "qty": {
            "type": "string",
            "description": "Transfer quantity as a positive decimal string",
            "example": "100.00"
          },
          "qty_unit": {
            "type": "string",
            "enum": [
              "base",
              "quote"
            ],
            "description": "Unit of the quantity.\n* **base** — Quantity is denominated in the base asset.\n* **quote** — Quantity is denominated in the quote asset.\n",
            "example": "base"
          },
          "to": {
            "type": "string",
            "description": "Destination wallet address",
            "example": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
          },
          "network": {
            "type": "string",
            "description": "Destination network for the withdrawal. **Required for CeFi transfers** and **must be omitted for DeFi transfers** (DeFi derives the network from the asset's chain).\n\nThe set of supported networks is asset-specific and is retrieved from the [`listAssets`](#operation/listAssets) (`GET /assets`) response: for the asset whose `id` equals this request's `asset_id`, `network` must match one of that asset's `networks[].network` values or any of their `networks[].compatible_networks` values. Matching is case-insensitive. Supplying an unsupported network returns `400 Bad Request`.\n",
            "example": "bitcoin"
          }
        }
      },
      "ExecuteTransferRequest": {
        "type": "object",
        "description": "Request to execute a transfer that is in `awaiting_signature` status. The client must sign each payload returned by the create endpoint and submit the signatures in the same order.\n",
        "required": [
          "signatures",
          "auth_type"
        ],
        "properties": {
          "signatures": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "minItems": 1,
            "description": "One stamp per payload, in the same order as the payloads returned by the create endpoint. With `auth_type: api_key`, an entry is the base64url encoding, without padding, of the JSON `{\"publicKey\": \"<compressed P-256 public key, hex>\", \"signature\": \"<DER signature, hex>\", \"scheme\": \"SIGNATURE_SCHEME_TK_API_P256\"}`, signed as `UnsignedPayload` describes. With `auth_type: web_authn`, an entry is the browser's WebAuthn stamp.\n"
          },
          "auth_type": {
            "$ref": "#/components/schemas/SigningMethod"
          }
        }
      },
      "TransferDetail": {
        "type": "object",
        "description": "Canonical representation of a transfer.",
        "required": [
          "id",
          "status",
          "venue",
          "asset_id",
          "asset_symbol",
          "chain",
          "network",
          "to",
          "qty",
          "qty_unit",
          "sent",
          "fee",
          "received",
          "tx_hash",
          "payloads",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Unique transfer identifier"
          },
          "status": {
            "$ref": "#/components/schemas/TransferStatus"
          },
          "venue": {
            "$ref": "#/components/schemas/Venue"
          },
          "asset_id": {
            "type": "string",
            "format": "uuid",
            "description": "Asset identifier"
          },
          "asset_symbol": {
            "type": "string",
            "description": "Asset ticker symbol (e.g. `USDC`, `SOL`)"
          },
          "chain": {
            "type": [
              "string",
              "null"
            ],
            "description": "Blockchain network (e.g. `solana`, `base`) for DeFi transfers, or null for CeFi transfers"
          },
          "network": {
            "type": [
              "string",
              "null"
            ],
            "description": "Destination network the CeFi withdrawal was submitted on (one of the asset's supported networks from `GET /assets`), or null for DeFi transfers.\n",
            "example": "bitcoin"
          },
          "to": {
            "type": "string",
            "description": "Destination wallet address"
          },
          "qty": {
            "type": "string",
            "description": "Transfer quantity as a decimal string"
          },
          "qty_unit": {
            "type": "string",
            "enum": [
              "base",
              "quote"
            ],
            "description": "Unit of the quantity"
          },
          "sent": {
            "type": "string",
            "description": "Amount sent as a decimal string"
          },
          "fee": {
            "type": "string",
            "description": "Fee as a decimal string"
          },
          "received": {
            "type": "string",
            "description": "Amount received as a decimal string"
          },
          "tx_hash": {
            "type": "string",
            "description": "On-chain transaction hash"
          },
          "explorer_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Public block-explorer page for `tx_hash`, null until the transfer is broadcast"
          },
          "payloads": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UnsignedPayload"
            },
            "description": "Unsigned transaction payloads for the client to sign. Present when status is `awaiting_signature`; empty array after execution.\n"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "Timestamp when the transfer was created (RFC 3339)"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "Timestamp of the last status update (RFC 3339)"
          }
        }
      },
      "ListTransfersResponse": {
        "type": "object",
        "description": "Paginated list of transfers",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TransferDetail"
            },
            "description": "List of transfers"
          },
          "pagination": {
            "$ref": "#/components/schemas/GatewayPagination"
          }
        }
      },
      "CreateRampRequest": {
        "type": "object",
        "description": "Request to create a ramp",
        "required": [
          "payment_method",
          "direction",
          "amount"
        ],
        "properties": {
          "payment_method": {
            "$ref": "#/components/schemas/RampPaymentMethod"
          },
          "direction": {
            "type": "string",
            "enum": [
              "onramp",
              "offramp"
            ],
            "description": "`onramp` buys crypto with fiat. `offramp` sells crypto for fiat."
          },
          "amount": {
            "type": "string",
            "description": "Decimal string. Fiat to spend on an onramp, or settlement stablecoin to sell on an offramp.\n",
            "example": "100.50"
          },
          "channel": {
            "type": "string",
            "enum": [
              "web",
              "ios",
              "android"
            ],
            "description": "Surface the request originates from. Required for `APPLE_PAY` and `GOOGLE_PAY`.",
            "example": "ios"
          }
        }
      },
      "CreateRampResponse": {
        "type": "object",
        "description": "A created ramp, with the provider page to complete it on",
        "required": [
          "id",
          "redirect_url"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Ramp ID, used by every other ramp endpoint"
          },
          "redirect_url": {
            "type": "string",
            "description": "Provider page the user completes the sale on"
          },
          "bridge_plan": {
            "$ref": "#/components/schemas/RampBridgePlan"
          }
        }
      },
      "RampBridgePlan": {
        "type": "object",
        "description": "Present when the user's own funds must move onto the settlement chain before the offramp transfer. Sign every payload and submit the signatures to `POST /ramps/{id}/bridge/execute`.\n",
        "required": [
          "id",
          "payloads",
          "steps",
          "shortfall"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Bridge ID"
          },
          "payloads": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UnsignedPayload"
            }
          },
          "steps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RampBridgeStep"
            }
          },
          "shortfall": {
            "$ref": "#/components/schemas/RampBridgeShortfall"
          }
        }
      },
      "RampBridgeStep": {
        "type": "object",
        "description": "One fund movement in a bridge plan",
        "required": [
          "kind",
          "amount",
          "asset_symbol",
          "src_chain"
        ],
        "properties": {
          "kind": {
            "type": "string",
            "description": "The kind of movement, e.g. a same-chain swap or a cross-chain bridge"
          },
          "amount": {
            "type": "string",
            "description": "Amount moved in this step, as a decimal string"
          },
          "asset_symbol": {
            "type": "string",
            "description": "Symbol debited in this step"
          },
          "dst_asset_symbol": {
            "type": "string",
            "description": "Symbol credited in this step, when it differs from the debited one"
          },
          "src_chain": {
            "type": "string",
            "description": "Chain the step debits from"
          }
        }
      },
      "RampBridgeShortfall": {
        "type": "object",
        "description": "The amount of the settlement asset the bridge plan covers",
        "required": [
          "amount",
          "asset_symbol"
        ],
        "properties": {
          "amount": {
            "type": "string",
            "description": "Amount to be bridged, as a decimal string"
          },
          "asset_symbol": {
            "type": "string",
            "description": "Settlement asset symbol"
          }
        }
      },
      "RampBridgeExecuteRequest": {
        "type": "object",
        "description": "Signatures over a bridge plan's payloads, in the same order",
        "required": [
          "signatures",
          "auth_type"
        ],
        "properties": {
          "signatures": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "minItems": 1,
            "description": "One stamp per payload, in the same order as the payloads in the bridge plan. With `auth_type: api_key`, an entry is the base64url encoding, without padding, of the JSON `{\"publicKey\": \"<compressed P-256 public key, hex>\", \"signature\": \"<DER signature, hex>\", \"scheme\": \"SIGNATURE_SCHEME_TK_API_P256\"}`, signed as `UnsignedPayload` describes. With `auth_type: web_authn`, an entry is the browser's WebAuthn stamp.\n"
          },
          "auth_type": {
            "$ref": "#/components/schemas/SigningMethod"
          }
        }
      },
      "RampBridgeExecuteResponse": {
        "type": "object",
        "description": "The executed bridge",
        "required": [
          "bridge_id"
        ],
        "properties": {
          "bridge_id": {
            "type": "string"
          }
        }
      },
      "RampTransferPrepareResponse": {
        "type": "object",
        "description": "Unsigned payloads for the transfer that sends funds to the provider",
        "required": [
          "transfer_id",
          "payloads"
        ],
        "properties": {
          "transfer_id": {
            "type": "string"
          },
          "payloads": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UnsignedPayload"
            }
          }
        }
      },
      "RampTransferExecuteRequest": {
        "type": "object",
        "description": "The prepared transfer and the signatures over its payloads",
        "required": [
          "transfer_id",
          "signatures",
          "auth_type"
        ],
        "properties": {
          "transfer_id": {
            "type": "string",
            "description": "Transfer ID returned by the prepare endpoint"
          },
          "signatures": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "minItems": 1,
            "description": "One stamp per payload, in the same order as the payloads returned by the prepare endpoint. With `auth_type: api_key`, an entry is the base64url encoding, without padding, of the JSON `{\"publicKey\": \"<compressed P-256 public key, hex>\", \"signature\": \"<DER signature, hex>\", \"scheme\": \"SIGNATURE_SCHEME_TK_API_P256\"}`, signed as `UnsignedPayload` describes. With `auth_type: web_authn`, an entry is the browser's WebAuthn stamp.\n"
          },
          "auth_type": {
            "$ref": "#/components/schemas/SigningMethod"
          }
        }
      },
      "RampTransferExecuteResponse": {
        "type": "object",
        "description": "The settled on-chain transfer to the provider",
        "required": [
          "tx_hash",
          "chain",
          "asset",
          "from",
          "to",
          "sent",
          "fee",
          "received"
        ],
        "properties": {
          "tx_hash": {
            "type": "string"
          },
          "chain": {
            "type": "string"
          },
          "asset": {
            "type": "string"
          },
          "from": {
            "type": "string"
          },
          "to": {
            "type": "string"
          },
          "sent": {
            "type": "string"
          },
          "fee": {
            "type": "string"
          },
          "received": {
            "type": "string"
          }
        }
      },
      "RampDetail": {
        "type": "object",
        "description": "Canonical representation of a ramp, served from the Gateway's own record. The settlement fields are filled in as the ramp progresses, so they are absent on a freshly created ramp and present once it settles.\n",
        "required": [
          "id",
          "payment_method",
          "direction",
          "status",
          "amount",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "payment_method": {
            "$ref": "#/components/schemas/RampPaymentMethod"
          },
          "direction": {
            "type": "string",
            "enum": [
              "onramp",
              "offramp"
            ]
          },
          "status": {
            "$ref": "#/components/schemas/RampStatus"
          },
          "amount": {
            "type": "string",
            "description": "Amount requested at creation, in the settlement asset"
          },
          "asset_symbol": {
            "type": "string"
          },
          "asset_amount": {
            "type": "string",
            "description": "Amount actually settled"
          },
          "fiat_currency": {
            "type": "string"
          },
          "fiat_amount": {
            "type": "string"
          },
          "fee_amount": {
            "type": "string"
          },
          "fee_currency": {
            "type": "string"
          },
          "exchange_rate": {
            "type": "string"
          },
          "wallet_address": {
            "type": "string",
            "description": "Address the ramp settles against"
          },
          "provider_wallet_address": {
            "type": "string",
            "description": "Provider deposit address the offramp transfer sends to"
          },
          "tx_hash": {
            "type": "string"
          },
          "redirect_url": {
            "type": "string"
          },
          "failure_reason": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "completed_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "AssetFlow": {
        "type": "string",
        "description": "Direction the row's asset moved relative to the caller's holdings, for rendering a row without reading the typed object. Scoped to `asset_symbol`, so a buy is `in` even though value moved out. Compose your own label from `type` and this field.\n",
        "enum": [
          "in",
          "out"
        ]
      },
      "TransactionType": {
        "type": "string",
        "description": "Kind of activity a transaction-feed row represents.",
        "enum": [
          "order",
          "transfer",
          "ramp"
        ]
      },
      "TransactionStatus": {
        "type": "string",
        "description": "Lifecycle bucket shared by all three types. Each type's native status stays verbatim inside the row's typed object.\n",
        "enum": [
          "pending",
          "completed",
          "failed",
          "canceled"
        ]
      },
      "TransactionDetail": {
        "type": "object",
        "description": "One feed row. Exactly one of `order`, `transfer`, or `ramp` is present, matching `type`, and holds the same shape that type's own endpoint returns.\n",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Id of the underlying order, transfer, or ramp"
          },
          "type": {
            "$ref": "#/components/schemas/TransactionType"
          },
          "asset_flow": {
            "$ref": "#/components/schemas/AssetFlow"
          },
          "status": {
            "$ref": "#/components/schemas/TransactionStatus"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the row was created"
          },
          "completed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the row reached a terminal status; null while in flight"
          },
          "qty": {
            "type": [
              "string",
              "null"
            ],
            "description": "Quantity denominated in `asset_symbol`: executed quantity for a filled order, requested quantity for an unfilled one, transferred quantity for a transfer, settled amount for a ramp. Null when none is known yet — an unfilled quote-denominated order, or an unsettled ramp.\n"
          },
          "asset_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Null for ramps until they carry an asset id"
          },
          "asset_symbol": {
            "type": [
              "string",
              "null"
            ]
          },
          "tx_hash": {
            "type": [
              "string",
              "null"
            ],
            "description": "Set once the row settles on-chain"
          },
          "explorer_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Public block-explorer page for the row: the order's or transfer's, or the Solana page for a ramp. Null while `tx_hash` is null and for CeFi orders.\n"
          },
          "failure_reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "Venue-supplied reason, set only on a failed row"
          },
          "order": {
            "allOf": [
              {
                "$ref": "#/components/schemas/OrderDetail"
              }
            ],
            "description": "Present only when `type` is `order`"
          },
          "transfer": {
            "allOf": [
              {
                "$ref": "#/components/schemas/TransferDetail"
              }
            ],
            "description": "Present only when `type` is `transfer`"
          },
          "ramp": {
            "allOf": [
              {
                "$ref": "#/components/schemas/RampDetail"
              }
            ],
            "description": "Present only when `type` is `ramp`"
          }
        }
      },
      "ListTransactionsResponse": {
        "type": "object",
        "description": "Paginated unified feed of orders, transfers, and ramps",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TransactionDetail"
            },
            "description": "List of transactions, newest first"
          },
          "pagination": {
            "$ref": "#/components/schemas/GatewayPagination"
          }
        }
      },
      "OrganizationTransaction": {
        "allOf": [
          {
            "$ref": "#/components/schemas/TransactionDetail"
          },
          {
            "type": "object",
            "description": "A transaction with the served user it belongs to",
            "required": [
              "user_id"
            ],
            "properties": {
              "user_id": {
                "type": "string",
                "format": "uuid",
                "description": "The served user this transaction belongs to"
              }
            }
          }
        ]
      },
      "ListOrganizationTransactionsResponse": {
        "type": "object",
        "description": "Paginated feed across an organization's users",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrganizationTransaction"
            },
            "description": "Transactions, newest first"
          },
          "pagination": {
            "$ref": "#/components/schemas/GatewayPagination"
          }
        }
      },
      "ListRampsResponse": {
        "type": "object",
        "description": "Paginated list of ramps",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RampDetail"
            },
            "description": "List of ramps"
          },
          "pagination": {
            "$ref": "#/components/schemas/GatewayPagination"
          }
        }
      },
      "RampPaymentMethod": {
        "type": "string",
        "description": "Rail the ramp is funded or paid out through. DeFi routes the provider from it, so it is the caller's only choice of venue. `APPLE_PAY` and `GOOGLE_PAY` are onramp-only and require a `channel`.\n",
        "enum": [
          "COINBASE",
          "PAYPAL",
          "APPLE_PAY",
          "GOOGLE_PAY"
        ]
      },
      "RampStatus": {
        "type": "string",
        "description": "Ramp lifecycle: `created` until funds move, `pending` while the provider settles, then `completed`, `failed`, or `expired` if it was abandoned before any funds moved.\n",
        "enum": [
          "created",
          "pending",
          "completed",
          "failed",
          "expired"
        ]
      },
      "GatewayError": {
        "type": "object",
        "description": "Shared API error envelope",
        "required": [
          "type",
          "message",
          "request_id"
        ],
        "properties": {
          "type": {
            "type": "string",
            "description": "Closed error category fixing the HTTP status",
            "enum": [
              "invalid_argument",
              "unauthenticated",
              "permission_denied",
              "not_found",
              "method_not_allowed",
              "conflict",
              "failed_precondition",
              "resource_exhausted",
              "unavailable",
              "internal"
            ]
          },
          "code": {
            "type": "string",
            "description": "Specific error condition from the fleet code registry. Extensible: clients MUST tolerate values not listed here and fall back to type-based handling. Omitted when no code applies.",
            "x-extensible-enum": [
              "allowance_approval_required",
              "already_submitted",
              "amount_above_maximum",
              "amount_below_minimum",
              "buy_not_allowed",
              "chain_not_supported",
              "guest_checkout_limit_exceeded",
              "guest_checkout_unavailable",
              "insufficient_balance",
              "insufficient_native_balance",
              "invalid_leverage",
              "invalid_otp_code",
              "invalid_qty_precision",
              "kyc_required",
              "no_liquidity",
              "order_rejected",
              "phone_not_verified",
              "phone_verification_expired",
              "prepared_action_not_found",
              "price_out_of_range",
              "quote_stale",
              "reduce_only_exceeds_position",
              "same_asset",
              "sell_not_allowed",
              "session_expired",
              "settlement_policy_required",
              "wallet_exported",
              "release_settling"
            ]
          },
          "message": {
            "type": "string",
            "description": "Human-readable error message"
          },
          "metadata": {
            "type": "object",
            "description": "Machine-readable context scoped to `code`; values are always strings. Which keys appear is determined by `code`.",
            "additionalProperties": {
              "type": "string"
            }
          },
          "field_violations": {
            "type": "array",
            "description": "Per-field rejections, present on `invalid_argument` when the request failed field validation.",
            "items": {
              "type": "object",
              "required": [
                "field",
                "message"
              ],
              "properties": {
                "field": {
                  "type": "string",
                  "description": "Dotted path to the offending field, as the client sent it"
                },
                "message": {
                  "type": "string",
                  "description": "Human-readable reason the field was rejected"
                }
              }
            }
          },
          "request_id": {
            "type": "string",
            "description": "Per-request correlation ID, empty when unavailable"
          }
        }
      },
      "ServiceHealth": {
        "type": "object",
        "description": "Status information for the REST API Gateway.",
        "required": [
          "status",
          "timestamp",
          "service"
        ],
        "properties": {
          "status": {
            "type": "string",
            "description": "Overall readiness indicator for the API.",
            "enum": [
              "healthy",
              "degraded"
            ],
            "example": "healthy"
          },
          "timestamp": {
            "type": "string",
            "description": "UTC timestamp the status was generated formatted as `YYYY-MM-DD HH:MM:SS`.",
            "example": "2025-01-15 14:30:00"
          },
          "service": {
            "type": "string",
            "description": "Name of the service reporting health.",
            "example": "rag"
          }
        }
      },
      "ApiVersions": {
        "type": "object",
        "description": "Information about supported API versions.",
        "required": [
          "supported_versions",
          "default_version",
          "version_header"
        ],
        "properties": {
          "supported_versions": {
            "type": "array",
            "description": "List of all supported API versions.",
            "items": {
              "$ref": "#/components/schemas/ApiVersionInfo"
            }
          },
          "default_version": {
            "type": "string",
            "description": "The version used when no X-Truex-Version header is provided.",
            "example": "v2024_01_01"
          },
          "version_header": {
            "type": "string",
            "description": "The header name to use for specifying API version.",
            "example": "X-Truex-Version"
          }
        }
      },
      "ApiVersionInfo": {
        "type": "object",
        "description": "Information about a specific API version.",
        "required": [
          "version",
          "deprecated"
        ],
        "properties": {
          "version": {
            "type": "string",
            "description": "The version identifier to use in the X-Truex-Version header.",
            "example": "v2024_01_01"
          },
          "deprecated": {
            "type": "boolean",
            "description": "Whether this version is deprecated and scheduled for removal.",
            "example": false
          },
          "deprecation_date": {
            "type": "string",
            "description": "HTTP-date format timestamp of when the version was deprecated. Only present if deprecated is true.\n",
            "example": "Sat, 01 Feb 2025 00:00:00 GMT"
          },
          "sunset_date": {
            "type": "string",
            "description": "HTTP-date format timestamp of when the version will be removed. Only present if deprecated is true.\n",
            "example": "Sun, 01 Feb 2026 00:00:00 GMT"
          }
        }
      },
      "Asset": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[1-9][0-9]*$",
            "example": "78901949717282824",
            "description": "Exchange assigned ID of asset."
          },
          "status": {
            "enum": [
              "DISABLED",
              "ACTIVE",
              "INVALID"
            ],
            "type": "string",
            "example": "ACTIVE",
            "description": "Current asset state."
          },
          "fields": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "maxLength": 31,
                "example": "BTC",
                "description": "Human readable name of the asset."
              },
              "min_transfer_qty": {
                "type": "string",
                "example": "1000.01",
                "description": "The minimum amount of an asset that can be transferred in a single transaction, specific to each asset."
              },
              "max_transfer_qty": {
                "type": "string",
                "example": "9999.99",
                "description": "The maximum amount of an asset that can be transferred in a single transaction, specific to each asset."
              },
              "flags": {
                "type": "array",
                "uniqueItems": true,
                "items": {
                  "type": "string",
                  "enum": [
                    "REFERENCE_ASSET",
                    "STABLECOIN"
                  ],
                  "example": "STABLECOIN"
                },
                "description": "A platform-defined value that provides additional metadata or classification for the asset. This flag is used to denote specific attributes or roles associated with the asset within the exchange ecosystem.\n- **REFERENCE_ASSET** Indicates that the asset is the default reference asset for the exchange. It serves as the primary asset for settling trades by default and is used as the basis for calculating fees.\n- **STABLECOIN** Indicates if the asset is a stablecoin (value pegged to a external source such as fiat currency.\n"
              }
            }
          }
        }
      },
      "InstrumentStat": {
        "type": "object",
        "properties": {
          "last_24hr_notional": {
            "type": "string",
            "example": "4325606.30380",
            "description": "The notional (quantity * price) amount of REFERENCE_ASSET traded over the last 24hr period."
          },
          "last_24hr_quantity": {
            "type": "string",
            "example": "123754.234598480",
            "description": "The quantity traded over the last 24 hour period."
          }
        }
      },
      "Instrument": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[1-9][0-9]*$",
            "example": "78901949723181070",
            "description": "Exchange assigned ID of the instrument."
          },
          "status": {
            "enum": [
              "INVALID",
              "DISABLED",
              "OPENING",
              "ACTIVE",
              "HALTED"
            ],
            "type": "string",
            "example": "ACTIVE",
            "description": "Current instrument state. INVALID indicates the requested instrument ID does not exist."
          },
          "info": {
            "type": "object",
            "properties": {
              "symbol": {
                "type": "string",
                "maxLength": 31,
                "example": "BTC-PYUSD",
                "description": "Human readable representation of the instrument."
              },
              "reference_price": {
                "type": "string",
                "example": "75000.50",
                "description": "Price used for initial price limit/band calcuations."
              },
              "base_asset_id": {
                "type": "string",
                "pattern": "^[1-9][0-9]*$",
                "example": "78901949718265865",
                "description": "ID of the base asset."
              },
              "quote_asset_id": {
                "type": "string",
                "pattern": "^[1-9][0-9]*$",
                "example": "78901949717282824",
                "description": "ID of the quote asset."
              },
              "price_limit_window_secs": {
                "type": "string",
                "example": "3600",
                "description": "Number of seconds in the price limit's sliding window."
              },
              "price_limit_percent": {
                "type": "string",
                "example": "0.015",
                "description": "Specifies the percentage threshold for price movement beyond a reference price (e.g., the midpoint or previous close) at which the exchange will take action. If the price of a trade or order breaches this threshold, the exchange may halt trading, trigger a circuit breaker, or initiate other predefined actions to ensure market stability."
              },
              "price_bands_percent": {
                "type": "string",
                "example": "0.025",
                "description": "Defines the acceptable price range for order validation within the market. The price bands ensure that orders are priced within a range around the market's midpoint, adjusted for increments and thresholds."
              }
            }
          },
          "stats": {
            "type": "object",
            "$ref": "#/components/schemas/InstrumentStat"
          }
        }
      },
      "MarketQuote": {
        "type": "object",
        "properties": {
          "price": {
            "type": "string",
            "example": "110865.50",
            "description": "Price at this level."
          },
          "qty": {
            "type": "string",
            "example": "0.00018",
            "description": "Aggregate quantity resting at this level."
          },
          "order_count": {
            "type": "string",
            "example": "10",
            "description": "Number of orders resting at this level."
          }
        }
      },
      "MarketTrade": {
        "type": "object",
        "properties": {
          "price": {
            "type": "string",
            "example": "110868",
            "description": "Price of the last trade."
          },
          "qty": {
            "type": "string",
            "example": "0.00901",
            "description": "Quantity of the last trade."
          },
          "timestamp": {
            "type": "string",
            "example": "1752156263825281640",
            "description": "The Unix UTC timestamp (in nanoseconds) when the trade was executed."
          }
        }
      },
      "MarketsQuoteRequest": {
        "type": "object",
        "required": [
          "qty",
          "instrument_id",
          "side",
          "qty_unit"
        ],
        "properties": {
          "qty": {
            "type": "string",
            "minLength": 1,
            "pattern": "^[0-9]+(\\.[0-9]+)?$",
            "example": "1.5",
            "description": "The quantity to quote. Interpretation depends on qty_unit: for BASE this is the base asset amount, for QUOTE this is the notional (e.g. USD) amount."
          },
          "instrument_id": {
            "type": "string",
            "minLength": 1,
            "pattern": "^[1-9][0-9]*$",
            "example": "1",
            "description": "The instrument ID for which to calculate the quote. Must be a valid non-zero numeric ID."
          },
          "side": {
            "type": "string",
            "enum": [
              "BUY",
              "SELL"
            ],
            "example": "BUY",
            "description": "The side of the quote request. BUY calculates the price to buy the base asset, SELL calculates the price to sell."
          },
          "qty_unit": {
            "type": "string",
            "enum": [
              "BASE",
              "QUOTE"
            ],
            "example": "BASE",
            "description": "Unit of the qty field. BASE means qty is in base asset units, QUOTE means qty is in quote asset (notional) units. Required — no default."
          }
        },
        "additionalProperties": false
      },
      "MarketsQuoteResponse": {
        "type": "object",
        "properties": {
          "qty": {
            "type": "string",
            "example": "1.5",
            "description": "The base quantity. For qty_unit=QUOTE, this is the computed base amount. For qty_unit=BASE, this echoes back the requested base quantity."
          },
          "price": {
            "type": "string",
            "example": "50025.50",
            "description": "The calculated VWAP (Volume-Weighted Average Price) across consumed order book levels."
          },
          "notional": {
            "type": "string",
            "example": "75038.25",
            "description": "Schema `v2026_01_23` only. The expected quote amount consumed from visible order book liquidity."
          },
          "notional_residual": {
            "type": "string",
            "example": "0.10",
            "description": "Schema `v2026_01_23` only. The unfilled portion of the requested quote amount. This is typically zero, but for qty_unit=QUOTE it can be positive when the remaining amount is smaller than one base increment at the final consumed price level."
          }
        }
      },
      "MarketData": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[1-9][0-9]*$",
            "example": "78901949723181070",
            "description": "Exchange assigned ID of the market data."
          },
          "symbol": {
            "type": "string",
            "maxLength": 31,
            "example": "BTC-PYUSD",
            "description": "Human readable representation of the instrument."
          },
          "info": {
            "type": "object",
            "properties": {
              "last_trade": {
                "type": "object",
                "$ref": "#/components/schemas/MarketTrade",
                "description": "Last trade information."
              },
              "best_bid": {
                "type": "object",
                "$ref": "#/components/schemas/MarketQuote",
                "description": "Current (at the time of request) exchange best bid."
              },
              "best_ask": {
                "type": "object",
                "$ref": "#/components/schemas/MarketQuote",
                "description": "Current (at the time of request) exchange best ask."
              },
              "last_update": {
                "type": "string",
                "example": "1752156513225654386",
                "description": "A UTC Unix epoch in nanoseconds indicating when the book was last updated."
              }
            }
          }
        }
      },
      "AuctionIndicative": {
        "type": "object",
        "description": "Opening-auction state and indicative for an instrument. All fields are zero and status is INVALID when the instrument is not in an opening auction.",
        "properties": {
          "indicative_price": {
            "type": "string",
            "example": "100",
            "description": "Indicative opening price the auction would currently clear at."
          },
          "matched_volume": {
            "type": "string",
            "example": "0",
            "description": "Volume that would cross at the indicative price."
          },
          "projected_best_bid_price": {
            "type": "string",
            "example": "0",
            "description": "Projected best bid price after a hypothetical uncross; zero when no bids would remain."
          },
          "projected_best_ask_price": {
            "type": "string",
            "example": "0",
            "description": "Projected best ask price after a hypothetical uncross; zero when no asks would remain."
          },
          "timestamp": {
            "type": "string",
            "example": "1752156513225654386",
            "description": "A UTC Unix epoch in nanoseconds indicating when the indicative was computed."
          },
          "status": {
            "type": "string",
            "enum": [
              "INVALID",
              "NORMAL",
              "INSUFFICIENT_BUY_INTEREST",
              "INSUFFICIENT_SELL_INTEREST",
              "NO_CROSS"
            ],
            "example": "INVALID",
            "description": "Health of the auction indicative calculation."
          }
        }
      },
      "AuctionState": {
        "type": "object",
        "description": "Opening-auction state for an instrument, returned by /v1/cefi/market/auction. `auction_mode` is always present; `auction_indicative` is included only while the instrument is in an opening auction (OPENING or LOCKED) and omitted otherwise (Coinbase-style nullable object).",
        "required": [
          "auction_mode"
        ],
        "properties": {
          "auction_mode": {
            "type": "boolean",
            "example": true,
            "description": "True while the instrument is in an opening auction (ST_OPENING or ST_LOCKED). The auction_indicative object is present only when this is true."
          },
          "auction_indicative": {
            "$ref": "#/components/schemas/AuctionIndicative",
            "description": "Indicative opening price and projected book. Present only when auction_mode is true; omitted otherwise."
          }
        }
      },
      "Client": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[1-9][0-9]*$",
            "example": "78901949710204932"
          },
          "status": {
            "enum": [
              "INITIALIZED",
              "ACTIVE",
              "DISABLED"
            ],
            "type": "string",
            "example": "ACTIVE",
            "description": "Current client state."
          },
          "info": {
            "type": "object",
            "properties": {
              "organization_id": {
                "type": "string",
                "format": "uuid",
                "description": "Must be UUIDv4. [RFC 9562](https://datatracker.ietf.org/doc/html/rfc9562#name-uuid-version-4).",
                "example": "ed671d2b-bb9e-4cf5-9eb4-71b6db672207"
              },
              "mnemonic": {
                "type": "string",
                "example": "CLIENT1",
                "description": "Client supplied human readable name of the client entity."
              },
              "type": {
                "type": "string",
                "enum": [
                  "INSTITUTION",
                  "INDIVIDUAL",
                  "APPLICATION"
                ],
                "example": "INDIVIDUAL",
                "description": "Client designation."
              },
              "maker_fee_tier": {
                "type": "integer",
                "example": 1,
                "description": "Client's current maker fee tier."
              },
              "taker_fee_tier": {
                "type": "integer",
                "example": 2,
                "description": "Client's current taker fee tier."
              },
              "self_trade_prevention": {
                "type": "string",
                "enum": [
                  "INVALID",
                  "NONE",
                  "CANCEL_AGGRESSIVE",
                  "CANCEL_BOTH"
                ],
                "example": "CANCEL_AGGRESSIVE",
                "description": "Client level self trade protection instruction.\n* **INVALID** Client level self trade protections are in an invalid state and may result in order rejection.\n* **NONE** No self trade protections are enabled for this client.  Can be overridden at the order level.\n* **CANCEL_AGGRESSIVE** All orders entered with this client ID will have cancel aggressive self trade protections enabled.\n* **CANCEL_BOTH** All order entered with this client ID will have cancel both self trade protections enabled.\n"
              }
            }
          }
        }
      },
      "ClientFees": {
        "type": "object",
        "description": "A client's fee tiers and the rates they resolve to.",
        "required": [
          "client_id",
          "maker_fee_tier",
          "taker_fee_tier",
          "maker_fee_rate",
          "taker_fee_rate"
        ],
        "properties": {
          "client_id": {
            "type": "string",
            "example": "1234567890",
            "description": "Exchange generated client ID."
          },
          "maker_fee_tier": {
            "type": "integer",
            "example": 1,
            "description": "Client's current maker fee tier."
          },
          "taker_fee_tier": {
            "type": "integer",
            "example": 2,
            "description": "Client's current taker fee tier."
          },
          "maker_fee_rate": {
            "type": "string",
            "example": "0.0005",
            "description": "Fee rate charged on maker fills, as a decimal fraction of trade notional. Negative values are rebates.\n"
          },
          "taker_fee_rate": {
            "type": "string",
            "example": "0.003",
            "description": "Fee rate charged on taker fills, as a decimal fraction of trade notional.\n"
          }
        }
      },
      "ClientPatch": {
        "type": "object",
        "required": [
          "id"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[1-9][0-9]*$",
            "example": "78901949710270469"
          },
          "info": {
            "type": "object",
            "properties": {
              "self_trade_prevention": {
                "type": "string",
                "enum": [
                  "NONE",
                  "CANCEL_AGGRESSIVE",
                  "CANCEL_BOTH"
                ],
                "example": "CANCEL_BOTH",
                "description": "Set the client level self trade protection instruction.\nIndividual and application clients may switch between **CANCEL_AGGRESSIVE** and **CANCEL_BOTH** but may not disable self trade protection; setting **NONE** is rejected for those client types.\n* **NONE** No self trade protections are enabled for this client.\n* **CANCEL_AGGRESSIVE** All orders entered with this client ID will have cancel aggressive self trade protections enabled.\n* **CANCEL_BOTH** All order entered with this client ID will have cancel both self trade protections enabled.\n"
              }
            }
          }
        }
      },
      "OrderNew": {
        "type": "object",
        "required": [
          "info"
        ],
        "properties": {
          "external_id": {
            "type": "string",
            "example": "321e7654-e89b-42d4-a456-426614174000",
            "description": "A unique identifier created by the client.  Must be in one of the following formats:\n* **UUID** version 4 in its human readable form, with hypens, and in lowercase.\n* **ASCII** character string of up to 18 characters containing only the unreserved URL characters: letters (a–z, A–Z), digits (0–9), hyphen (-), underscore (\\_), period (.), and tilde (~). \n"
          },
          "info": {
            "type": "object",
            "$ref": "#/components/schemas/OrderInfo"
          }
        }
      },
      "OrderInfo": {
        "type": "object",
        "required": [
          "client_id",
          "instrument_id",
          "qty",
          "price",
          "side",
          "type"
        ],
        "properties": {
          "msg_id": {
            "type": "string",
            "pattern": "^[1-9][0-9]*$",
            "example": "799477895858487977",
            "description": "ID of last message to act upon the order."
          },
          "parent_id": {
            "type": "string",
            "pattern": "^[1-9][0-9]*$",
            "example": "432351810263056385",
            "description": "ID of the application creating the order, may be zero."
          },
          "client_id": {
            "type": "string",
            "pattern": "^[1-9][0-9]*$",
            "example": "78901949710204932",
            "description": "The client ID the order will be entered on behalf of."
          },
          "instrument_id": {
            "type": "string",
            "pattern": "^[1-9][0-9]*$",
            "example": "78901949723181070",
            "description": "The ID of the instrument the order will transact in."
          },
          "qty": {
            "type": "string",
            "example": "0.00145",
            "description": "The amount of base asset the order is requesting to tranasct, or of quote asset when the `QUOTE_QTY` flag is set."
          },
          "price": {
            "type": "string",
            "example": "111067",
            "description": "The highest or lowest price the order will buy or sell, respectively, at. Only required for LIMIT orders; optional on MARKET orders as a worst-price cap."
          },
          "flags": {
            "type": "array",
            "uniqueItems": true,
            "items": {
              "type": "string",
              "enum": [
                "USE_AGGRESSIVE_PRICING",
                "QUOTE_QTY"
              ],
              "example": "USE_AGGRESSIVE_PRICING"
            },
            "description": "General order flags that can be combined and used together.\n* **USE_AGGRESIVE_PRICING** Applicable to market orders only. When enabled, the exchange calculates a price for the market order that is more aggressive than the current best bid or offer. This is useful when prioritizing liquidity capture over minimizing price slippage.\n* **QUOTE_QTY** Applicable to market orders only. `qty` is an amount of the quote asset, e.g. buy 10 PYUSD of BTC. The exchange converts it to a base quantity against the current book at entry and rejects the order if the book cannot fill it within the price band, or within `price` when one is supplied. Accepted and reported orders carry the converted base `qty`.\n"
          },
          "side": {
            "type": "string",
            "enum": [
              "BUY",
              "SELL"
            ],
            "description": "Side of order, can be `BUY` or `SELL`\n* **BUY** Provide trader's quote asset to acquire the base asset.\n* **SELL** Provide trader's base asset to acquire the quote asset.\n",
            "example": "BUY"
          },
          "type": {
            "type": "string",
            "enum": [
              "LIMIT",
              "MARKET",
              "NOTIONAL_LIMIT"
            ],
            "description": "Type of order, can be `LIMIT`, `MARKET`, or the deprecated `NOTIONAL_LIMIT`.\n* **LIMIT** A specified limit price sets the maximum amount in quote currency units that the order will exchange to acquire the base currency.\n* **MARKET** The order uses the CeFi exchange market price at time of order entry plus/minus (for buy/sell respectively) the max price allowed by the price band risk limits for the instrument.\n* **NOTIONAL_LIMIT** *Deprecated — use `MARKET` with the `QUOTE_QTY` flag.* The quote amount is sent in `price` and `qty` must be zero. The exchange accepts it as `MARKET` + `QUOTE_QTY`, so the order is reported with that type and flag.\n",
            "example": "LIMIT"
          },
          "tif": {
            "type": "string",
            "enum": [
              "GTC",
              "IOC"
            ],
            "description": "The \"Time In Force\" (TIF) of an order indicates how long the order will remain active before being canceled, can be `GTC`, `IOC`.\n* **GTC** (Good-Till-Cancel) Order remains active for up to 30 days from the time of entry. \n* **IOC** (Immediate-Or-Cancel) Order will execute as much of the order as possible up to the requested price, provided there are existing orders that match or improve upon the price. An `IOC` order will cancel any unfilled quantity back to the requestor. If no matching orders are found, the `IOC` order will be canceled immediately. If the TIF is omitted, the order will default to `GTC`.\n",
            "example": "GTC"
          },
          "exec_inst_flags": {
            "type": "array",
            "uniqueItems": true,
            "items": {
              "type": "string",
              "enum": [
                "ALO",
                "AON"
              ],
              "example": "ALO"
            },
            "description": "Execution specific instructions that can be combined and used together.\n* **ALO** Ensures the order adds liquidity to the market rather than removing it. When this flag is enabled, the order will only be placed if it would not immediately execute against the current best bid or offer. If the order would otherwise result in an immediate match, it will be canceled or adjusted based on the exchange's rules. * **AON** Requests that the order either fully executes or cancel back to user with nothing done. All or none (AON) is only valid on market orders.\n"
          },
          "hold_fee_rate": {
            "type": "string",
            "example": "0.002",
            "description": "The rate used to hold fee asset against the order. This is not necessarily the fee charge associated with the order.\nMay be supplied on a new order to hold at a higher rate than the exchange's own fee; omit it (or send \"0\") to hold at the exchange rate for the client's fee tiers. A rate below the exchange fee is rejected.\n"
          },
          "stp": {
            "type": "string",
            "enum": [
              "INVALID",
              "NONE",
              "CANCEL_AGGRESSIVE",
              "CANCEL_BOTH"
            ],
            "example": "NONE",
            "description": "Order level self trade protection instruction.\n* **INVALID** Order level self trade protections are in an invalid state and may result in order rejection.\n* **NONE** No self trade protections are enabled for this order.  \n* **CANCEL_AGGRESSIVE** This order will be canceled in the result of a self trade.\n* **CANCEL_BOTH** This order and the resting order will both be canceled in the result of a self trade.\n"
          }
        }
      },
      "OrderModify": {
        "type": "object",
        "required": [
          "info"
        ],
        "properties": {
          "id": {
            "type": "string",
            "example": "1159718398822187014",
            "description": "The internal order ID of the order to be modified. This is the id that was set by the exchange and should be a purely numeric string.\n"
          },
          "external_id": {
            "type": "string",
            "example": "123e7654-e89b-42d4-a456-426614174000",
            "description": "The external ID for the order to be modified set by the client. Must be in one of the following formats:\n* **UUID** version 4 in its human readable form, with hypens, and in lowercase.\n* **ASCII** character string of up to 18 characters containing only the unreserved URL characters: letters (a–z, A–Z), digits (0–9), hyphen (-), underscore (\\_), period (.), and tilde (~). \n"
          },
          "info": {
            "type": "object",
            "$ref": "#/components/schemas/ModifyInfo"
          }
        }
      },
      "ModifyInfo": {
        "type": "object",
        "required": [
          "client_id",
          "new_qty",
          "new_price"
        ],
        "properties": {
          "msg_id": {
            "type": "string",
            "pattern": "^[1-9][0-9]*$",
            "example": "1",
            "description": "ID of last message to act upon the order."
          },
          "parent_id": {
            "type": "string",
            "pattern": "^[1-9][0-9]*$",
            "example": "1",
            "description": "ID of the application creating the order, may be zero."
          },
          "client_id": {
            "type": "string",
            "pattern": "^[1-9][0-9]*$",
            "example": "1",
            "description": "The client ID the modification will be entered on behalf of."
          },
          "prev_modify": {
            "type": "string",
            "example": "0",
            "description": "ID of previous modify to act upon the order."
          },
          "new_qty": {
            "type": "string",
            "example": "0",
            "description": "The new amount of base asset the order is requesting to tranasct."
          },
          "new_price": {
            "type": "string",
            "example": "0",
            "description": "The new highest or lowest price the order will buy or sell, respectively, at. Only required for LIMIT orders."
          },
          "new_type": {
            "type": "string",
            "enum": [
              "MARKET"
            ],
            "example": "MARKET",
            "description": "`LIMIT` orders may be converted to `MARKET` orders. The new `MARKET` order will immediately execute against the resting side of the order book providing there is available liquidity on the contra side of the request.\n"
          }
        }
      },
      "CancelAllOrdersAccepted": {
        "type": "object",
        "description": "Acknowledgement of an asynchronous cancel-all request. `accepted` lists the ref ids of orders a cancel was dispatched for. Per-order completion is reported on the order event stream (cancel reports), not in this response.\n",
        "properties": {
          "accepted": {
            "type": "array",
            "description": "Ref ids of orders a cancel was dispatched for.",
            "items": {
              "type": "string",
              "example": "799477895858487977"
            }
          }
        },
        "required": [
          "accepted"
        ]
      },
      "OrderActive": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "799477895858487977"
          },
          "status": {
            "enum": [
              "INITIALIZED",
              "NEW_PENDING",
              "REJECTED",
              "ACTIVE",
              "FILLED",
              "CANCEL_PENDING",
              "CANCELED",
              "MODIFY_PENDING"
            ],
            "type": "string",
            "example": "ACTIVE",
            "description": "The current status of the order.\n* **INITIALIZED** Order has been created, but not sent yet.\n* **NEW_PENDING** Order has been sent, but not confirmed by the exchange or downstream process.\n* **REJECTED** An order setting or market condition prevents the order from getting processed.\n* **ACTIVE** The order was accepted by the system and open to trading (order and market conditions permitting).\n* **FILLED** The entire order traded.\n* **CANCEL_PENDING** Indicates a cancel request was received and being processed.\n* **CANCELED** The order was canceled from a cancel request, order conditions, or market conditions.\n* **MODIFY_PENDING** Indicates a modification request was received and being processed.\n"
          },
          "order_info": {
            "type": "object",
            "$ref": "#/components/schemas/OrderInfo"
          },
          "modify_info": {
            "type": "object",
            "$ref": "#/components/schemas/ModifyInfo"
          },
          "external_id": {
            "type": "string",
            "example": "EXT-ORDER-123",
            "description": "A unique identifier created by the client.  Must be in one of the following formats:\n* **UUID** version 4 in its human readable form, with hypens, and in lowercase.\n* **ASCII** character string of up to 18 characters containing only the unreserved URL characters: letters (a–z, A–Z), digits (0–9), hyphen (-), underscore (\\_), period (.), and tilde (~). \n"
          },
          "ref_external_id": {
            "type": "string",
            "example": "REF-EXT-ORDER-123",
            "description": "A unique identifier created by the client.  Must be in one of the following formats:\n* **UUID** version 4 in its human readable form, with hypens, and in lowercase.\n* **ASCII** character string of up to 18 characters containing only the unreserved URL characters: letters (a–z, A–Z), digits (0–9), hyphen (-), underscore (\\_), period (.), and tilde (~). \n"
          },
          "pending_qty": {
            "type": "string",
            "example": "0",
            "description": "Order quantity that has been acknowledge by the exchange but is not yet trading."
          },
          "leaves_qty": {
            "type": "string",
            "example": "0.00145",
            "description": "Order quantity that is currently active in the market."
          },
          "executed_qty": {
            "type": "string",
            "example": "0.00239",
            "description": "Amount of quantity currently executed."
          },
          "executed_vwap": {
            "type": "string",
            "example": "111050.5",
            "description": "Volume weighted average price calculation for all executions on the order."
          }
        }
      },
      "Order": {
        "allOf": [
          {
            "$ref": "#/components/schemas/OrderActive"
          },
          {
            "type": "object",
            "properties": {
              "total": {
                "type": "string",
                "example": "3500000",
                "description": "Total notional (quantity X price) of the order."
              },
              "timestamp": {
                "type": "string",
                "example": "1752159930164131767",
                "description": "UNIX UTC nanosecond timestamp of when the order was created."
              },
              "update_timestamp": {
                "type": "string",
                "example": "1752159930192000004",
                "description": "UNIX UTC nanosecond timestamp of when the order was last updated."
              }
            }
          }
        ]
      },
      "BalanceActivity": {
        "type": "object",
        "properties": {
          "msg_type": {
            "type": "string",
            "enum": [
              "UPDATE"
            ],
            "description": "Message type. Activity endpoint only returns UPDATE messages."
          },
          "msg_action": {
            "type": "string",
            "example": "ACCEPT",
            "description": "Message action status."
          },
          "amount": {
            "type": "string",
            "pattern": "^[-+]?\\d+(\\.\\d+)?$",
            "example": "100.50",
            "description": "Amount of the balance update."
          },
          "client_id": {
            "type": "string",
            "pattern": "^[1-9][0-9]*$",
            "example": "78901985055342602",
            "description": "Exchange assigned client ID."
          },
          "asset_id": {
            "type": "string",
            "pattern": "^[1-9][0-9]*$",
            "example": "78901985048264711",
            "description": "Exchange assigned asset ID."
          },
          "type": {
            "type": "string",
            "enum": [
              "TRADE_SETTLEMENT",
              "FEE_SETTLEMENT",
              "BALANCE_ADJUSTMENT"
            ],
            "description": "Type of balance update."
          },
          "timestamp": {
            "type": "string",
            "example": "1752159930192000004",
            "description": "UNIX UTC nanosecond timestamp of the update."
          },
          "ownership": {
            "type": "object",
            "properties": {
              "client_id": {
                "type": "string",
                "description": "Client ID that owns this balance entry."
              }
            }
          }
        }
      },
      "Balance": {
        "type": "object",
        "description": "Per-asset balance entry.\n\n**Do not treat `balance` as your tradable amount.** `balance` is the gross amount on the exchange; it does **not** subtract the holds placed against open orders and pending transfers. Sizing an order off `balance` alone will lead to rejections for insufficient balance.\n\nCompute the amount you can trade with as:\n\n```\ntradable = balance + unsettled - order_hold - transfer_hold\n```\n\nFor the asset used to pay fees (the settlement stablecoin), also subtract the account-level `fees_hold` and `unsettled_fees` from `Balances`:\n\n```\ntradable(fee asset) = balance + unsettled - order_hold - transfer_hold - fees_hold - unsettled_fees\n```\n\nWithdrawable amount is stricter: positive `unsettled` (inbound, not yet settled) does **not** count, while negative `unsettled` (an outbound obligation) still reduces it:\n\n```\nwithdrawable = balance + min(unsettled, 0) - order_hold - transfer_hold (minus fees_hold and any positive unsettled_fees for the fee asset)\n```\n\nSee the Balances guide for worked examples.\n",
        "properties": {
          "asset_id": {
            "type": "string",
            "pattern": "^[1-9][0-9]*$",
            "example": "78901985048264711",
            "description": "Exchange assigned entity ID. For balance entities this will be the same as your client id."
          },
          "balance": {
            "type": "string",
            "example": "10000000.45",
            "description": "Gross amount of asset on the exchange. This is NOT your tradable amount — it does not exclude holds. See `order_hold`, `transfer_hold`, and the schema description for how to derive tradable/withdrawable amounts."
          },
          "unsettled": {
            "type": "string",
            "example": "0",
            "description": "Net amount traded but awaiting settlement by the asset custodian. Positive = inbound (counts toward tradable, not withdrawable); negative = an outbound obligation (reduces both tradable and withdrawable)."
          },
          "order_hold": {
            "type": "string",
            "example": "3586008.49833",
            "description": "Amount held against open/resting orders. Subtract from `balance` to get tradable amount; released as orders fill or cancel."
          },
          "transfer_hold": {
            "type": "string",
            "example": "100.00",
            "description": "Amount held against pending transfers/withdrawals. Subtract from `balance` to get tradable amount; released when the transfer settles or is rejected."
          },
          "state": {
            "type": "string",
            "enum": [
              "INVALID",
              "INITIALIZED",
              "OPEN",
              "LOCKED",
              "CLOSING"
            ],
            "example": "OPEN",
            "description": "Current state of the balance.\n* **INVALID** Balance is not active on the exchange and currently in an error state.\n* **INITIALIZED** Balance has been created on the exchange but is not currently active.\n* **OPEN** Balance is active on the exchange.\n* **LOCKED** Balance is on the exchange but cannot be used for transactions.\n* **CLOSING** Balance is currently be moved off of the exchange and cannot be used for transactions.\"\n"
          }
        }
      },
      "Balances": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "78901985055342602",
            "description": "Exchange assigned entity ID."
          },
          "status": {
            "type": "string",
            "enum": [
              "INVALID"
            ],
            "example": "INVALID",
            "description": "Exchange only status value, will always be INVALID."
          },
          "unsettled_fees": {
            "type": "string",
            "example": "9210.236229375",
            "description": "Account-level fees accrued from trading but not yet settled, denominated in the fee asset (settlement stablecoin). Reduces the tradable/withdrawable amount of the fee asset only."
          },
          "fees_hold": {
            "type": "string",
            "example": "179300.4249165",
            "description": "Account-level amount of the fee asset held against anticipated fees on open orders. Reduces the tradable/withdrawable amount of the fee asset only."
          },
          "balances": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Balance"
            }
          }
        }
      },
      "FiatInstructions": {
        "type": "object",
        "required": [
          "fiat_account_id",
          "identity_id",
          "account_id",
          "includes_fee"
        ],
        "properties": {
          "fiat_account_id": {
            "type": "string",
            "format": "uuid",
            "description": "The ID of the fiat account to use for the transfer.",
            "example": "ed671d2b-bb9e-4cf5-9eb4-71b6db672207"
          },
          "identity_id": {
            "type": "string",
            "format": "uuid",
            "description": "The identity ID of the individual submitting the transfer.",
            "example": "b2a99c93-f1ee-41ed-9e9e-ec704cfbca4b"
          },
          "account_id": {
            "type": "string",
            "format": "uuid",
            "description": "The account ID of the institution submitting the transfer.",
            "example": "b2a99c93-f1ee-41ed-9e9e-ec704cfbca4b"
          },
          "includes_fee": {
            "type": "boolean",
            "description": "Indicates whether the transfer amount includes or doesn't include the fee."
          }
        }
      },
      "CryptoInstructions": {
        "type": "object",
        "required": [
          "address",
          "identity_id",
          "account_id",
          "includes_fee",
          "network"
        ],
        "properties": {
          "address": {
            "type": "string",
            "description": "A wallet address (including prefix) to use for the crypto transfer.",
            "example": "0x4b6f5a3dfc911e992c3d8f38c6bb9d1563b5e9a5"
          },
          "fee_id": {
            "type": "string",
            "format": "uuid",
            "description": "The ID of a pre-arranged fee guarantee to use with the transfer.",
            "example": "ed671d2b-bb9e-4cf5-9eb4-71b6db672207"
          },
          "identity_id": {
            "type": "string",
            "format": "uuid",
            "description": "The identity ID of the institution submitting the transfer.",
            "example": "b2a99c93-f1ee-41ed-9e9e-ec704cfbca4b"
          },
          "account_id": {
            "type": "string",
            "format": "uuid",
            "description": "The account ID of the institution submitting the transfer.",
            "example": "ed671d2b-bb9e-4cf5-9eb4-71b6db672207"
          },
          "includes_fee": {
            "type": "boolean",
            "description": "Indicates whether the transfer amount includes or doesn't include the fee."
          },
          "network": {
            "type": "string",
            "enum": [
              "BITCOIN",
              "ETHEREUM",
              "SOLANA"
            ],
            "description": "The crypto network to perform the transfer on.",
            "example": "SOLANA"
          }
        }
      },
      "TransferNew": {
        "type": "object",
        "required": [
          "asset_id",
          "client_id",
          "amount",
          "type",
          "platform"
        ],
        "properties": {
          "amount": {
            "type": "string",
            "example": "1000000",
            "description": "Amount of asset to transfer."
          },
          "asset_id": {
            "type": "string",
            "pattern": "^[1-9][0-9]*$",
            "example": "78901985055342602",
            "description": "Exchange assigned ID of asset."
          },
          "client_id": {
            "type": "string",
            "pattern": "^[1-9][0-9]*$",
            "example": "78901985048264710",
            "description": "Exchange assigned ID of client."
          },
          "type": {
            "type": "string",
            "enum": [
              "DEPOSIT",
              "WITHDRAW"
            ],
            "example": "WITHDRAW",
            "description": "Direction of the transfer.\n* **DEPOSIT** Place the amount specified on the exchange.\n* **WITHDRAW** Remove the amount specified from the exchange.\n"
          },
          "platform": {
            "type": "string",
            "enum": [
              "FIAT",
              "CRYPTO"
            ],
            "example": "FIAT",
            "description": "The type of service to use for the transfer. Must match with the corresponding instructions defined below.\n* **FIAT** Indicates the transfer should use the traditional banking system used to handle the corresponding fiat currency. Note, performing a transfer with fiat on a stablecoin asset will result in an automatic conversion.\n* **CRYPTO** Indicates the transfer uses a blockchain platform.\n"
          },
          "instructions": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/FiatInstructions"
              },
              {
                "$ref": "#/components/schemas/CryptoInstructions"
              }
            ],
            "description": "Platform specific instructions. The defined object must match with the platform value.\n* **FiatInstructions** Must be used when setting the platform to `FIAT`\n* **CryptoInstructions** Must be used when setting the platform to `CRYPTO`\n"
          }
        }
      },
      "Transfer": {
        "type": "object",
        "required": [
          "request"
        ],
        "properties": {
          "request": {
            "type": "object",
            "$ref": "#/components/schemas/TransferNew"
          }
        }
      },
      "TransferDetails": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "799477925457100828"
          },
          "status": {
            "type": "string",
            "enum": [
              "INITIALIZED",
              "PENDING",
              "COMPLETED",
              "FAILED",
              "REJECTED"
            ],
            "example": "INITIALIZED"
          },
          "request": {
            "$ref": "#/components/schemas/TransferNew"
          }
        }
      },
      "HistoricalTransfer": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "799477925458083869"
          },
          "status": {
            "type": "string",
            "enum": [
              "INITIALIZED",
              "PENDING",
              "COMPLETED",
              "FAILED",
              "REJECTED"
            ],
            "example": "INITIALIZED"
          },
          "request": {
            "$ref": "#/components/schemas/TransferNew"
          },
          "timestamp": {
            "type": "string",
            "format": "int64",
            "description": "The UNIX UTC nanosecond timestamp of when the transfer was initiated.",
            "example": "1740740509058376312"
          },
          "updated_timestamp": {
            "type": "string",
            "format": "int64",
            "description": "The UNIX UTC nanosecond timestamp of the last update to the transfer.",
            "example": "1740740509058376312"
          }
        }
      },
      "OrderTrade": {
        "type": "object",
        "description": "A single trade execution against an order.",
        "properties": {
          "client_id": {
            "type": "string",
            "pattern": "^[1-9][0-9]*$",
            "description": "A unique identifier assigned to the client.",
            "example": "78901968715907076"
          },
          "external_id": {
            "type": "string",
            "description": "External identifier supplied by the client when the order was created.",
            "example": "550e8400-e29b-41d4-a716-446655440000"
          },
          "instrument_id": {
            "type": "string",
            "pattern": "^[1-9][0-9]*$",
            "description": "A unique identifier for the trading instrument.",
            "example": "78901968728948750"
          },
          "order_id": {
            "type": "string",
            "pattern": "^[1-9][0-9]*$",
            "description": "A unique identifier for the order.",
            "example": "8005237327190949926"
          },
          "trade_price": {
            "type": "string",
            "description": "The price at which the trade was executed.",
            "example": "111480.5"
          },
          "trade_qty": {
            "type": "string",
            "description": "The quantity of the asset traded.",
            "example": "0.06089"
          },
          "side": {
            "type": "string",
            "enum": [
              "BUY",
              "SELL"
            ],
            "description": "The side of the order (BUY/SELL).",
            "example": "BUY"
          },
          "trade_fee_rate": {
            "type": "string",
            "description": "The fee rate applied to the trade.",
            "example": "0.0005"
          },
          "liq_flag": {
            "type": "string",
            "description": "Indicates whether the trade was executed as a taker or a maker.",
            "enum": [
              "TAKER",
              "MAKER"
            ],
            "example": "TAKER"
          },
          "match_id": {
            "type": "string",
            "pattern": "^[1-9][0-9]*$",
            "description": "A unique identifier for the trade match event.",
            "example": "147670564223998146302870408890920992792"
          },
          "timestamp": {
            "type": "string",
            "description": "The Unix UTC timestamp (in nanoseconds) when the trade was executed.",
            "example": "1752163579133484200"
          }
        }
      },
      "OrderActivityBase": {
        "type": "object",
        "description": "Common fields present in all order activity events.",
        "required": [
          "client_id",
          "instrument_id",
          "msg_type",
          "timestamp",
          "side"
        ],
        "properties": {
          "client_id": {
            "type": "string",
            "description": "A unique identifier assigned to the client.",
            "example": "78975249877368840"
          },
          "external_id": {
            "type": "string",
            "description": "An external identifier for the order.",
            "example": "550e8400-e29b-41d4-a716-446655440000"
          },
          "instrument_id": {
            "type": "string",
            "description": "A unique identifier for the trading instrument.",
            "example": "78975249883267118"
          },
          "msg_type": {
            "type": "string",
            "description": "The type of activity event.",
            "enum": [
              "REQUEST_NEW",
              "REQUEST_CANCEL",
              "REQUEST_MODIFY",
              "REPORT_CONFIRM",
              "REPORT_REJECT",
              "REPORT_TRADE",
              "REPORT_CANCELED",
              "REPORT_MODIFIED"
            ]
          },
          "timestamp": {
            "type": "string",
            "description": "The Unix UTC timestamp (in nanoseconds) when the activity occurred.",
            "example": "1770919994854735762"
          },
          "side": {
            "type": "string",
            "description": "The side of the order (BUY/SELL).",
            "enum": [
              "BUY",
              "SELL"
            ],
            "example": "BUY"
          }
        }
      },
      "OrderActivityRequestNew": {
        "description": "Activity event for a new order request.",
        "allOf": [
          {
            "$ref": "#/components/schemas/OrderActivityBase"
          },
          {
            "type": "object",
            "properties": {
              "msg_type": {
                "type": "string",
                "enum": [
                  "REQUEST_NEW"
                ]
              },
              "order_price": {
                "type": "string",
                "description": "The requested order price.",
                "example": "66000"
              },
              "order_qty": {
                "type": "string",
                "description": "The requested order quantity.",
                "example": "0.0001"
              }
            }
          }
        ]
      },
      "OrderActivityRequestCancel": {
        "description": "Activity event for a cancel order request.",
        "allOf": [
          {
            "$ref": "#/components/schemas/OrderActivityBase"
          },
          {
            "type": "object",
            "properties": {
              "msg_type": {
                "type": "string",
                "enum": [
                  "REQUEST_CANCEL"
                ]
              }
            }
          }
        ]
      },
      "OrderActivityRequestModify": {
        "description": "Activity event for a modify order request.",
        "allOf": [
          {
            "$ref": "#/components/schemas/OrderActivityBase"
          },
          {
            "type": "object",
            "properties": {
              "msg_type": {
                "type": "string",
                "enum": [
                  "REQUEST_MODIFY"
                ]
              }
            }
          }
        ]
      },
      "OrderActivityReportConfirm": {
        "description": "Activity event for an order confirmation.",
        "allOf": [
          {
            "$ref": "#/components/schemas/OrderActivityBase"
          },
          {
            "type": "object",
            "required": [
              "order_id"
            ],
            "properties": {
              "msg_type": {
                "type": "string",
                "enum": [
                  "REPORT_CONFIRM"
                ]
              },
              "order_id": {
                "type": "string",
                "description": "A unique identifier for the order.",
                "example": "2312760665443598349"
              }
            }
          }
        ]
      },
      "OrderActivityReportReject": {
        "description": "Activity event for an order rejection.",
        "allOf": [
          {
            "$ref": "#/components/schemas/OrderActivityBase"
          },
          {
            "type": "object",
            "required": [
              "order_id"
            ],
            "properties": {
              "msg_type": {
                "type": "string",
                "enum": [
                  "REPORT_REJECT"
                ]
              },
              "order_id": {
                "type": "string",
                "description": "A unique identifier for the order.",
                "example": "2312760665443598349"
              },
              "reject_reason": {
                "type": "string",
                "description": "The reason for order rejection.",
                "example": "INSUFFICIENT_FUNDS"
              },
              "reject_message": {
                "type": "string",
                "description": "Human-readable rejection message.",
                "example": "Insufficient funds to place order"
              }
            }
          }
        ]
      },
      "OrderActivityReportTrade": {
        "description": "Activity event for a trade execution.",
        "allOf": [
          {
            "$ref": "#/components/schemas/OrderActivityBase"
          },
          {
            "type": "object",
            "required": [
              "order_id"
            ],
            "properties": {
              "msg_type": {
                "type": "string",
                "enum": [
                  "REPORT_TRADE"
                ]
              },
              "order_id": {
                "type": "string",
                "description": "A unique identifier for the order.",
                "example": "2312760665443598349"
              },
              "trade_price": {
                "type": "string",
                "description": "The price at which the trade was executed.",
                "example": "111480.5"
              },
              "trade_qty": {
                "type": "string",
                "description": "The quantity of the asset traded.",
                "example": "0.06089"
              },
              "trade_fee_rate": {
                "type": "string",
                "description": "The fee rate applied to the trade.",
                "example": "0.0005"
              },
              "liq_flag": {
                "type": "string",
                "description": "Liquidity flag indicating whether the order was a maker or taker.",
                "enum": [
                  "TAKER",
                  "MAKER"
                ],
                "example": "TAKER"
              },
              "match_id": {
                "type": "string",
                "description": "A unique identifier for the trade match.",
                "example": "147670564223998146302870408890920992792"
              }
            }
          }
        ]
      },
      "OrderActivityReportCanceled": {
        "description": "Activity event for an order cancellation.",
        "allOf": [
          {
            "$ref": "#/components/schemas/OrderActivityBase"
          },
          {
            "type": "object",
            "required": [
              "order_id"
            ],
            "properties": {
              "msg_type": {
                "type": "string",
                "enum": [
                  "REPORT_CANCELED"
                ]
              },
              "order_id": {
                "type": "string",
                "description": "A unique identifier for the order.",
                "example": "2312760665443598349"
              },
              "canceled_qty": {
                "type": "string",
                "description": "The quantity that was canceled.",
                "example": "1.5"
              },
              "cancel_reason": {
                "type": "string",
                "description": "The reason for cancellation.",
                "example": "USER_REQUESTED"
              }
            }
          }
        ]
      },
      "OrderActivityReportModified": {
        "description": "Activity event for an order modification.",
        "allOf": [
          {
            "$ref": "#/components/schemas/OrderActivityBase"
          },
          {
            "type": "object",
            "required": [
              "order_id"
            ],
            "properties": {
              "msg_type": {
                "type": "string",
                "enum": [
                  "REPORT_MODIFIED"
                ]
              },
              "order_id": {
                "type": "string",
                "description": "A unique identifier for the order.",
                "example": "2312760665443598349"
              },
              "old_qty": {
                "type": "string",
                "description": "The original order quantity before modification.",
                "example": "0.0001"
              },
              "old_price": {
                "type": "string",
                "description": "The original order price before modification.",
                "example": "66000"
              },
              "new_qty": {
                "type": "string",
                "description": "The new order quantity after modification.",
                "example": "0.0001"
              },
              "new_price": {
                "type": "string",
                "description": "The new order price after modification.",
                "example": "66001"
              },
              "old_type": {
                "type": "string",
                "description": "The original order type before modification.",
                "example": "LIMIT"
              },
              "new_type": {
                "type": "string",
                "description": "The new order type after modification.",
                "example": "LIMIT"
              }
            }
          }
        ]
      },
      "OrderActivity": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/OrderActivityRequestNew"
          },
          {
            "$ref": "#/components/schemas/OrderActivityRequestCancel"
          },
          {
            "$ref": "#/components/schemas/OrderActivityRequestModify"
          },
          {
            "$ref": "#/components/schemas/OrderActivityReportConfirm"
          },
          {
            "$ref": "#/components/schemas/OrderActivityReportReject"
          },
          {
            "$ref": "#/components/schemas/OrderActivityReportTrade"
          },
          {
            "$ref": "#/components/schemas/OrderActivityReportCanceled"
          },
          {
            "$ref": "#/components/schemas/OrderActivityReportModified"
          }
        ],
        "discriminator": {
          "propertyName": "msg_type",
          "mapping": {
            "REQUEST_NEW": "#/components/schemas/OrderActivityRequestNew",
            "REQUEST_CANCEL": "#/components/schemas/OrderActivityRequestCancel",
            "REQUEST_MODIFY": "#/components/schemas/OrderActivityRequestModify",
            "REPORT_CONFIRM": "#/components/schemas/OrderActivityReportConfirm",
            "REPORT_REJECT": "#/components/schemas/OrderActivityReportReject",
            "REPORT_TRADE": "#/components/schemas/OrderActivityReportTrade",
            "REPORT_CANCELED": "#/components/schemas/OrderActivityReportCanceled",
            "REPORT_MODIFIED": "#/components/schemas/OrderActivityReportModified"
          }
        }
      },
      "Problem": {
        "type": "object",
        "required": [
          "type",
          "title",
          "status"
        ],
        "properties": {
          "type": {
            "type": "string",
            "format": "uri",
            "description": "A URI reference that identifies the problem type.",
            "example": "about:blank"
          },
          "title": {
            "type": "string",
            "description": "A short, human-readable summary of the problem type.",
            "example": "An Error Occured"
          },
          "status": {
            "type": "integer",
            "format": "int32",
            "description": "The HTTP status code generated by the origin server.",
            "example": 400
          },
          "detail": {
            "type": "string",
            "description": "A human-readable explanation specific to this occurrence of the problem.",
            "example": "A more detailed sentence about the error"
          },
          "instance": {
            "type": "string",
            "format": "uri-reference",
            "description": "A URI reference that identifies the specific occurrence of the problem.",
            "example": "/v1/cefi/endpoint"
          },
          "extensions": {
            "type": "object",
            "additionalProperties": true,
            "description": "A map for extension members (custom fields not defined by the RFC)."
          }
        }
      },
      "IndicatorPoint": {
        "type": "object",
        "properties": {
          "t": {
            "type": "string",
            "format": "date-time"
          },
          "value": {
            "type": "string",
            "description": "Indicator value at this timestamp"
          }
        }
      },
      "IndicatorHistoryResponse": {
        "type": "object",
        "properties": {
          "asset_id": {
            "type": "string",
            "format": "uuid",
            "description": "Backend asset ID. Absent on the CeFi routes."
          },
          "symbol": {
            "type": "string"
          },
          "window": {
            "type": "string"
          },
          "resolution": {
            "type": "string"
          },
          "indicator": {
            "type": "string"
          },
          "lines": {
            "type": "object",
            "description": "Indicator lines keyed by line name",
            "additionalProperties": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/IndicatorPoint"
              }
            }
          }
        }
      },
      "TrendingAsset": {
        "type": "object",
        "properties": {
          "symbol": {
            "type": "string"
          },
          "address": {
            "type": "string",
            "description": "On-chain token address"
          },
          "chain": {
            "type": "string"
          },
          "market_cap": {
            "type": "string"
          },
          "trending_ratio": {
            "type": "string",
            "description": "Recent volume over the historical baseline"
          },
          "recent_volume": {
            "type": "string"
          },
          "historical_volume": {
            "type": "string"
          }
        }
      },
      "TrendingResponse": {
        "type": "object",
        "properties": {
          "assets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TrendingAsset"
            }
          }
        }
      },
      "SurgingAsset": {
        "type": "object",
        "properties": {
          "symbol": {
            "type": "string"
          },
          "address": {
            "type": "string",
            "description": "On-chain token address"
          },
          "chain": {
            "type": "string"
          },
          "price_change_pct_1h": {
            "type": "string"
          },
          "price_change_pct_4h": {
            "type": "string"
          },
          "price_change_pct_24h": {
            "type": "string"
          },
          "price_1h_ago": {
            "type": "string"
          },
          "price_4h_ago": {
            "type": "string"
          },
          "price_24h_ago": {
            "type": "string"
          },
          "current_price": {
            "type": "string"
          }
        }
      },
      "SurgingResponse": {
        "type": "object",
        "properties": {
          "assets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SurgingAsset"
            }
          }
        }
      },
      "MarketDataError": {
        "type": "object",
        "description": "Shared API error envelope",
        "required": [
          "type",
          "message",
          "request_id"
        ],
        "properties": {
          "type": {
            "type": "string",
            "description": "Closed error category fixing the HTTP status",
            "enum": [
              "invalid_argument",
              "unauthenticated",
              "permission_denied",
              "not_found",
              "method_not_allowed",
              "conflict",
              "failed_precondition",
              "resource_exhausted",
              "unavailable",
              "internal"
            ]
          },
          "code": {
            "type": "string",
            "description": "Specific error condition from the fleet code registry. Extensible: clients MUST tolerate any value and fall back to type-based handling. No operation here emits one today."
          },
          "message": {
            "type": "string",
            "description": "Human-readable error message"
          },
          "metadata": {
            "type": "object",
            "description": "Machine-readable context scoped to `code`; values are always strings. Which keys appear is determined by `code`.",
            "additionalProperties": {
              "type": "string"
            }
          },
          "field_violations": {
            "type": "array",
            "description": "Per-field rejections, present on `invalid_argument` when the request failed field validation.",
            "items": {
              "type": "object",
              "required": [
                "field",
                "message"
              ],
              "properties": {
                "field": {
                  "type": "string",
                  "description": "Dotted path to the offending field, as the client sent it"
                },
                "message": {
                  "type": "string",
                  "description": "Human-readable reason the field was rejected"
                }
              }
            }
          },
          "request_id": {
            "type": "string",
            "description": "Per-request correlation ID, empty when unavailable"
          }
        }
      },
      "MarketCapResponse": {
        "type": "object",
        "properties": {
          "symbol": {
            "type": "string",
            "description": "The asset symbol"
          },
          "market_cap": {
            "type": "string",
            "description": "Market capitalization in USD (as string to preserve precision)"
          }
        }
      },
      "MarketCapListResponse": {
        "type": "object",
        "properties": {
          "assets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MarketCapResponse"
            },
            "description": "List of assets with market cap, sorted by market cap descending"
          }
        }
      },
      "PriceResponse": {
        "type": "object",
        "properties": {
          "symbol": {
            "type": "string",
            "description": "The asset symbol"
          },
          "candles": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Candle"
            },
            "description": "List of price candles for different time intervals"
          }
        }
      },
      "Candle": {
        "type": "object",
        "properties": {
          "interval": {
            "type": "string",
            "description": "Time interval for the candle (e.g., 1h, 4h, 24h)"
          },
          "openPrice": {
            "type": "string",
            "description": "Opening price for the interval"
          },
          "closePrice": {
            "type": "string",
            "description": "Closing price for the interval"
          },
          "highPrice": {
            "type": "string",
            "description": "Highest price during the interval"
          },
          "lowPrice": {
            "type": "string",
            "description": "Lowest price during the interval"
          }
        }
      },
      "PricePointResponse": {
        "type": "object",
        "properties": {
          "asset_id": {
            "type": "string",
            "format": "uuid",
            "description": "Backend asset ID. Absent on the CeFi routes."
          },
          "symbol": {
            "type": "string",
            "description": "The asset symbol"
          },
          "timestamp": {
            "type": "integer",
            "format": "int64",
            "description": "Unix timestamp of the actual data point returned"
          },
          "price": {
            "type": "string",
            "description": "Price at the returned timestamp"
          }
        }
      },
      "PriceRangeResponse": {
        "type": "object",
        "properties": {
          "asset_id": {
            "type": "string",
            "format": "uuid",
            "description": "Backend asset ID. Absent on the CeFi routes."
          },
          "symbol": {
            "type": "string",
            "description": "The asset symbol"
          },
          "window": {
            "type": "string",
            "description": "The time window used for the query"
          },
          "min_price": {
            "type": "string",
            "description": "Minimum price within the window"
          },
          "max_price": {
            "type": "string",
            "description": "Maximum price within the window"
          },
          "min_timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp when the minimum price occurred"
          },
          "max_timestamp": {
            "type": "string",
            "description": "ISO 8601 timestamp when the maximum price occurred"
          }
        }
      },
      "PerpMarketHistoryResponse": {
        "type": "object",
        "properties": {
          "asset_id": {
            "type": "string",
            "format": "uuid",
            "description": "Backend asset ID of the perp"
          },
          "symbol": {
            "type": "string",
            "description": "The perp symbol"
          },
          "window": {
            "type": "string",
            "description": "The time window used for the query"
          },
          "resolution": {
            "type": "string",
            "description": "The time resolution used for the query"
          },
          "points": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PerpMarketPoint"
            },
            "description": "Funding rate and open interest buckets, oldest first"
          }
        }
      },
      "PerpMarketPoint": {
        "type": "object",
        "properties": {
          "t": {
            "type": "string",
            "format": "date-time",
            "description": "ISO 8601 timestamp of the bucket"
          },
          "funding_rate": {
            "type": "string",
            "description": "Hourly funding rate as a decimal fraction (0.0000125 is 0.00125% per hour)"
          },
          "open_interest": {
            "type": "string",
            "description": "Open interest as a coin count of the base asset, not a USD notional"
          }
        }
      },
      "VolumeHistoryResponse": {
        "type": "object",
        "properties": {
          "asset_id": {
            "type": "string",
            "format": "uuid",
            "description": "Backend asset ID"
          },
          "symbol": {
            "type": "string",
            "description": "The asset symbol"
          },
          "window": {
            "type": "string",
            "description": "The time window used for the query"
          },
          "resolution": {
            "type": "string",
            "description": "The time resolution used for the query"
          },
          "points": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VolumePoint"
            },
            "description": "Reported 24h volume buckets, oldest first"
          }
        }
      },
      "VolumePoint": {
        "type": "object",
        "properties": {
          "t": {
            "type": "string",
            "format": "date-time",
            "description": "ISO 8601 timestamp of the bucket"
          },
          "volume": {
            "type": "string",
            "description": "Reported rolling 24h volume in USD at this timestamp"
          }
        }
      },
      "ScanCandidate": {
        "type": "object",
        "properties": {
          "symbol": {
            "type": "string",
            "description": "The asset symbol"
          },
          "value": {
            "type": "string",
            "description": "The figure the source ranks on, signed for a price change"
          }
        }
      },
      "ScanBucket": {
        "type": "object",
        "properties": {
          "t": {
            "type": "string",
            "format": "date-time",
            "description": "ISO 8601 timestamp of the bucket"
          },
          "assets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScanCandidate"
            },
            "description": "The bucket's top assets, best first"
          }
        }
      },
      "ScanHistoryResponse": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string",
            "description": "The ranking that was taken"
          },
          "sort": {
            "type": "string",
            "description": "Which end of the ranking each bucket kept"
          },
          "window": {
            "type": "string",
            "description": "The time window used for the query"
          },
          "resolution": {
            "type": "string",
            "description": "The time resolution used for the query"
          },
          "per_bucket": {
            "type": "integer",
            "description": "The most assets any bucket carries"
          },
          "buckets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScanBucket"
            },
            "description": "One ranking per bucket, oldest first"
          }
        }
      },
      "MarketCapHistoryResponse": {
        "type": "object",
        "properties": {
          "symbol": {
            "type": "string",
            "description": "The asset symbol"
          },
          "window": {
            "type": "string",
            "description": "The time window used for the query"
          },
          "resolution": {
            "type": "string",
            "description": "The time resolution used for the query"
          },
          "points": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MarketCapPoint"
            },
            "description": "Reported market-cap buckets, oldest first"
          }
        }
      },
      "MarketCapPoint": {
        "type": "object",
        "properties": {
          "t": {
            "type": "string",
            "format": "date-time",
            "description": "ISO 8601 timestamp of the bucket"
          },
          "market_cap": {
            "type": "string",
            "description": "Reported market capitalisation in USD at this timestamp"
          }
        }
      },
      "PriceHistoryResponse": {
        "type": "object",
        "properties": {
          "asset_id": {
            "type": "string",
            "format": "uuid",
            "description": "Backend asset ID. Absent on the CeFi routes."
          },
          "symbol": {
            "type": "string",
            "description": "The asset symbol"
          },
          "window": {
            "type": "string",
            "description": "The time window used for the query"
          },
          "resolution": {
            "type": "string",
            "description": "The time resolution used for the query"
          },
          "points": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Point"
            },
            "description": "List of price points"
          }
        }
      },
      "Point": {
        "type": "object",
        "properties": {
          "t": {
            "type": "string",
            "description": "ISO 8601 timestamp for the price point"
          },
          "price": {
            "type": "string",
            "description": "Price at this timestamp"
          }
        }
      },
      "CandleHistoryResponse": {
        "type": "object",
        "properties": {
          "asset_id": {
            "type": "string",
            "format": "uuid",
            "description": "Backend asset ID. Absent on the CeFi routes."
          },
          "symbol": {
            "type": "string",
            "description": "The asset symbol"
          },
          "window": {
            "type": "string",
            "description": "The time window used for the query"
          },
          "resolution": {
            "type": "string",
            "description": "The candle size used for the query"
          },
          "candles": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CandleBucket"
            },
            "description": "List of OHLC buckets, oldest first"
          }
        }
      },
      "CandleBucket": {
        "type": "object",
        "properties": {
          "t": {
            "type": "string",
            "description": "ISO 8601 timestamp of the bucket start"
          },
          "open": {
            "type": "string",
            "description": "First price in the bucket"
          },
          "high": {
            "type": "string",
            "description": "Highest price in the bucket"
          },
          "low": {
            "type": "string",
            "description": "Lowest price in the bucket"
          },
          "close": {
            "type": "string",
            "description": "Last price in the bucket"
          }
        }
      },
      "BatchPriceHistoryResponse": {
        "type": "object",
        "properties": {
          "window": {
            "type": "string",
            "description": "The time window used for the query"
          },
          "resolution": {
            "type": "string",
            "description": "The time resolution used for the query"
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BatchPriceHistoryResult"
            },
            "description": "Per-symbol results"
          }
        }
      },
      "BatchPriceHistoryResult": {
        "type": "object",
        "properties": {
          "asset_id": {
            "type": "string",
            "format": "uuid",
            "description": "Backend asset ID. Absent on the CeFi routes."
          },
          "symbol": {
            "type": "string",
            "description": "The asset symbol"
          },
          "points": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Point"
            },
            "description": "Price points (omitted if error)"
          },
          "error": {
            "type": "string",
            "description": "Error message if the symbol could not be resolved (omitted on success)"
          }
        }
      }
    },
    "parameters": {
      "OrganizationIdParam": {
        "name": "organization_id",
        "in": "path",
        "required": true,
        "description": "Your organization's id: the `tm.organization_id` claim of an organization token, also shown on the console Overview. The token must be this organization's, or belong to one of its admins.\n",
        "schema": {
          "type": "string",
          "format": "uuid"
        }
      },
      "AccountOnBehalfOf": {
        "name": "TM-On-Behalf-Of",
        "in": "header",
        "required": false,
        "description": "Act as one of your organization's users. The value is the `user_id` returned when the user was created; the request then reads that user's account. Requires an organization token and a user your organization created: `400` for a personal token, a repeated header or a non-UUID, `403` for a user outside your organization.\n",
        "schema": {
          "type": "string",
          "format": "uuid"
        },
        "example": "3f6d2c0e-8a41-4c2b-9f1e-2b7d5c0a9e11"
      },
      "GatewayOnBehalfOf": {
        "name": "TM-On-Behalf-Of",
        "in": "header",
        "required": false,
        "description": "Act as one of your organization's users. The value is the `user_id` returned when the user was created; the request then reads and writes that user's account. Requires an organization token and a user your organization created: `400` for a personal token, a repeated header or a non-UUID, `403` for a user outside your organization. Not accepted on organization-scoped routes.\n",
        "schema": {
          "type": "string",
          "format": "uuid"
        },
        "example": "3f6d2c0e-8a41-4c2b-9f1e-2b7d5c0a9e11"
      },
      "XTruexVersion": {
        "in": "header",
        "name": "X-Truex-Version",
        "required": false,
        "schema": {
          "type": "string",
          "enum": [
            "v2024_01_01",
            "v2026_01_23"
          ],
          "default": "v2024_01_01"
        },
        "description": "API version to use for the request. Controls response format: - `v2024_01_01` (default, deprecated — sunset August 5, 2026): Raw data arrays/objects - `v2026_01_23`: Envelope format with `{ \"data\": [...], \"pagination\": {...} }`\n"
      },
      "XAuthUserId": {
        "in": "header",
        "name": "x-truex-auth-userid",
        "required": false,
        "schema": {
          "type": "string"
        },
        "description": "HMAC only. The client the request acts for. Omit it with a JWT, which carries your client id."
      },
      "XAuthTimestamp": {
        "in": "header",
        "name": "x-truex-auth-timestamp",
        "required": true,
        "schema": {
          "type": "string"
        },
        "description": "Timestamp when request was made in seconds since epoch. Must be no older than 15 seconds and no more than 1 second in the future. Required with both JWT and HMAC authentication; it guards against replayed requests."
      },
      "XAuthToken": {
        "in": "header",
        "name": "x-truex-auth-token",
        "required": false,
        "schema": {
          "type": "string"
        },
        "description": "HMAC only. The UUID affiliated with the HMAC key. Omit it with a JWT."
      },
      "XAuthSignature": {
        "in": "header",
        "name": "x-truex-auth-signature",
        "required": false,
        "schema": {
          "type": "string"
        },
        "description": "HMAC only. The computed HMAC signature. Omit it with a JWT."
      },
      "FeedLimit": {
        "name": "limit",
        "in": "query",
        "description": "Assets to return.",
        "required": false,
        "schema": {
          "type": "integer",
          "minimum": 1,
          "maximum": 50,
          "default": 10
        }
      },
      "FeedSort": {
        "name": "sort",
        "in": "query",
        "description": "Rank ascending instead of descending.",
        "required": false,
        "schema": {
          "type": "string",
          "enum": [
            "asc",
            "desc"
          ],
          "default": "desc"
        }
      }
    },
    "responses": {
      "AccountUnauthorized": {
        "description": "Unauthorized",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/AccountError"
            }
          }
        }
      },
      "AccountForbidden": {
        "description": "Forbidden",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/AccountError"
            }
          }
        }
      },
      "ValidationError": {
        "description": "Validation error",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/AccountError"
            }
          }
        }
      },
      "AccountInternalError": {
        "description": "Internal server error",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/AccountError"
            }
          }
        }
      },
      "GatewayBadRequest": {
        "description": "Bad request",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/GatewayError"
            }
          }
        }
      },
      "GatewayUnauthorized": {
        "description": "Unauthorized",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/GatewayError"
            }
          }
        }
      },
      "GatewayForbidden": {
        "description": "Forbidden. On order creation this also covers an asset that is not available to trade from the country the request came from.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/GatewayError"
            }
          }
        }
      },
      "GatewayNotFound": {
        "description": "Not found",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/GatewayError"
            }
          }
        }
      },
      "Conflict": {
        "description": "Conflict",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/GatewayError"
            }
          }
        }
      },
      "UnprocessableEntity": {
        "description": "Request is well-formed but cannot be processed (e.g. leverage missing or out of range for a perp order)",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/GatewayError"
            }
          }
        }
      },
      "GatewayInternalError": {
        "description": "Internal server error",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/GatewayError"
            }
          }
        }
      },
      "GatewayServiceUnavailable": {
        "description": "Service unavailable",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/GatewayError"
            }
          }
        }
      },
      "InstitutionalBadRequest": {
        "description": "Bad request.",
        "content": {
          "application/problem+json": {
            "schema": {
              "type": "object",
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "InstitutionalUnauthorized": {
        "description": "Unauthorized.",
        "content": {
          "application/problem+json": {
            "schema": {
              "type": "object",
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "InstitutionalForbidden": {
        "description": "Forbidden.",
        "content": {
          "application/problem+json": {
            "schema": {
              "type": "object",
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "InstitutionalNotFound": {
        "description": "Not found.",
        "content": {
          "application/problem+json": {
            "schema": {
              "type": "object",
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "Timeout": {
        "description": "Request timeout.",
        "content": {
          "application/problem+json": {
            "schema": {
              "type": "object",
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "UnsupportedMedia": {
        "description": "Unsupported media type.",
        "content": {
          "application/problem+json": {
            "schema": {
              "type": "object",
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "InstitutionalInternalError": {
        "description": "Internal server error.",
        "content": {
          "application/problem+json": {
            "schema": {
              "type": "object",
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "InstitutionalServiceUnavailable": {
        "description": "Service unavailable.",
        "content": {
          "application/problem+json": {
            "schema": {
              "type": "object",
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      }
    }
  }
}
