openapi: 3.0.3
servers:
  - url: https://api.exchange.bullish.com/trading-api
    description: PRODUCTION
  - url: https://registered.api.exchange.bullish.com/trading-api
    description: PRODUCTION
  - url: https://prod.access.bullish.com/trading-api
    description: PRODUCTION (Direct Connect)
  - url: https://api.bugbounty.bullish.com/trading-api
    description: SECURITY SANDBOX
  - url: https://api.simnext.bullish-test.com/trading-api
    description: API SANDBOX
  - url: https://registered.api.simnext.bullish-test.com/trading-api
    description: API SANDBOX
  - url: https://simnext.access.bullish.com/trading-api
    description: API SANDBOX (Direct Connect)
info:
  description: REST API specification for the Bullish Trading API.
  version: 1.0.0
  title: Bullish Trading API
  contact:
    name: Bullish Help Center
    email: support@bullish.com
    url: https://support.bullish.com

tags:
  - name: general
    x-displayName: General
  - name: asset-data
    x-displayName: Asset Data
    description: Non-authenticated APIs for accessing general asset data information
  - name: market-data
    x-displayName: Market Data
    description: Non-authenticated APIs for accessing general market data information
  - name: market-history-data
    x-displayName: Market History Data
  - name: index-price-data
    x-displayName: Index Price Data
  - name: derivatives-public
    x-displayName: Derivatives
  - name: auction-public
    x-displayName: Auction
  - name: session-management
    x-displayName: Session Management
  - name: trading-accounts
    x-displayName: Trading Accounts
  - name: account-assets
    x-displayName: Account Assets
    description: Authenticated APIs for reading account data
  - name: orders
    x-displayName: Orders
    description: Authenticated APIs for interacting with orders
  - name: trades
    x-displayName: Trades
    description: Authenticated APIs for reading trade data
  - name: amm-instructions
    x-displayName: AMM Instructions
    description: |+
      Authenticated APIs that allow users to Create, View and Terminate AMM instructions.

      Please refer to the [AMM instruction Overview Doc](https://github.com/bullish-exchange/api-docs/wiki/Automated-Market-Making-%28AMM%29-Instructions) 
      for more details on how AMM instructions work.
  - name: transfer
    x-displayName: Transfer
    description: Authenticated API for initiating asset transfers between trading accounts.
  - name: custody
    x-displayName: Custody
    description: |+
      Authenticated APIs for custody,  [Custody Basic Examples](https://github.com/bullish-exchange/api-examples/blob/master/bullish/rest/custody_basics.py)

      Custody APIs have a limit of 40 requests per IP, per minute. This is combined across all endpoints of type **/wallets/***
  - name: derivatives
    x-displayName: Derivatives
  - name: market-maker-protection
    x-displayName: Market Maker Protection (MMP)
  - name: history
    x-displayName: History
  - name: otc
    x-displayName: OTC
    description: The OTC Clearing Facility API (OTC API) is available to customers to book trades negotiated outside of the Bullish Exchange order book to Bullish's clearing and settlement platform. Customers may agree to an OTC transaction through bilateral negotiations or via a 3rd party RFQ platform. Once the two customers agree on the trade details, they can use the OTC API to book the trade to their Bullish account to benefit from Bullish's risk and collateral management system. For purposes of clarity, the OTC API is not for trading purposes.
  - name: idb
    x-displayName: Inter-dealer Broker (IDB)
    description: The Inter-dealer Broker (IDB) API is available to authorized inter-dealer brokers to book OTC trades on Bullish on behalf of their respective end customers.
  - name: index-data
    x-displayName: Index Data
  - name: users
    x-displayName: Users
    description: Authenticated APIs for interacting with users
  - name: command entry
    x-displayName: Command Entry
    description: Authenticated API for submitting commands into the exchange.
  - name: time
    x-displayName: Time
    description: Non-authenticated API for reading time data
  - name: account-model
    x-displayName: SpotAccount Model
    description: |
      <SchemaDefinition schemaRef="#/components/schemas/SpotAccount"/>
  - name: order-model
    x-displayName: Order Model
    description: |
      <SchemaDefinition schemaRef="#/components/schemas/Order"/>
  - name: create-order-request-model
    x-displayName: Create Order Request Model
    description: |
      <SchemaDefinition schemaRef="#/components/schemas/CreateOrderRequest"/>
  - name: update-order-quantity-request-model
    x-displayName: Update Order Quantity Request Model
    description: |
      <SchemaDefinition schemaRef="#/components/schemas/UpdateOrderQuantityRequest"/>
  - name: trade-model
    x-displayName: Trade Model
    description: |
      <SchemaDefinition schemaRef="#/components/schemas/Trade"/>
  - name: obfuscated-trade-model
    x-displayName: Obfuscated Trade Model
    description: |
      <SchemaDefinition schemaRef="#/components/schemas/ObfuscatedTrade"/>
  - name: market-model
    x-displayName: Market Model
    description: |
      <SchemaDefinition schemaRef="#/components/schemas/Market"/>
  - name: orderbook-model
    x-displayName: Order Book Model
    description: |
      <SchemaDefinition schemaRef="#/components/schemas/OrderBook"/>
  - name: tick-model
    x-displayName: Tick Model
    description: |
      <SchemaDefinition schemaRef="#/components/schemas/Tick"/>
  - name: ohlcv-candle-model
    x-displayName: OHLCV Candle Model
    description: |
      <SchemaDefinition schemaRef="#/components/schemas/OHLCVCandle"/>
  - name: position-model
    x-displayName: Position Model
    description: |
      <SchemaDefinition schemaRef="#/components/schemas/Position"/>
  - name: spot-account-id
    x-displayName: SpotAccount ID
    description: |
      <SchemaDefinition schemaRef="#/components/schemas/SpotAccountID"/>
  - name: order-id
    x-displayName: Order ID
    description: |
      <SchemaDefinition schemaRef="#/components/schemas/OrderID"/>
  - name: trade-id
    x-displayName: Trade ID
    description: |
      <SchemaDefinition schemaRef="#/components/schemas/TradeID"/>
  - name: market-id
    x-displayName: Market ID
    description: |
      <SchemaDefinition schemaRef="#/components/schemas/MarketID"/>
  - name: timestamp
    x-displayName: Timestamp Model
    description: |
      <SchemaDefinition schemaRef="#/components/schemas/TimeStamp"/>
  - name: timestamp-as-string
    x-displayName: Timestamp Model
    description: |
      <SchemaDefinition schemaRef="#/components/schemas/TimeStampAsString"/>
  - name: datetime
    x-displayName: Datetime Model
    description: |
      <SchemaDefinition schemaRef="#/components/schemas/DateTime"/>
  - name: order-time-in-force
    x-displayName: Order Time In Force
    description: |
      <SchemaDefinition schemaRef="#/components/schemas/OrderTimeInForce"/>
  - name: order-time-in-force-as-string
    x-displayName: Order Time In Force
    description: |
      <SchemaDefinition schemaRef="#/components/schemas/OrderTimeInForceAsString"/>
  - name: order-type
    x-displayName: Order Type
    description: |
      <SchemaDefinition schemaRef="#/components/schemas/OrderType"/>
  - name: order-type-as-string
    x-displayName: Order Type
    description: |
      <SchemaDefinition schemaRef="#/components/schemas/OrderTypeAsString"/>
  - name: order-status
    x-displayName: Order Status
    description: |
      <SchemaDefinition schemaRef="#/components/schemas/OrderStatus"/>
  - name: order-status-as-string
    x-displayName: Order Status
    description: |
      <SchemaDefinition schemaRef="#/components/schemas/OrderStatusAsString"/>
  - name: order-side
    x-displayName: Order Side
    description: |
      <SchemaDefinition schemaRef="#/components/schemas/OrderSide"/>
  - name: order-side-as-string
    x-displayName: Order Side
    description: |
      <SchemaDefinition schemaRef="#/components/schemas/OrderSideAsString"/>
  - name: candle-window
    x-displayName: Candle Window
    description: |
      <SchemaDefinition schemaRef="#/components/schemas/CandleWindow"/>
  - name: portfolio-margin-simulator
    x-displayName: Portfolio Margin Simulator
x-tagGroups:
  - name: Public Endpoints
    tags:
      - general
      - asset-data
      - market-data
      - market-history-data
      - index-price-data
      - derivatives-public
      - auction-public
  - name: Private Endpoints
    tags:
      - session-management
      - trading-accounts
      - account-assets
      - orders
      - trades
      - amm-instructions
      - transfer
      - custody
      - derivatives
      - market-maker-protection
      - history
      - otc
      - idb
      - portfolio-margin-simulator

paths:
  /v1/nonce:
    get:
      tags:
        - general
      summary: Get Current Nonce Range
      description: |
        Get the current nonce range. The lower bound of nonce range is EPOCH start of day in microseconds, and upper bound of nonce range is EPOCH end of day in microseconds.

        **Ratelimited:** `False`
      operationId: getNonce
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Nonce"
        "401":
          description: Not Authenticated
        "403":
          description: Access Forbidden
        "429":
          description: Too Many Requests
        "500":
          description: Internal Server Error
      security: []
  /v1/users/logout:
    get:
      x-position: 3
      tags:
        - session-management
      summary: Logout
      description: |
        Logout of the session associated with the JWT. It requires [bearer token](/rest/authentication#add-authenticated-request-header) in authorization header. 

        **Ratelimited:** `True`
      operationId: logoutUser
      responses:
        "200":
          description: OK
        "401":
          description: Not Authenticated
        "403":
          description: Access Forbidden
        "429":
          description: Too Many Requests
        "500":
          description: Internal Server Error
      security:
        - jwtTokenAuth: []
  /v2/users/login:
    post:
      x-position: 1
      tags:
        - session-management
      summary: Login
      description: |
        Login and generate a new session associated with a JWT. Once you log in from an IP, the same IP must be used for 
        the duration of the session for any subsequent requests.

        **Ratelimited:** `True`
      operationId: loginUserV2
      responses:
        "200":
          description: returns JWT and the `authorizer` for signing requests
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LoginResponse"
        "400":
          description: Bad Request
        "401":
          description: Not Authenticated
        "403":
          description: Access Forbidden
        "429":
          description: Too Many Requests
        "500":
          description: Internal Server Error
      requestBody:
        description: login request body
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/LoginRequest"
      security: []
  /v1/users/hmac/login:
    get:
      x-position: 2
      tags:
        - session-management
      summary: HMAC Login
      description: |
        Login and generate a new session associated with a JWT using HMAC. Once you log in from an IP, the same IP must
        be used for the duration of the session for any subsequent requests.

        **Ratelimited:** `True`
      operationId: loginUserHmac
      parameters:
        - $ref: "#/components/parameters/BX-SIGNATURE"
        - $ref: "#/components/parameters/BX-TIMESTAMP"
        - $ref: "#/components/parameters/BX-NONCE"
        - $ref: "#/components/parameters/BX-PUBLIC-KEY"
      responses:
        "200":
          description: returns JWT and the `authorizer` for signing requests
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LoginResponse"
        "400":
          description: Bad Request
        "401":
          description: Not Authenticated
        "403":
          description: Access Forbidden
        "429":
          description: Too Many Requests
        "500":
          description: Internal Server Error
      security: []
  /v1/accounts/trading-accounts:
    get:
      tags:
        - trading-accounts
      summary: Get All Trading Accounts Details
      description: |
        Gets details for all trading accounts accessible by the API key used in the request. It requires [bearer token](/rest/authentication#add-authenticated-request-header) in authorization header. The trading account's id will be used in all other REST API

        **Ratelimited:** `True`
      operationId: getTradingAccounts
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                minItems: 0
                maxItems: 25
                items:
                  $ref: "#/components/schemas/TradingAccountResponse"
        "401":
          description: Not Authenticated
        "403":
          description: Access Forbidden
        "429":
          description: Too Many Requests
        "500":
          description: Internal Server Error
      security:
        - jwtTokenAuth: []
  /v1/accounts/trading-accounts/{tradingAccountId}:
    get:
      tags:
        - trading-accounts
      summary: Get Trading Account Details by ID
      description: |
        Gets details for specific trading account by `tradingAccountId` and API key used in the request. It requires [bearer token](/rest/authentication#add-authenticated-request-header) in authorization header.

        **Ratelimited:** `True`
      operationId: getTradingAccountById
      parameters:
        - in: path
          name: tradingAccountId
          description: Id of the trading account
          schema:
            $ref: "#/components/schemas/TradingAccountId"
          required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TradingAccountResponse"
        "400":
          description: Bad Request Parameter
        "401":
          description: Not Authenticated
        "403":
          description: Access Forbidden
        "404":
          description: Resource Not Found
        "429":
          description: Too Many Requests
        "500":
          description: Internal Server Error
      security:
        - jwtTokenAuth: []

  /v1/accounts/asset:
    get:
      tags:
        - account-assets
      summary: Get All Account Assets
      description: |
        Gets the asset accounts, requires [bearer token](/rest/authentication#add-authenticated-request-header) in authorization header

        **Ratelimited:** `True`
      operationId: getAssetAccounts
      parameters:
        - in: query
          name: tradingAccountId
          description: Id of the trading account
          schema:
            $ref: "#/components/schemas/TradingAccountId"
          required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                minItems: 0
                maxItems: 10
                items:
                  $ref: "#/components/schemas/AssetAccount"
        "401":
          description: Not Authenticated
        "403":
          description: Access Forbidden
        "429":
          description: Too Many Requests
        "500":
          description: Internal Server Error
      security:
        - jwtTokenAuth: []
  /v1/accounts/asset/{symbol}:
    get:
      parameters:
        - in: path
          name: symbol
          schema:
            $ref: "#/components/schemas/AssetSymbol"
          required: true
        - in: query
          name: tradingAccountId
          description: Id of the trading account
          schema:
            $ref: "#/components/schemas/TradingAccountId"
          required: true
      tags:
        - account-assets
      summary: Get All Account Assets by Symbol
      description: |
        Gets the asset account by symbol, requires [bearer token](/rest/authentication#add-authenticated-request-header) in authorization header

        **Ratelimited:** `True`
      operationId: getAssetAccountBySymbol
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AssetAccount"
        "401":
          description: Not Authenticated
        "403":
          description: Access Forbidden
        "404":
          description: Resource Not Found
        "429":
          description: Too Many Requests
        "500":
          description: Internal Server Error
      security:
        - jwtTokenAuth: []

  /v2/orders:
    get:
      x-position: 1
      tags:
        - orders
      summary: Get Orders
      description: |
        Retrieve a list of orders placed by a trading account with specified filters.
        - Only the last 24 hours of data is available for querying

        This endpoint requires [authentication](/rest/authentication#generate-a-jwt-token) and supports [pagination](/rest/general/pagination).
        To filter by `createdAtDatetime` and `createdAtTimestamp`, additional parameters are required. For detailed instructions, see the [Filtering Support](/rest/general/filtering) section.
        Additionally, this endpoint is subjected to rate limiting.
      operationId: getOrdersV2
      parameters:
        - in: query
          name: symbol
          schema:
            $ref: "#/components/schemas/MarketSymbol"
          required: false
        - in: query
          name: clientOrderId
          description: Unique numeric (i64) identifier generated on the client
            side expressed as a string value
          schema:
            $ref: "#/components/schemas/OrderHandle"
          required: false
        - in: query
          name: side
          description: order side
          schema:
            $ref: "#/components/schemas/OrderSide"
          required: false
        - in: query
          name: status
          description: order status
          schema:
            $ref: "#/components/schemas/OrderStatus"
          required: false
        - in: query
          name: tradingAccountId
          description: Id of the trading account
          schema:
            $ref: "#/components/schemas/TradingAccountId"
          required: true
        - in: query
          name: isAuctionOrder
          description: Filter orders by auction type. `true` returns auction orders (GTX) only, `false` returns non-auction orders only. Omit to return all orders
          schema:
            type: boolean
          required: false
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                minItems: 0
                maxItems: 10
                items:
                  $ref: "#/components/schemas/Order"
        "401":
          description: Not Authenticated
        "403":
          description: Access Forbidden
        "429":
          description: Too Many Requests
        "500":
          description: Internal Server Error
      security:
        - jwtTokenAuth: []
    post:
      x-position: 4
      tags:
        - orders
      summary: Create Order
      description: |
        Creates an order, requires [bearer token](/rest/authentication#add-authenticated-request-header) in authorization header.

        This endpoint uses the [signing format](/rest/authentication#signing-format) which does not require strict field ordering 
        and addition of null fields in the request body. Quantities and prices does not require strict precision. 
        E.g. for asset precision of 4 - `100`, `100.0`, `100.00`, `100.000` and `100.0000` are all accepted.

        **Ratelimited:** `True`. Higher tiers of rate limits available by providing the `BX-RATELIMIT-TOKEN` request header.
      operationId: createOrderV2
      parameters:
        - $ref: "#/components/parameters/BX-SIGNATURE"
        - $ref: "#/components/parameters/BX-TIMESTAMP"
        - $ref: "#/components/parameters/BX-NONCE"
        - $ref: "#/components/parameters/BX-NONCE-WINDOW-ENABLED"
        - $ref: "#/components/parameters/BX-REFERRER"
      responses:
        "200":
          description: Status OK. The create order command was successfully
            acknowledged. To check the current status of the order, query [Get
            Order by ID](/rest/api/get-order-by-id-v-2) using the
            `orderId` received in the response payload. Please consult the
            section [How To Ensure The Order Of *Create Order* or *Cancel Order*
            Requests](/rest/order-processing-create-cancel-request-mechanism)
            for more information.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CreateOrderCommandResponseV3"
        "400":
          description: |
            Bad Request

            For example, sending a request with the `BX-SIGNATURE` header missing will result in the following response:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadOrderEntryResponse"
        "401":
          description: Not Authenticated
        "403":
          description: Access Forbidden
        "429":
          description: Too Many Requests
        "500":
          description: Internal Server Error
      requestBody:
        description: new order request body
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateOrderCommandV3"
            examples:
              CreateLimitOrderCommand:
                $ref: "#/components/examples/CreateLimitOrderCommand"
              CreateMarketOrderCommand:
                $ref: "#/components/examples/CreateMarketOrderCommand"
              CreateStopLimitOrderCommand:
                $ref: "#/components/examples/CreateStopLimitOrderCommand"
              CreatePostOnlyOrderCommand:
                $ref: "#/components/examples/CreatePostOnlyOrderCommand"
      security:
        - jwtTokenAuth: []
  /v2/orders/{orderId}:
    parameters:
      - in: path
        name: orderId
        schema:
          type: number
        required: true
        description: order ID
    get:
      x-position: 2
      tags:
        - orders
      summary: Get Order by ID
      description: |
        Retrieve a specific order using its unique identifier.

        This endpoint requires [authentication](/rest/authentication#generate-a-jwt-token) and is subjected to rate limiting.
      operationId: getOrderByIdV2
      parameters:
        - in: query
          name: tradingAccountId
          description: Id of the trading account
          schema:
            $ref: "#/components/schemas/TradingAccountId"
          required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Order"
        "404":
          description: Order not found (order ID is invalid)
        "401":
          description: Not Authenticated
        "403":
          description: Access Forbidden
        "429":
          description: Too Many Requests
        "500":
          description: Internal Server Error
      security:
        - jwtTokenAuth: []
  /v2/orders/client-order-id/{clientOrderId}:
    parameters:
      - in: path
        name: clientOrderId
        schema:
          type: number
        required: true
        description: unique numeric (i64) identifier generated on the client side
    get:
      x-position: 3
      tags:
        - orders
      summary: Get Order by clientOrder ID
      description: |
        Retrieve a specific order using its unique identifier generated on the client side.

        This endpoint requires [authentication](/rest/authentication#generate-a-jwt-token) and is subjected to rate limiting.
      operationId: trade-get-order-by-client-order-id-v2
      parameters:
        - in: query
          name: tradingAccountId
          description: Id of the trading account
          schema:
            $ref: "#/components/schemas/TradingAccountId"
          required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Order"
        "401":
          description: Not Authenticated
        "404":
          description: Order not found (clientOrder ID is invalid)
        "403":
          description: Access Forbidden
        "429":
          description: Too Many Requests
        "500":
          description: Internal Server Error
      security:
        - jwtTokenAuth: []
  /v2/history/orders:
    get:
      tags:
        - history
      summary: Get Historical Orders
      description: |
        Retrieve a list of orders placed by a trading account with specified filters.
        - On a single query request you can retrieve data over a 7 day window, with the data available for the last 90 days

        This endpoint requires [authentication](/rest/authentication#generate-a-jwt-token) and supports [pagination](/rest/general/pagination).
        To filter by `createdAtDatetime` and `createdAtTimestamp`, additional parameters are required. For detailed instructions, see the [Filtering Support](/rest/general/filtering) section.
        Additionally, this endpoint is subjected to rate limiting.
      operationId: getOrdersHistoryV2
      parameters:
        - in: query
          name: symbol
          schema:
            $ref: "#/components/schemas/MarketSymbol"
          required: false
        - in: query
          name: orderId
          schema:
            $ref: "#/components/schemas/OrderID"
          required: false
        - in: query
          name: clientOrderId
          description: Unique numeric (i64) identifier generated on the client
            side expressed as a string value
          schema:
            $ref: "#/components/schemas/OrderHandle"
          required: false
        - in: query
          name: side
          description: order side
          schema:
            $ref: "#/components/schemas/OrderSide"
          required: false
        - in: query
          name: status
          description: order status
          schema:
            $ref: "#/components/schemas/OrderStatus"
          required: false
        - in: query
          name: tradingAccountId
          description: Id of the trading account
          schema:
            $ref: "#/components/schemas/TradingAccountId"
          required: true
        - in: query
          name: createdAtDatetime[gte]
          description: start timestamp of period, ISO 8601 with millisecond as
            string
          schema:
            $ref: "#/components/schemas/DateTime"
          required: false
        - in: query
          name: createdAtDatetime[lte]
          description: end timestamp of period, ISO 8601 with millisecond as
            string
          schema:
            $ref: "#/components/schemas/DateTime"
          required: false
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                minItems: 0
                maxItems: 10
                items:
                  $ref: "#/components/schemas/Order"
        "401":
          description: Not Authenticated
        "403":
          description: Access Forbidden
        "429":
          description: Too Many Requests
        "500":
          description: Internal Server Error
      security:
        - jwtTokenAuth: []
  /v2/amm-instructions:
    get:
      x-position: 1
      tags:
        - amm-instructions
      summary: Get AMM Instructions
      description: |
        Gets a list of AMM instructions based on applied filters.
        - requires [bearer token](/rest/authentication#add-authenticated-request-header) in authorization header
        - [supports pagination](/rest/general/pagination)

        **Ratelimited:** `True`
      operationId: getAmmInstructions
      parameters:
        - in: query
          name: symbol
          schema:
            $ref: "#/components/schemas/MarketSymbol"
          required: false
        - in: query
          name: status
          description: order status
          schema:
            $ref: "#/components/schemas/AMMInstructionStatus"
          required: false
        - in: query
          name: tradingAccountId
          description: Id of the trading account
          schema:
            $ref: "#/components/schemas/TradingAccountId"
          required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                minItems: 0
                maxItems: 10
                items:
                  $ref: "#/components/schemas/AMMInstruction"
        "401":
          description: Not Authenticated
        "403":
          description: Access Forbidden
        "429":
          description: Too Many Requests
        "500":
          description: Internal Server Error
      security:
        - jwtTokenAuth: []
    post:
      x-position: 3
      tags:
        - amm-instructions
      summary: Create AMM Instruction
      description: |
        Creates an AMM instruction, requires [bearer token](/rest/authentication#add-authenticated-request-header) 
        in authorization header.

        This endpoint uses the [signing format](/rest/authentication#signing-format) which does not require strict field ordering
        in the request body. Quantities and prices does not require strict precision. 
        E.g. for asset precision of 4 - `100`, `100.0`, `100.00`, `100.000` and `100.0000` are all accepted.

        **Ratelimited:** `True`
      operationId: createAmmInstruction
      parameters:
        - $ref: "#/components/parameters/BX-SIGNATURE"
        - $ref: "#/components/parameters/BX-TIMESTAMP"
        - $ref: "#/components/parameters/BX-NONCE"
      responses:
        "200":
          description: Status OK. This means a create AMM instruction command
            was successfully acknowledged. It does not necessarily mean the
            instruction was created. To check the current status, query [Get AMM
            Instruction by
            ID](/rest/api/get-amm-instruction-by-id-v-2) using the
            `instructionId` received in the response payload.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CreateAMMInstructionCommandResponseV3"
              examples:
                CreateAMMInstructionCommandResponse:
                  $ref: "#/components/examples/CreateAMMInstructionCommandResponse"
        "400":
          description: |
            Bad Request

            For example, sending a request with the `BX-SIGNATURE` header missing will result in the following response:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadOrderEntryResponse"
        "401":
          description: Not Authenticated
        "403":
          description: Access Forbidden
        "429":
          description: Too Many Requests
        "500":
          description: Internal Server Error
      requestBody:
        description: new AMM instruction
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateAMMInstructionCommandV3"
            examples:
              CreateAMMInstructionCommand:
                $ref: "#/components/examples/CreateAMMInstructionCommand"
      security:
        - jwtTokenAuth: []
  /v2/amm-instructions/{instructionId}:
    parameters:
      - in: path
        name: instructionId
        schema:
          type: number
        required: true
        description: unique AMM instruction ID
      - in: query
        name: tradingAccountId
        description: Id of the trading account
        schema:
          $ref: "#/components/schemas/TradingAccountId"
        required: true
    get:
      x-position: 2
      tags:
        - amm-instructions
      summary: Get AMM Instruction by ID
      description: |
        Gets a specific AMM instruction based on the `instructionId`, 
        requires [bearer token](/rest/authentication#add-authenticated-request-header) in authorization header

        **Ratelimited:** `True`
      operationId: getAmmInstructionByIdV2
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AMMInstruction"
        "401":
          description: Not Authenticated
        "403":
          description: Access Forbidden
        "429":
          description: Too Many Requests
        "500":
          description: Internal Server Error
      security:
        - jwtTokenAuth: []

  /v2/command:
    post:
      tags:
        - command entry
      summary: Create Command
      description: |
        Submits a command to the trading engine. A successful response indicates that the command entry was acknowledged 
        but does not indicate that the command was executed. 
        This endpoint uses the [signing format](/rest/authentication#signing-format) which does not require strict field 
        ordering and addition of null fields in the request body. Quantities and prices does not require strict precision. 
        E.g. for asset precision of 4 - `100`, `100.0`, `100.00`, `100.000` and `100.0000` are all accepted.

        Command schemas and examples are provided below. Supported commands:
        - V3CancelOrder
        - V1CancelAllOrders
        - V1CancelAllOrdersByMarket
        - V1DelayedCancelAllOrders
        - V1UnsetDelayedCancelAllOrders
        - V1AmendOrder
        - V3TerminateAMMInstruction
        - V2TransferAsset

        Requires
        - [bearer token](/rest/authentication#add-authenticated-request-header) in authorization header

        **Ratelimited:** `True`. Higher tiers of rate limits available by providing the `BX-RATELIMIT-TOKEN` request header.
      operationId: submitCommand
      parameters:
        - $ref: "#/components/parameters/BX-SIGNATURE"
        - $ref: "#/components/parameters/BX-TIMESTAMP"
        - $ref: "#/components/parameters/BX-NONCE"
        - $ref: "#/components/parameters/BX-NONCE-WINDOW-ENABLED"
      responses:
        "200":
          description: Status OK. This means a command was successfully
            acknowledged.
          content:
            application/json:
              schema:
                discriminator:
                  propertyName: commandType
                  mapping:
                    V3CancelOrder: "#/components/schemas/CancelOrderCommandResponseV3"
                    V1CancelAllOrders: "#/components/schemas/CancelAllOrdersCommandResponse"
                    V1CancelAllOrdersByMarket: "#/components/schemas/CancelAllOrdersByMarketResponse"
                    V1DelayedCancelAllOrders: "#/components/schemas/DelayedCancelAllOrdersResponse"
                    V1UnsetDelayedCancelAllOrders: "#/components/schemas/UnsetDelayedCancelAllOrdersResponse"
                    V3TerminateAMMInstruction: "#/components/schemas/TerminateAMMInstructionCommandResponseV3"
                    V2TransferAsset: "#/components/schemas/TradingAccountTransferResponse"
                    V1AmendOrder: "#/components/schemas/AmendOrderCommandResponseV1"
                oneOf:
                  - $ref: "#/components/schemas/CancelOrderCommandResponseV3"
                  - $ref: "#/components/schemas/CancelAllOrdersCommandResponse"
                  - $ref: "#/components/schemas/CancelAllOrdersByMarketResponse"
                  - $ref: "#/components/schemas/DelayedCancelAllOrdersResponse"
                  - $ref: "#/components/schemas/UnsetDelayedCancelAllOrdersResponse"
                  - $ref: "#/components/schemas/TerminateAMMInstructionCommandResponseV3"
                  - $ref: "#/components/schemas/TradingAccountTransferResponse"
                  - $ref: "#/components/schemas/AmendOrderCommandResponseV1"
              examples:
                CancelOrderCommand:
                  $ref: "#/components/examples/CancelOrderCommandResponse"
                CancelAllOrdersCommand:
                  $ref: "#/components/examples/CancelAllOrdersCommandResponse"
                CancelAllOrdersByMarketCommand:
                  $ref: "#/components/examples/CancelAllOrdersByMarketCommandResponse"
                DelayedCancelAllOrdersCommand:
                  $ref: "#/components/examples/DelayedCancelAllOrdersCommandResponse"
                UnsetDelayedCancelAllOrdersCommand:
                  $ref: "#/components/examples/UnsetDelayedCancelAllOrdersCommandResponse"
                TerminateAMMInstructionCommand:
                  $ref: "#/components/examples/TerminateAMMInstructionCommandResponse"
                TransferAssetCommand:
                  $ref: "#/components/examples/TransferAssetCommandResponse"
                AmendOrderCommand:
                  $ref: "#/components/examples/AmendOrderCommandResponse"
        "400":
          description: |
            Bad Request

            For example, sending a request with the `BX-SIGNATURE` header missing will result in the following response:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadOrderEntryResponse"
        "401":
          description: Not Authenticated
        "403":
          description: Access Forbidden
        "429":
          description: Too Many Requests
        "500":
          description: Internal Server Error
      requestBody:
        required: true
        content:
          application/json:
            schema:
              discriminator:
                propertyName: commandType
                mapping:
                  V3CancelOrder: "#/components/schemas/CancelOrderCommandV3"
                  V1CancelAllOrders: "#/components/schemas/CancelAllOrdersCommand"
                  V1CancelAllOrdersByMarket: "#/components/schemas/CancelAllOrdersByMarketCommand"
                  V1DelayedCancelAllOrders: "#/components/schemas/DelayedCancelAllOrdersCommand"
                  V1UnsetDelayedCancelAllOrders: "#/components/schemas/UnsetDelayedCancelAllOrdersCommand"
                  V3TerminateAMMInstruction: "#/components/schemas/TerminateAMMInstructionCommandV3"
                  V2TransferAsset: "#/components/schemas/TransferAssetCommandV2"
                  V1AmendOrder: "#/components/schemas/AmendOrderCommandV1"
              oneOf:
                - $ref: "#/components/schemas/CancelOrderCommandV3"
                - $ref: "#/components/schemas/CancelAllOrdersCommand"
                - $ref: "#/components/schemas/CancelAllOrdersByMarketCommand"
                - $ref: "#/components/schemas/DelayedCancelAllOrdersCommand"
                - $ref: "#/components/schemas/UnsetDelayedCancelAllOrdersCommand"
                - $ref: "#/components/schemas/TerminateAMMInstructionCommandV3"
                - $ref: "#/components/schemas/TransferAssetCommandV2"
                - $ref: "#/components/schemas/AmendOrderCommandV1"
            examples:
              CancelOrderCommand:
                $ref: "#/components/examples/CancelOrderCommand"
              CancelAllOrdersCommand:
                $ref: "#/components/examples/CancelAllOrdersCommand"
              CancelAllOrdersByMarketCommand:
                $ref: "#/components/examples/CancelAllOrdersByMarketCommand"
              DelayedCancelAllOrdersCommand:
                $ref: "#/components/examples/DelayedCancelAllOrdersCommand"
              UnsetDelayedCancelAllOrdersCommand:
                $ref: "#/components/examples/UnsetDelayedCancelAllOrdersCommand"
              AmendOrderCommand:
                $ref: "#/components/examples/AmendOrderCommand"
              TerminateAMMInstructionCommand:
                $ref: "#/components/examples/TerminateAMMInstructionCommand"
              TransferAssetCommand:
                $ref: "#/components/examples/TransferAssetCommand"
      security:
        - jwtTokenAuth: []

  /v2/command#transferAsset:
    post:
      tags:
        - transfer
      summary: Transfer Asset Command
      description: |
        Submits a command to the trading engine. A successful response indicates that the command entry was acknowledged 
        but does not indicate that the command was executed. 
        This endpoint uses the [signing format](/rest/authentication#signing-format) which does not require strict field 
        ordering and addition of null fields in the request body. Quantities and prices does not require strict precision. 
        E.g. for asset precision of 4 - `100`, `100.0`, `100.00`, `100.000` and `100.0000` are all accepted.

        Requires
        - [bearer token](/rest/authentication#add-authenticated-request-header) in authorization header

        **Ratelimited:** `True`. Higher tiers of rate limits available by providing the `BX-RATELIMIT-TOKEN` request header.
      operationId: submitTransferAssetCommand
      parameters:
        - $ref: "#/components/parameters/BX-SIGNATURE"
        - $ref: "#/components/parameters/BX-TIMESTAMP"
        - $ref: "#/components/parameters/BX-NONCE"
        - $ref: "#/components/parameters/BX-NONCE-WINDOW-ENABLED"
      responses:
        "200":
          description: Status OK. This means a command was successfully
            acknowledged.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TradingAccountTransferResponse"
              examples:
                TransferAssetResponse:
                  $ref: "#/components/examples/TransferAssetCommandResponse"
        "400":
          description: |
            Bad Request

            For example, sending a request with the `BX-SIGNATURE` header missing will result in the following response:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadOrderEntryResponse"
        "401":
          description: Not Authenticated
        "403":
          description: Access Forbidden
        "429":
          description: Too Many Requests
        "500":
          description: Internal Server Error
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/TransferAssetCommandV2"
            examples:
              TransferAssetCommand:
                $ref: "#/components/examples/TransferAssetCommand"
      security:
        - jwtTokenAuth: []

  /v2/command#terminateAMMInstruction:
    post:
      x-position: 4
      tags:
        - amm-instructions
      summary: Terminate AMM Instruction Command
      description: |
        Submits a command to the trading engine. A successful response indicates that the command entry was acknowledged 
        but does not indicate that the command was executed. 
        This endpoint uses the [signing format](/rest/authentication#signing-format) which does not require strict field 
        ordering and addition of null fields in the request body. Quantities and prices does not require strict precision. 
        E.g. for asset precision of 4 - `100`, `100.0`, `100.00`, `100.000` and `100.0000` are all accepted.

        Requires
        - [bearer token](/rest/authentication#add-authenticated-request-header) in authorization header

        **Ratelimited:** `True`. Higher tiers of rate limits available by providing the `BX-RATELIMIT-TOKEN` request header.
      operationId: submitTerminateAMMInstructionCommand
      parameters:
        - $ref: "#/components/parameters/BX-SIGNATURE"
        - $ref: "#/components/parameters/BX-TIMESTAMP"
        - $ref: "#/components/parameters/BX-NONCE"
        - $ref: "#/components/parameters/BX-NONCE-WINDOW-ENABLED"
      responses:
        "200":
          description: Status OK. This means a command was successfully
            acknowledged.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TerminateAMMInstructionCommandResponseV3"
              examples:
                TerminateAMMInstructionResponse:
                  $ref: "#/components/examples/TerminateAMMInstructionCommandResponse"
        "400":
          description: |
            Bad Request

            For example, sending a request with the `BX-SIGNATURE` header missing will result in the following response:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadOrderEntryResponse"
        "401":
          description: Not Authenticated
        "403":
          description: Access Forbidden
        "429":
          description: Too Many Requests
        "500":
          description: Internal Server Error
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/TerminateAMMInstructionCommandV3"
            examples:
              TerminateAMMInstructionCommand:
                $ref: "#/components/examples/TerminateAMMInstructionCommand"
      security:
        - jwtTokenAuth: []

  /v2/command#cancellations:
    post:
      x-position: 5
      tags:
        - orders
      summary: Cancel Order Commands
      description: |
        Submits a command to the trading engine. A successful response indicates that the command entry was acknowledged 
        but does not indicate that the command was executed. 
        This endpoint uses the [signing format](/rest/authentication#signing-format) which does not require strict field 
        ordering and addition of null fields in the request body. Quantities and prices does not require strict precision. 
        E.g. for asset precision of 4 - `100`, `100.0`, `100.00`, `100.000` and `100.0000` are all accepted.

        Command schemas and examples are provided below. Supported commands:
        - V3CancelOrder
        - V1CancelAllOrders
        - V1CancelAllOrdersByMarket
        - V1DelayedCancelAllOrders
        - V1UnsetDelayedCancelAllOrders

        Requires
        - [bearer token](/rest/authentication#add-authenticated-request-header) in authorization header

        **Ratelimited:** `True`. Higher tiers of rate limits available by providing the `BX-RATELIMIT-TOKEN` request header.
      operationId: submitCancellationCommands
      parameters:
        - $ref: "#/components/parameters/BX-SIGNATURE"
        - $ref: "#/components/parameters/BX-TIMESTAMP"
        - $ref: "#/components/parameters/BX-NONCE"
        - $ref: "#/components/parameters/BX-NONCE-WINDOW-ENABLED"
      responses:
        "200":
          description: Status OK. This means a command was successfully acknowledged.
          content:
            application/json:
              schema:
                discriminator:
                  propertyName: commandType
                  mapping:
                    V3CancelOrder: "#/components/schemas/CancelOrderCommandResponseV3"
                    V1CancelAllOrders: "#/components/schemas/CancelAllOrdersCommandResponse"
                    V1CancelAllOrdersByMarket: "#/components/schemas/CancelAllOrdersByMarketResponse"
                    V1DelayedCancelAllOrders: "#/components/schemas/DelayedCancelAllOrdersResponse"
                    V1UnsetDelayedCancelAllOrders: "#/components/schemas/UnsetDelayedCancelAllOrdersResponse"
                oneOf:
                  - $ref: "#/components/schemas/CancelOrderCommandResponseV3"
                  - $ref: "#/components/schemas/CancelAllOrdersCommandResponse"
                  - $ref: "#/components/schemas/CancelAllOrdersByMarketResponse"
                  - $ref: "#/components/schemas/DelayedCancelAllOrdersResponse"
                  - $ref: "#/components/schemas/UnsetDelayedCancelAllOrdersResponse"
              examples:
                CancelOrderCommand:
                  $ref: "#/components/examples/CancelOrderCommandResponse"
                CancelAllOrdersCommand:
                  $ref: "#/components/examples/CancelAllOrdersCommandResponse"
                CancelAllOrdersByMarketCommand:
                  $ref: "#/components/examples/CancelAllOrdersByMarketCommandResponse"
                DelayedCancelAllOrdersCommand:
                  $ref: "#/components/examples/DelayedCancelAllOrdersCommandResponse"
                UnsetDelayedCancelAllOrdersCommand:
                  $ref: "#/components/examples/UnsetDelayedCancelAllOrdersCommandResponse"

        "400":
          description: |
            Bad Request

            For example, sending a request with the `BX-SIGNATURE` header missing will result in the following response:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadOrderEntryResponse"
        "401":
          description: Not Authenticated
        "403":
          description: Access Forbidden
        "429":
          description: Too Many Requests
        "500":
          description: Internal Server Error
      requestBody:
        required: true
        content:
          application/json:
            schema:
              discriminator:
                propertyName: commandType
                mapping:
                  V3CancelOrder: "#/components/schemas/CancelOrderCommandV3"
                  V1CancelAllOrders: "#/components/schemas/CancelAllOrdersCommand"
                  V1CancelAllOrdersByMarket: "#/components/schemas/CancelAllOrdersByMarketCommand"
                  V1DelayedCancelAllOrders: "#/components/schemas/DelayedCancelAllOrdersCommand"
                  V1UnsetDelayedCancelAllOrders: "#/components/schemas/UnsetDelayedCancelAllOrdersCommand"
              oneOf:
                - $ref: "#/components/schemas/CancelOrderCommandV3"
                - $ref: "#/components/schemas/CancelAllOrdersCommand"
                - $ref: "#/components/schemas/CancelAllOrdersByMarketCommand"
                - $ref: "#/components/schemas/DelayedCancelAllOrdersCommand"
                - $ref: "#/components/schemas/UnsetDelayedCancelAllOrdersCommand"
            examples:
              CancelOrderCommand:
                $ref: "#/components/examples/CancelOrderCommand"
              CancelAllOrdersCommand:
                $ref: "#/components/examples/CancelAllOrdersCommand"
              CancelAllOrdersByMarketCommand:
                $ref: "#/components/examples/CancelAllOrdersByMarketCommand"
              DelayedCancelAllOrdersCommand:
                $ref: "#/components/examples/DelayedCancelAllOrdersCommand"
              UnsetDelayedCancelAllOrdersCommand:
                $ref: "#/components/examples/UnsetDelayedCancelAllOrdersCommand"
      security:
        - jwtTokenAuth: []

  /v2/command#amend:
    post:
      x-position: 6
      tags:
        - orders
      summary: Amend Order Command
      description: |
        Ability to amend the `price`, `quantity` and `type` (i.e. change from Taker Only to Maker Only and vice versa) on GTC Limit orders. It can be applied only to open orders (`quantityFilled=0` and `status=OPEN`). For Auction Limit Orders (LOC), only `price` can be amended. Auction Market Orders (MOC) do not support amendment.

        Submits a command to the trading engine to amend an order. A successful response indicates that the command entry was acknowledged 
        but does not indicate that the command was executed. 

        This endpoint uses the [signing format](/rest/authentication#signing-format) which does not require strict field 
        ordering and addition of null fields in the request body. Quantities and prices does not require strict precision. 
        E.g. for asset precision of 4 - `100`, `100.0`, `100.00`, `100.000` and `100.0000` are all accepted.

        Requires
        - [bearer token](/rest/authentication#add-authenticated-request-header) in authorization header

        **Ratelimited:** `True`. Higher tiers of rate limits available by providing the `BX-RATELIMIT-TOKEN` request header.
      operationId: submitAmendmentCommand
      parameters:
        - $ref: "#/components/parameters/BX-SIGNATURE"
        - $ref: "#/components/parameters/BX-TIMESTAMP"
        - $ref: "#/components/parameters/BX-NONCE"
        - $ref: "#/components/parameters/BX-NONCE-WINDOW-ENABLED"
      responses:
        "200":
          description: Status OK. This means a command was successfully
            acknowledged.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: "#/components/schemas/AmendOrderCommandResponseV1"
              examples:
                AmendOrderResponse:
                  $ref: "#/components/examples/AmendOrderCommandResponse"
        "400":
          description: |
            Bad Request

            For example, sending a request with the `BX-SIGNATURE` header missing will result in the following response:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadOrderEntryResponse"
        "401":
          description: Not Authenticated
        "403":
          description: Access Forbidden
        "429":
          description: Too Many Requests
        "500":
          description: Internal Server Error
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - $ref: "#/components/schemas/AmendOrderCommandV1"
            examples:
              AmendOrderCommand:
                $ref: "#/components/examples/AmendOrderCommand"
      security:
        - jwtTokenAuth: []
  /v2/mmp-configuration:
    post:
      x-position: 2
      tags:
        - market-maker-protection
      summary: Setup Market Maker Protection (MMP)
      description: |
        MMP configurations are setup per underlying asset symbol for a specific trading Account. While setting up MMP configurations you can specify `windowTimeInSeconds`, `frozenTimeInSeconds`, `quantityLimit` and `deltaLimit` and use it as best suited.
        Please reach out to your relationship manager to understand how to enable MMP for your trading accounts.

        - To get updates on the status of your set / reset MMP configs request for an underlying asset symbol over WS, please subscribe to `mmpRequest` TOPIC within the [Private Data WebSocket](/websocket/private/private-data).
        - To get updates about MMP triggered event over WS, please subscribe to the `mmpTriggered` TOPIC within the [Private Data WebSocket](/websocket/private/private-data).

        To update/amend your MMP configs, please use the ResetMMPCommandV1 to reset the MMP configurations, followed by setting up a new MMP config via setMMPCommandV1 per underlying asset symbol.

        Notes: 
        - MMP is only applicable for Options [Orders created](/rest/api/create-order-v-2) with the `isMMP` flag set to `true`.
        - ResetMMPCommandV1 will trigger only when there are no `isMMP=true` open orders on the account
      operationId: setMmpConfiguration
      parameters:
        - $ref: "#/components/parameters/BX-SIGNATURE"
        - $ref: "#/components/parameters/BX-TIMESTAMP"
        - $ref: "#/components/parameters/BX-NONCE"
      responses:
        "200":
          description: Status OK. This means a command was successfully acknowledged.
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: "#/components/schemas/SetMMPCommandResponse"
                  - $ref: "#/components/schemas/ResetMMPCommandResponse"
              examples:
                SetMMPCommandResponse:
                  $ref: "#/components/examples/SetMMPCommandResponse"
                ResetMMPCommandResponse:
                  $ref: "#/components/examples/ResetMMPCommandResponse"
        "400":
          description: Bad Request
        "401":
          description: Not Authenticated
        "403":
          description: Access Forbidden
        "429":
          description: Too Many Requests
        "500":
          description: Internal Server Error
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - $ref: "#/components/schemas/SetMMPCommandV1"
                - $ref: "#/components/schemas/ResetMMPCommandV1"
            examples:
              SetMMPCommandV1:
                $ref: "#/components/examples/SetMMPCommandV1"
              ResetMMPCommandV1:
                $ref: "#/components/examples/ResetMMPCommandV1"
      security:
        - jwtTokenAuth: []
    get:
      x-position: 1
      tags:
        - market-maker-protection
      summary: Get Market Marker Protection (MMP) by Trading Account ID
      description: |
        Get market maker protection configurations under a trading account id

        This endpoint requires [authentication](/rest/authentication#generate-a-jwt-token). To filter by `symbol`, additional parameters are required. For detailed instructions, see the [Filtering Support](/rest/general/filtering) section.
      operationId: getMmpConfiguration
      parameters:
        - in: query
          name: symbol
          description: The underlying asset id you filter the configurations against. If symbol is provided, this API will only return the market maker protection configuration for this symbol for this trading account.
          schema:
            $ref: "#/components/schemas/UnderlyingAssetSymbol"
          required: false
        - in: query
          name: tradingAccountId
          description: Id of the trading account
          schema:
            $ref: "#/components/schemas/TradingAccountId"
          required: true
      responses:
        "200":
          description: Status OK. This means a command was successfully acknowledged.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetMmpConfigurationResponse"
        "400":
          description: Bad Request
        "401":
          description: Not Authenticated
        "403":
          description: Access Forbidden
      security:
        - jwtTokenAuth: []

  /v1/trades:
    get:
      tags:
        - trades
      summary: Get Trades
      description: |
        Get a list of trades based on specified filters.
        - requires [bearer token](/rest/authentication#add-authenticated-request-header) in authorization header
        - Only the last 24 hours of data is available for querying
        - [supports pagination](/rest/general/pagination)
        - filtering on `createdAtDatetime`, `createdAtTimestamp` requires additional keywords, [see filtering support](/rest/general/filtering)

        **Ratelimited:** `True`
      operationId: getTrades
      parameters:
        - in: query
          name: symbol
          schema:
            $ref: "#/components/schemas/MarketSymbol"
          required: false
        - in: query
          name: orderId
          description: unique order ID
          schema:
            $ref: "#/components/schemas/OrderID"
          required: false
        - in: query
          name: clientOrderId
          description: unique numeric (i64) identifier generated on the client side, only orderId or clientOrderId can be used
          schema:
            $ref: "#/components/schemas/OrderHandle"
          required: false
        - in: query
          name: tradingAccountId
          description: Id of the trading account
          schema:
            $ref: "#/components/schemas/TradingAccountId"
          required: true
        - in: query
          name: otcTradeId
          description: unique Bullish otc trade id
          schema:
            $ref: "#/components/schemas/OtcTradeId"
          required: false
        - in: query
          name: clientOtcTradeId
          description: unique client otc trade id
          schema:
            $ref: "#/components/schemas/ClientOtcTradeId"
          required: false
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                minItems: 0
                maxItems: 10
                items:
                  $ref: "#/components/schemas/Trade"
        "401":
          description: Not Authenticated
        "403":
          description: Access Forbidden
        "429":
          description: Too Many Requests
        "500":
          description: Internal Server Error
      security:
        - jwtTokenAuth: []
  /v1/trades/{tradeId}:
    get:
      parameters:
        - in: path
          name: tradeId
          schema:
            type: number
          required: true
          description: trade ID
        - in: query
          name: tradingAccountId
          description: Id of the trading account
          schema:
            $ref: "#/components/schemas/TradingAccountId"
          required: true
      tags:
        - trades
      summary: Get Trade by ID
      description: |
        Gets a trade by ID, requires [bearer token](/rest/authentication#add-authenticated-request-header) in authorization header

        **Ratelimited:** `True`
      operationId: getTradeById
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Trade"
        "401":
          description: Not Authenticated
        "403":
          description: Access Forbidden
        "404":
          description: Resource Not Found
        "429":
          description: Too Many Requests
        "500":
          description: Internal Server Error
      security:
        - jwtTokenAuth: []
  /v1/trades/client-order-id/{clientOrderId}:
    get:
      parameters:
        - in: path
          name: clientOrderId
          schema:
            $ref: "#/components/schemas/OrderHandle"
          required: true
          description: unique numeric (i64) identifier generated on the client side
        - in: query
          name: tradingAccountId
          description: Id of the trading account
          schema:
            $ref: "#/components/schemas/TradingAccountId"
          required: true
      tags:
        - trades
      summary: Get Trades by clientOrder ID
      description: |
        Gets trade(s) associated with the clientOrderID, requires [bearer token](/rest/authentication#add-authenticated-request-header) in authorization header

        **Ratelimited:** `True`
      operationId: trade-get-trade-by-client-order-id
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Trade"
        "401":
          description: Not Authenticated
        "403":
          description: Access Forbidden
        "404":
          description: Resource Not Found
        "429":
          description: Too Many Requests
        "500":
          description: Internal Server Error
      security:
        - jwtTokenAuth: []
  /v1/history/trades:
    get:
      tags:
        - history
      summary: Get Historical Trades
      description: |
        Get a list of trades based on specified filters.
        - requires [bearer token](/rest/authentication#add-authenticated-request-header) in authorization header
        - On a single query request you can retrieve data over a 7 day window, with the data available for the last 90 days
        - [supports pagination](/rest/general/pagination)
        - filtering on `createdAtDatetime`, `createdAtTimestamp` requires additional keywords, [see filtering support](/rest/general/filtering)

        **Ratelimited:** `True`
      operationId: getTradesHistory
      parameters:
        - in: query
          name: symbol
          schema:
            $ref: "#/components/schemas/MarketSymbol"
          required: false
        - in: query
          name: orderId
          description: unique order ID
          schema:
            $ref: "#/components/schemas/OrderID"
          required: false
        - in: query
          name: tradeId
          description: unique trade ID
          schema:
            $ref: "#/components/schemas/TradeID"
          required: false
        - in: query
          name: clientOrderId
          description: unique numeric (i64) identifier generated on the client side, only orderId or clientOrderId can be used
          schema:
            $ref: "#/components/schemas/OrderHandle"
          required: false
        - in: query
          name: tradingAccountId
          description: Id of the trading account
          schema:
            $ref: "#/components/schemas/TradingAccountId"
          required: true
        - in: query
          name: createdAtDatetime[gte]
          description: start timestamp of period, ISO 8601 with millisecond as string
          schema:
            $ref: "#/components/schemas/DateTime"
          required: false
        - in: query
          name: createdAtDatetime[lte]
          description: end timestamp of period, ISO 8601 with millisecond as string
          schema:
            $ref: "#/components/schemas/DateTime"
          required: false
        - in: query
          name: otcTradeId
          description: unique Bullish otc trade id
          schema:
            $ref: "#/components/schemas/OtcTradeId"
          required: false
        - in: query
          name: clientOtcTradeId
          description: unique client otc trade id
          schema:
            $ref: "#/components/schemas/ClientOtcTradeId"
          required: false
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                minItems: 0
                maxItems: 10
                items:
                  $ref: "#/components/schemas/Trade"
        "401":
          description: Not Authenticated
        "403":
          description: Access Forbidden
        "429":
          description: Too Many Requests
        "500":
          description: Internal Server Error
      security:
        - jwtTokenAuth: []
  /v1/wallets/transactions:
    get:
      tags:
        - custody
      summary: Get Custody Transaction History
      description: |
        Get custody transaction history, requires [bearer token](/rest/authentication#add-authenticated-request-header) in authorization header

        Please note that Custody endpoints utilize a non-multiplied asset format for long decimal assets like SHIB and PEPE, ensuring consistency with real-world asset representation. This differs from Trading endpoints, which use a multiplied asset format, such as SHIB1M and PEPE1M. For more information, please see [help center](https://bullishexchange.atlassian.net/wiki/spaces/BHC/pages/20807684/Understanding+Multiplied+Assets+PEPE1M+and+SHIB1M)

        - [supports pagination](/rest/general/pagination)

        **Ratelimited:** `True` - see [custody limits](/rest/general/rate-limits)
      operationId: getCustodyTransactionHistory
      parameters:
        - in: query
          name: createdAtDatetime[gte]
          description: start timestamp of period, ISO 8601 with millisecond as string
          schema:
            $ref: "#/components/schemas/DateTime"
          required: false
        - in: query
          name: createdAtDatetime[lte]
          description: end timestamp of period, ISO 8601 with millisecond as string
          schema:
            $ref: "#/components/schemas/DateTime"
          required: false
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/CustodyHistory"
        "429":
          description: Too Many Requests
        "500":
          description: Internal Server Error
      security:
        - jwtTokenAuth: []
  /v1/wallets/limits/{symbol}:
    get:
      tags:
        - custody
      summary: Get Withdrawal Limits for Symbol
      description: |
        Get withdrawal limits for symbol, requires [bearer token](/rest/authentication#add-authenticated-request-header) in authorization header

        Please note that Custody endpoints utilize a non-multiplied asset format for long decimal assets like SHIB and PEPE, ensuring consistency with real-world asset representation. This differs from Trading endpoints, which use a multiplied asset format, such as SHIB1M and PEPE1M. For more information, please see [help center](https://bullishexchange.atlassian.net/wiki/spaces/BHC/pages/20807684/Understanding+Multiplied+Assets+PEPE1M+and+SHIB1M)

        **Ratelimited:** `True` - see [custody limits](/rest/general/rate-limits)
      operationId: getCustodyWithdrawalLimits
      parameters:
        - in: path
          name: symbol
          schema:
            $ref: "#/components/schemas/CustodySymbol"
          required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CustodyLimits"
        "429":
          description: Too Many Requests
        "500":
          description: Internal Server Error
      security:
        - jwtTokenAuth: []
  /v1/wallets/deposit-instructions/crypto/{symbol}:
    get:
      tags:
        - custody
      summary: Get Deposit Instructions for Crypto
      description: |
        Get deposit instructions, requires [bearer token](/rest/authentication#add-authenticated-request-header) in authorization header

        Please note that Custody endpoints utilize a non-multiplied asset format for long decimal assets like SHIB and PEPE, ensuring consistency with real-world asset representation. This differs from Trading endpoints, which use a multiplied asset format, such as SHIB1M and PEPE1M. For more information, please see [help center](https://bullishexchange.atlassian.net/wiki/spaces/BHC/pages/20807684/Understanding+Multiplied+Assets+PEPE1M+and+SHIB1M)

        **Ratelimited:** `True` - see [custody limits](/rest/general/rate-limits)
      operationId: getCryptoDepositInstructions
      parameters:
        - in: path
          name: symbol
          schema:
            $ref: "#/components/schemas/CustodySymbol"
          required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/CustodyCryptoDepositInstructions"
        "429":
          description: Too Many Requests
        "500":
          description: Internal Server Error
      security:
        - jwtTokenAuth: []
  /v1/wallets/withdrawal-instructions/crypto/{symbol}:
    get:
      tags:
        - custody
      summary: Get Withdrawal Instructions for Crypto
      description: |
        Get crypto withdrawal instructions, requires [bearer token](/rest/authentication#add-authenticated-request-header) in authorization header. Please note that all withdrawal addresses must be whitelisted via the Bullish website before any digital asset withdrawals can be processed.

        Please note that Custody endpoints utilize a non-multiplied asset format for long decimal assets like SHIB and PEPE, ensuring consistency with real-world asset representation. This differs from Trading endpoints, which use a multiplied asset format, such as SHIB1M and PEPE1M. For more information, please see [help center](https://bullishexchange.atlassian.net/wiki/spaces/BHC/pages/20807684/Understanding+Multiplied+Assets+PEPE1M+and+SHIB1M)

        **Ratelimited:** `True` - see [custody limits](/rest/general/rate-limits)
      operationId: getCryptoWithdrawalInstructions
      parameters:
        - in: path
          name: symbol
          schema:
            $ref: "#/components/schemas/CustodySymbol"
          required: true
        - in: query
          name: signed
          schema:
            $ref: "#/components/schemas/CustodyDestinationSigned"
          required: false
        - in: query
          name: locked
          schema:
            $ref: "#/components/schemas/CustodyDestinationLocked"
          required: false
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/CustodyCryptoWithdrawalInstructions"
        "429":
          description: Too Many Requests
        "500":
          description: Internal Server Error
      security:
        - jwtTokenAuth: []
  /v1/wallets/deposit-instructions/fiat/{symbol}:
    get:
      tags:
        - custody
      summary: Get Deposit Instructions for Fiat
      description: |
        Get deposit instructions, requires [bearer token](/rest/authentication#add-authenticated-request-header) in authorization header

        **Ratelimited:** `True` - see [custody limits](/rest/general/rate-limits)
      operationId: getFiatDepositInstructions
      parameters:
        - in: path
          name: symbol
          example: USD
          schema:
            $ref: "#/components/schemas/InstrumentId"
          required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/CustodyFiatDepositInstructions"
        "429":
          description: Too Many Requests
        "500":
          description: Internal Server Error
      security:
        - jwtTokenAuth: []
  /v1/wallets/withdrawal-instructions/fiat/{symbol}:
    get:
      tags:
        - custody
      summary: Get Withdrawal Instructions for Fiat
      description: |
        Get withdrawal instructions added by the user, requires [bearer token](/rest/authentication#add-authenticated-request-header) in authorization header. Please note that before withdrawal destinations can be used for withdrawing to, they must be whitelisted on the Bullish website.

        **Ratelimited:** `True` - see [custody limits](/rest/general/rate-limits)
      operationId: getFiatWithdrawalInstructions
      parameters:
        - in: path
          name: symbol
          schema:
            $ref: "#/components/schemas/CustodyFiatSymbol"
          required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/CustodyFiatWithdrawalInstructions"
        "429":
          description: Too Many Requests
        "500":
          description: Internal Server Error
      security:
        - jwtTokenAuth: []
  /v1/wallets/self-hosted/initiate:
    post:
      tags:
        - custody
      summary: Initiate Self-Hosted Wallet Verification
      description: |
        This endpoint is used for initiating wallet verification requests.

        Note: users will have 24 hours to complete the wallet verification by sending the exact total amount to the Bullish deposit address provided.

        **Ratelimited:** `True` - see [custody limits](/rest/general/rate-limits)
      operationId: custody-initiate-self-hosted-verification
      requestBody:
        description: Self hosted wallet verification request
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CustodySelfHostedInitiateRequest"
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CustodySelfHostedInitiateResponse"
        "429":
          description: Too Many Requests
        "500":
          description: Internal Server Error
      security:
        - jwtTokenAuth: []
  /v1/wallets/self-hosted/verification-attempts:
    get:
      tags:
        - custody
      summary: Get a List of Self-Hosted Wallet Verification Attempts
      description: |
        This endpoint provides a history of all Wallet Verification attempts, including those that are completed, pending verification and expired.

        **Ratelimited:** `True` - see [custody limits](/rest/general/rate-limits)
      operationId: custody-get-self-hosted-verifications
      parameters:
        - in: query
          name: address
          schema:
            $ref: "#/components/schemas/CustodyNetworkAddress"
          required: false
        - in: query
          name: destinationId
          schema:
            $ref: "#/components/schemas/CustodyDestinationID"
          required: false
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/CustodyGetSelfHostedVerificationResponse"
        "429":
          description: Too Many Requests
        "500":
          description: Internal Server Error
      security:
        - jwtTokenAuth: []
  /v1/wallets/withdrawal-instructions/{destinationId}:
    delete:
      tags:
        - custody
      summary: Delete Existing Wallet Address
      description: |
        This endpoint is used for deleting any existing withdrawal addresses.

        **Ratelimited:** `True` - see [custody limits](/rest/general/rate-limits)
      operationId: custody-delete-withdrawal-instructions
      parameters:
        - in: path
          name: destinationId
          schema:
            $ref: "#/components/schemas/CustodyDestinationID"
          required: true
      responses:
        "200":
          description: OK
        "404":
          description: A wallet destination is not found for the specified `destinationId`.
        "429":
          description: Too Many Requests
        "500":
          description: Internal Server Error
      security:
        - jwtTokenAuth: []
  /v1/wallets/withdrawal:
    post:
      tags:
        - custody
      summary: Create Withdrawal
      description: |
        Trigger a withdrawal, requires [bearer token](/rest/authentication#add-authenticated-request-header) in authorization header

        The `BX-SIGNATURE` header should be created by signing the request with an ECDSA API Key as follows:

        1. Construct a string that concatenates the following fields:
            - `timestamp` - current epoch milliseconds e.g. 1697008474031
            - `nonce` - a UUID identifier to protect against replay attacks e.g. 255241a1-2cde-4954-87b1-13beef547960
            - `request method` - e.g. POST
            - `request path` - e.g. /trading-api/v1/wallets/withdrawal
            - `request body JSON string`, removing any spaces and newline characters
        2. Hash the string using a SHA-256 hash function and sign the resulting hexdigest with your `<PRIVATE_KEY>`.
        3. DER encode the signature, and base64 encode the DER encoded signature.

        > **Bullish requires you to whitelist a withdrawal destination address before submitting a withdrawal request. You may view, approve, and manage your list of destination addresses in Account Settings on the Bullish website. If you attempt a withdrawal without first whitelisting an address in Account Settings, then the withdrawal attempt will fail.**

        For a full example of using the withdrawal endpoint please see the [Custody Withdrawal Example](https://github.com/bullish-exchange/api-examples/blob/master/custody/custody_withdrawal_ecdsa.py)

        Please note that Custody endpoints utilize a non-multiplied asset format for long decimal assets like SHIB and PEPE, ensuring consistency with real-world asset representation. This differs from Trading endpoints, which use a multiplied asset format, such as SHIB1M and PEPE1M. For more information, please see [help center](https://bullishexchange.atlassian.net/wiki/spaces/BHC/pages/20807684/Understanding+Multiplied+Assets+PEPE1M+and+SHIB1M)

        The currently supported precisions for withdrawal quantities are as follows. Please note that fees are always specified in units of the symbol itself, not in smaller denominations (e.g. BTC not Satoshi, ETH not Wei) :

        | Symbol | Precision | Remarks |
        | ---------- |---------------- | --- |
        | USD | 2dp | |
        | BTC | 8dp | |
        | DOGE | 8dp | |
        | ETH | 8dp | |
        | LTC | 8dp | |
        | XRP | 6dp | |
        | AAVE | 8dp | |
        | CRV | 8dp | |
        | LINK | 8dp | |
        | MANA | 8dp | |
        | MATIC | 8dp | |
        | SUSHI | 8dp | |
        | UNI | 8dp | |
        | USDC | 6dp | |
        | USDT | 6dp | |
        | SHIB | 2dp | Please ensure to use the non-multiplied asset format (e.g., SHIB, PEPE, BONK) when creating withdrawals, as Custody endpoints align with real-world asset representation |
        | PEPE | 2dp | Please ensure to use the non-multiplied asset format (e.g., SHIB, PEPE, BONK) when creating withdrawals, as Custody endpoints align with real-world asset representation |
        | BONK | Round to the nearest ten (e.g., 120 or 130, not 125). | Please ensure to use the non-multiplied asset format (e.g., SHIB, PEPE, BONK) when creating withdrawals, as Custody endpoints align with real-world asset representation |

        **Ratelimited:** `True` - see [custody limits](/rest/general/rate-limits)
      operationId: createCustodyWithdrawal
      parameters:
        - $ref: "#/components/parameters/BX-SIGNATURE"
      requestBody:
        description: withdrawal request
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CustodyApiEcdsaWithdrawalRequest"
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CustodyApiWithdrawalResponse"
        "429":
          description: Too Many Requests
        "500":
          description: Internal Server Error
      security:
        - jwtTokenAuth: []
  /v1/assets:
    get:
      tags:
        - asset-data
      summary: Get Assets
      description: Get supported assets.
      operationId: getAssets
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                minItems: 0
                maxItems: 10
                items:
                  $ref: "#/components/schemas/Asset"
        "429":
          description: Too Many Requests
        "500":
          description: Internal Server Error
      security: []
  /v1/assets/{symbol}:
    get:
      tags:
        - asset-data
      summary: Get Asset by Symbol
      description: Get Asset by Symbol
      operationId: getAssetBySymbol
      parameters:
        - in: path
          name: symbol
          schema:
            type: string
          required: true
          example: BTC
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Asset"
        "429":
          description: Too Many Requests
        "500":
          description: Internal Server Error
      security: []
  /v1/vol-grids:
    get:
      tags:
        - asset-data
      summary: Get Vol Grids
      description: Returns grids for **all** options-enabled underlyings.
      operationId: getVolGrids
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/VolGridConfiguration"
        "500":
          description: Internal Server Error
      security: []
  /v1/assets/{symbol}/vol-grid:
    get:
      parameters:
        - in: path
          name: symbol
          schema:
            type: string
          required: true
          example: BTC
          description: The underlying asset symbol (e.g. `BTC`, `ETH`)
      tags:
        - asset-data
      summary: Get Vol Grid by Symbol
      description: Returns the current active BPM (Bullish Portfolio Margin) vol grid configuration for the specified underlying asset.
      operationId: getVolGridByAsset
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/VolGridConfiguration"
        "400":
          description: Invalid asset symbol
        "404":
          description: Vol grid config not found for assetSymbol
        "500":
          description: Internal Server Error
      security: []
  /v1/derivatives-positions:
    get:
      tags:
        - derivatives
      summary: Get Derivatives Positions
      description: Get derivatives positions
      operationId: getDerivativesPositions
      parameters:
        - in: query
          name: tradingAccountId
          description: Id of the trading account. `tradingAccountId` is mandatory in the query for users with multiple trading accounts. For users with a single trading account, it can be automatically retrieved from the login.
          schema:
            $ref: "#/components/schemas/TradingAccountId"
          required: false
        - in: query
          name: symbol
          example: BTC-USDC-PERP
          schema:
            $ref: "#/components/schemas/MarketSymbol"
        - in: query
          name: marketType
          description: Optional - Filter for results by expiry date
          example: DATED_FUTURE
          schema:
            $ref: "#/components/schemas/MarketTypeAsString"
        - in: query
          name: optionType
          description: Optional - Filter for results by option type
          example: CALL
          schema:
            $ref: "#/components/schemas/OptionTypeAsString"
        - in: query
          name: sort
          description: Optional - Sort results by Market Type or Option Type
          schema:
            $ref: "#/components/schemas/MarketTypeOrOptionTypeSortByAsString"
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/DerivativesPositionResponse"
        "429":
          description: Too Many Requests
        "500":
          description: Internal Server Error
      security:
        - jwtTokenAuth: []
  /v1/history/derivatives-settlement:
    get:
      tags:
        - history
      summary: Get Historical Hourly Derivatives Settlement
      description: |
        Get historical derivatives settlement. 
        - [supports pagination](/rest/general/pagination)
        - filtering on `settlementDatetime` requires additional keywords, [see filtering support](/rest/general/filtering)
        - On a single query request you can retrieve data over a 7 day window, with the data available for the last 90 days. By default the results are returned and sorted in descending order if specific settlement datetime is not specified.
      operationId: getDerivativesSettlementHistory
      parameters:
        - in: query
          name: tradingAccountId
          description: Id of the trading account. `tradingAccountId` is mandatory in the query for users with multiple trading accounts. For users with a single trading account, it can be automatically retrieved from the login.
          schema:
            $ref: "#/components/schemas/TradingAccountId"
          required: false
        - in: query
          name: symbol
          example: BTC-USDC-PERP
          schema:
            $ref: "#/components/schemas/DatedFutureMarketSymbol"
          required: false
        - in: query
          name: settlementDatetime[gte]
          description: start timestamp of window, ISO 8601 with millisecond as string
          schema:
            $ref: "#/components/schemas/DateTime"
          required: true
        - in: query
          name: settlementDatetime[lte]
          description: end timestamp of window, ISO 8601 with millisecond as string
          schema:
            $ref: "#/components/schemas/DateTime"
          required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                minItems: 0
                maxItems: 25
                items:
                  $ref: "#/components/schemas/DerivativesSettlementResponse"
        "429":
          description: Too Many Requests
        "500":
          description: Internal Server Error
      security:
        - jwtTokenAuth: []
  /v1/history/transfer:
    get:
      tags:
        - history
      summary: Get Historical Account Transfer
      description: |
        Get historical transfers.
        - [supports pagination](/rest/general/pagination)
        - filtering on `createdAtDatetime` and `createdAtTimestamp` requires additional keywords, [see filtering support](/rest/general/filtering)
        - On a single query request you can retrieve data over a 7 day window, with the data available for the last 90 days
      operationId: getTransferHistory
      parameters:
        - in: query
          name: tradingAccountId
          description: Id of the trading account. `tradingAccountId` is mandatory in the query for users with multiple trading accounts. For users with a single trading account, it can be automatically retrieved from the login.
          schema:
            $ref: "#/components/schemas/TradingAccountId"
          required: false
        - in: query
          name: status
          description: Status of the transfer request. Defaults to `CLOSED`
          schema:
            type: string
            example: CLOSED
            default: CLOSED
        - in: query
          name: requestId
          description: Unique identifier of the transfer request
          schema:
            type: string
            example: "561287547935260672"
        - in: query
          name: assetSymbol
          description: Asset symbol of the transfer request
          schema:
            $ref: "#/components/schemas/AssetSymbol"
        - in: query
          name: createdAtDatetime[gte]
          description: start datetime of window, ISO 8601 with millisecond as string
          schema:
            $ref: "#/components/schemas/DateTime"
          required: true
        - in: query
          name: createdAtDatetime[lte]
          description: end datetime of window, ISO 8601 with millisecond as string
          schema:
            $ref: "#/components/schemas/DateTime"
          required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                minItems: 0
                maxItems: 25
                items:
                  $ref: "#/components/schemas/SubAccountTransferResponse"
        "429":
          description: Too Many Requests
        "500":
          description: Internal Server Error
      security:
        - jwtTokenAuth: []
  /v1/markets:
    parameters:
      - in: query
        name: marketType
        description: Market Types to filter markets against
        schema:
          $ref: "#/components/schemas/MarketTypeAsString"
        required: false
      - in: query
        name: optionType
        description: Option Type to filter markets against. If this is present, only Option Markets will be returned
        schema:
          $ref: "#/components/schemas/OptionTypeAsString"
        required: false
    get:
      tags:
        - market-data
      summary: Get Markets
      description: Get Markets.
      operationId: getMarkets
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                minItems: 0
                maxItems: 10
                items:
                  $ref: "#/components/schemas/Market"
        "404":
          description: Not Found
        "429":
          description: Too Many Requests
        "500":
          description: Internal Server Error
      security: []
  /v1/markets/{symbol}:
    parameters:
      - in: path
        name: symbol
        schema:
          $ref: "#/components/schemas/MarketSymbol"
        required: true
    get:
      tags:
        - market-data
      summary: Get Market by Symbol
      description: Get Market by Symbol.
      operationId: getMarketBySymbol
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Market"
        "404":
          description: Not Found
        "429":
          description: Too Many Requests
        "500":
          description: Internal Server Error
      security: []
  /v1/history/markets:
    get:
      tags:
        - market-data
      summary: Get Historical Markets
      description: |
        Get a list of historical markets, including expired markets.
        This endpoint returns simplified market information and supports filtering by market type and expiry status.
      operationId: getHistoricalMarkets
      parameters:
        - in: query
          name: marketType
          description: Filter by market type (can be specified multiple times for multiple types)
          schema:
            type: array
            items:
              type: string
              enum:
                - SPOT
                - PERPETUAL
                - DATED_FUTURE
                - OPTION
          style: form
          explode: true
          required: false
        - in: query
          name: status
          description: Filter by expiry status (can be specified multiple times for multiple statuses)
          schema:
            type: array
            items:
              type: string
              enum:
                - ACTIVE
                - EXPIRED
                - ALL
          style: form
          explode: true
          required: false
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    symbol:
                      type: string
                      description: Market symbol
                      example: "BTC-USD-20241231-100000-C"
                    expiryDatetime:
                      type: string
                      description: Expiry datetime in ISO 8601 format (only for DATED_FUTURE and OPTION markets)
                      example: "2025-12-31T08:00:00.000Z"
                    status:
                      type: string
                      description: Market expiry status
                      example: "EXPIRED"
                      enum:
                        - ACTIVE
                        - EXPIRING
                        - EXPIRED
              example:
                - symbol: "BTC-USD"
                  status: "ACTIVE"
                - symbol: "BTC-USD-20241231-100000-C"
                  expiryDatetime: "2024-12-31T08:00:00.000Z"
                  status: "EXPIRED"
                - symbol: "ETH-USD-20241231"
                  expiryDatetime: "2024-12-31T08:00:00.000Z"
                  status: "EXPIRED"
        "400":
          description: Bad Request - Invalid query parameters
        "429":
          description: Too Many Requests
        "500":
          description: Internal Server Error
      security: []
  /v1/history/markets/{symbol}:
    parameters:
      - in: path
        name: symbol
        schema:
          $ref: "#/components/schemas/OptionAndDatedFuturesMarketSymbol"
        required: true
    get:
      tags:
        - market-data
      summary: Get Historical Market by Symbol
      description: Get Historical Market by Symbol. This endpoint will return specified market even if it is expired. Only applicable for this is applicable only for `DATED_FUTURE` and `OPTION` markets.
      operationId: getHistoricalMarketBySymbol
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Market"
        "404":
          description: Not Found
        "429":
          description: Too Many Requests
        "500":
          description: Internal Server Error
      security: []
  /v1/markets/{symbol}/orderbook/hybrid:
    get:
      parameters:
        - in: path
          name: symbol
          schema:
            $ref: "#/components/schemas/MarketSymbol"
          required: true
          description: symbol to get
      tags:
        - market-data
      summary: Get Market Order Book
      description: |
        Get Order Book by Market Symbol

        **Ratelimited:** `False`
      operationId: getMarketOrderBook
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/OrderBook"
        "404":
          description: Resource Not Found
        "429":
          description: Too Many Requests
        "500":
          description: Internal Server Error
      security: []
  /v1/markets/{symbol}/trades:
    get:
      parameters:
        - in: path
          name: symbol
          schema:
            $ref: "#/components/schemas/MarketSymbol"
          required: true
          description: symbol to get
      tags:
        - market-data
      summary: Get Latest Market Trades
      description: |
        Get Market Trades by Market Symbol.
        - return 100 most recent trades
        - lookup from local cache

        **Ratelimited:** `False`
      operationId: getLatestMarketTrades
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                minItems: 0
                maxItems: 100
                items:
                  $ref: "#/components/schemas/ObfuscatedTrade"
        "404":
          description: Resource Not Found
        "429":
          description: Too Many Requests
        "500":
          description: Internal Server Error
      security: []
  /v1/index-prices:
    get:
      tags:
        - index-price-data
      summary: Get Index Prices
      description: |
        Retrieves the index price of all supported assets
      operationId: getIndexPrices
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/IndexPrice"
        "429":
          description: Too Many Requests
        "500":
          description: Internal Server Error
      security: []
  /v1/index-prices/{assetSymbol}:
    parameters:
      - in: path
        name: assetSymbol
        schema:
          $ref: "#/components/schemas/AssetSymbol"
        required: true
    get:
      tags:
        - index-price-data
      summary: Get Index Price by Asset Symbol
      description: Retrieves the index price of a specified asset
      operationId: getIndexPriceBySymbol
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/IndexPrice"
        "404":
          description: Not found
        "429":
          description: Too Many Requests
        "500":
          description: Internal Server Error
      security: []
  /v1/history/markets/{symbol}/trades:
    get:
      parameters:
        - in: path
          name: symbol
          schema:
            $ref: "#/components/schemas/MarketSymbol"
          required: true
          description: symbol to get
        - in: query
          name: createdAtDatetime[gte]
          description: start timestamp of period, ISO 8601 with millisecond as string
          schema:
            $ref: "#/components/schemas/DateTime"
          required: false
        - in: query
          name: createdAtDatetime[lte]
          description: end timestamp of period, ISO 8601 with millisecond as string
          schema:
            $ref: "#/components/schemas/DateTime"
          required: false
      tags:
        - market-history-data
      summary: Get Historical Market Trades
      description: |
        Get Historical Market Trades by Market Symbol. Supports querying of up to 7 days of data at a time.
        - [supports pagination](/rest/general/pagination)

        **Ratelimited:** `False`
        - On a single query request you can retrieve data over a 7 day window, with the data available for the last 90 days
      operationId: getHistoricalMarketTrades
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                minItems: 0
                maxItems: 25
                items:
                  $ref: "#/components/schemas/ObfuscatedTradeWithId"
        "404":
          description: Resource Not Found
        "429":
          description: Too Many Requests
        "500":
          description: Internal Server Error
      security: []
  /v1/history/option-trades:
    get:
      parameters:
        - in: query
          name: createdAtDatetime[gte]
          description: start timestamp of period, ISO 8601 with millisecond as string
          schema:
            $ref: "#/components/schemas/DateTime"
          required: false
        - in: query
          name: createdAtDatetime[lte]
          description: end timestamp of period, ISO 8601 with millisecond as string
          schema:
            $ref: "#/components/schemas/DateTime"
          required: false
        - in: query
          name: optionType
          description: Specifies if it's a call (right to buy) or a put (right to sell)
          schema:
            $ref: "#/components/schemas/OptionType"
          required: false
      tags:
        - market-history-data
      summary: Get Historical Options Market Trades
      description: |
        Get Historical Options Market Trades by `optionType`. If `optionType` is not specified in request parameters, both CALL & PUT markets will be returned
        - On a single query request you can retrieve data over a 7 day window, with the data available for the last 90 days
        - Only max 100 data will be returned during the window
        - Default: If `createdAtDatetime` is omitted, the endpoint returns a rolling 7-day window of trade history, starting from the most recent trade across all options markets
      operationId: getHistoricalOptionTrades
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                minItems: 0
                maxItems: 100
                items:
                  $ref: "#/components/schemas/OptionTrade"
        "404":
          description: Resource Not Found
        "429":
          description: Too Many Requests
        "400":
          description: Bad Request
        "500":
          description: Internal Server Error
      security: []
  /v1/history/markets/{symbol}/funding-rate:
    get:
      parameters:
        - in: path
          name: symbol
          schema:
            $ref: "#/components/schemas/PerpMarketSymbol"
          required: true
          description: symbol to get
        - in: query
          name: updatedAtDatetime[gte]
          description: start timestamp of period, ISO 8601 with millisecond as string
          schema:
            $ref: "#/components/schemas/DateTime"
        - in: query
          name: updatedAtDatetime[lte]
          description: end timestamp of period, ISO 8601 with millisecond as string
          schema:
            $ref: "#/components/schemas/DateTime"
      tags:
        - market-history-data
      summary: Get Historical Funding Rate
      description: |
        Get historical hourly funding rate for the requested perpetual market
        - [supports pagination](/rest/general/pagination)
        - On a single query request you can retrieve data over a 7 day window, with the data available for the last 90 days
      operationId: getFundingRateHistory
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                minItems: 0
                maxItems: 100
                items:
                  $ref: "#/components/schemas/FundingRateHistoryResponse"
        "400":
          description: Bad Request
        "404":
          description: Market Symbol Not Found
        "429":
          description: Too Many Requests
        "500":
          description: Internal Server Error
      security: []
  /v1/option-ladder:
    get:
      parameters:
        - in: query
          name: baseSymbol
          schema:
            $ref: "#/components/schemas/AssetSymbol"
          required: true
          description: symbol to get
        - in: query
          name: expiry
          description: Optional - Filter results by expiry date in YYYYMMDD format (e.g. 20250520)
          schema:
            $ref: "#/components/schemas/OptionExpiryDate"
        - in: query
          name: type
          description: Optional - Filter results by type (`CALL` or ` PUT`) of the option markets
          schema:
            $ref: "#/components/schemas/OptionType"
        - in: query
          name: sort
          description: Optional - Sort results by Option Type or Expiry Datetime
          schema:
            $ref: "#/components/schemas/OptionTypeOrExpiryDatetimeSortAsString"
      tags:
        - derivatives-public
      summary: Get Option Ladder by Base Symbol
      description: |
        Returns the available options contracts. This data helps traders quickly assess the available options and their respective prices, implied volatilities, and Greeks (such as delta, gamma, theta, and vega).
      operationId: getOptionLadder
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/OptionLadderResponse"
        "400":
          description: Bad Request
        "429":
          description: Too Many Requests
        "500":
          description: Internal Server Error
      security: []
  /v1/option-ladder/{symbol}:
    get:
      parameters:
        - in: path
          name: symbol
          schema:
            $ref: "#/components/schemas/OptionMarketSymbol"
          required: true
          description: symbol to get. Only option markets are supported.
      tags:
        - derivatives-public
      summary: Get Option Ladder by Symbol
      description: |
        Returns the for a given `baseSymbol`, organized by strike prices and expiration dates. This data helps traders quickly assess the available options and their respective prices, implied volatilities, and Greeks (such as delta, gamma, theta, and vega).
      operationId: getOptionLadderBySymbol
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/OptionLadderResponse"
        "400":
          description: Bad Request
        "404":
          description: Option Market Not Found
        "429":
          description: Too Many Requests
        "500":
          description: Internal Server Error
      security: []
  /v1/markets/{symbol}/tick:
    get:
      parameters:
        - in: path
          name: symbol
          schema:
            $ref: "#/components/schemas/MarketSymbol"
          required: true
          description: symbol to get. Only perpetual markets are supported.
      tags:
        - market-data
      summary: Get Market Tick
      description: |
        Get Current Tick by Market Symbol.
        - return top 100

        **Ratelimited:** `False`
      operationId: getMarketTick
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Tick"
        "404":
          description: Resource Not Found
        "429":
          description: Too Many Requests
        "500":
          description: Internal Server Error
      security: []
  /v1/markets/{symbol}/candle:
    get:
      tags:
        - market-data
      summary: Get Market Candle
      description: |
        Get Current OHLCV Candle by Market Symbol
        - [supports pagination](/rest/general/pagination)
        - filtering on `createdAtDatetime`, `createdAtTimestamp` requires additional keywords, [see filtering support](/rest/general/filtering)

        **Ratelimited:** `False`
      operationId: getMarketCandles
      parameters:
        - in: path
          name: symbol
          schema:
            $ref: "#/components/schemas/MarketSymbol"
          required: true
        - in: query
          name: createdAtDatetime[gte]
          description: start timestamp of window, ISO 8601 with millisecond as string
          schema:
            $ref: "#/components/schemas/DateTime"
          required: true
        - in: query
          name: createdAtDatetime[lte]
          description: end timestamp of window, ISO 8601 with millisecond as string
          schema:
            $ref: "#/components/schemas/DateTime"
          required: true
        - in: query
          name: timeBucket
          schema:
            $ref: "#/components/schemas/TimeBucket"
          required: true
          description: time bucket size
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                minItems: 1
                maxItems: 25
                items:
                  $ref: "#/components/schemas/OHLCVCandle"
        "404":
          description: Resource Not Found
        "429":
          description: Too Many Requests
        "500":
          description: Internal Server Error
      security: []
  /v1/history/borrow-interest:
    get:
      tags:
        - history
      summary: Get Historical Hourly Borrow Interest
      description: |
        Get Historical Hourly Borrow Interest. Each entry denotes the hourly quantities for the specific asset. 
        Total borrowed quantity is inclusive of interest. `interest = totalBorrowedQuantity - borrowedQuantity` 
        which denotes the interest charged in the particular hour for the asset.
        - [supports pagination](/rest/general/pagination)
        - filtering `createdAtDatetime`, `createdAtTimestamp` requires additional keywords, [see filtering support](/rest/general/filtering)
        - On a single query request you can retrieve data over a 7 day window, with the data available for the last 90 days

        **Ratelimited:** `True`
      operationId: getBorrowInterestHistory
      parameters:
        - in: query
          name: tradingAccountId
          description: Id of the trading account. `tradingAccountId` is mandatory in the query for users with multiple trading accounts. For users with a single trading account, it can be automatically retrieved from the login.
          schema:
            $ref: "#/components/schemas/TradingAccountId"
          required: false
        - in: query
          name: assetSymbol
          example: BTC
          schema:
            $ref: "#/components/schemas/AssetSymbol"
          required: true
        - in: query
          name: createdAtDatetime[gte]
          description: start timestamp of period, ISO 8601 with millisecond as string
          schema:
            $ref: "#/components/schemas/DateTime"
          required: true
        - in: query
          name: createdAtDatetime[lte]
          description: end timestamp of period, ISO 8601 with millisecond as string
          schema:
            $ref: "#/components/schemas/DateTime"
          required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                minItems: 0
                maxItems: 25
                items:
                  $ref: "#/components/schemas/BorrowInterest"
        "404":
          description: Resource Not Found
        "429":
          description: Too Many Requests
        "500":
          description: Internal Server Error
      security:
        - jwtTokenAuth: []
  /v1/time:
    get:
      tags:
        - general
      summary: Get Exchange Time
      description: Get Current Exchange Time
      operationId: getExchangeTime
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CurrentExchangeTimeResponse"
        "429":
          description: Too Many Requests
        "500":
          description: Internal Server Error
      security: []
  /v1/simulate-portfolio-margin:
    post:
      tags:
        - portfolio-margin-simulator
      summary: Simulate Portfolio Margin
      description: |
        Use Portfolio margin simulator to determine your margin requirements and risk levels based on your current portfolio balances. 
        You can also append position details on top of your portfolio specifics to see simulated results.
      operationId: simulatePortfolioMargin
      parameters:
        - in: query
          name: includeExisting
          schema:
            $ref: "#/components/schemas/Boolean"
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PortfolioSimulationResponse"
        "400":
          description: Bad Request
        "401":
          description: Not Authenticated
        "403":
          description: Access Forbidden
        "429":
          description: Too Many Requests
        "500":
          description: Internal Server Error
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PortfolioSimulationRequest"
            examples:
              SimulatePortfolioMarginExample:
                value:
                  tradingAccountId: "111000000000001"
                  positions:
                    - symbol: "BTC"
                      quantity: "1.5"
                    - symbol: "ETH"
                      quantity: "10.0"
                  orders:
                    - symbol: "BTCUSDC"
                      quantity: "0.5"
                      limitPrice: "95000.0"
                      timeInForce: "GTX"
                  referencePrices:
                    - symbol: "BTC"
                      price: "100000.0"
                    - symbol: "ETH"
                      price: "3500.0"
                  priceVolOffsetParams:
                    cryptoPriceMultipliers:
                      BTC: 1.2
                      ETH: 0.9
                    globalCryptoPriceMultiplier: 1.1
                    volOffset: 0.05
      security:
        - jwtTokenAuth: []
  /v1/bulk-simulate-portfolio-margin:
    post:
      tags:
        - portfolio-margin-simulator
      summary: Simulate Portfolio Margin in Bulk
      description: |
        Use Portfolio margin simulator to determine your margin requirements and risk levels based on your current portfolio balances.
        You can also append position details on top of your portfolio specifics to see simulated results.
        This endpoint supports running multiple simulations at the same time.
      operationId: bulkSimulatePortfolioMargin
      parameters:
        - in: query
          name: includeExisting
          description: When true, includes existing portfolio positions in the simulation. Defaults to false
          required: false
          schema:
            $ref: "#/components/schemas/Boolean"
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/PortfolioSimulationResponse"
        "400":
          description: Bad Request
        "401":
          description: Not Authenticated
        "403":
          description: Access Forbidden
        "429":
          description: Too Many Requests
        "500":
          description: Internal Server Error
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: "#/components/schemas/PortfolioSimulationRequest"
            examples:
              BulkSimulatePortfolioMarginExample:
                value:
                  - tradingAccountId: "111000000000001"
                    positions:
                      - symbol: "BTC"
                        quantity: "1.5"
                      - symbol: "ETH"
                        quantity: "10.0"
                    orders:
                      - symbol: "BTCUSDC"
                        quantity: "0.5"
                        limitPrice: "95000.0"
                        timeInForce: "GTX"
                    referencePrices:
                      - symbol: "BTC"
                        price: "100000.0"
                      - symbol: "ETH"
                        price: "3500.0"
                    priceVolOffsetParams:
                      cryptoPriceMultipliers:
                        BTC: 1.2
                        ETH: 0.9
                      globalCryptoPriceMultiplier: 1.1
                      volOffset: 0.05
      security:
        - jwtTokenAuth: []

  /v2/otc-trades:
    post:
      x-position: 1
      summary: Create OTC Trade
      operationId: createOtcTrade
      description: |
        Creates an OTC trade, requires [bearer token](/rest/authentication#add-authenticated-request-header) in authorization header.

        This endpoint uses the [signing format](/rest/authentication#signing-format) which does not require strict field ordering 
        and addition of null fields in the request body. Prices do not require strict precision. 
        E.g. for asset precision of 4 - `100`, `100.0`, `100.00`, `100.000` and `100.0000` are all accepted.
      tags:
        - otc
      parameters:
        - $ref: "#/components/parameters/BX-SIGNATURE"
        - $ref: "#/components/parameters/BX-TIMESTAMP"
        - $ref: "#/components/parameters/BX-NONCE"
        - $ref: "#/components/parameters/BX-REFERRER"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateOtcTradeCommand"
      responses:
        "200":
          description: |
            Status OK. The create OTC trade command was successfully acknowledged. To check the current status of the 
            OTC trade, query [Get Trade by ID](/rest/api/get-otc-trade-by-id) using `otcTradeId` or `clientOtcTradeId` received in the response payload.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CreateOtcTradeResponse"
        "400":
          description: |
            Bad Request

            For example, sending a request with the `BX-SIGNATURE` header missing will result in the following response:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadOtcTradeEntryResponse"
        "401":
          description: Unauthorized. Either API details are missing or invalid
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadOtcTradeEntryResponse"
        "403":
          description: Forbidden- You do not have access to the requested resource
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadOtcTradeEntryResponse"
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadOtcTradeEntryResponse"
      security:
        - jwtTokenAuth: []
    get:
      x-position: 2
      summary: Get OTC Trades
      operationId: getOtcTrades
      description: |
        Get the otc trade list based on specified filters.
        - requires [bearer token](/rest/authentication#add-authenticated-request-header) in authorization header
        - [supports pagination](/rest/general/pagination)
        - supports filtering on `status`, `tradingAccountId`, `sharedMatchKey`, `clientOtcTradeId`, `createdAtDatetime`, `createdAtTimestamp`, `brokeredBy`
      tags:
        - otc
      parameters:
        - in: query
          name: status
          description: OTC trade status
          schema:
            $ref: "#/components/schemas/OtcTradeExternalStatus"
          required: false
        - in: query
          name: tradingAccountId
          schema:
            $ref: "#/components/schemas/TradingAccountId"
          required: true
        - in: query
          name: sharedMatchKey
          schema:
            $ref: "#/components/schemas/SharedMatchKey"
        - in: query
          name: clientOtcTradeId
          schema:
            $ref: "#/components/schemas/ClientOtcTradeId"
          required: false
        - in: query
          name: brokeredBy
          description: Originating broker short code
          schema:
            $ref: "#/components/schemas/IdbShortCode"
          required: false
        - in: query
          name: createdAtDatetime[ gte ]
          description: Start timestamp of window, ISO 8601 with millisecond as string
          schema:
            $ref: "#/components/schemas/DateTime"
          required: false
        - in: query
          name: createdAtDatetime[ lte ]
          description: End timestamp of window, ISO 8601 with millisecond as string
          schema:
            $ref: "#/components/schemas/DateTime"
          required: false
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                minItems: 0
                maxItems: 25
                items:
                  $ref: "#/components/schemas/OtcTradeView"
        "400":
          description: For example, sending a request with an invalid trading account
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadOtcTradeEntryResponse"
        "401":
          description: Not Authenticated
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadOtcTradeEntryResponse"
        "403":
          description: Access Forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadOtcTradeEntryResponse"
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadOtcTradeEntryResponse"
      security:
        - jwtTokenAuth: []
  /v2/otc-trades/{otcTradeId}:
    parameters:
      - in: path
        name: otcTradeId
        schema:
          type: string
        required: true
        description: Id of the OTC Trade
    get:
      x-position: 3
      summary: Get OTC Trade by ID
      operationId: getOtcTradeById
      description: Retrieve a specific otc trade using its unique identifier.
      tags:
        - otc
      parameters:
        - in: query
          name: tradingAccountId
          description: Id of the trading account
          schema:
            $ref: "#/components/schemas/TradingAccountId"
          required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/OtcTradeView"
        "400":
          description: For example, sending a request with an invalid trading account
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadOtcTradeEntryResponse"
        "401":
          description: Not Authenticated
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadOtcTradeEntryResponse"
        "403":
          description: Access Forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadOtcTradeEntryResponse"
        "404":
          description: The given otcTradeId does not exist
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadOtcTradeEntryResponse"
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadOtcTradeEntryResponse"
      security:
        - jwtTokenAuth: []
  /v2/otc-trades/unconfirmed-trade:
    get:
      x-position: 4
      summary: Get Unconfirmed OTC Trade
      operationId: getUnconfirmedOtcTrade
      description: Retrieve the unconfirmed trade details using shared match key.
      tags:
        - otc
      parameters:
        - in: query
          name: tradingAccountId
          description: Id of the trading account for accepting the unconfirmed trade
          schema:
            $ref: "#/components/schemas/TradingAccountId"
          required: true
        - in: query
          name: sharedMatchKey
          description: Provided by your counterparty to identify the trade
          schema:
            $ref: "#/components/schemas/SharedMatchKey"
          required: true
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/UnconfirmedOtcTradeView"
        "400":
          description: For example, querying a closed OTC trade
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadOtcTradeEntryResponse"
        "401":
          description: Not Authenticated
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadOtcTradeEntryResponse"
        "403":
          description: Access Forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadOtcTradeEntryResponse"
        "404":
          description: The unconfirmed OTC trade does not exist
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadOtcTradeEntryResponse"
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadOtcTradeEntryResponse"
      security:
        - jwtTokenAuth: []
  /v2/otc-command#approve:
    post:
      x-position: 5
      summary: Approve OTC Trade
      operationId: otc-command-approve
      description: |
        Authorize an OTC trade previously submitted on your behalf by an inter-dealer broker.

        Submits a command to the trading engine to approve an OTC trade. A successful response indicates that the command entry was acknowledged
        but does not indicate that the command was executed.
        This endpoint uses the [signing format](/rest/authentication#signing-format) which does not require strict field
        ordering and addition of null fields in the request body.

        Command schemas and examples are provided below. Supported commands:
        - V1ApproveOtcTrade

        Requires
        - [bearer token](/rest/authentication#add-authenticated-request-header) in authorization header
      tags:
        - otc
      parameters:
        - $ref: "#/components/parameters/BX-SIGNATURE"
        - $ref: "#/components/parameters/BX-TIMESTAMP"
        - $ref: "#/components/parameters/BX-NONCE"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              discriminator:
                propertyName: commandType
                mapping:
                  V1ApproveOtcTrade: "#/components/schemas/ApproveOtcTradeCommand"
              oneOf:
                - $ref: "#/components/schemas/ApproveOtcTradeCommand"
            examples:
              ApproveOtcTrade:
                $ref: "#/components/examples/ApproveOtcTradeCommand"
      responses:
        "200":
          description: Status OK. This means a command was successfully acknowledged.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: "#/components/schemas/ApproveOtcTradeResponse"
              examples:
                ApproveOtcTradeResponse:
                  $ref: "#/components/examples/ApproveOtcTradeResponse"
        "400":
          description: |
            Bad Request

            For example, sending a request with the `BX-SIGNATURE` header missing will result in the following response:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadOtcTradeEntryResponse"
        "401":
          description: Unauthorized. Either API details are missing or invalid
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadOtcTradeEntryResponse"
        "403":
          description: Forbidden- You do not have access to the requested resource
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadOtcTradeEntryResponse"
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadOtcTradeEntryResponse"
      security:
        - jwtTokenAuth: []
  /v2/otc-command#cancel:
    post:
      x-position: 6
      summary: Cancel OTC Trade
      operationId: otc-command-cancel
      description: |
        Cancel a pending OTC trade or reject an OTC trade previously submitted on your behalf by an inter-dealer broker.

        Submits a command to the trading engine. A successful response indicates that the command entry was acknowledged
        but does not indicate that the command was executed.
        This endpoint uses the [signing format](/rest/authentication#signing-format) which does not require strict field
        ordering and addition of null fields in the request body.

        Command schemas and examples are provided below. Supported commands:
        - V1CancelOtcTrade
        - V1CancelAllOtcTrades

        Requires
        - [bearer token](/rest/authentication#add-authenticated-request-header) in authorization header
      tags:
        - otc
      parameters:
        - $ref: "#/components/parameters/BX-SIGNATURE"
        - $ref: "#/components/parameters/BX-TIMESTAMP"
        - $ref: "#/components/parameters/BX-NONCE"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              discriminator:
                propertyName: commandType
                mapping:
                  V1CancelOtcTrade: "#/components/schemas/CancelOtcTradeCommand"
                  V1CancelAllOtcTrades: "#/components/schemas/CancelAllOtcTradesCommand"
              oneOf:
                - $ref: "#/components/schemas/CancelOtcTradeCommand"
                - $ref: "#/components/schemas/CancelAllOtcTradesCommand"
            examples:
              CancelOtcTrade:
                $ref: "#/components/examples/CancelOtcTradeCommand"
              CancelAllOtcTrades:
                $ref: "#/components/examples/CancelAllOtcTradesCommand"
      responses:
        "200":
          description: Status OK. This means a command was successfully acknowledged.
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: "#/components/schemas/CancelOtcTradeResponse"
                  - $ref: "#/components/schemas/CancelAllOtcTradesResponse"
              examples:
                CancelOtcTradeResponse:
                  $ref: "#/components/examples/CancelOtcTradeResponse"
                CancelAllOtcTradeResponse:
                  $ref: "#/components/examples/CancelAllOtcTradesResponse"
        "400":
          description: |
            Bad Request

            For example, sending a request with the `BX-SIGNATURE` header missing will result in the following response:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadOtcTradeEntryResponse"
        "401":
          description: Unauthorized. Either API details are missing or invalid
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadOtcTradeEntryResponse"
        "403":
          description: Forbidden- You do not have access to the requested resource
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadOtcTradeEntryResponse"
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadOtcTradeEntryResponse"
      security:
        - jwtTokenAuth: []
  /v2/idb/delegated-accounts:
    get:
      x-position: 1
      summary: IDB Get Delegated Trading Accounts
      operationId: idb-otc-get-delegated-accounts
      description: |
        Get details for all delegated trading accounts from the broker perspective.

        - requires [bearer token](/rest/authentication#add-authenticated-request-header) in authorization header
        - [supports pagination](/rest/general/pagination)
      tags:
        - idb
      parameters:
        - in: query
          name: tradingAccountId
          description: Optional filter by a single delegated trading account
          schema:
            $ref: "#/components/schemas/TradingAccountId"
          required: false
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/IdbDelegatedAccountView"
              examples:
                IdbDelegatedAccountView:
                  value:
                    - institutionName: "Alpha Traders"
                      institutionRegistrationNumber: "87654321"
                      tradingAccountId: "111000000000001"
                      tradingAccountNickname: "Alpha Traders Primary"
                      approvalMethod: "APPROVAL_REQUIRED"
                    - institutionName: "Beta Traders"
                      tradingAccountId: "111000000000002"
                      tradingAccountNickname: "Beta Traders OTC"
                      approvalMethod: "STRAIGHT_THROUGH"
        "401":
          description: Not Authenticated
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadOtcTradeEntryResponse"
        "403":
          description: Access Forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadOtcTradeEntryResponse"
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadOtcTradeEntryResponse"
      security:
        - jwtTokenAuth: []
  /v2/idb/otc-trades:
    post:
      x-position: 2
      summary: IDB Create OTC Trade
      operationId: idb-otc-create-trade
      description: |
        Enables authorized inter-dealer broker to book a dual-sided OTC trade on behalf of two clients.

        This endpoint uses the [signing format](/rest/authentication#signing-format) which does not require strict field
        ordering and addition of null fields in the request body. Prices do not require strict precision.
        Eg. for asset precision of 4 - `100`, `100.0`, `100.00`, `100.000` and `100.0000` are all accepted.

        - requires [bearer token](/rest/authentication#add-authenticated-request-header) in authorization header
      tags:
        - idb
      parameters:
        - $ref: "#/components/parameters/BX-SIGNATURE"
        - $ref: "#/components/parameters/BX-TIMESTAMP"
        - $ref: "#/components/parameters/BX-NONCE"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/IdbCreateOtcTradeCommand"
      responses:
        "200":
          description: |
            Status OK. The IDB create OTC trade command was successfully acknowledged. To check the current status of the OTC trades, query [IDB Get OTC Trades](/rest/api/idb-otc-get-trades) using `sharedMatchKey` received in the response payload.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/IdbCreateOtcTradeResponse"
        "400":
          description: |
            Bad Request

            For example, sending a request with the `BX-SIGNATURE` header missing will result in the following response:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadOtcTradeEntryResponse"
        "401":
          description: Unauthorized. Either API details are missing or invalid
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadOtcTradeEntryResponse"
        "403":
          description: Forbidden- You do not have access to the requested resource
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadOtcTradeEntryResponse"
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadOtcTradeEntryResponse"
      security:
        - jwtTokenAuth: []
  /v2/idb/otc-trades#list:
    get:
      x-position: 3
      summary: IDB Get OTC Trades
      operationId: idb-otc-get-trades
      description: |
        Get the brokered OTC trade list initiated by the IDB based on specified filters.

        - requires [bearer token](/rest/authentication#add-authenticated-request-header) in authorization header
        - supports filtering on `status`, `tradingAccountId`, `sharedMatchKey`, `createdAtDatetime`, `createdAtTimestamp`
        - [supports pagination](/rest/general/pagination)
      tags:
        - idb
      parameters:
        - in: query
          name: status
          description: OTC trade status
          schema:
            $ref: "#/components/schemas/OtcTradeExternalStatus"
          required: false
        - in: query
          name: tradingAccountId
          schema:
            type: array
            items:
              $ref: "#/components/schemas/TradingAccountId"
          style: form
          explode: true
          example:
            - "111000000000001"
          description: Allow filtering across multiple delegated trading accounts; if tradingAccountId is null or omitted, returns trades for all delegated accounts
          required: false
        - in: query
          name: sharedMatchKey
          schema:
            $ref: "#/components/schemas/SharedMatchKey"
        - in: query
          name: "createdAtDatetime[ gte ]"
          description: Start timestamp of window, ISO 8601 with millisecond as string
          schema:
            $ref: "#/components/schemas/DateTime"
          required: false
        - in: query
          name: "createdAtDatetime[ lte ]"
          description: End timestamp of window, ISO 8601 with millisecond as string
          schema:
            $ref: "#/components/schemas/DateTime"
          required: false
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                minItems: 0
                maxItems: 25
                items:
                  $ref: "#/components/schemas/IdbOtcTradeView"
              examples:
                IdbOtcTradeView:
                  value:
                    - otcTradeId: "200000000000000098"
                      institutionName: "Alpha Traders"
                      tradingAccountId: "111000000000001"
                      tradingAccountNickname: "Alpha Traders Primary"
                      sharedMatchKey: "qt6mlga14z3k9e420y2qap5"
                      status: "REJECTED"
                      statusReason: "OTC trade has expired"
                      statusReasonCode: "9028"
                      createdAtDatetime: "2026-02-26T07:28:49.087Z"
                      createdAtTimestamp: "1772090929087"
                      expireDatetime: "2026-02-26T07:43:49.087Z"
                      expireTimestamp: "1772091829087"
                      remarks: "alpha first trade"
                      idbRemarks: "otc trades between Alpha and Beta"
                      trades:
                        - symbol: BTC-USDC-PERP
                          side: SELL
                          price: "98213.0000"
                          quantity: "1.50000000"
                          isTaker: true
                      brokeredBy: "IDB_A"
                    - otcTradeId: "200000000000000099"
                      institutionName: "Beta Traders"
                      tradingAccountId: "111000000000002"
                      tradingAccountNickname: "Beta Traders OTC"
                      sharedMatchKey: "qt6mlga14z3k9e420y2qap5"
                      status: "REJECTED"
                      statusReason: "OTC trade has expired"
                      statusReasonCode: "9028"
                      createdAtDatetime: "2026-02-26T07:28:49.087Z"
                      createdAtTimestamp: "1772090929087"
                      expireDatetime: "2026-02-26T07:43:49.087Z"
                      expireTimestamp: "1772091829087"
                      idbRemarks: "otc trades between Alpha and Beta"
                      trades:
                        - symbol: BTC-USDC-PERP
                          side: BUY
                          price: "98213.0000"
                          quantity: "1.50000000"
                          isTaker: false
                      brokeredBy: "IDB_A"
        "400":
          description: For example, sending a request with an invalid trading account
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadOtcTradeEntryResponse"
        "401":
          description: Not Authenticated
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadOtcTradeEntryResponse"
        "403":
          description: Access Forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadOtcTradeEntryResponse"
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadOtcTradeEntryResponse"
      security:
        - jwtTokenAuth: []
  /v2/idb/otc-command#cancel:
    post:
      x-position: 4
      summary: IDB Cancel OTC Trade
      operationId: idb-otc-command-cancel
      description: |
        Cancel a pending OTC trade that was previously initiated by the IDB.

        Submits a command to the trading engine. A successful response indicates that the command entry was acknowledged
        but does not indicate that the command was executed.
        This endpoint uses the [signing format](/rest/authentication#signing-format) which does not require strict field
        ordering and addition of null fields in the request body.

        Command schemas and examples are provided below. Supported commands:
        - V1IdbCancelOtcTrade

        - requires [bearer token](/rest/authentication#add-authenticated-request-header) in authorization header
      tags:
        - idb
      parameters:
        - $ref: "#/components/parameters/BX-SIGNATURE"
        - $ref: "#/components/parameters/BX-TIMESTAMP"
        - $ref: "#/components/parameters/BX-NONCE"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              discriminator:
                propertyName: commandType
                mapping:
                  V1IdbCancelOtcTrade: "#/components/schemas/IdbCancelOtcTradeCommand"
              oneOf:
                - $ref: "#/components/schemas/IdbCancelOtcTradeCommand"
            examples:
              IdbCancelOtcTrade:
                $ref: "#/components/examples/IdbCancelOtcTradeCommand"
      responses:
        "200":
          description: Status OK. This means a command was successfully acknowledged.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: "#/components/schemas/IdbCancelOtcTradeResponse"
              examples:
                IdbCancelOtcTradeResponse:
                  $ref: "#/components/examples/IdbCancelOtcTradeResponse"
        "400":
          description: |
            Bad Request

            For example, sending a request with the `BX-SIGNATURE` header missing will result in the following response:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadOtcTradeEntryResponse"
        "401":
          description: Unauthorized. Either API details are missing or invalid
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadOtcTradeEntryResponse"
        "403":
          description: Forbidden- You do not have access to the requested resource
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadOtcTradeEntryResponse"
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadOtcTradeEntryResponse"
      security:
        - jwtTokenAuth: []
  /v2/idb/otc-command#update-remarks:
    post:
      x-position: 5
      summary: IDB Update Remarks
      operationId: idb-otc-command-update-remarks
      description: |
        Update the IDB remarks of a previously initiated OTC trade.

        Submits a command to the trading engine. A successful response indicates that the command entry was acknowledged
        but does not indicate that the command was executed.
        This endpoint uses the [signing format](/rest/authentication#signing-format) which does not require strict field
        ordering and addition of null fields in the request body.

        Command schemas and examples are provided below. Supported commands:
        - V1IdbUpdateRemarks

        - requires [bearer token](/rest/authentication#add-authenticated-request-header) in authorization header
      tags:
        - idb
      parameters:
        - $ref: "#/components/parameters/BX-SIGNATURE"
        - $ref: "#/components/parameters/BX-TIMESTAMP"
        - $ref: "#/components/parameters/BX-NONCE"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              discriminator:
                propertyName: commandType
                mapping:
                  V1IdbUpdateRemarks: "#/components/schemas/IdbUpdateRemarksCommand"
              oneOf:
                - $ref: "#/components/schemas/IdbUpdateRemarksCommand"
            examples:
              IdbUpdateRemarks:
                $ref: "#/components/examples/IdbUpdateRemarksCommand"
      responses:
        "200":
          description: Status OK. This means a command was successfully acknowledged.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: "#/components/schemas/IdbUpdateRemarksResponse"
              examples:
                IdbUpdateRemarksResponse:
                  $ref: "#/components/examples/IdbUpdateRemarksResponse"
        "400":
          description: |
            Bad Request

            For example, sending a request with the `BX-SIGNATURE` header missing will result in the following response:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadOtcTradeEntryResponse"
        "401":
          description: Unauthorized. Either API details are missing or invalid
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadOtcTradeEntryResponse"
        "403":
          description: Forbidden- You do not have access to the requested resource
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadOtcTradeEntryResponse"
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BadOtcTradeEntryResponse"
      security:
        - jwtTokenAuth: []
  /v1/expiry-prices/{symbol}:
    get:
      summary: Get Expiry Prices
      operationId: get-expiry-prices--symbol
      description: Retrieves Expiry Price and Expiry Notional for respective Options and Dated Futures markets.
      tags:
        - derivatives-public
      parameters:
        - in: path
          name: symbol
          schema:
            $ref: "#/components/schemas/DerivativeMarketSymbol"
          required: true
      responses:
        "200":
          description: Retrieve expiry price and expiry notional for options and dated future.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MarketExpiryPriceResponse"
        "400":
          description: Expiry price for market is not (yet) available
        "500":
          description: Internal Server Error
        "404":
          description: Invalid symbol provided
  /v1/markets/{symbol}/auctions:
    get:
      parameters:
        - in: path
          name: symbol
          schema:
            $ref: "#/components/schemas/MarketSymbol"
          required: true
          description: market symbol, e.g. BTCUSDC
      tags:
        - auction-public
      summary: Get Auction by Symbol
      description: Get current auction information and phase for a symbol.
      operationId: getAuctionBySymbol
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: "#/components/schemas/Auction"
        "400":
          description: Bad Request
        "404":
          description: Symbol not found or auction not available
        "500":
          description: Internal Server Error
      security: []
  /v1/markets/{symbol}/auctions/noii:
    get:
      parameters:
        - in: path
          name: symbol
          schema:
            $ref: "#/components/schemas/MarketSymbol"
          required: true
          description: market symbol, e.g. BTCUSDC
      tags:
        - auction-public
      summary: Get Auction Net Order Imbalance Indicator
      description: |
        Get NOII (Net Order Imbalance Indicator) snapshot. Available during Lockdown phase only.
        Returns empty array in other phases.
      operationId: getAuctionNoii
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: "#/components/schemas/AuctionNoii"
        "400":
          description: Bad Request
        "404":
          description: Symbol not found or auction not available
        "500":
          description: Internal Server Error
      security: []
  /v1/history/markets/{symbol}/auctions:
    get:
      parameters:
        - in: path
          name: symbol
          schema:
            $ref: "#/components/schemas/MarketSymbol"
          required: true
          description: market symbol, e.g. BTCUSDC
        - in: query
          name: createdAtDatetime[gte]
          description: start timestamp of period, ISO 8601 with millisecond as string
          schema:
            $ref: "#/components/schemas/DateTime"
          required: false
        - in: query
          name: createdAtDatetime[lte]
          description: end timestamp of period, ISO 8601 with millisecond as string
          schema:
            $ref: "#/components/schemas/DateTime"
          required: false
      tags:
        - market-history-data
      summary: Get Historical Auction Results
      description: |
        Get historical auction results for a symbol.
        - [supports pagination](/rest/general/pagination)
        - filtering on `createdAtDatetime` requires additional keywords, [see filtering support](/rest/general/filtering)
      operationId: getHistoricalAuctionResults
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                minItems: 0
                maxItems: 25
                items:
                  $ref: "#/components/schemas/AuctionResult"
        "400":
          description: Bad Request
        "404":
          description: Symbol not found
        "500":
          description: Internal Server Error
      security: []
components:
  securitySchemes:
    jwtTokenAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
  parameters:
    BX-SIGNATURE:
      in: header
      name: BX-SIGNATURE
      description: signature obtained using the [signing format](/rest/authentication#signing-format)
      required: true
      schema:
        type: string
    BX-TIMESTAMP:
      in: header
      name: BX-TIMESTAMP
      description: timestamp is the number of milliseconds since EPOCH
      required: true
      schema:
        type: string
    BX-NONCE:
      in: header
      name: BX-NONCE
      description: nonce is a client side incremented unsigned 64 bit integer
      required: true
      schema:
        type: string
    BX-REFERRER:
      in: header
      name: BX-REFERRER
      description: A numeric referrer id if applicable
      required: false
      schema:
        type: string
    BX-PUBLIC-KEY:
      in: header
      name: BX-PUBLIC-KEY
      description: public key being used to generate the JWT
      required: true
      schema:
        type: string
    BX-NONCE-WINDOW-ENABLED:
      in: header
      name: BX-NONCE-WINDOW-ENABLED
      description: |
        string representation of a boolean value, [enables out-of-order order requests to be processed](/rest/order-processing-create-cancel-request-mechanism)
      schema:
        type: string
        enum:
          - "false"
          - "true"
        default: "false"
  schemas:
    Boolean:
      type: boolean
      format: true or false
      example: true
    MarketTypeOrOptionTypeSortByAsString:
      type: string
      description: Sorting parameter that can have the following string values `"marketType"`, `"optionType"`
      enum:
        - marketType
        - optionType
      example: optionType
    OptionTypeOrExpiryDatetimeSortAsString:
      type: string
      description: Sorting parameter that can have the following string values `"optionType"`, `"expiryDatetime"`
      enum:
        - optionType
        - expiryDatetime
      example: optionType
    MarketTypeAsString:
      type: string
      description: market type can have the following string values `"SPOT"`, `"PERPETUAL"`, `"DATED_FUTURE"`, `"OPTION"`
      enum:
        - SPOT
        - PERPETUAL
        - DATED_FUTURE
        - OPTION
      example: SPOT
    OptionTypeAsString:
      type: string
      description: option type can have the following string values `"CALL"`, `"PUT"`
      enum:
        - CALL
        - PUT
      example: CALL
    OrderTypeAsString:
      type: string
      description: order type can have the following string values `"LMT"`, `"MKT"`, `"STOP_LIMIT"`, `"POST_ONLY"`. `"MKT"` and `"STOP_LIMIT"` are not applicable for Options
      example: "LMT"
    OrderTypeAsStringV2:
      type: string
      description: order type can have the following string values `"LIMIT"`, `"MARKET"`, `"STOP_LIMIT"`, `"POST_ONLY"`. `"MARKET"` and `"STOP_LIMIT"` are not applicable for Options
      example: "LIMIT"
    OrderTypeAsStringAmend:
      type: string
      description: order type can have the following string values `"LIMIT"`, `"POST_ONLY"`
      example: "LIMIT"
    OrderSideAsString:
      type: string
      description: order side can have the following string values `"BUY"`, `"SELL"`
      example: BUY
    OrderTimeInForceAsString:
      type: string
      description: time in force can have the following string values `"GTC"`, `"FOK"`, `"IOC"`, `"GTX"` (Good Till Crossing - for auction orders), see [details](/rest/general/order-type)
      example: "GTX"
    OrderStatusAsString:
      type: string
      description: order status can have the following string values `"OPEN"`, `"CLOSED"`, `"CANCELLED"`, `"REJECTED"`
      example: OPEN
    TimeStampAsString:
      type: string
      format: string
      example: "1621490985000"
      description: unsigned 64 bit integer value which is the number of milliseconds since EPOCH expressed as string
    OrderID:
      type: string
      example: "297735387747975680"
    AMMInstructionID:
      type: string
      example: "297735387747975680"
    RequestID:
      type: string
      example: "197735387747975680"
    OrderHandle:
      description: Unique numeric (i64) identifier generated on the client side expressed as a string value
      type: string
      example: "299834741023572480"
    TradingAccountId:
      description: unique trading account ID
      type: string
      example: "111000000000001"
    MarketID:
      type: string
      example: "10000"
    TradeID:
      type: string
      example: "100020000000000060"
    AssetValue:
      description: see [asset value](/rest/general/price-quantity-precision) format
      type: string
      example: "1.00000000"
    UsdcValue:
      description: see [asset value](/rest/general/price-quantity-precision) format
      type: string
      example: "1.0000"
    UserId:
      type: string
      example: "12345"
      description: Bullish user ID
    TimeStampInSeconds:
      type: integer
      format: int64
      example: 1621490985
      description: number of seconds since EPOCH as integer
    DateTime:
      type: string
      format: date-time
      example: "2025-05-20T01:01:01.000Z"
      description: ISO 8601 with millisecond as string
    OptionExpiryDate:
      type: string
      example: "20250520"
      description: Expiry date of the option market in YYYYMMDD format (e.g. 20250520)
    TimeStamp:
      type: string
      format: int64
      example: "1621490985000"
      description: number of milliseconds since EPOCH as string
    CustodyDestinationID:
      type: string
      example: "1560ec0b406c0d909bb9f5f827dd6aa14a1f638884f33a2a3134878102e78038"
      description: destination id provided by bullish that uniquely identifies a whitelisted address or account
    CustodyDestinationUserWalletType:
      type: string
      enum:
        - HOSTED
        - SELF_HOSTED
        - UNKNOWN
      description: The host type of the wallet. `HOSTED` wallet uses a custodial wallet service, `SELF_HOSTED` wallet is a non-custodial wallet.
    CustodyDestinationSigned:
      type: boolean
      example: true
      description: Whether this destination has been signed by the user. Some operations such as withdrawal requires the destination to be signed.
    CustodyDestinationLocked:
      type: boolean
      example: true
      description: Whether this destination is currently in a withdrawal lock period. Addresses are locked upon whitelisting for a 24-hour security period.
    CustodyLockExpiryDateTime:
      type: string
      format: date-time
      example: "2026-06-24T12:00:00Z"
      description: ISO 8601 Zulu timestamp of when the withdrawal lock period expires. Applies only when `locked` is true.
    CustodyDestinationVaspName:
      type: string
      example: Bullish
      description: The name of the hosting VASP of the wallet. This is only applicable for `HOSTED` wallets.
    CustodySelfHostedRequestedDepositAmount:
      type: string
      example: "12.3456"
      description: User-requested amount for the deposit.
    CustodySelfHostedVerificationAmount:
      type: string
      example: "0.0012"
      description: Bullish specified additional small deposit amount to add to the `requestedDepositAmount` for wallet verification.
    CustodySelfHostedDepositAddress:
      type: string
      example: "0xb0a64d976972d87b0783eeb1ff88306cd1891f02"
      description: The address of the Bullish trading account that the user should deposit to during a self hosted deposit attempt.
    CustodySelfHostedDepositMemo:
      type: string
      example: MZAXEMRXA
      description: The memo or destination tag of the Bullish trading account that the user should deposit to during a self hosted deposit attempt.
    CustodySelfHostedTotalDepositAmount:
      type: string
      example: "12.3468"
      description: The actual amount that the user should deposit for wallet verification. It is the sum of `requestedDepositAmount` and `verificationAmount`.
    CustodySelfHostedVerificationStatus:
      type: string
      enum:
        - VERIFIED
        - PENDING_VERIFICATION
        - VERIFICATION_EXPIRED
      description: |
        The status for the self-hosted wallet verification attempt.
        - `VERIFIED` - Self-hosted wallet has been verified
        - `PENDING_VERIFICATION` - pending verification via satoshi test
        - `VERIFICATION_EXPIRED` - the verification has expired
    NetworkID:
      type: string
      example: "ETH"
      description: the network of the native coin or token, e.g. BTC, ETH, SOL
    CustodyNetworkAddress:
      type: string
      example: "0xb0a64d976972d87b0783eeb1ff88306cd1891f02"
      description: an address on the given network
    CustodySymbol:
      type: string
      example: "USDC"
      description: symbol representing coin or token, e.g. USDC, BTC, ETH, SHIB
    CustodyFiatSymbol:
      type: string
      example: "USD"
      description: symbol representing fiat currency, e.g. USD, EUR
    CustodyTransactionID:
      type: string
      example: "DB:9e6304a08c9cc2a33e6bc6429a088eae2a6b940c8e312aede3a3780257b9b979"
      description: unique identifier for tracking a withdrawal during signing and in history
    CustodyTransactionHistoryID:
      type: string
      example: "DB:9e6304a08c9cc2a33e6bc6429a088eae2a6b940c8e312aede3a3780257b9b979"
      description: unique identifier for tracking a deposit or withdrawal
    CustodyDirection:
      type: string
      example: "DEPOSIT"
      description: direction of transaction from API user's perspective, 'DEPOSIT' or 'WITHDRAWAL'
    CustodyBankName:
      type: string
      example: Silvergate Bank
      description: name of bank
    CustodyPhysicalBankAddress:
      type: string
      description: physical location of bank
      example: 4250 Executive Square Suite 300 La Jolla, CA 92037
    CustodyBankAccountNumber:
      type: string
      description: bank account number
      example: "9873481227"
    CustodyBankNetworkID:
      type: string
      description: the fiat network, e.g. SWIFT, ABA or SEPA
      example: SWIFT
    CustodyBankRoutingCode:
      type: string
      description: routing code of bank
      example: "322286803"
    CustodyQuantity:
      type: string
      description: total quantity of symbol to withdraw including fee in units of symbol, not in smaller denominations (e.g. BTC not Satoshi, ETH not Wei) - quantity received will have fee subtracted.
      example: "100000.00"
    CustodyWithdrawalFee:
      type: string
      example: "3.00"
      description: withdrawal fee charged in units of symbol, not in smaller denominations (e.g. BTC not Satoshi, ETH not Wei)
    CustodyDepositMemo:
      type: string
      example: "925891241"
      description: memo or destination tag used during deposit to help identify account to credit funds to
    CustodyMinimumDepositAmount:
      type: string
      example: "0.01"
      description: the minimum deposit amount required for this symbol and network. Deposits under this amount will not be credited to your account
    CustodyWithdrawalMemo:
      type: string
      example: MZAXEMRXA
      description: memo or destination tag that will be used as a reference on transaction
    CustodyWithdrawalLabel:
      type: string
      example: Our cold wallet
      description: descriptive label of destination provided by user
    CustodyTransactionStatus:
      type: string
      example: "COMPLETE"
      description: one of 'PENDING', 'COMPLETE', 'CANCELLED', 'FAILED'
    CustodyTransactionDetails:
      type: object
      properties:
        address:
          type: string
          description: crypto network address
          example: "0xb0a64d976972d87b0783eeb1ff88306cd1891f02"
        blockchainTxId:
          type: string
          description: transaction id on chain
          example: "0xec557f2c7278d2dae2d98a27b9bd43f386789a4209090cbbd11595f1bed4a4c2"
        swiftUetr:
          type: string
          description: unique end-to-end-transaction reference for swift transactions
          example: b55aa5cd-baa2-4122-8c17-ae9b856ae36a
    CustodyAvailableWithdrawalLimit:
      type: string
      example: "20000.0"
      description: remaining limit on amount of coin or token that could be withdrawn now, in units of the symbol itself, not in smaller denominations (e.g. BTC not Satoshi, ETH not Wei)
    Custody24HWithdrawalLimit:
      type: string
      example: "1000000.00"
      description: limit on amount of coin or token that can be withdrawn over a 24 hour period, in units of the symbol itself, not in smaller denominations (e.g. BTC not Satoshi, ETH not Wei)
    CustodyCreatedAtDateTime:
      type: string
      example: "2022-09-16T07:56:15.000Z"
      description: time of initial transaction
    PublicKey:
      type: string
      example: PUB_R1_6PTdfWbXvXWQduhcCiRooGHTVpriu15xMqfr7EDq6sWLDj7NjS
    Signature:
      type: string
      example: SIG_R1_K35d5hSY5FbNoJwrCfmH6QvPG7m9XmhL2mgWYcSB7q2hKJ2mv39Luck9WBJroSB635ZAXhdg36TYG7QJX1fTidbsMvyE8N
    AssetAccount:
      type: object
      required:
        - tradingAccountId
        - assetId
        - assetSymbol
        - availableQuantity
        - borrowedQuantity
        - lockedQuantity
        - loanedQuantity
        - updatedAtDatetime
        - updatedAtTimestamp
      properties:
        tradingAccountId:
          allOf:
            - $ref: "#/components/schemas/TradingAccountId"
        assetId:
          description: asset ID
          allOf:
            - $ref: "#/components/schemas/AssetID"
        assetSymbol:
          description: asset symbol
          allOf:
            - $ref: "#/components/schemas/AssetSymbol"
        availableQuantity:
          description: the assets that are available to use on the account, see [asset value](/rest/general/price-quantity-precision) format
          allOf:
            - $ref: "#/components/schemas/AssetValue"
        borrowedQuantity:
          description: the assets on the account that are borrowed, see [asset value](/rest/general/price-quantity-precision) format
          allOf:
            - $ref: "#/components/schemas/AssetValue"
        lockedQuantity:
          description: the assets on the account that are locked in orders, loans and AMM instructions, see [asset value](/rest/general/price-quantity-precision) format
          allOf:
            - $ref: "#/components/schemas/AssetValue"
        loanedQuantity:
          description: the assets on the account that are being loaned, see [asset value](/rest/general/price-quantity-precision) format
          allOf:
            - $ref: "#/components/schemas/AssetValue"
        updatedAtDatetime:
          description: denotes the time the AMM instruction was updated by the exchange, ISO 8601 with millisecond as string
          allOf:
            - $ref: "#/components/schemas/DateTime"
        updatedAtTimestamp:
          description: denotes the time the AMM instruction was updated by the exchange
          allOf:
            - $ref: "#/components/schemas/TimeStampAsString"
    CreateOrderCommandResponseV3:
      type: object
      required:
        - message
        - requestId
        - orderId
      properties:
        message:
          description: message
          type: string
        requestId:
          description: unique request ID
          allOf:
            - $ref: "#/components/schemas/RequestID"
        orderId:
          description: unique order ID
          allOf:
            - $ref: "#/components/schemas/OrderID"
        clientOrderId:
          description: unique numeric identifier generated on the client side expressed as a string value
          type: string
      example:
        message: "Command acknowledged - CreateOrder"
        requestId: "633910976353665024"
        orderId: "633910775316480001"
        clientOrderId: "1234567"
    AmendOrderCommandResponseV1:
      type: object
      required:
        - commandType
        - message
        - requestId
        - orderId
      properties:
        commandType:
          description: The command type
          type: string
          enum:
            - V1AmendOrder
        message:
          description: message
          type: string
        requestId:
          description: unique request ID
          allOf:
            - $ref: "#/components/schemas/RequestID"
        orderId:
          description: unique order ID
          allOf:
            - $ref: "#/components/schemas/OrderID"
        clientOrderId:
          description: Will be updated as part of a successful order amendment
          type: string
      example:
        commandType: "V1AmendOrder"
        message: "Command acknowledged - AmendOrder"
        requestId: "633910976353665024"
        orderId: "633910775316480001"
        clientOrderId: "1234567-1"
    CancelOrderCommandResponseV3:
      type: object
      required:
        - commandType
        - message
        - requestId
      properties:
        commandType:
          description: The command type
          type: string
          enum:
            - V3CancelOrder
        message:
          description: message
          type: string
        requestId:
          description: unique request ID
          allOf:
            - $ref: "#/components/schemas/RequestID"
        orderId:
          description: unique order ID
          allOf:
            - $ref: "#/components/schemas/OrderID"
        clientOrderId:
          description: unique numeric identifier generated on the client side expressed as a string value
          type: string
      example:
        commandType: "V3CancelOrder"
        message: "Command acknowledged - CancelOrder"
        requestId: "633910976353665024"
        orderId: "633910775316480001"
    CancelAllOrdersCommandResponse:
      type: object
      required:
        - commandType
        - message
        - requestId
      properties:
        commandType:
          description: The command type
          type: string
          enum:
            - V1CancelAllOrders
        message:
          description: message
          type: string
        requestId:
          description: unique request ID
          allOf:
            - $ref: "#/components/schemas/RequestID"
      example:
        commandType: "V1CancelAllOrders"
        message: "Command acknowledged - CancelAllOrders"
        requestId: "633910976353665024"
    DelayedCancelAllOrdersResponse:
      type: object
      required:
        - commandType
        - message
        - requestId
      properties:
        commandType:
          description: The command type
          type: string
          enum:
            - V1DelayedCancelAllOrders
        message:
          description: message
          type: string
        requestId:
          description: unique request ID
          allOf:
            - $ref: "#/components/schemas/RequestID"
      example:
        commandType: "V1DelayedCancelAllOrders"
        message: "Command acknowledged - DelayedCancelAllOrders"
        requestId: "633910976353665024"
    UnsetDelayedCancelAllOrdersResponse:
      type: object
      required:
        - commandType
        - message
        - requestId
      properties:
        commandType:
          description: The command type
          type: string
          enum:
            - V1UnsetDelayedCancelAllOrders
        message:
          description: message
          type: string
        requestId:
          description: unique request ID
          allOf:
            - $ref: "#/components/schemas/RequestID"
      example:
        commandType: "V1UnsetDelayedCancelAllOrders"
        message: "Command acknowledged - UnsetDelayedCancelAllOrders"
        requestId: "633910976353665024"
    CreateOrderCommandV3:
      type: object
      required:
        - commandType
        - symbol
        - type
        - side
        - quantity
        - timeInForce
        - tradingAccountId
      properties:
        commandType:
          description: The command type, it must be 'V3CreateOrder'
          type: string
        clientOrderId:
          allOf:
            - $ref: "#/components/schemas/OrderHandle"
        symbol:
          allOf:
            - $ref: "#/components/schemas/MarketSymbol"
        type:
          allOf:
            - $ref: "#/components/schemas/OrderTypeAsStringV2"
        side:
          allOf:
            - $ref: "#/components/schemas/OrderSideAsString"
        price:
          description: price
          allOf:
            - $ref: "#/components/schemas/AssetValue"
        stopPrice:
          description: stop price
          allOf:
            - $ref: "#/components/schemas/AssetValue"
        quantity:
          description: quantity
          allOf:
            - $ref: "#/components/schemas/AssetValue"
        timeInForce:
          allOf:
            - $ref: "#/components/schemas/OrderTimeInForceAsString"
        allowBorrow:
          description: allows to borrow on the order
          type: boolean
          default: false
          example: false
        isMMP:
          description: Indicate if the order is subject to `Market Maker Protection`. Only applicable to option markets
          type: boolean
          example: true
        tradingAccountId:
          allOf:
            - $ref: "#/components/schemas/TradingAccountId"
    TradingAccountResponse:
      type: object
      required:
        - isBorrowing
        - isLending
        - isPrimaryAccount
        - maxInitialLeverage
        - rateLimitToken
        - tradingAccountDescription
        - tradingAccountId
        - tradingAccountName
        - isDefaulted
        - riskLimitUSD
        - totalBorrowedUSD
        - totalCollateralUSD
        - initialMarginUSD
        - warningMarginUSD
        - liquidationMarginUSD
        - fullLiquidationMarginUSD
        - defaultedMarginUSD
        - endCustomerId
        - isConcentrationRiskEnabled
        - liquidityAddonUSD
        - marketRiskUSD
        - marginProfile
        - totalLiabilitiesUSD
        - tradeFeeRate
      properties:
        isBorrowing:
          description: whether the trading account is borrowing
          type: string
          example: "false"
        isLending:
          description: whether the trading account is lending
          type: string
          example: "false"
        makerFee:
          description: Deprecated and no longer accurate. See `tradeFeeRate` instead
          type: string
          example: "0.00000000"
          deprecated: true
        takerFee:
          description: Deprecated and no longer accurate. See `tradeFeeRate` instead
          type: string
          example: "0.00020000"
          deprecated: true
        maxInitialLeverage:
          description: max initial leverage
          type: string
          example: "1"
        tradingAccountId:
          description: id of the trading account
          allOf:
            - $ref: "#/components/schemas/TradingAccountId"
        tradingAccountName:
          description: name of the trading account
          type: string
          example: algo trading account
        tradingAccountDescription:
          description: description of the trading account
          type: string
          example: algo trading account with experimental strategy
        isPrimaryAccount:
          description: whether this is the primary account
          type: string
          example: "false"
        rateLimitToken:
          description: unique rate limit token of the trading account
          type: string
          example: 97d98951b12fb11f330dd9cb1b807d888c702679ee602edcf1ebc6bac17ad63d
        isDefaulted:
          description: whether the trading account is defaulted
          type: string
          example: "false"
        tradeFeeRate:
          description: Trade fees per `feeGroupId` for this trading account
          type: array
          minItems: 0
          items:
            allOf:
              - $ref: "#/components/schemas/TradeFeeRate"
        riskLimitUSD:
          description: The maximum allowed borrowing for this trading account (in USD currency)
          type: string
          example: "10000.0000"
        totalLiabilitiesUSD:
          description: The The total liabilities for this trading account (in USD currency)
          type: string
          example: "14000.0000"
        totalBorrowedUSD:
          description: total borrowed across all assets in this trading account displayed in the reference asset in USD
          type: string
          example: "12000.0000"
        totalCollateralUSD:
          description: total collateral across all assets in this trading account displayed in the reference asset in USD
          type: string
          example: "13000.0000"
        initialMarginUSD:
          description: The minimum margin one must maintain in order to be able to purposefully increase risk
          type: string
          example: "0000.0000"
        warningMarginUSD:
          description: The minimum margin when the customer will receive warning via email/notifications over UI
          type: string
          example: "0000.0000"
        liquidationMarginUSD:
          description: The minimum value of margin one must maintain in order to avoid liquidation
          type: string
          example: "0000.0000"
        fullLiquidationMarginUSD:
          description: The value of margin when full liquidation occurs
          type: string
          example: "0000.0000"
        defaultedMarginUSD:
          description: The value of margin when this trading account will be moved into a Defaulted state
          type: string
          example: "0000.0000"
        endCustomerId:
          description: The end customer id used for self trade prevention (default is institution id, max 32 characters)
          type: string
          example: "PrimeBroker"
        isConcentrationRiskEnabled:
          description: whether concentration risk checks are enforced for an account when sending new orders. By default, concentration risk checks will apply to all accounts
          type: string
          example: "true"
        liquidityAddonUSD:
          description: expected market impact of unwinding the portfolio in the case of a liquidation event
          type: string
          example: "1000.0000"
        marketRiskUSD:
          description: the worst possible loss on the portfolio based on scenario analysis
          type: string
          example: "2000.0000"
        marginProfile:
          description: Contains the market risk multipliers applied to a trading account to derive the five individual Margin Requirement values
          allOf:
            - $ref: "#/components/schemas/MarginProfile"

    MarginProfile:
      properties:
        initialMarketRiskMultiplierPct:
          description: market risk multiplier used to calculate initial margin requirement of the account
          type: string
          example: "200.00"
        warningMarketRiskMultiplierPct:
          description: market risk multiplier used to calculate warning margin requirement of the account
          type: string
          example: "150.00"
        liquidationMarketRiskMultiplierPct:
          description: market risk multiplier used to calculate liquidation margin requirement of the account
          type: string
          example: "100.00"
        fullLiquidationMarketRiskMultiplierPct:
          description: market risk multiplier used to calculate full liquidation margin requirement of the account
          type: string
          example: "75.00"
        defaultedMarketRiskMultiplierPct:
          description: market risk multiplier used to calculate defaulted margin requirement of the account
          type: string
          example: "50.00"
    CreateAMMInstructionCommandResponseV3:
      type: object
      required:
        - message
        - requestId
        - instructionId
      properties:
        message:
          description: message
          type: string
        requestId:
          description: unique request ID
          allOf:
            - $ref: "#/components/schemas/RequestID"
        instructionId:
          description: unique AMM instruction ID
          allOf:
            - $ref: "#/components/schemas/AMMInstructionID"
      example:
        message: "Command acknowledged - CreateAMMInstruction"
        requestId: "633906221577404416"
        instructionId: "633906221577404424"
    TerminateAMMInstructionCommandResponseV3:
      type: object
      required:
        - commandType
        - message
        - requestId
        - instructionId
      properties:
        commandType:
          description: The command type
          type: string
          enum:
            - V3TerminateAMMInstruction
        message:
          description: message
          type: string
        requestId:
          description: unique request ID
          allOf:
            - $ref: "#/components/schemas/RequestID"
        instructionId:
          description: unique AMM instruction ID
          allOf:
            - $ref: "#/components/schemas/AMMInstructionID"
      example:
        commandType: "V3TerminateAMMInstruction"
        message: "Command acknowledged - TerminateAMMInstruction"
        requestId: "633906221577404416"
        instructionId: "633906221577404424"
    BadOrderEntryResponse:
      type: object
      required:
        - message
        - errorCode
        - errorCodeName
      properties:
        message:
          description: message
          type: string
          example: "Missing signature header"
        errorCode:
          description: unique error code
          type: integer
          example: 6029
        errorCodeName:
          description: unique error code name
          type: string
          example: "MISSING_SIGNATURE_HEADER"
    CreateAMMInstructionCommandV3:
      type: object
      required:
        - commandType
        - symbol
        - baseQuantity
        - quoteQuantity
        - upperBound
        - lowerBound
        - feeTierId
        - tradingAccountId
      properties:
        commandType:
          description: The command type, it must be 'V3CreateAMMInstruction'
          type: string
        symbol:
          allOf:
            - $ref: "#/components/schemas/MarketSymbol"
        baseQuantity:
          description: base quantity
          allOf:
            - $ref: "#/components/schemas/AssetValue"
        quoteQuantity:
          description: quote quantity
          allOf:
            - $ref: "#/components/schemas/AssetValue"
        upperBound:
          type: string
          description: upper bound of price range, in quote currency
        lowerBound:
          type: string
          description: lower bound of price range, in quote currency
        feeTierId:
          allOf:
            - $ref: "#/components/schemas/FeeTierId"
        tradingAccountId:
          allOf:
            - $ref: "#/components/schemas/TradingAccountId"
      example:
        commandType: "V3CreateAMMInstruction"
        symbol:
          $ref: "#/components/schemas/MarketSymbol/example"
        baseQuantity: "0"
        quoteQuantity: "50000.1"
        upperBound: "25000"
        lowerBound: "20000"
        feeTierId:
          $ref: "#/components/schemas/FeeTierId/example"
        tradingAccountId:
          $ref: "#/components/schemas/TradingAccountId/example"
    CancelOrderCommandV3:
      type: object
      required:
        - commandType
        - tradingAccountId
        - symbol
      properties:
        commandType:
          description: The command type, it must be 'V3CancelOrder'
          type: string
          enum:
            - V3CancelOrder
        orderId:
          description: Unique order ID, only orderId or clientOrderId can be used in the V3CancelOrder command
          allOf:
            - $ref: "#/components/schemas/OrderID"
        clientOrderId:
          description: Unique numeric (i64) identifier generated on the client side expressed as a string value, only orderId or clientOrderId can be used in the V3CancelOrder command
          allOf:
            - $ref: "#/components/schemas/OrderHandle"
        symbol:
          allOf:
            - $ref: "#/components/schemas/MarketSymbol"
        tradingAccountId:
          allOf:
            - $ref: "#/components/schemas/TradingAccountId"
      example:
        commandType: "V3CancelOrder"
        orderId: "297735387747975680"
        symbol: "BTCUSDC"
        tradingAccountId: "111000000000001"
    AmendOrderCommandV1:
      type: object
      required:
        - commandType
        - symbol
        - tradingAccountId
      properties:
        commandType:
          description: The command type, it must be 'V1AmendOrder'
          type: string
          enum:
            - V1AmendOrder
        orderId:
          description: unique order ID
          allOf:
            - $ref: "#/components/schemas/OrderID"
        symbol:
          allOf:
            - $ref: "#/components/schemas/MarketSymbol"
        type:
          allOf:
            - $ref: "#/components/schemas/OrderTypeAsStringAmend"
        price:
          description: price
          allOf:
            - $ref: "#/components/schemas/AssetValue"
        clientOrderId:
          description: unique numeric identifier generated on the client side expressed as a string value
          type: string
        quantity:
          description: quantity
          allOf:
            - $ref: "#/components/schemas/AssetValue"
        tradingAccountId:
          allOf:
            - $ref: "#/components/schemas/TradingAccountId"
      example:
        commandType: "V1AmendOrder"
        orderId: "297735387747975680"
        symbol: "BTCUSDC"
        type: "LIMIT"
        price: "1.00000000"
        clientOrderId: "633914459442118656"
        quantity: "1.00000000"
        tradingAccountId: "111000000000001"
    TerminateAMMInstructionCommandV3:
      type: object
      required:
        - commandType
        - instructionId
        - symbol
        - tradingAccountId
      properties:
        commandType:
          description: The command type, it must be 'V3TerminateAMMInstruction'
          type: string
          enum:
            - V3TerminateAMMInstruction
        instructionId:
          description: unique AMM instruction ID
          allOf:
            - $ref: "#/components/schemas/AMMInstructionID"
        symbol:
          allOf:
            - $ref: "#/components/schemas/MarketSymbol"
        tradingAccountId:
          allOf:
            - $ref: "#/components/schemas/TradingAccountId"
      example:
        commandType: "V3TerminateAMMInstruction"
        instructionId: "297735387747975680"
        symbol: "BTCUSDC"
        tradingAccountId: "111000000000001"
    SetMMPCommandV1:
      type: object
      required:
        - commandType
        - tradingAccountId
        - underlyingAssetSymbol
        - windowTimeInSeconds
        - frozenTimeInSeconds
      properties:
        commandType:
          description: the command type must be provided as 'V1SetMMP'
          type: string
          enum:
            - V1SetMMP
          example: "V1SetMMP"
        tradingAccountId:
          allOf:
            - $ref: "#/components/schemas/TradingAccountId"
        underlyingAssetSymbol:
          allOf:
            - $ref: "#/components/schemas/UnderlyingAssetSymbol"
        windowTimeInSeconds:
          type: string
          description: time window during which the MMP checks are conducted. It helps in determining how frequently the system evaluates the market maker's activity against predefined thresholds. Value needs to be `> 0`. Maximum value is 600 seconds (10 minutes).
        frozenTimeInSeconds:
          type: string
          description: the duration for which a market maker's trading activity is temporarily halted after a protective measure is triggered. Value needs to be `>= 0`. Maximum value is 3600 seconds (60 minutes).
        quantityLimit:
          type: string
          description: cap on the total number of contracts that a market maker can trade within `windowTimeInSeconds`. This is direction(side) agnostic. Needs to be `> 0` if set.
          example: "100"
        deltaLimit:
          type: string
          description: net delta exposure that a market maker can accumulate within `windowTimeInSeconds`
          example: "10"
      example:
        commandType: "V1SetMMP"
        tradingAccountId: "123567443543"
        underlyingAssetSymbol: "BTC"
        windowTimeInSeconds: "10"
        frozenTimeInSeconds: "5"
        quantityLimit: "10"
        deltaLimit: "1"
    SetMMPCommandResponse:
      type: object
      required:
        - message
        - requestId
      properties:
        message:
          description: message
          type: string
        requestId:
          description: unique request ID
          allOf:
            - $ref: "#/components/schemas/RequestID"
      example:
        message: "Command acknowledged - SetMMPConfig"
        requestId: "633910976353665025"
    ResetMMPCommandV1:
      type: object
      required:
        - commandType
        - tradingAccountId
        - underlyingAssetSymbol
      properties:
        commandType:
          description: the command type must be provided as 'V1ResetMMP'
          type: string
          enum:
            - V1ResetMMP
          example: "V1ResetMMP"
        tradingAccountId:
          allOf:
            - $ref: "#/components/schemas/TradingAccountId"
        underlyingAssetSymbol:
          allOf:
            - $ref: "#/components/schemas/UnderlyingAssetSymbol"
      example:
        commandType: "V1ResetMMP"
        tradingAccountId: "123567443543"
        underlyingAssetSymbol: "BTC"
    ResetMMPCommandResponse:
      type: object
      required:
        - message
        - requestId
      properties:
        message:
          description: message
          type: string
        requestId:
          description: unique request ID
          allOf:
            - $ref: "#/components/schemas/RequestID"
      example:
        message: "Command acknowledged - ResetMMPConfig"
        requestId: "633910976353665026"
    CancelAllOrdersCommand:
      type: object
      required:
        - commandType
        - tradingAccountId
      properties:
        commandType:
          description: The command type, it must be 'V1CancelAllOrders'
          type: string
          enum:
            - V1CancelAllOrders
        tradingAccountId:
          description: Unique trading account Id
          allOf:
            - $ref: "#/components/schemas/TradingAccountId"
      example:
        commandType: "V1CancelAllOrders"
        tradingAccountId: "111000000000001"

    DelayedCancelAllOrdersCommand:
      type: object
      required:
        - commandType
        - delayBySeconds
        - tradingAccountId
      properties:
        commandType:
          description: The command type, it must be 'V1DelayedCancelAllOrders'
          type: string
          enum:
            - V1DelayedCancelAllOrders
          example: "V1DelayedCancelAllOrders"
        cancelId:
          allOf:
            - $ref: "#/components/schemas/CancelId"
        delayBySeconds:
          description: "Delay of the cancel-all-order in seconds"
          allOf:
            - $ref: "#/components/schemas/DelayBySeconds"
        tradingAccountId:
          allOf:
            - $ref: "#/components/schemas/TradingAccountId"
      example:
        commandType: "V1DelayedCancelAllOrders"
        delayBySeconds: "5"
        tradingAccountId: "111000000000001"
    UnsetDelayedCancelAllOrdersCommand:
      type: object
      required:
        - commandType
        - tradingAccountId
      properties:
        commandType:
          description: The command type, it must be 'V1UnsetDelayedCancelAllOrders'
          type: string
          enum:
            - V1UnsetDelayedCancelAllOrders
          example: "V1UnsetDelayedCancelAllOrders"
        tradingAccountId:
          allOf:
            - $ref: "#/components/schemas/TradingAccountId"
      example:
        commandType: "V1UnsetDelayedCancelAllOrders"
        tradingAccountId: "111000000000001"
    JWT:
      type: string
      format: string
      example: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoic2FuZGVlcCByYWtocmEifQ.wyVq6PlKaldWXtu-jz2hJCvkGl1lM2S7HUKCH8LnXp0"
      description: JWT token
    Authorizer:
      type: string
      format: string
      example: "03E02367E8C900000500000000000000"
      description: JWT authorizer you obtain along with the [JWT token](/rest/authentication#generate-a-jwt-token)
    TradingAccountTransferResponse:
      type: object
      required:
        - commandType
        - message
        - requestId
      properties:
        commandType:
          description: The command type
          type: string
          enum:
            - V2TransferAsset
        message:
          description: message
          type: string
        requestId:
          description: unique request ID
          allOf:
            - $ref: "#/components/schemas/RequestID"
      example:
        commandType: "V2TransferAsset"
        message: "Command acknowledged - TransferAsset"
        requestId: "633909659774222336"
    TransferAssetCommandV2:
      type: object
      required:
        - commandType
        - assetSymbol
        - quantity
        - fromTradingAccountId
        - toTradingAccountId
      properties:
        commandType:
          description: The command type, e.g. 'V2TransferAsset'
          type: string
          enum:
            - V2TransferAsset
        assetSymbol:
          description: Symbol of the asset. i.e. currency
          allOf:
            - $ref: "#/components/schemas/AssetSymbol"
        quantity:
          description: |
            Quantity of the asset. Can be representated with any number of trailing zeroes up to asset precision 
            (eg `100.1`, `100.10`, `100.100`, `100.1000` are valid for asset precision 4)
          type: string
        fromTradingAccountId:
          description: Source of the asset transfer
          allOf:
            - $ref: "#/components/schemas/TradingAccountId"
        toTradingAccountId:
          description: Destination of the asset transfer
          allOf:
            - $ref: "#/components/schemas/TradingAccountId"
      example:
        commandType: "V2TransferAsset"
        assetSymbol:
          $ref: "#/components/schemas/AssetSymbol/example"
        quantity: "100.1"
        fromTradingAccountId:
          $ref: "#/components/schemas/TradingAccountId/example"
        toTradingAccountId: "111000000000002"
    CancelAllOrdersByMarketCommand:
      type: object
      required:
        - commandType
        - symbol
        - tradingAccountId
      properties:
        commandType:
          description: The command type, it must be 'V1CancelAllOrdersByMarket'
          type: string
          enum:
            - V1CancelAllOrdersByMarket
        symbol:
          description: market symbol. E.g. `BTCUSDC`
          allOf:
            - $ref: "#/components/schemas/MarketSymbol"
        tradingAccountId:
          description: unique trading account Id
          allOf:
            - $ref: "#/components/schemas/TradingAccountId"
      example:
        commandType: "V1CancelAllOrdersByMarket"
        symbol: "BTCUSDC"
        tradingAccountId: "111000000000001"
    CancelAllOrdersByMarketResponse:
      type: object
      required:
        - commandType
        - message
        - requestId
      properties:
        commandType:
          description: The command type
          type: string
          enum:
            - V1CancelAllOrdersByMarket
        message:
          description: message
          type: string
        requestId:
          description: unique request ID
          allOf:
            - $ref: "#/components/schemas/RequestID"
      example:
        commandType: "V1CancelAllOrdersByMarket"
        message: "Command acknowledged - CancelAllOrdersByMarket"
        requestId: "633914459442118656"
    LoginRequest:
      type: object
      required:
        - timestamp
        - nonce
        - authorizer
        - command
      properties:
        publicKey:
          allOf:
            - $ref: "#/components/schemas/PublicKey"
        signature:
          allOf:
            - $ref: "#/components/schemas/Signature"
        loginPayload:
          allOf:
            - $ref: "#/components/schemas/LoginPayload"
    LoginPayload:
      type: object
      required:
        - userId
        - nonce
        - expirationTime
        - biometricsUsed
        - sessionKey
      properties:
        userId:
          description: Bullish user ID corresponding to the metadata
          allOf:
            - $ref: "#/components/schemas/UserId"
        nonce:
          description: epoch timestamp in seconds; note this login API nonce has no connection to the orders API nonce
          allOf:
            - $ref: "#/components/schemas/TimeStampInSeconds"
        expirationTime:
          description: epoch timestamp in seconds that is 5 minutes in the future
          allOf:
            - $ref: "#/components/schemas/TimeStampInSeconds"
        biometricsUsed:
          description: biometrics flag. always `false`
          type: boolean
          example: false
        sessionKey:
          description: session key. always `null`
          type: string
          nullable: true
    LoginResponse:
      type: object
      required:
        - authorizer
        - token
      properties:
        authorizer:
          description: Authorizer
          allOf:
            - $ref: "#/components/schemas/Authorizer"
        token:
          description: JWT token
          allOf:
            - $ref: "#/components/schemas/JWT"
    Order:
      type: object
      required:
        - orderId
        - clientOrderId
        - symbol
        - price
        - stopPrice
        - averageFillPrice
        - allowBorrow
        - quantity
        - quantityFilled
        - quoteAmount
        - baseFee
        - quoteFee
        - isLiquidation
        - side
        - type
        - timeInForce
        - status
        - statusReason
        - statusReasonCode
        - createdAtTimestamp
        - createdAtDatetime
      properties:
        clientOrderId:
          allOf:
            - $ref: "#/components/schemas/OrderHandle"
        orderId:
          description: unique order ID
          allOf:
            - $ref: "#/components/schemas/OrderID"
        symbol:
          description: market symbol
          allOf:
            - $ref: "#/components/schemas/MarketSymbol"
        price:
          description: price, see [asset value](/rest/general/price-quantity-precision) format
          allOf:
            - $ref: "#/components/schemas/AssetValue"
        averageFillPrice:
          description: average fill price, see [asset value](/rest/general/price-quantity-precision) format
          allOf:
            - $ref: "#/components/schemas/AssetValue"
        stopPrice:
          description: stop price, see [asset value](/rest/general/price-quantity-precision) format
          allOf:
            - $ref: "#/components/schemas/AssetValue"
        allowBorrow:
          description: indicates if the order was allowed to borrow (does not indicate that borrowing occurred)
          type: boolean
          example: false
        quantity:
          description: quantity, see [asset value](/rest/general/price-quantity-precision) format
          allOf:
            - $ref: "#/components/schemas/AssetValue"
        quantityFilled:
          description: quantity filled, see [asset value](/rest/general/price-quantity-precision) format
          allOf:
            - $ref: "#/components/schemas/AssetValue"
        quoteAmount:
          description: quote quantity deducted from asset account, see [asset value](/rest/general/price-quantity-precision) format
          allOf:
            - $ref: "#/components/schemas/AssetValue"
        baseFee:
          description: base fee rate that will be charged upon trade execution, see [asset value](/rest/general/price-quantity-precision) format
          example: "0.00100000"
          allOf:
            - $ref: "#/components/schemas/AssetValue"
        quoteFee:
          description: quote fee rate that will be charged upon trade execution, see [asset value](/rest/general/price-quantity-precision) format
          example: "0.0010"
          allOf:
            - $ref: "#/components/schemas/AssetValue"
        borrowedBaseQuantity:
          description: quantity borrowed, see [asset value](/rest/general/price-quantity-precision) format
          allOf:
            - $ref: "#/components/schemas/AssetValue"
        borrowedQuoteQuantity:
          description: quantity borrowed, see [asset value](/rest/general/price-quantity-precision) format
          allOf:
            - $ref: "#/components/schemas/AssetValue"
        isLiquidation:
          description: indicates if the order was executed as a liquidation order
          type: boolean
          example: false
        side:
          description: order side
          allOf:
            - $ref: "#/components/schemas/OrderSideAsString"
          example: "BUY"
        type:
          description: order type
          allOf:
            - $ref: "#/components/schemas/OrderTypeAsString"
          example: "LMT"
        timeInForce:
          description: time in force
          allOf:
            - $ref: "#/components/schemas/OrderTimeInForceAsString"
          example: "GTC"
        status:
          description: order status
          allOf:
            - $ref: "#/components/schemas/OrderStatusAsString"
          example: "OPEN"
        statusReason:
          description: status reason, describes why the order is in a specific state
          type: string
          example: "User cancelled"
        statusReasonCode:
          description: status reason code, see [details](/rest/general/error-rejection-codes)
          type: string
          example: "1002"
        createdAtDatetime:
          description: denotes the time the order was ACK'd by the exchange, ISO 8601 with millisecond as string
          allOf:
            - $ref: "#/components/schemas/DateTime"
        createdAtTimestamp:
          description: denotes the time the order was ACK'd by the exchange
          allOf:
            - $ref: "#/components/schemas/TimeStampAsString"
    AMMInstruction:
      type: object
      required:
        - apy
        - baseCurrentQuantity
        - baseFee
        - baseInvestQuantity
        - basePrice
        - baseWithdrawQuantity
        - createdAtDateTime
        - createdAtTimestamp
        - currentValue
        - dislocationEnabled
        - feeTierId
        - impermanentLoss
        - initialBasePrice
        - initialQuotePrice
        - initialValue
        - liquidityId
        - instructionId
        - lowerBound
        - price
        - quoteFee
        - quoteInvestQuantity
        - quotePrice
        - quoteWithdrawQuantity
        - requestId
        - staticSpreadFee
        - status
        - statusReason
        - statusReasonCode
        - symbol
        - updatedAtDateTime
        - updatedAtTimestamp
        - upperBound
        - yieldEarn
      properties:
        liquidityId:
          description: unique AMM instruction ID
          deprecated: true
          allOf:
            - $ref: "#/components/schemas/AMMInstructionID"
        instructionId:
          description: unique AMM instruction ID
          allOf:
            - $ref: "#/components/schemas/AMMInstructionID"
        symbol:
          description: market symbol
          allOf:
            - $ref: "#/components/schemas/MarketSymbol"
        baseFee:
          description: base fee, see [asset value](/rest/general/price-quantity-precision) format
          allOf:
            - $ref: "#/components/schemas/AssetValue"
        quoteFee:
          description: quote fee, see [asset value](/rest/general/price-quantity-precision) format
          allOf:
            - $ref: "#/components/schemas/AssetValue"
        status:
          description: order status
          allOf:
            - $ref: "#/components/schemas/OrderStatusAsString"
          example: "OPEN"
        statusReason:
          description: status reason, describes why the order is in a specific state
          type: string
          example: "Ok"
        statusReasonCode:
          description: status reason code, see [details](/rest/general/error-rejection-codes)
          type: integer
          example: 1001
        createdAtDatetime:
          description: denotes the time the order was ACK'd by the exchange, ISO 8601 with millisecond as string
          allOf:
            - $ref: "#/components/schemas/DateTime"
        createdAtTimestamp:
          description: denotes the time the order was ACK'd by the exchange
          allOf:
            - $ref: "#/components/schemas/TimeStampAsString"
        24HrApy:
          type: string
          description: APY of the last 24 Hours, only for AMM instructions with `OPEN` status
          example: "2.3319"
        24HrYieldEarn:
          type: string
          description: amount of money earned in USD from the last 24 Hours, only for AMM instructions with `OPEN` status
          example: "0.00"
        apy:
          type: string
          description: yield generated from the time AMM instruction was created, in annualised percentage
          example: "0.0000"
        baseCurrentQuantity:
          type: string
          description: amount of base asset this AMM instruction currently holds, only for AMM instruction with `OPEN` status
          example: "0.00000000"
        baseInvestQuantity:
          type: string
          description: initial base investment
          example: "0.00000008"
        basePrice:
          type: string
          description: current price of base asset
          example: "345.6700"
        baseWithdrawQuantity:
          type: string
          description: amount of base asset returned when AMM instruction is terminated
          example: "0.00000010"
        currentValue:
          type: string
          description: value of assets (base and quote) in USD amount that this AMM instruction currently holds
          example: "0.0000"
        dislocationEnabled:
          description: dislocation enabled/disabled
          type: boolean
          example: false
        feeTierId:
          allOf:
            - $ref: "#/components/schemas/FeeTierId"
        finalValue:
          type: string
          description: value of assets (base and quote) in USD amount when AMM instruction was terminated, only for AMM instruction with `CLOSED` status
          example: "0.0001"
        impermanentLoss:
          type: string
          description: impermanent loss
          example: "0.0000"
        initialBasePrice:
          type: string
          description: price of base asset when AMM instruction was created
          example: "100.0000"
        initialQuotePrice:
          type: string
          description: price of quote asset when AMM instruction was created
          example: "0.0100"
        initialValue:
          type: string
          description: value of assets (base and quote) in USD amount when AMM instruction was created
          example: "0.0000"
        lowerBound:
          type: string
          description: lower bound of price range, in quote currency
          example: "0.0013"
        price:
          type: string
          description: current price of AMM, see [Get Tick By Symbol](/rest/api/get-market-tick)
          example: "456.7800"
        quoteCurrentQuantity:
          type: string
          description: amount of quote asset this AMM instruction currently holds, only for AMM instruction with `OPEN` status
          example: "0.0000"
        quoteInvestQuantity:
          type: string
          description: initial quote investment
          example: "0.0009"
        quotePrice:
          type: string
          description: current price of quote asset
          example: "1.0000"
        quoteWithdrawQuantity:
          type: string
          description: amount of quote asset returned when AMM instruction is terminated
          example: "0.0011"
        lastDistributedPrice:
          type: string
          nullable: true
          description: (Perpetual market only) The price used at the time of settlement for AMM Instructions that can be used to determine mtmPnl and the actual Pnl
        requestId:
          description: unique request ID
          allOf:
            - $ref: "#/components/schemas/RequestID"
        staticSpreadFee:
          type: string
          description: static spread fee, see [Get Market By Symbol](/rest/api/get-market-by-symbol)
          example: "0.00200000"
        updatedAtDatetime:
          description: denotes the time the AMM instruction was updated by the exchange, ISO 8601 with millisecond as string
          allOf:
            - $ref: "#/components/schemas/DateTime"
        updatedAtTimestamp:
          description: denotes the time the AMM instruction was updated by the exchange
          allOf:
            - $ref: "#/components/schemas/TimeStampAsString"
        upperBound:
          type: string
          description: upper bound of price range, in quote currency
          example: "14000.0000"
        yieldEarn:
          type: string
          description: amount of money earned in USD
          example: "0.00"
    ObfuscatedTradeWithId:
      type: object
      required:
        - tradeId
        - symbol
        - price
        - quantity
        - side
        - isTaker
        - createdAtTimestamp
        - createdAtDatetime
      properties:
        tradeId:
          description: unique trade ID
          allOf:
            - $ref: "#/components/schemas/TradeID"
        symbol:
          description: market symbol
          allOf:
            - $ref: "#/components/schemas/MarketSymbol"
        price:
          description: price
          allOf:
            - $ref: "#/components/schemas/AssetValue"
        quantity:
          description: quantity
          allOf:
            - $ref: "#/components/schemas/AssetValue"
        side:
          description: order side
          allOf:
            - $ref: "#/components/schemas/OrderSideAsString"
          example: "BUY"
        isTaker:
          description: denotes whether this is a taker's trade
          allOf:
            - $ref: "#/components/schemas/Boolean"
        createdAtDatetime:
          description: denotes the time the trade was executed by the exchange, ISO 8601 with millisecond as string
          allOf:
            - $ref: "#/components/schemas/DateTime"
        createdAtTimestamp:
          description: denotes the time the trade was executed by the exchange
          allOf:
            - $ref: "#/components/schemas/TimeStampAsString"
        auctionId:
          description: unique Bullish auction identifier. Present only for auction trades
          type: string
          example: "397735387747975680"
    ObfuscatedTrade:
      type: object
      required:
        - tradeId
        - symbol
        - price
        - quantity
        - side
        - isTaker
        - createdAtTimestamp
        - createdAtDatetime
      properties:
        tradeId:
          description: unique trade ID
          allOf:
            - $ref: "#/components/schemas/TradeID"
        symbol:
          description: market symbol
          allOf:
            - $ref: "#/components/schemas/MarketSymbol"
        price:
          description: price
          allOf:
            - $ref: "#/components/schemas/AssetValue"
        quantity:
          description: quantity
          allOf:
            - $ref: "#/components/schemas/AssetValue"
        side:
          description: order side
          allOf:
            - $ref: "#/components/schemas/OrderSideAsString"
          example: "BUY"
        isTaker:
          description: denotes whether this is a taker's trade
          allOf:
            - $ref: "#/components/schemas/Boolean"
        createdAtDatetime:
          description: denotes the time the trade was executed by the exchange, ISO 8601 with millisecond as string
          allOf:
            - $ref: "#/components/schemas/DateTime"
        createdAtTimestamp:
          description: denotes the time the trade was executed by the exchange
          allOf:
            - $ref: "#/components/schemas/TimeStampAsString"
        auctionId:
          description: unique Bullish auction identifier. Present only for auction trades
          type: string
          example: "397735387747975680"
    CustodyApiEcdsaWithdrawalCommand:
      type: object
      required:
        - commandType
        - destinationId
        - symbol
        - network
        - quantity
      properties:
        commandType:
          description: the command type, it must be 'V1Withdrawal'
          type: string
          example: "V1Withdrawal"
        destinationId:
          allOf:
            - $ref: "#/components/schemas/CustodyDestinationID"
        symbol:
          allOf:
            - $ref: "#/components/schemas/CustodySymbol"
        network:
          allOf:
            - $ref: "#/components/schemas/NetworkID"
        quantity:
          example: "100000.000001"
          allOf:
            - $ref: "#/components/schemas/CustodyQuantity"
    CustodyApiEcdsaWithdrawalRequest:
      type: object
      required:
        - timestamp
        - nonce
        - authorizer
        - command
      properties:
        timestamp:
          allOf:
            - $ref: "#/components/schemas/TimeStampAsString"
        nonce:
          type: string
          description: a UUID withdrawal nonce to protect against replay attacks
          example: "1628376611"
        authorizer:
          description: JWT authorizer you obtain along with the [JWT token](/rest/authentication#generate-a-jwt-token)
          allOf:
            - $ref: "#/components/schemas/Authorizer"
        command:
          description: withdrawal command
          allOf:
            - $ref: "#/components/schemas/CustodyApiEcdsaWithdrawalCommand"
    CustodyApiWithdrawalResponse:
      type: object
      properties:
        statusReason:
          description: status reason, describes why withdrawal challenge is in a specific state
          type: string
          example: Withdrawal accepted
        statusReasonCode:
          description: status reason code, see [details](/rest/general/error-rejection-codes)
          type: integer
          example: 1001
        custodyTransactionId:
          allOf:
            - $ref: "#/components/schemas/CustodyTransactionID"
    CustodyHistory:
      type: object
      properties:
        custodyTransactionId:
          allOf:
            - $ref: "#/components/schemas/CustodyTransactionHistoryID"
        direction:
          allOf:
            - $ref: "#/components/schemas/CustodyDirection"
        quantity:
          allOf:
            - $ref: "#/components/schemas/CustodyQuantity"
        symbol:
          allOf:
            - $ref: "#/components/schemas/CustodySymbol"
        network:
          allOf:
            - $ref: "#/components/schemas/NetworkID"
        fee:
          allOf:
            - $ref: "#/components/schemas/CustodyWithdrawalFee"
        memo:
          allOf:
            - $ref: "#/components/schemas/CustodyDepositMemo"
        createdAtDateTime:
          allOf:
            - $ref: "#/components/schemas/CustodyCreatedAtDateTime"
        status:
          allOf:
            - $ref: "#/components/schemas/CustodyTransactionStatus"
        transactionDetails:
          allOf:
            - $ref: "#/components/schemas/CustodyTransactionDetails"
    CustodyCryptoDepositInstructions:
      type: object
      required:
        - network
        - symbol
        - address
      properties:
        network:
          allOf:
            - $ref: "#/components/schemas/NetworkID"
        symbol:
          allOf:
            - $ref: "#/components/schemas/CustodySymbol"
        memo:
          allOf:
            - $ref: "#/components/schemas/CustodyDepositMemo"
        address:
          allOf:
            - $ref: "#/components/schemas/CustodyNetworkAddress"
        minimumDepositAmount:
          allOf:
            - $ref: "#/components/schemas/CustodyMinimumDepositAmount"
      example:
        network: "ETH"
        symbol: "USDC"
        address: "0xb0a64d976972d87b0783eeb1ff88306cd1891f02"
        minimumDepositAmount: "0.01"
    CustodyCryptoWithdrawalInstructions:
      type: object
      required:
        - network
        - symbol
        - address
        - fee
        - label
        - destinationId
        - userWalletType
        - signed
      properties:
        network:
          allOf:
            - $ref: "#/components/schemas/NetworkID"
        symbol:
          allOf:
            - $ref: "#/components/schemas/CustodySymbol"
        address:
          allOf:
            - $ref: "#/components/schemas/CustodyNetworkAddress"
        fee:
          allOf:
            - $ref: "#/components/schemas/CustodyWithdrawalFee"
        memo:
          allOf:
            - $ref: "#/components/schemas/CustodyWithdrawalMemo"
        label:
          allOf:
            - $ref: "#/components/schemas/CustodyWithdrawalLabel"
        destinationId:
          allOf:
            - $ref: "#/components/schemas/CustodyDestinationID"
        vaspName:
          allOf:
            - $ref: "#/components/schemas/CustodyDestinationVaspName"
        userWalletType:
          allOf:
            - $ref: "#/components/schemas/CustodyDestinationUserWalletType"
        signed:
          allOf:
            - $ref: "#/components/schemas/CustodyDestinationSigned"
        locked:
          allOf:
            - $ref: "#/components/schemas/CustodyDestinationLocked"
        lockExpiryDateTime:
          allOf:
            - $ref: "#/components/schemas/CustodyLockExpiryDateTime"
      example:
        network: "ETH"
        symbol: "USDC"
        address: "0xb0a64d976972d87b0783eeb1ff88306cd1891f02"
        fee: "3.00"
        label: "Our cold wallet"
        destinationId: "1560ec0b406c0d909bb9f5f827dd6aa14a1f638884f33a2a3134878102e78038"
        minimumWithdrawalAmount: "0.01"
        vaspName: "Bullish"
        userWalletType: "HOSTED"
        signed: true
        locked: true
        lockExpiryDateTime: "2026-06-24T12:00:00Z"
    CustodySelfHostedInitiateRequest:
      type: object
      required:
        - network
        - symbol
        - address
        - label
        - requestedDepositAmount
      properties:
        network:
          allOf:
            - $ref: "#/components/schemas/NetworkID"
        symbol:
          allOf:
            - $ref: "#/components/schemas/CustodySymbol"
        address:
          allOf:
            - $ref: "#/components/schemas/CustodyNetworkAddress"
        memo:
          allOf:
            - $ref: "#/components/schemas/CustodyWithdrawalMemo"
        label:
          allOf:
            - $ref: "#/components/schemas/CustodyWithdrawalLabel"
        requestedDepositAmount:
          allOf:
            - $ref: "#/components/schemas/CustodySelfHostedRequestedDepositAmount"
      example:
        network: "ETH"
        symbol: "USDC"
        address: "0xb0a64d976972d87b0783eeb1ff88306cd1891f02"
        label: "Our cold wallet"
        requestedDepositAmount: "12.3456"
    CustodySelfHostedInitiateResponse:
      type: object
      properties:
        destinationId:
          allOf:
            - $ref: "#/components/schemas/CustodyDestinationID"
        network:
          allOf:
            - $ref: "#/components/schemas/NetworkID"
        symbol:
          allOf:
            - $ref: "#/components/schemas/CustodySymbol"
        depositAddress:
          allOf:
            - $ref: "#/components/schemas/CustodySelfHostedDepositAddress"
        depositMemo:
          allOf:
            - $ref: "#/components/schemas/CustodySelfHostedDepositMemo"
        requestedDepositAmount:
          allOf:
            - $ref: "#/components/schemas/CustodySelfHostedRequestedDepositAmount"
        verificationAmount:
          allOf:
            - $ref: "#/components/schemas/CustodySelfHostedVerificationAmount"
        totalDepositAmount:
          allOf:
            - $ref: "#/components/schemas/CustodySelfHostedTotalDepositAmount"
        verificationExpiryTime:
          allOf:
            - $ref: "#/components/schemas/DateTime"
      example:
        destinationId: "1560ec0b406c0d909bb9f5f827dd6aa14a1f638884f33a2a3134878102e78038"
        network: "ETH"
        symbol: "USDC"
        depositAddress: "0xb0a64d976972d87b0783eeb1ff88306cd1891f02"
        requestedDepositAmount: "12.3456"
        verificationAmount: "0.0012"
        totalDepositAmount: "12.3468"
        verificationExpiryTime: "2025-05-20T01:01:01.000Z"
    CustodyGetSelfHostedVerificationResponse:
      type: object
      required:
        - destinationId
        - network
        - symbol
        - address
        - verificationStatus
        - requestedDepositAmount
        - verificationAmount
        - totalDepositAmount
        - verificationExpiryTime
      properties:
        destinationId:
          allOf:
            - $ref: "#/components/schemas/CustodyDestinationID"
        network:
          allOf:
            - $ref: "#/components/schemas/NetworkID"
        symbol:
          allOf:
            - $ref: "#/components/schemas/CustodySymbol"
        address:
          allOf:
            - $ref: "#/components/schemas/CustodyNetworkAddress"
        memo:
          allOf:
            - $ref: "#/components/schemas/CustodyWithdrawalMemo"
        verificationStatus:
          allOf:
            - $ref: "#/components/schemas/CustodySelfHostedVerificationStatus"
        requestedDepositAmount:
          allOf:
            - $ref: "#/components/schemas/CustodySelfHostedRequestedDepositAmount"
        verificationAmount:
          allOf:
            - $ref: "#/components/schemas/CustodySelfHostedVerificationAmount"
        totalDepositAmount:
          allOf:
            - $ref: "#/components/schemas/CustodySelfHostedTotalDepositAmount"
        verificationExpiryTime:
          allOf:
            - $ref: "#/components/schemas/DateTime"
      example:
        destinationId: "1560ec0b406c0d909bb9f5f827dd6aa14a1f638884f33a2a3134878102e78038"
        network: "ETH"
        symbol: "USDC"
        address: "0xb0a64d976972d87b0783eeb1ff88306cd1891f02"
        verificationStatus: "VERIFIED"
        requestedDepositAmount: "12.3456"
        verificationAmount: "0.0012"
        totalDepositAmount: "12.3468"
        verificationExpiryTime: "2025-05-20T01:01:01.000Z"
    CustodyBankDetails:
      type: object
      properties:
        name:
          allOf:
            - $ref: "#/components/schemas/CustodyBankName"
        physicalAddress:
          allOf:
            - $ref: "#/components/schemas/CustodyPhysicalBankAddress"
        routingCode:
          allOf:
            - $ref: "#/components/schemas/CustodyBankRoutingCode"
    CustodyBankIntermediateDetails:
      type: object
      properties:
        name:
          example: "Middle Bank"
          allOf:
            - $ref: "#/components/schemas/CustodyBankName"
        physicalAddress:
          example: "523 Exchange Square, Canary Wharf, E14 2WA"
          allOf:
            - $ref: "#/components/schemas/CustodyPhysicalBankAddress"
        routingCode:
          example: "321176234"
          allOf:
            - $ref: "#/components/schemas/CustodyBankRoutingCode"
    CustodyFiatDepositInstructions:
      type: object
      properties:
        network:
          type: string
          example: SWIFT
          description: the network that the account belongs to and the transaction will be performed on SWIFT, ABA or SEPA
        symbol:
          type: string
          example: USD
          description: the currency associated with the account, e.g. USD, EUR
        accountNumber:
          allOf:
            - $ref: "#/components/schemas/CustodyBankAccountNumber"
          example: "5090022533"
          description: the Bullish account number, varies for SWIFT/ABA and SEPA
        name:
          type: string
          example: Bullish (GI) Limited
          description: official Bullish account holder name
        physicalAddress:
          type: string
          example: 26/F, The Centrium, 60 Wyndham Street, Central, Hong Kong
          description: bullish entity's physical address for the bank account
        memo:
          type: string
          example: 8VZPKSGPA
          description: client specific reference to identify which account desposits should be allocated to on the exhange
        bank:
          allOf:
            - $ref: "#/components/schemas/CustodyBankDetails"
    CustodyFiatWithdrawalInstructions:
      type: object
      properties:
        destinationId:
          allOf:
            - $ref: "#/components/schemas/CustodyDestinationID"
        accountNumber:
          allOf:
            - $ref: "#/components/schemas/CustodyBankAccountNumber"
        network:
          allOf:
            - $ref: "#/components/schemas/CustodyBankNetworkID"
        symbol:
          allOf:
            - $ref: "#/components/schemas/CustodyFiatSymbol"
        name:
          allOf:
            - $ref: "#/components/schemas/CustodyBankName"
        physicalAddress:
          allOf:
            - $ref: "#/components/schemas/CustodyPhysicalBankAddress"
        fee:
          allOf:
            - $ref: "#/components/schemas/CustodyWithdrawalFee"
        memo:
          allOf:
            - $ref: "#/components/schemas/CustodyWithdrawalMemo"
        bank:
          allOf:
            - $ref: "#/components/schemas/CustodyBankDetails"
        intermediaryBank:
          allOf:
            - $ref: "#/components/schemas/CustodyBankIntermediateDetails"
    CustodyLimits:
      type: object
      properties:
        symbol:
          allOf:
            - $ref: "#/components/schemas/CustodySymbol"
        available:
          allOf:
            - $ref: "#/components/schemas/CustodyAvailableWithdrawalLimit"
        twentyFourHour:
          allOf:
            - $ref: "#/components/schemas/Custody24HWithdrawalLimit"
    Trade:
      type: object
      required:
        - tradeId
        - orderId
        - clientOrderId
        - symbol
        - price
        - quantity
        - quoteAmount
        - baseFee
        - quoteFee
        - side
        - isTaker
        - tradeRebateAmount
        - tradeRebateAssetSymbol
        - otcMatchId
        - otcTradeId
        - clientOtcTradeId
        - createdAtTimestamp
        - createdAtDatetime
      properties:
        tradeId:
          description: unique trade ID
          allOf:
            - $ref: "#/components/schemas/TradeID"
        orderId:
          description: unique order ID
          allOf:
            - $ref: "#/components/schemas/OrderID"
        clientOrderId:
          description: unique numeric (i64) identifier generated on the client side
          allOf:
            - $ref: "#/components/schemas/OrderHandle"
        symbol:
          description: market symbol
          allOf:
            - $ref: "#/components/schemas/MarketSymbol"
        price:
          description: price, see [asset value](/rest/general/price-quantity-precision) format
          allOf:
            - $ref: "#/components/schemas/AssetValue"
        quantity:
          description: quantity, see [asset value](/rest/general/price-quantity-precision) format
          allOf:
            - $ref: "#/components/schemas/AssetValue"
        quoteAmount:
          description: quote quantity deducted from asset account, see [asset value](/rest/general/price-quantity-precision) format
          allOf:
            - $ref: "#/components/schemas/AssetValue"
        baseFee:
          description: base fee, see [asset value](/rest/general/price-quantity-precision) format
          allOf:
            - $ref: "#/components/schemas/AssetValue"
        quoteFee:
          description: quote fee, see [asset value](/rest/general/price-quantity-precision) format
          allOf:
            - $ref: "#/components/schemas/AssetValue"
        side:
          description: order side
          allOf:
            - $ref: "#/components/schemas/OrderSideAsString"
          example: "BUY"
        isTaker:
          description: denotes whether this is a taker's trade
          allOf:
            - $ref: "#/components/schemas/Boolean"
        tradeRebateAmount:
          description: amount of rebate that is credited to the user as part of the trade.
          allOf:
            - $ref: "#/components/schemas/AssetValue"
        tradeRebateAssetSymbol:
          description: the symbol of the asset in which the rebate is paid
          allOf:
            - $ref: "#/components/schemas/QuoteAssetSymbol"
        otcMatchId:
          description: unique OTC match ID.
          allOf:
            - $ref: "#/components/schemas/OtcMatchId"
        otcTradeId:
          description: unique Bullish OTC trade ID
          allOf:
            - $ref: "#/components/schemas/OtcTradeId"
        clientOtcTradeId:
          description: unique Client OTC trade ID
          allOf:
            - $ref: "#/components/schemas/ClientOtcTradeId"
        createdAtDatetime:
          description: denotes the time the trade was executed by the exchange, ISO 8601 with millisecond as string
          allOf:
            - $ref: "#/components/schemas/DateTime"
        createdAtTimestamp:
          description: denotes the time the trade was executed by the exchange
          allOf:
            - $ref: "#/components/schemas/TimeStampAsString"
    OptionTrade:
      type: object
      required:
        - symbol
        - tradeId
        - price
        - quantity
        - side
        - isTaker
        - createdAtTimestamp
        - createdAtDatetime
        - optionType
        - otcTradeId
      properties:
        symbol:
          description: option market symbol
          allOf:
            - $ref: "#/components/schemas/OptionMarketSymbol"
        tradeId:
          description: unique trade ID
          allOf:
            - $ref: "#/components/schemas/TradeID"
        price:
          description: price
          allOf:
            - $ref: "#/components/schemas/AssetValue"
        quantity:
          description: quantity
          allOf:
            - $ref: "#/components/schemas/AssetValue"
        side:
          description: order side
          allOf:
            - $ref: "#/components/schemas/OrderSideAsString"
          example: "BUY"
        isTaker:
          description: denotes whether this is a taker's trade
          allOf:
            - $ref: "#/components/schemas/Boolean"
        createdAtDatetime:
          description: denotes the time the trade was executed by the exchange, ISO 8601 with millisecond as string
          allOf:
            - $ref: "#/components/schemas/DateTime"
        createdAtTimestamp:
          description: denotes the time the trade was executed by the exchange
          allOf:
            - $ref: "#/components/schemas/TimeStampAsString"
        optionType:
          description: Specifies if it's a call (right to buy) or a put (right to sell)
          allOf:
            - $ref: "#/components/schemas/OptionType"
        otcTradeId:
          description: unique Bullish OTC trade ID
          allOf:
            - $ref: "#/components/schemas/OtcTradeId"
    Tick:
      allOf:
        - type: object
          required:
            - createdAtDatetime
            - createdAtTimestamp
            - high
            - low
            - bestBid
            - bidVolume
            - bestAsk
            - askVolume
            - vwap
            - open
            - close
            - last
            - change
            - percentage
            - average
            - baseVolume
            - quoteVolume
            - bancorPrice
            - lastTradeDatetime
            - lastTradeTimestamp
            - lastTradeQuantity
            - ammData
          properties:
            createdAtDatetime:
              description: denotes the time of the current tick on the exchange, ISO 8601 with millisecond as string
              allOf:
                - $ref: "#/components/schemas/DateTime"
            createdAtTimestamp:
              description: denotes the time of the current tick on the exchange
              allOf:
                - $ref: "#/components/schemas/TimeStampAsString"
            high:
              description: highest price, see [asset value](/rest/general/price-quantity-precision) format
              allOf:
                - $ref: "#/components/schemas/AssetValue"
            low:
              description: lowest price, see [asset value](/rest/general/price-quantity-precision) format
              allOf:
                - $ref: "#/components/schemas/AssetValue"
            bestBid:
              description: current best bid (buy) price, see [asset value](/rest/general/price-quantity-precision) format
              allOf:
                - $ref: "#/components/schemas/AssetValue"
            bidIVPercentage:
              description: Implied volatility of the best bid price
              type: string
              example: "99.0"
            bidVolume:
              description: current best bid (buy) quantity (may be missing or undefined), see [asset value](/rest/general/price-quantity-precision) format
              allOf:
                - $ref: "#/components/schemas/AssetValue"
            bestAsk:
              description: current best ask (sell) price, see [asset value](/rest/general/price-quantity-precision) format
              allOf:
                - $ref: "#/components/schemas/AssetValue"
            askIVPercentage:
              description: Implied volatility of the best ask price
              type: string
              example: "99.0"
            askVolume:
              description: current best ask (sell) quantity (may be missing or undefined), see [asset value](/rest/general/price-quantity-precision) format
              allOf:
                - $ref: "#/components/schemas/AssetValue"
            vwap:
              description: volume weighed average price, see [asset value](/rest/general/price-quantity-precision) format
              allOf:
                - $ref: "#/components/schemas/AssetValue"
            open:
              description: opening price, see [asset value](/rest/general/price-quantity-precision) format
              allOf:
                - $ref: "#/components/schemas/AssetValue"
            close:
              description: price of last trade (closing price for current period), see [asset value](/rest/general/price-quantity-precision) format
              allOf:
                - $ref: "#/components/schemas/AssetValue"
            last:
              description: price of last trade (closing price for current period), see [asset value](/rest/general/price-quantity-precision) format
              allOf:
                - $ref: "#/components/schemas/AssetValue"
            change:
              description: absolute change, `last - open`, see [asset value](/rest/general/price-quantity-precision) format
              allOf:
                - $ref: "#/components/schemas/AssetValue"
            percentage:
              description: relative change, `(change/open) * 100`, see [asset value](/rest/general/price-quantity-precision) format
              allOf:
                - $ref: "#/components/schemas/AssetValue"
            average:
              description: average price, `(last + open) / 2`, see [asset value](/rest/general/price-quantity-precision) format
              allOf:
                - $ref: "#/components/schemas/AssetValue"
            baseVolume:
              description: volume of base asset traded for last 24 hours, see [asset value](/rest/general/price-quantity-precision) format
              allOf:
                - $ref: "#/components/schemas/AssetValue"
            quoteVolume:
              description: volume of quote asset traded for last 24 hours, see [asset value](/rest/general/price-quantity-precision) format
              allOf:
                - $ref: "#/components/schemas/AssetValue"
            bancorPrice:
              description: current price, see [asset value](/rest/general/price-quantity-precision) format
              allOf:
                - $ref: "#/components/schemas/AssetValue"
            markPrice:
              description: mark price represents the fair value of a contract at the current time.
              type: string
              example: "19999.00"
            fundingRate:
              description: funding rate is used to calculate funding, which measures the relative difference between the index price and mark price.
              type: string
              example: "0.01"
            openInterest:
              description: open interest is the total quantity of open long positions and short positions, see [asset value](/rest/general/price-quantity-precision) format (only applies to derivatives market)
              type: string
              example: "100000.32452"
            lastTradeDatetime:
              description: time of the last trade on this symbol, ISO 8601 with millisecond as string
              allOf:
                - $ref: "#/components/schemas/DateTime"
            lastTradeTimestamp:
              description: time of the last trade on this symbol
              allOf:
                - $ref: "#/components/schemas/TimeStampAsString"
            lastTradeQuantity:
              description: quantity of the last trade on this symbol, see [asset value](/rest/general/price-quantity-precision) format
              allOf:
                - $ref: "#/components/schemas/AssetValue"
            ammData:
              description: AMM data of all available fee tiers. Not applicable for `Option` markets
              type: array
              minItems: 0
              items:
                allOf:
                  - $ref: "#/components/schemas/AmmData"
        - $ref: "#/components/schemas/OptionGreeks"
    AmmData:
      type: object
      description: AMM data
      required:
        - feeTierId
        - bidSpreadFee
        - askSpreadFee
        - currentPrice
      properties:
        feeTierId:
          allOf:
            - $ref: "#/components/schemas/FeeTierId"
        bidSpreadFee:
          description: bid spread fee
          type: string
          example: "0.00040000"
        askSpreadFee:
          description: ask spread fee
          type: string
          example: "0.00040000"
        currentPrice:
          description: current AMM price
          type: string
          example: "16856.0000"
    MarketSymbol:
      type: string
      description: market symbol. E.g. `BTCUSDC`
      example: "BTCUSDC"
    DerivativeMarketSymbol:
      type: string
      description: market symbol. E.g. `BTC-USDC-20250919-90000-C` for OPTION markets and `BTC-USDC-20250919` for DATED FUTURE markets.
      example: "BTC-USDC-20250919-90000-C"
    DatedFutureMarketSymbol:
      type: string
      description: market symbol. E.g. `BTC-USDC-PERP` for PERPETUAL and `BTC-USDC-20241201` for DATED FUTURE markets.
      example: "BTC-USDC-20241201"
    OptionMarketSymbol:
      type: string
      description: market symbol. E.g. `BTC-USDC-20241004-70000-C` for OPTION markets.
      example: "BTC-USDC-20241004-70000-C"
    OptionAndDatedFuturesMarketSymbol:
      type: string
      description: market symbol. E.g. `BTC-USDC-20241004-70000-C` for OPTION markets and `BTC-USDC-20241201` for DATED FUTURE markets.
      example: "BTC-USDC-20241004-70000-C"
    PerpMarketSymbol:
      type: string
      description: market symbol. E.g. `BTC-USDC-PERP` for PERPETUAL market
      example: "BTC-USDC-PERP"
    FeeTier:
      type: object
      description: unique fee tier
      required:
        - feeTierId
        - staticSpreadFee
        - isDislocationEnabled
      properties:
        feeTierId:
          allOf:
            - $ref: "#/components/schemas/FeeTierId"
        staticSpreadFee:
          description: static spread fee
          type: string
          example: "0.00040000"
        isDislocationEnabled:
          description: dislocation enabled/disabled
          type: boolean
          example: true
    FeeTierId:
      type: string
      description: unique fee tier ID, see [Get Market By Symbol](/rest/api/get-market-by-symbol)
      example: "1"
    InstrumentId:
      type: string
      description: custody identifier for instrument
      example: "BTC"
    AssetSymbol:
      type: string
      description: asset symbol as denoted in the world
      example: "BTC"
    UnderlyingAssetSymbol:
      type: string
      description: the underlying asset symbol that is configured for MMP checks
      example: "BTC"
    QuoteAssetSymbol:
      type: string
      description: asset symbol as denoted in the world
      example: "USDC"
    AssetName:
      type: string
      description: asset name
      example: "Bitcoin"
    AssetID:
      type: string
      description: unique asset ID
      example: "1"
    CollateralBand:
      type: object
      properties:
        collateralPercentage:
          description: collateral percentage applied to the asset for this band - a value of 90.00 indicates 90% of the asset is eligible to be used as collateral
          type: string
          example: "95.00"
        bandLimitUSD:
          description: upper limit in USD for this band
          type: string
          example: "1000000.0000"
    UnderlyingAsset:
      type: object
      properties:
        symbol:
          description: underlying asset symbol
          type: string
          example: "BTC"
        assetId:
          description: underlying asset ID
          type: string
          example: "1"
        bpmMinReturnStart:
          description: start of the 1/1000 biggest downward price movement of an underlying asset over 6 hours
          type: string
          example: "40.0000"
        bpmMinReturnEnd:
          description: end of the 1/1000 biggest downward price movement of an underlying asset over 6 hours
          type: string
          example: "20.0000"
        bpmMaxReturnStart:
          description: start of the 1/1000 biggest upward price movement of an underlying asset over 6 hours
          type: string
          example: "30.0000"
        bpmMaxReturnEnd:
          description: end of the 1/1000 biggest upward price movement of an underlying asset over 6 hours
          type: string
          example: "50.0000"
        marketRiskFloorPctStart:
          description: the percentage range of risk reduction allowed for a portfolio
          type: string
          example: "1.00"
        marketRiskFloorPctEnd:
          description: the percentage range of risk reduction allowed for a portfolio
          type: string
          example: "5.00"
        bpmTransitionDateTimeStart:
          description: the start datetime which the values linearly transition from `bpmMinReturnStart` to `bpmMinReturnEnd` for an underlying asset
          type: string
          example: "2024-08-02T12:00:00.000Z"
        bpmTransitionDateTimeEnd:
          description: the end datetime which the values linearly transition from `bpmMinReturnStart` to `bpmMinReturnEnd` for an underlying asset
          type: string
          example: "2024-08-02T18:00:00.000Z"

    VolGridConfiguration:
      type: object
      properties:
        assetId:
          description: underlying asset ID
          type: string
          example: "1"
        assetSymbol:
          description: underlying asset symbol
          type: string
          example: "BTC"
        effectiveFromDatetime:
          description: ISO 8601 datetime of when this vol grid configuration became effective
          type: string
          format: date-time
          example: "2026-05-29T08:00:00.000Z"
        volGrid:
          description: list of vol grid rows, one per days-to-expiry bucket
          type: array
          items:
            $ref: "#/components/schemas/VolGridData"
          example:
            - timeToExpiryDays: 0
              atmMax: "0.100754"
              atmMin: "-0.078081"
              skewMax: "0.083929"
              skewMin: "-0.103593"
            - timeToExpiryDays: 1
              atmMax: "0.100754"
              atmMin: "-0.078081"
              skewMax: "0.083929"
              skewMin: "-0.103593"
            - timeToExpiryDays: 7
              atmMax: "0.100754"
              atmMin: "-0.078081"
              skewMax: "0.063888"
              skewMin: "-0.073318"
            - timeToExpiryDays: 14
              atmMax: "0.100754"
              atmMin: "-0.078081"
              skewMax: "0.043847"
              skewMin: "-0.043043"
            - timeToExpiryDays: 30
              atmMax: "0.100754"
              atmMin: "-0.078081"
              skewMax: "0.034441"
              skewMin: "-0.034124"
            - timeToExpiryDays: 60
              atmMax: "0.100754"
              atmMin: "-0.078081"
              skewMax: "0.024271"
              skewMin: "-0.02397"
            - timeToExpiryDays: 90
              atmMax: "0.100754"
              atmMin: "-0.078081"
              skewMax: "0.024142"
              skewMin: "-0.024381"
            - timeToExpiryDays: 180
              atmMax: "0.100754"
              atmMin: "-0.078081"
              skewMax: "0.017566"
              skewMin: "-0.017433"
    VolGridData:
      type: object
      properties:
        timeToExpiryDays:
          description: days-to-expiry bucket this row applies to. supported buckets — [0, 1, 7, 14, 30, 60, 90, 180]
          type: integer
          example: 0
        atmMax:
          description: max upward ATM IV shift applied in BPM stress. supported range — [0, 1]
          type: string
          example: "0.100754"
        atmMin:
          description: max downward ATM IV shift. supported range — [-1, 0]
          type: string
          example: "-0.078081"
        skewMax:
          description: max upward skew shift. supported range — [0, 1]
          type: string
          example: "0.083929"
        skewMin:
          description: max downward skew shift. supported range [-1, 0]
          type: string
          example: "-0.103593"
    PriceQuantityTuple:
      type: object
      properties:
        price:
          allOf:
            - $ref: "#/components/schemas/AssetValue"
        priceLevelQuantity:
          allOf:
            - $ref: "#/components/schemas/AssetValue"
    OrderBook:
      type: object
      required:
        - bids
        - asks
        - datetime
        - timestamp
        - sequenceNumber
      properties:
        bids:
          description: bids
          type: array
          minItems: 0
          maxItems: 10
          items:
            allOf:
              - $ref: "#/components/schemas/PriceQuantityTuple"
        asks:
          description: asks
          type: array
          minItems: 0
          maxItems: 10
          items:
            allOf:
              - $ref: "#/components/schemas/PriceQuantityTuple"
        datetime:
          description: date and time of order book snapshot, ISO 8601 with millisecond as string
          allOf:
            - $ref: "#/components/schemas/DateTime"
        timestamp:
          description: timestamp of order book snapshot
          allOf:
            - $ref: "#/components/schemas/TimeStampAsString"
        sequenceNumber:
          description: an incremented unique identifier of the order book snapshot
          type: integer
          example: 999
    IndexPrice:
      type: object
      required:
        - assetSymbol
        - price
        - updatedAtDatetime
        - updatedAtTimestamp
      properties:
        assetSymbol:
          description: Asset symbol
          allOf:
            - $ref: "#/components/schemas/AssetSymbol"
        price:
          description: Asset price in USD
          example: "66100.0000"
          type: string
        updatedAtDatetime:
          description: Date and time when the index price is updated
          allOf:
            - $ref: "#/components/schemas/DateTime"
        updatedAtTimestamp:
          description: Timestamp when the index price is updated
          allOf:
            - $ref: "#/components/schemas/TimeStamp"
    Market:
      type: object
      required:
        - marketId
        - symbol
        - quoteAssetId
        - baseAssetId
        - quoteSymbol
        - baseSymbol
        - quotePrecision
        - basePrecision
        - pricePrecision
        - quantityPrecision
        - costPrecision
        - priceBuffer
        - minQuantityLimit
        - maxQuantityLimit
        - timeZone
        - tickSize
        - liquidityTickSize
        - liquidityPrecision
        - feeGroupId
        - roundingCorrectionFactor
        - makerMinLiquidityAddition
        - spotTradingEnabled
        - marginTradingEnabled
        - marketEnabled
        - createOrderEnabled
        - cancelOrderEnabled
        - liquidityInvestEnabled
        - liquidityWithdrawEnabled
        - feeTiers
        - marketType
        - openInterestUSD
        - concentrationRiskThresholdUSD
        - concentrationRiskPercentage
        - expiryDatetime
      properties:
        marketId:
          description: unique market ID
          allOf:
            - $ref: "#/components/schemas/MarketID"
        symbol:
          description: market symbol
          allOf:
            - $ref: "#/components/schemas/OptionMarketSymbol"
        baseSymbol:
          description: base asset symbol (only applies to spot market)
          allOf:
            - $ref: "#/components/schemas/AssetSymbol"
        underlyingBaseSymbol:
          description: underlying base asset symbol (only applies to derivative market)
          example:
          allOf:
            - $ref: "#/components/schemas/AssetSymbol"
        quoteSymbol:
          description: quote asset symbol (only applies to spot market)
          allOf:
            - $ref: "#/components/schemas/AssetSymbol"
        underlyingQuoteSymbol:
          description: underlying quote asset symbol (only applies to derivative market)
          example:
          allOf:
            - $ref: "#/components/schemas/AssetSymbol"
        quoteAssetId:
          description: quote asset id
          allOf:
            - $ref: "#/components/schemas/AssetID"
        baseAssetId:
          description: base asset id
          allOf:
            - $ref: "#/components/schemas/AssetID"
        quotePrecision:
          description: quote precision
          type: integer
          example: 4
        basePrecision:
          description: base precision
          type: integer
          example: 8
        pricePrecision:
          description: number of decimal digits 'after the dot' for price
          type: integer
          example: 8
        quantityPrecision:
          description: number of decimal digits 'after the dot' for quantity
          type: integer
          example: 8
        costPrecision:
          description: number of decimal digits 'after the dot' for cost, `price * quantity`
          type: integer
          example: 8
        priceBuffer:
          description: buffer range of limit price from the last traded price. Not applicable for `Option` markets
          type: string
          example: "0.3"
        minQuantityLimit:
          description: order quantity should be > min, see [asset value](/rest/general/price-quantity-precision) format
          allOf:
            - $ref: "#/components/schemas/AssetValue"
        maxQuantityLimit:
          description: order quantity should be < max, see [asset value](/rest/general/price-quantity-precision) format
          allOf:
            - $ref: "#/components/schemas/AssetValue"
        timeZone:
          description: time zone
          type: string
          example: Etc/UTC
        tickSize:
          description: tick size, see [asset value](/rest/general/price-quantity-precision) format
          allOf:
            - $ref: "#/components/schemas/AssetValue"
        liquidityTickSize:
          description: liquidity tick size. Not applicable for `Option` markets
          type: string
          example: "100.0000"
        liquidityPrecision:
          description: liquidity precision. Not applicable for `Option` markets
          type: integer
          example: 4
        roundingCorrectionFactor:
          description: rounding correction factor for market
          type: string
          example: "0.00000001"
        makerMinLiquidityAddition:
          description: minimum amount required to invest liquidity to market. Not applicable for `Option` markets
          type: string
          example: "5000"
        orderTypes:
          type: array
          items:
            allOf:
              - $ref: "#/components/schemas/OrderTypeAsString"
        spotTradingEnabled:
          description: spot trading enabled (only applies for Spot markets)
          type: boolean
          example: true
        marginTradingEnabled:
          description: margin trading enabled (only applies for Spot markets)
          type: boolean
          example: true
        marketEnabled:
          description: market enabled
          type: boolean
          example: true
        createOrderEnabled:
          description: able to create order
          type: boolean
          example: true
        amendOrderEnabled:
          description: able to amend order
          type: boolean
          example: true
          deprecated: true
        cancelOrderEnabled:
          description: able to cancel order
          type: boolean
          example: true
        liquidityInvestEnabled:
          description: able to invest liquidity to market. Not applicable for `Option` markets
          type: boolean
          example: true
        liquidityWithdrawEnabled:
          description: able to withdraw liquidity from market. Not applicable for `Option` markets
          type: boolean
          example: true
        feeGroupId:
          description: Identifier to the trade fee assigned to this market. Used with `tradeFeeRate` at [Get Trading Account](/rest/api/get-trading-account-by-id)
          type: integer
          example: 1
        feeTiers:
          description: all available fee tiers. Not applicable for `Option` markets
          type: array
          minItems: 0
          items:
            allOf:
              - $ref: "#/components/schemas/FeeTier"
        marketType:
          description: market type, e.g. "SPOT" for market like "BTCUSD", "PERPETUAL" for market like "BTC-USDC-PERP", "DATED_FUTURE" for market like "BTC-USDC-20250901", "OPTION" for market like "BTC-USDC-20250901-90000-C"
          allOf:
            - $ref: "#/components/schemas/MarketTypeAsString"
        contractMultiplier:
          description: contract multiplier. (only applies to perpetual market)
          type: integer
          example: null
        settlementAssetSymbol:
          description: settlement asset symbol. (only applies to perpetual market)
          type: string
          example: null
        openInterestUSD:
          description: cumulative notional value of all open interest for a specific derivative contract on the exchange.
          type: string
          example: null
        concentrationRiskThresholdUSD:
          description: open interest notional of an account for a specific derivative contract.
          type: string
          example: null
        concentrationRiskPercentage:
          description: percentage of the total open interest for a specific derivative contract.
          type: string
          example: null
        expiryDatetime:
          description: denotes the time when the market expires in ISO 8601 with millisecond format as string
          type: string
          example: 2024-10-04T08:00:00.000Z
        optionStrikePrice:
          description: The price at which the option can be exercised upon expiry.
          type: string
          example: "70000.0000"
        optionType:
          description: Specifies if it's a call (right to buy) or a put (right to sell)
          allOf:
            - $ref: "#/components/schemas/OptionType"
        premiumCapRatio:
          description: A cap that is set on the underlying asset's movement as part of the premium that limits the option buyer's profit.
          type: string
          example: "0.10"
        auctionEnabled:
          description: whether auction is enabled for this market
          type: boolean
          example: true
        auctionPriceCollar:
          description: auction clearing price range from Index Price, expressed as a decimal ratio
          type: string
          example: "0.05"
    Auction:
      type: object
      properties:
        auctionId:
          description: unique auction identifier
          type: string
          example: "397735387747975680"
        symbol:
          description: market symbol
          allOf:
            - $ref: "#/components/schemas/MarketSymbol"
        phase:
          description: "current auction phase: COOLING, ACCUMULATION, LOCKDOWN, CROSS"
          type: string
          enum:
            - COOLING
            - ACCUMULATION
            - LOCKDOWN
            - CROSS
          example: ACCUMULATION
        startTime:
          description: accumulation start time, ISO 8601 with millisecond as string
          allOf:
            - $ref: "#/components/schemas/DateTime"
        lockdownTime:
          description: lockdown start time, ISO 8601 with millisecond as string
          allOf:
            - $ref: "#/components/schemas/DateTime"
        scheduledCrossTime:
          description: scheduled cross time, ISO 8601 with millisecond as string
          allOf:
            - $ref: "#/components/schemas/DateTime"
        createAuctionOrderEnabled:
          description: whether new auction orders can be created. Defaults true after auction starts (post-cooling)
          type: boolean
          example: true
        amendAuctionOrderEnabled:
          description: whether auction orders can be amended. Defaults true after auction starts; auto-switches to false during lockdown
          type: boolean
          example: true
        cancelAuctionOrderEnabled:
          description: whether auction orders can be cancelled. Defaults true after auction starts; auto-switches to false during lockdown
          type: boolean
          example: true
        createdAt:
          description: auction creation time, ISO 8601 with millisecond as string
          allOf:
            - $ref: "#/components/schemas/DateTime"
        updatedAt:
          description: auction last update time, ISO 8601 with millisecond as string
          allOf:
            - $ref: "#/components/schemas/DateTime"
    AuctionNoii:
      type: object
      properties:
        auctionId:
          description: auction identifier
          type: string
          example: "397735387747975680"
        symbol:
          description: market symbol
          allOf:
            - $ref: "#/components/schemas/MarketSymbol"
        timestamp:
          description: data timestamp, ISO 8601 with millisecond as string
          allOf:
            - $ref: "#/components/schemas/DateTime"
        farPrice:
          description: indicative clearing price (auction orders only)
          allOf:
            - $ref: "#/components/schemas/AssetValue"
        referencePrice:
          description: "Last Trade Price on Regular Continuous Orderbook; if Last Trade Price is not available, then Index Price"
          allOf:
            - $ref: "#/components/schemas/AssetValue"
        imbalanceDirection:
          description: "imbalance direction: BUY, SELL, or NONE"
          type: string
          enum:
            - BUY
            - SELL
            - NONE
          example: BUY
        imbalanceQuantity:
          description: unmatched quantity at farPrice
          allOf:
            - $ref: "#/components/schemas/AssetValue"
        pairedQuantity:
          description: predicted matched volume
          allOf:
            - $ref: "#/components/schemas/AssetValue"
    AuctionResult:
      type: object
      properties:
        auctionId:
          description: auction identifier
          type: string
          example: "397735387747975680"
        symbol:
          description: market symbol
          allOf:
            - $ref: "#/components/schemas/MarketSymbol"
        crossTime:
          description: actual cross time, ISO 8601 with millisecond as string
          allOf:
            - $ref: "#/components/schemas/DateTime"
        clearingPrice:
          description: final clearing price
          allOf:
            - $ref: "#/components/schemas/AssetValue"
        referencePrice:
          description: "Last Trade Price on Regular Continuous Orderbook; if Last Trade Price is not available, then Index Price"
          allOf:
            - $ref: "#/components/schemas/AssetValue"
        pairedQuantity:
          description: total matched volume
          allOf:
            - $ref: "#/components/schemas/AssetValue"
        imbalanceDirection:
          description: "final imbalance direction: BUY, SELL, or NONE"
          type: string
          enum:
            - BUY
            - SELL
            - NONE
          example: NONE
        imbalanceQuantity:
          description: final imbalance quantity
          allOf:
            - $ref: "#/components/schemas/AssetValue"
        createdAtDatetime:
          description: denotes the time the auction cross was executed, ISO 8601 with millisecond as string
          allOf:
            - $ref: "#/components/schemas/DateTime"
    Asset:
      type: object
      required:
        - assetId
        - symbol
        - name
        - precision
        - minBalanceInterest
        - minFee
        - apr
        - collateralRating
        - maxBorrow
        - totalOfferedLoanQuantity
        - loanBorrowedQuantity
        - collateralBands
        - underlyingAsset
      properties:
        assetId:
          description: unique asset ID
          allOf:
            - $ref: "#/components/schemas/AssetID"
        symbol:
          description: asset symbol
          allOf:
            - $ref: "#/components/schemas/AssetSymbol"
        name:
          description: asset name
          allOf:
            - $ref: "#/components/schemas/AssetName"
        precision:
          description: number of decimal digits 'after the dot' for asset amount
          type: string
          example: "8"
        minBalanceInterest:
          allOf:
            - $ref: "#/components/schemas/AssetValue"
        minFee:
          description: minimum fee
          allOf:
            - $ref: "#/components/schemas/AssetValue"
        apr:
          description: annualized percentage rate
          type: string
          example: "12.50"
        collateralRating:
          deprecated: true
          description: collateral rating applied to this asset, a value of 100.00 indicates 100%. `Deprecated in favour of collateral bands`
          type: string
          example: "95.00"
        maxBorrow:
          description: maximum quantity that can be borrowed for this asset
          type: string
          example: "10.00000000"
        totalOfferedLoanQuantity:
          description: quantity of an asset that is across all loan offers on the exchange
          type: string
          example: "5.00000000"
        loanBorrowedQuantity:
          description: amount of loans that is currently being borrowed for the asset
          type: string
          example: "3.00000000"
        collateralBands:
          description: list of collateral bands for the asset. A collateral band holds the upper limit of the USD notional and the corresponding collateral percentage which applies to it. An asset's collateral value will be capped by the highest limit of the collateral bands, any remaining amount greater than this limit will have a collateral percentage of 0. If an asset has an empty list of CollateralBands, this signifies that the asset has a collateralValue of 0.
          type: array
          items:
            allOf:
              - $ref: "#/components/schemas/CollateralBand"
        underlyingAsset:
          description: underlying asset for the asset.
          allOf:
            - $ref: "#/components/schemas/UnderlyingAsset"
    OHLCVCandle:
      type: object
      properties:
        open:
          description: see [asset value](/rest/general/price-quantity-precision) format
          allOf:
            - $ref: "#/components/schemas/AssetValue"
        high:
          description: see [asset value](/rest/general/price-quantity-precision) format
          allOf:
            - $ref: "#/components/schemas/AssetValue"
        low:
          description: see [asset value](/rest/general/price-quantity-precision) format
          allOf:
            - $ref: "#/components/schemas/AssetValue"
        close:
          description: see [asset value](/rest/general/price-quantity-precision) format
          allOf:
            - $ref: "#/components/schemas/AssetValue"
        volume:
          description: see [asset value](/rest/general/price-quantity-precision) format
          allOf:
            - $ref: "#/components/schemas/AssetValue"
        createdAtTimestamp:
          allOf:
            - $ref: "#/components/schemas/TimeStampAsString"
        createdAtDatetime:
          description: date and time of the candle, ISO 8601 with millisecond as string
          allOf:
            - $ref: "#/components/schemas/DateTime"
        publishedAtTimestamp:
          description: date and time of the candle getting published, ISO 8601 with millisecond as string
          allOf:
            - $ref: "#/components/schemas/TimeStampAsString"
    BorrowInterest:
      type: object
      required:
        - assetId
        - assetSymbol
        - borrowedQuantity
        - totalBorrowedQuantity
        - createdAtDatetime
        - createdAtTimestamp
      properties:
        assetId:
          description: unique asset ID
          allOf:
            - $ref: "#/components/schemas/AssetID"
        assetSymbol:
          description: asset symbol
          allOf:
            - $ref: "#/components/schemas/AssetSymbol"
        borrowedQuantity:
          description: the principal borrowed quantity
          allOf:
            - $ref: "#/components/schemas/AssetValue"
        totalBorrowedQuantity:
          description: the sum of the principal borrowed quantity and the interest charged
          allOf:
            - $ref: "#/components/schemas/AssetValue"
        createdAtDatetime:
          description: denotes the hour in which the principal quantity was borrowed or when the interest was charged, ISO 8601 with millisecond as string
          type: string
          format: date-time
          example: "2020-08-21T08:00:00.000Z"
        createdAtTimestamp:
          description: denotes the hour in which the principal quantity was borrowed or when the interest was charged
          type: string
          format: string
          example: "1621490985000"
    CurrentExchangeTimeResponse:
      type: object
      required:
        - timestamp
        - datetime
      properties:
        timestamp:
          allOf:
            - $ref: "#/components/schemas/TimeStampAsString"
        datetime:
          description: ISO 8601 with millisecond as string
          allOf:
            - $ref: "#/components/schemas/DateTime"
    Nonce:
      type: object
      required:
        - upperBound
        - lowerBound
      properties:
        lowerBound:
          description: lower bound of nonce range
          type: integer
          example: 8455
        upperBound:
          description: upper bound of nonce range
          type: integer
          example: 9455
    OptionType:
      description: Type of Option market
      example: CALL
      type: string
      enum:
        - CALL
        - PUT
    OrderSide:
      type: string
      example: BUY
      enum:
        - BUY
        - SELL
    TimeBucket:
      type: string
      example: 1m
      enum:
        - 1m
        - 5m
        - 30m
        - 1h
        - 6h
        - 12h
        - 1d
    OrderStatus:
      type: string
      example: OPEN
      enum:
        - OPEN
        - CLOSED
        - CANCELLED
        - REJECTED
    AMMInstructionStatus:
      type: string
      example: OPEN
      enum:
        - OPEN
        - CLOSED
    DelayBySeconds:
      description: Delay the cancel-all-orders request by (seconds) as a timeout mechanism
      type: string
      enum:
        - "5"
        - "10"
        - "15"
        - "20"
        - "25"
        - "30"
        - "40"
        - "50"
        - "60"
      example: "5"
    CancelId:
      description: Unique id for this cancel request which is an unsigned 64 bit integer expressed as string
      type: string
      example: "123456789"
    DerivativesPositionResponse:
      description: Derivatives Position of one market for the trading account
      type: object
      properties:
        tradingAccountId:
          allOf:
            - $ref: "#/components/schemas/TradingAccountId"
        symbol:
          example: "BTC-USDC-PERP"
          allOf:
            - $ref: "#/components/schemas/MarketSymbol"
        side:
          allOf:
            - $ref: "#/components/schemas/OrderSide"
        quantity:
          description: Current size of the  position [asset value](/rest/general/price-quantity-precision) format
          allOf:
            - $ref: "#/components/schemas/AssetValue"
        notional:
          description: Notional value of the current position, calculated using the mark price
          allOf:
            - $ref: "#/components/schemas/UsdcValue"
        entryNotional:
          description: Notional value of the position, using the average entry price
          allOf:
            - $ref: "#/components/schemas/UsdcValue"
        mtmPnl:
          description: Sum of all mark-to-market profits and losses plus profits and losses realised from trading, accumulated since the last settlement
          allOf:
            - $ref: "#/components/schemas/UsdcValue"
        reportedMtmPnl:
          description: The profit/losses from the net price change since the last time the absolute quantity decreased. It is updated with every mark to market and is not updated during settlement or a position size increase
          allOf:
            - $ref: "#/components/schemas/UsdcValue"
        reportedFundingPnl:
          description: Sum of all funding payments received  since the position was opened. This is updated every time funding is paid.
          allOf:
            - $ref: "#/components/schemas/UsdcValue"
        realizedPnl:
          description: Total profits realized since the trading account first opened this position. This is only updated every time a position's absolute quantity (aka size) is reduced.
          allOf:
            - $ref: "#/components/schemas/UsdcValue"
        settlementAssetSymbol:
          description: Settlement Asset Symbol
          type: string
          example: "USDC"
        createdAtDatetime:
          description: Denotes the time the position was created by the exchange, ISO 8601 with millisecond as string
          allOf:
            - $ref: "#/components/schemas/DateTime"
        createdAtTimestamp:
          description: Denotes the time the position was created by the exchange, number of milliseconds since EPOCH
          allOf:
            - $ref: "#/components/schemas/TimeStampAsString"
        updatedAtDatetime:
          description: Denotes the time the position was updated by the exchange, ISO 8601 with millisecond as string
          allOf:
            - $ref: "#/components/schemas/DateTime"
        updatedAtTimestamp:
          description: Denotes the time the position was updated by the exchange, number of milliseconds since EPOCH
          allOf:
            - $ref: "#/components/schemas/TimeStampAsString"
        greeks:
          description: Position greeks
          allOf:
            - $ref: "#/components/schemas/PositionGreeks"
    DerivativesSettlementResponse:
      description: Derivatives Settlement of one market for the trading account
      type: object
      properties:
        tradingAccountId:
          allOf:
            - $ref: "#/components/schemas/TradingAccountId"
        symbol:
          example: "BTC-USDC-PERP"
          allOf:
            - $ref: "#/components/schemas/DatedFutureMarketSymbol"
        side:
          allOf:
            - $ref: "#/components/schemas/OrderSide"
        settlementQuantity:
          description: position size at the time of the settlement
          allOf:
            - $ref: "#/components/schemas/AssetValue"
        deltaTradingQuantity:
          description: the change in the position size from the account's trading activities
          allOf:
            - $ref: "#/components/schemas/AssetValue"
        mtmPnl:
          description: mark to market profit (losses) accumulated since the last settlement
          allOf:
            - $ref: "#/components/schemas/UsdcValue"
        fundingPnl:
          description: funding profits (losses) accumulated since the last settlement. Applicable for perpetuals only.
          allOf:
            - $ref: "#/components/schemas/UsdcValue"
        eventType:
          description: derivatives position update event types
          type: string
          example: "settlementUpdate"
        settlementMarkPrice:
          description: market price at which the position was settled for this past cycle
          allOf:
            - $ref: "#/components/schemas/UsdcValue"
        settlementIndexPrice:
          description: index price at which the position was settled for this past cycle
          allOf:
            - $ref: "#/components/schemas/UsdcValue"
        settlementFundingRate:
          description: funding rate at which the position was settled for this past cycle. Applicable for perpetuals only.
          type: string
          example: "10.0"
        settlementDatetime:
          description: Denotes the time the position was settled by the exchange, ISO 8601 with millisecond as string
          allOf:
            - $ref: "#/components/schemas/DateTime"
        settlementTimestamp:
          description: Denotes the time the position was settled by the exchange, number of milliseconds since EPOCH
          allOf:
            - $ref: "#/components/schemas/TimeStampAsString"
    SubAccountTransferResponse:
      description: Get account transfer history
      type: object
      properties:
        requestId:
          description: unique identifier of the transfer request
          type: string
          example: "1"
        toTradingAccountId:
          description: recipient's trading account
          allOf:
            - $ref: "#/components/schemas/TradingAccountId"
        fromTradingAccountId:
          description: sender's trading account
          type: string
          example: "121000000000001"
        assetSymbol:
          description: asset currency of the transfer
          allOf:
            - $ref: "#/components/schemas/AssetSymbol"
        quantity:
          description: transfer quantity
          allOf:
            - $ref: "#/components/schemas/AssetValue"
        status:
          description: transfer status [CLOSED/OPEN/REJECTED]
          type: string
          example: "CLOSED"
        statusReasonCode:
          description: status reason code
          type: string
          example: "6002"
        statusReason:
          description: readable status reason
          type: string
          example: "Executed"
        createdAtTimestamp:
          allOf:
            - $ref: "#/components/schemas/TimeStampAsString"
        createdAtDatetime:
          allOf:
            - $ref: "#/components/schemas/DateTime"
    SimulationPosition:
      type: object
      required:
        - symbol
        - quantity
      properties:
        symbol:
          description: asset or market symbol. E.g. `USDC` for asset and `BTCUSDC` for market
          type: string
          example: "BTC-USDC-PERP"
        quantity:
          description: size of the position
          type: string
          example: "1.0"

    SimulationOrder:
      type: object
      required:
        - symbol
        - quantity
      properties:
        symbol:
          allOf:
            - $ref: "#/components/schemas/MarketSymbol"
        quantity:
          description: quantity placed for order
          type: string
          example: "1.0"
        limitPrice:
          description: limit price for order
          type: string
          example: "10000.0"
        timeInForce:
          allOf:
            - $ref: "#/components/schemas/OrderTimeInForceAsString"
    ReferencePrice:
      type: object
      properties:
        symbol:
          description: asset or market symbol. E.g. `USDC` for asset and `BTCUSDC` for market
          type: string
          example: "BTC"
        price:
          description: reference price for asset or market
          type: string
          example: "12000.0"
    TradeFeeRate:
      type: object
      required:
        - feeGroupId
        - makerFee
        - takerFee
        - makerOtcFee
        - takerOtcFee
        - brokerFee
      properties:
        feeGroupId:
          type: integer
          description: Identifier for this particular fee tier
          example: 1
        makerFee:
          type: string
          description: Maker Fee in decimal value
          example: "0.00005000"
        takerFee:
          type: string
          description: Taker Fee in decimal value
          example: "0.00005000"
        makerOtcFee:
          type: string
          description: OTC Maker Fee in decimal value
          example: "0.00005000"
        takerOtcFee:
          type: string
          description: OTC Taker Fee in decimal value
          example: "0.00005000"
        brokerFee:
          type: string
          description: Fee charged for brokered OTC trade in decimal value
          example: "0.00005000"
        auctionFee:
          type: string
          description: Fee charged for auction trade in decimal value
          example: "0.00005000"
    PriceVolOffsetParams:
      type: object
      description: Parameters for adjusting prices and volatility in portfolio simulation
      properties:
        cryptoPriceMultipliers:
          type: object
          description: Symbol-specific price multipliers. When specified for a symbol, overrides the global multiplier
          additionalProperties:
            type: number
            format: double
          example:
            BTC: 1.2
            ETH: 0.9
        globalCryptoPriceMultiplier:
          type: number
          format: double
          description: Global price multiplier applied to all crypto assets (except stablecoins and symbols with explicit multipliers)
          default: 1.0
          example: 1.1
        volOffset:
          type: number
          format: double
          description: Offset to add to implied volatility for options pricing. Can be positive or negative
          default: 0.0
          example: 0.05
    PortfolioSimulationRequest:
      type: object
      required:
        - tradingAccountId
      properties:
        tradingAccountId:
          allOf:
            - $ref: "#/components/schemas/TradingAccountId"
        positions:
          type: array
          description: portfolio position to be used in simulation
          items:
            allOf:
              - $ref: "#/components/schemas/SimulationPosition"
        orders:
          type: array
          description: pending orders to be used in simulation
          items:
            allOf:
              - $ref: "#/components/schemas/SimulationOrder"
        referencePrices:
          type: array
          description: reference price to be used in simulation
          items:
            allOf:
              - $ref: "#/components/schemas/ReferencePrice"
        priceVolOffsetParams:
          description: optional parameters for price and volatility adjustments in simulation
          allOf:
            - $ref: "#/components/schemas/PriceVolOffsetParams"
    OptionLadderResponse:
      description: Option Ladder Response
      type: object
      properties:
        symbol:
          description: Symbol of the option market. For example `BTC-USDC-20241004-70000-C`
          allOf:
            - $ref: "#/components/schemas/OptionMarketSymbol"
        baseSymbol:
          description: Base symbol of the option market. For `BTC-USDC-20241004-70000-C`, it will be `BTC`
          allOf:
            - $ref: "#/components/schemas/AssetSymbol"
        settlementAssetSymbol:
          description: Asset used for Mark To Market settlement
          allOf:
            - $ref: "#/components/schemas/QuoteAssetSymbol"
        bidQuantity:
          description: Quantity of `bid`
          type: string
          example: "0.0"
        askQuantity:
          description: Quantity of `ask`
          type: string
          example: "0.0"
        bidIVPercentage:
          description: Implied volatility of the best bid price
          type: string
          example: "99.0"
        askIVPercentage:
          description: Implied volatility of the best ask price
          type: string
          example: "99.0"
        bid:
          description: Bid price in the order book
          type: string
          example: "90000.0000"
        ask:
          description: Ask price in the order book
          type: string
          example: "90000.0000"
        underlyingPrice:
          description: Index price of the base asset
          type: string
          example: "100000.0000"
        optionStrikePrice:
          description: Strike price of the option market
          type: string
          example: "90000"
        markPrice:
          description: Mark Price of the option market
          type: string
          example: "100.0000"
        quantity:
          description: Number of contracts outstanding
          type: string
          example: "1000"
        openInterest:
          description: Amount of outstanding contracts in the exchange
          type: string
          example: "0.11442400"
        openInterestUSD:
          description: USD value of outstanding contracts in the exchange
          type: string
          example: "1144240.0000"
        optionType:
          description: Specifies if it's a call (right to buy) or a put (right to sell)
          allOf:
            - $ref: "#/components/schemas/OptionType"
        expiryDatetime:
          allOf:
            - $ref: "#/components/schemas/DateTime"
        greeks:
          description: Option greeks
          allOf:
            - $ref: "#/components/schemas/OptionGreeks"

    OptionGreeks:
      description: Pricing parameters for option instruments. Only returned for option markets and omitted for spot and perpetual markets.
      type: object
      properties:
        delta:
          description: Sensitivity of an option's price to a $1 change in the price of the underlying asset. Only present for option markets.
          type: string
          example: "0.98"
        gamma:
          description: Rate of change of Delta with respect to a $1 change in the underlying asset's price. Only present for option markets.
          type: string
          example: "0.98"
        theta:
          description: The rate at which an option's price decreases as it approaches its expiration date. Only present for option markets.
          type: string
          example: "-0.17"
        vega:
          description: Sensitivity of an option's price to a 1% change in the implied volatility of the underlying asset. Only present for option markets.
          type: string
          example: "0.05"
    PositionGreeks:
      description: Position greeks for derivative instruments
      type: object
      properties:
        delta:
          description: The sensitivity of the portfolio's value to a change in the underlying price, expressed in the base asset (e.g., BTC, ETH)
          type: string
          example: "0.98000000"
        gamma:
          description: The rate of change in Delta per 1 USDC move in the underlying price, expressed in the base asset
          type: string
          example: "0.01000000"
        theta:
          description: The rate at which the portfolio's value changes as it approaches expiration, expressed in $/day
          type: string
          example: "-0.1700"
        vega:
          description: The change in portfolio value for a 1% (percentage point) absolute change in implied volatility, expressed in dollars ($)
          type: string
          example: "0.0500"
    PortfolioSimulationResponse:
      description: Simulation result
      type: object
      properties:
        collateralUSD:
          description: total collateral across all assets in this trading account displayed in the reference asset in USD
          type: string
          example: "13000.0000"
        borrowedUSD:
          description: total borrowed across all assets in this trading account displayed in the reference asset in USD
          type: string
          example: "12000.0000"
        initialMarginUSD:
          description: The minimum margin one must maintain in order to be able to purposefully increase risk
          type: string
          example: "14000.0000"
        warningMarginUSD:
          description: The minimum margin when the customer will receive warning via email/notifications over UI
          type: string
          example: "15000.0000"
        liquidationMarginUSD:
          description: The minimum value of margin one must maintain in order to avoid liquidation
          type: string
          example: "16000.0000"
        fullLiquidationMarginUSD:
          description: The value of margin when full liquidation occurs
          type: string
          example: "17000.0000"
        defaultedMarginUSD:
          description: The value of margin when this trading account will be moved into a Defaulted state
          type: string
          example: "18000.0000"
        liquidityAddonUSD:
          description: expected market impact of unwinding the portfolio in the case of a liquidation event
          type: string
          example: "19000.0000"
        marketRiskUSD:
          description: the worst possible loss on the portfolio based on scenario analysis
          type: string
          example: "20000.0000"
    FundingRateHistoryResponse:
      description: Hourly Funding Rate History of one market
      type: array
      items:
        type: object
        properties:
          fundingRate:
            description: funding rate for this hour
            type: string
            example: "0.1"
          updatedAtDatetime:
            description: date time of the last funding rate update for the hour
            type: string
            example: "2024-09-16T12:59:59.000Z"
    CreateOtcTradeCommand:
      type: object
      description: A command with details to an OTC trade
      required:
        - commandType
        - sharedMatchKey
        - tradingAccountId
        - isTaker
        - trades
      properties:
        commandType:
          type: string
          description: Specifies the command type and must be ‘V1CreateOtcTrade' to indicate the submission of an OTC trade.
        clientOtcTradeId:
          $ref: "#/components/schemas/ClientOtcTradeId"
        sharedMatchKey:
          $ref: "#/components/schemas/SharedMatchKey"
        tradingAccountId:
          $ref: "#/components/schemas/TradingAccountId"
        isTaker:
          description: denotes whether the role of the counterparty is Taker or Maker. The corresponding leg of the opposite side of the trade should have the inverse role to be successfully matched on the OTC Clearing Facility
          allOf:
            - $ref: "#/components/schemas/Boolean"
        remarks:
          $ref: "#/components/schemas/Remarks"
        trades:
          type: array
          nullable: false
          description: all trades for the OTC trade
          items:
            $ref: "#/components/schemas/TradeInOtcRequest"
      example:
        commandType: V1CreateOtcTrade
        clientOtcTradeId: "20050900225"
        sharedMatchKey: cfBtcXrpMatch001
        tradingAccountId: "111000000000001"
        isTaker: true
        remarks: "first otc trade with xyz client"
        trades:
          - symbol: BTC-USDC-PERP
            side: BUY
            price: "98213.0000"
            quantity: "1.50000000"
          - symbol: XRP-USDC-PERP
            side: SELL
            price: "2.6600"
            quantity: "50.000000"
    TradeInOtcRequest:
      description: A trade of an OTC trade
      required:
        - symbol
        - price
        - quantity
        - side
      properties:
        symbol:
          $ref: "#/components/schemas/OtcMarketSymbol"
        price:
          description: price, see [asset value](/rest/general/price-quantity-precision) format
          allOf:
            - $ref: "#/components/schemas/AssetValue"
        quantity:
          description: quantity, see [ asset value ](/rest/general/price-quantity-precision) format
          allOf:
            - $ref: "#/components/schemas/AssetValue"
        side:
          $ref: "#/components/schemas/TradeSideAsString"
    OtcTradeView:
      type: object
      required:
        - otcTradeId
        - sharedMatchKey
        - status
        - statusReason
        - statusReasonCode
        - createdAtDatetime
        - createdAtTimestamp
        - expireDatetime
        - expireTimestamp
        - trades
      properties:
        otcTradeId:
          allOf:
            - $ref: "#/components/schemas/OtcTradeId"
        clientOtcTradeId:
          allOf:
            - $ref: "#/components/schemas/ClientOtcTradeId"
        tradingAccountId:
          allOf:
            - $ref: "#/components/schemas/TradingAccountId"
        tradingAccountNickname:
          description: nickname of the trading account (only for brokered trades)
          type: string
          example: "my-trading-account"
        sharedMatchKey:
          allOf:
            - $ref: "#/components/schemas/SharedMatchKey"
        status:
          allOf:
            - $ref: "#/components/schemas/OtcTradeExternalStatus"
          example: "MATCHED"
        statusReason:
          description: status reason, describes why the otc trade is in a specific state
          type: string
          example: "Ok"
        statusReasonCode:
          description: status reason code, see [details](/rest/general/error-rejection-codes)
          type: string
          example: "1002"
        createdAtDatetime:
          description: denotes the time the otc trade was ACK'd by the exchange, ISO 8601 with millisecond as string
          allOf:
            - $ref: "#/components/schemas/DateTime"
        createdAtTimestamp:
          description: denotes the time the otc trade was ACK'd by the exchange
          allOf:
            - $ref: "#/components/schemas/TimeStampAsString"
        expireDatetime:
          description: denotes the time the otc trade would expire, ISO 8601 with millisecond as string
          allOf:
            - $ref: "#/components/schemas/DateTime"
        expireTimestamp:
          description: denotes the time the otc trade would expire
          allOf:
            - $ref: "#/components/schemas/TimeStampAsString"
        remarks:
          $ref: "#/components/schemas/Remarks"
        brokeredBy:
          $ref: "#/components/schemas/IdbShortCode"
        trades:
          type: array
          minItems: 0
          maxItems: 25
          nullable: false
          description: all trades for the OTC trade
          items:
            allOf:
              - $ref: "#/components/schemas/OtcTradeLegView"
    OtcTradeLegView:
      description: a trade of an OTC trade
      required:
        - symbol
        - price
        - quantity
        - side
        - isTaker
      properties:
        tradeId:
          description: unique trade ID
          allOf:
            - $ref: "#/components/schemas/TradeID"
        symbol:
          $ref: "#/components/schemas/OtcMarketSymbol"
        price:
          description: price, see [asset value](/rest/general/price-quantity-precision) format
          allOf:
            - $ref: "#/components/schemas/AssetValue"
        quantity:
          description: quantity, see [asset value](/rest/general/price-quantity-precision) format
          allOf:
            - $ref: "#/components/schemas/AssetValue"
        quoteAmount:
          description: notional value of the trade in quote or settlement asset, see [asset value](/rest/general/price-quantity-precision) format
          allOf:
            - $ref: "#/components/schemas/AssetValue"
        baseFee:
          description: base fee, see [asset value](/rest/general/price-quantity-precision) format
          allOf:
            - $ref: "#/components/schemas/AssetValue"
        quoteFee:
          description: quote fee, see [asset value](/rest/general/price-quantity-precision) format
          allOf:
            - $ref: "#/components/schemas/AssetValue"
        tradeRebateAssetSymbol:
          $ref: "#/components/schemas/OtcMarketSymbol"
        tradeRebateAmount:
          description: trade rebate fee, see [ asset value ](/rest/general/price-quantity-precision) format
          allOf:
            - $ref: "#/components/schemas/AssetValue"
        side:
          allOf:
            - $ref: "#/components/schemas/TradeSideAsString"
          example: "BUY"
        isTaker:
          description: denotes whether the role of the counterparty is Taker or Maker. The corresponding leg of the opposite side of the trade should have the inverse role to be successfully matched on the OTC Clearing Facility
          allOf:
            - $ref: "#/components/schemas/Boolean"
        createdAtDatetime:
          description: denotes the time the trade was executed by the exchange, ISO 8601 with millisecond as string
          allOf:
            - $ref: "#/components/schemas/DateTime"
        createdAtTimestamp:
          description: denotes the time the trade was executed by the exchange
          allOf:
            - $ref: "#/components/schemas/TimeStampAsString"
    UnconfirmedOtcTradeView:
      type: object
      description: An unconfirmed OTC trade for booking.
      required:
        - sharedMatchKey
        - isTaker
        - createdAtDatetime
        - createdAtTimestamp
        - expireDatetime
        - expireTimestamp
        - trades
      properties:
        sharedMatchKey:
          $ref: "#/components/schemas/SharedMatchKey"
        isTaker:
          description: denotes your role as the counterparty to the initiator
          allOf:
            - $ref: "#/components/schemas/Boolean"
        createdAtDatetime:
          description: denotes the time the otc trade was ACK'd by the exchange, ISO 8601 with millisecond as string
          allOf:
            - $ref: "#/components/schemas/DateTime"
        createdAtTimestamp:
          description: denotes the time the otc trade was ACK'd by the exchange
          allOf:
            - $ref: "#/components/schemas/TimeStampAsString"
        expireDatetime:
          description: denotes the time the otc trade would expire, ISO 8601 with millisecond as string
          allOf:
            - $ref: "#/components/schemas/DateTime"
        expireTimestamp:
          description: denotes the time the otc trade would expire
          allOf:
            - $ref: "#/components/schemas/TimeStampAsString"
        trades:
          type: array
          nullable: false
          description: all trades for the OTC trade
          items:
            $ref: "#/components/schemas/TradeInOtcRequest"
    CreateOtcTradeResponse:
      description: A response for an acknowledged OTC trade creation request
      required:
        - message
        - requestId
        - otcTradeId
        - sharedMatchKey
      properties:
        message:
          type: string
          description: message indicating the status of the request
          example: Command acknowledged - CreateOtcTrade
        requestId:
          $ref: "#/components/schemas/RequestID"
        otcTradeId:
          $ref: "#/components/schemas/OtcTradeId"
        clientOtcTradeId:
          $ref: "#/components/schemas/ClientOtcTradeId"
        sharedMatchKey:
          $ref: "#/components/schemas/SharedMatchKey"
    ApproveOtcTradeCommand:
      type: object
      description: A command to approve an OTC trade. Only one of `clientOtcTradeId` or `otcTradeId` can be used in the approve OTC trade command
      required:
        - commandType
        - tradingAccountId
      properties:
        commandType:
          type: string
          description: Specifies the command type and must be 'V1ApproveOtcTrade' to indicate the approval of an OTC trade.
        tradingAccountId:
          $ref: "#/components/schemas/TradingAccountId"
        otcTradeId:
          $ref: "#/components/schemas/OtcTradeId"
        clientOtcTradeId:
          $ref: "#/components/schemas/ClientOtcTradeId"
      example:
        commandType: V1ApproveOtcTrade
        otcTradeId: "200000000000000098"
        tradingAccountId: "111000000000001"
    ApproveOtcTradeResponse:
      description: A response for an acknowledged OTC command to approve an OTC trade
      required:
        - message
        - requestId
        - otcTradeId
        - tradingAccountId
      properties:
        message:
          type: string
          description: message indicating the status of the request
          example: Command acknowledged - ApproveOtcTrade
        requestId:
          $ref: "#/components/schemas/RequestID"
        otcTradeId:
          $ref: "#/components/schemas/OtcTradeId"
        clientOtcTradeId:
          $ref: "#/components/schemas/ClientOtcTradeId"
        tradingAccountId:
          $ref: "#/components/schemas/TradingAccountId"
      example:
        message: Command acknowledged - ApproveOtcTrade
        requestId: "100000000000000149"
        otcTradeId: "200000000000000098"
        tradingAccountId: "111000000000001"
    CancelOtcTradeCommand:
      type: object
      description: A command to cancel an OTC trade. Only one of `clientOtcTradeId` or `otcTradeId` can be used in the cancel OTC trade command
      required:
        - commandType
        - tradingAccountId
      properties:
        commandType:
          type: string
          description: Specifies the command type and must be ‘V1CancelOtcTrade' to indicate the cancellation of an OTC trade.
          enum:
            - V1CancelOtcTrade
        otcTradeId:
          $ref: "#/components/schemas/OtcTradeId"
        clientOtcTradeId:
          $ref: "#/components/schemas/ClientOtcTradeId"
        tradingAccountId:
          $ref: "#/components/schemas/TradingAccountId"
      example:
        commandType: V1CancelOtcTrade
        clientOtcTradeId: "20050900225"
        tradingAccountId: "111000000000001"
    CancelOtcTradeResponse:
      description: A response for an acknowledged OTC command to cancel an OTC trade
      required:
        - message
        - requestId
        - otcTradeId
        - tradingAccountId
      properties:
        message:
          type: string
          description: message indicating the status of the request
          example: Command acknowledged - CancelOtcTrade
        requestId:
          $ref: "#/components/schemas/RequestID"
        otcTradeId:
          $ref: "#/components/schemas/OtcTradeId"
        clientOtcTradeId:
          $ref: "#/components/schemas/ClientOtcTradeId"
        tradingAccountId:
          $ref: "#/components/schemas/TradingAccountId"
      example:
        message: Command acknowledged - CancelOtcTrade
        requestId: "100000000000000147"
        otcTradeId: "200000000000000098"
        tradingAccountId: "111000000000001"
    CancelAllOtcTradesCommand:
      type: object
      description: A command to cancel all pending OTC trades.
      required:
        - commandType
        - tradingAccountId
      properties:
        commandType:
          type: string
          description: Specifies the command type and must be ‘V1CancelAllOtcTrades' to indicate the cancellation of all pending OTC trades.
          enum:
            - V1CancelAllOtcTrades
        tradingAccountId:
          $ref: "#/components/schemas/TradingAccountId"
      example:
        commandType: V1CancelAllOtcTrades
        tradingAccountId: "111000000000001"
    CancelAllOtcTradesResponse:
      description: A response for an acknowledged OTC command to cancel all pending OTC trades
      required:
        - message
        - requestId
        - tradingAccountId
      properties:
        message:
          type: string
          description: message indicating the status of the request
          example: Command acknowledged - CancelOtcTrade
        requestId:
          $ref: "#/components/schemas/RequestID"
        tradingAccountId:
          $ref: "#/components/schemas/TradingAccountId"
      example:
        message: Command acknowledged - CancelAllOtcTrades
        requestId: "100000000000000148"
        tradingAccountId: "111000000000001"
    BadOtcTradeEntryResponse:
      type: object
      required:
        - message
        - errorCode
        - errorCodeName
      properties:
        message:
          description: message
          type: string
        errorCode:
          description: unique error code
          type: integer
        errorCodeName:
          description: unique error code name
          type: string
    OtcMarketSymbol:
      type: string
      description: market symbol. E.g. `BTC-USDC-PERP` for PERPETUAL market `BTC-USDC-20250613` for DATEDFUTURE market and `BTC-USDC-20250613-100000-C` for OPTION market
      example: BTC-USDC-PERP
    SharedMatchKey:
      type: string
      description: Unique shared key that is agreed between the two customers to represent their OTC trade to be matched on Bullish's OTC Clearing Facility. Must be a 12 to 64 characters alphanumeric value
      example: cfBtcXrpMatch001
    TradeSideAsString:
      type: string
      description: trade side can have the following string values `BUY`, `SELL`
      example: BUY
    OtcMatchId:
      type: string
      description: unique numeric (i64) identifier generated on Bullish side expressed as a string value
      example: "15"
    ClientOtcTradeId:
      type: string
      description: unique numeric (i64) identifier generated on the client side expressed as a string value
      example: "20050900225"
    OtcTradeId:
      type: string
      description: unique numeric (i64) identifier generated on Bullish side expressed as a string value
      example: "200000000000000098"
    OtcTradeExternalStatus:
      type: string
      description: OTC trade status
      enum:
        - APPROVAL_PENDING
        - COUNTERPARTY_PENDING
        - COUNTERPARTY_PAIRED
        - RISK_PENDING
        - MATCHED
        - CANCELLED
        - REJECTED
      x-enumDescriptions:
        APPROVAL_PENDING: Pending authorization from the customer in an IDB flow
        COUNTERPARTY_PENDING: Pending counterparty trade submission
        COUNTERPARTY_PAIRED: Both sides of the trade have been paired and are pending system processing
        RISK_PENDING: Trade is undergoing risk and margin checks
        MATCHED: Trade is successfully executed
        CANCELLED: The trade was manually retracted by the user, counterparty, or broker
        REJECTED: The trade failed system validation or encountered a system error
      example: MATCHED
    Remarks:
      type: string
      description: text field for client's internal reference to a trade, max length is 255 characters
      example: "first otc trade with xyz client"
    IdbShortCode:
      type: string
      description: broker short code
      example: "IDB_A"
    DelegatedTradingAccountNickname:
      description: nickname assigned for this account
      type: string
      example: "Alpha Traders Primary"
    DelegatedApprovalMethod:
      description: |
        The default execution workflow for this IDB-Client pair:
        - STRAIGHT_THROUGH: Trades are processed automatically
        - APPROVAL_REQUIRED: Every trade requires manual authorization from the client
      type: string
      enum:
        - STRAIGHT_THROUGH
        - APPROVAL_REQUIRED
      example: "APPROVAL_REQUIRED"
    DelegatedInstitutionName:
      description: legal name of the institution that owns the delegated trading account
      type: string
      example: "Alpha Traders"
    DelegatedInstitutionRegistrationNumber:
      description: |
        registration number of the institution that owns the delegated trading account.
        Nullable and omitted from the response when the institution has no registration number.
      type: string
      nullable: true
      example: "87654321"
    IdbRemarks:
      type: string
      description: text field for IDB's internal reference to a trade, max length is 255 characters
      example: "otc trades between abc and xyz client"
    BrokeredTradeSide:
      type: object
      required:
        - tradingAccountId
      properties:
        tradingAccountId:
          allOf:
            - $ref: "#/components/schemas/TradingAccountId"
        remarks:
          $ref: "#/components/schemas/Remarks"
    IdbRequestItem:
      type: object
      properties:
        requestId:
          type: string
          description: unique request ID
          allOf:
            - $ref: "#/components/schemas/RequestID"
        otcTradeId:
          $ref: "#/components/schemas/OtcTradeId"
    IdbDelegatedAccountView:
      type: object
      description: Details of delegated accounts from the broker perspective.
      required:
        - institutionName
        - tradingAccountId
        - tradingAccountNickname
        - approvalMethod
      properties:
        institutionName:
          $ref: "#/components/schemas/DelegatedInstitutionName"
        institutionRegistrationNumber:
          $ref: "#/components/schemas/DelegatedInstitutionRegistrationNumber"
        tradingAccountId:
          $ref: "#/components/schemas/TradingAccountId"
        tradingAccountNickname:
          $ref: "#/components/schemas/DelegatedTradingAccountNickname"
        approvalMethod:
          $ref: "#/components/schemas/DelegatedApprovalMethod"
    IdbCreateOtcTradeCommand:
      type: object
      description: A single command with details for both the maker and taker legs of a brokered OTC trade
      required:
        - commandType
        - maker
        - taker
        - trades
      properties:
        commandType:
          type: string
          description: Specifies the command type and must be 'V1IdbCreateOtcTrade' to indicate the submission of an OTC trade
        idbRemarks:
          $ref: "#/components/schemas/IdbRemarks"
        maker:
          $ref: "#/components/schemas/BrokeredTradeSide"
        taker:
          $ref: "#/components/schemas/BrokeredTradeSide"
        trades:
          type: array
          nullable: false
          description: all trades for the OTC trade, submitted from the maker's perspective
          items:
            $ref: "#/components/schemas/TradeInOtcRequest"
      example:
        commandType: V1IdbCreateOtcTrade
        idbRemarks: "otc trades between abc and xyz client"
        maker:
          tradingAccountId: "111000000000001"
          remarks: "confirmed over the phone"
        taker:
          tradingAccountId: "111000000000002"
        trades:
          - symbol: BTC-USDC-PERP
            side: BUY
            price: "98213.0000"
            quantity: "1.50000000"
          - symbol: XRP-USDC-PERP
            side: SELL
            price: "2.6600"
            quantity: "50.000000"
    IdbCreateOtcTradeResponse:
      description: A response for an acknowledged dual-sided brokered OTC trade creation request
      required:
        - message
        - sharedMatchKey
        - maker
        - taker
      properties:
        message:
          type: string
          description: message indicating the status of the request
          example: Command acknowledged - IdbCreateOtcTrade
        sharedMatchKey:
          type: string
          description: system-generated unique identifier for the dual-sided brokered OTC trade
          example: a40d0c302d0448ce8e144c8312dd6ef0
        maker:
          $ref: "#/components/schemas/IdbRequestItem"
        taker:
          $ref: "#/components/schemas/IdbRequestItem"
      example:
        message: Command acknowledged - IdbCreateOtcTrade
        sharedMatchKey: "a40d0c302d0448ce8e144c8312dd6ef0"
        maker:
          requestId: "100000000000000147"
          otcTradeId: "200000000000000098"
        taker:
          requestId: "100000000000000148"
          otcTradeId: "200000000000000099"
    IdbOtcTradeView:
      type: object
      required:
        - otcTradeId
        - sharedMatchKey
        - tradingAccountId
        - tradingAccountNickname
        - institutionName
        - status
        - statusReason
        - statusReasonCode
        - createdAtDatetime
        - createdAtTimestamp
        - expireDatetime
        - expireTimestamp
        - trades
        - brokeredBy
      properties:
        otcTradeId:
          allOf:
            - $ref: "#/components/schemas/OtcTradeId"
        institutionName:
          $ref: "#/components/schemas/DelegatedInstitutionName"
        tradingAccountId:
          $ref: "#/components/schemas/TradingAccountId"
        tradingAccountNickname:
          $ref: "#/components/schemas/DelegatedTradingAccountNickname"
        sharedMatchKey:
          allOf:
            - $ref: "#/components/schemas/SharedMatchKey"
        status:
          allOf:
            - $ref: "#/components/schemas/OtcTradeExternalStatus"
          example: "MATCHED"
        statusReason:
          description: status reason, why the trade is in a specific state, see [details](/rest/error-rejection-codes)
          type: string
          example: "Ok"
        statusReasonCode:
          description: status reason code, see [details](/rest/error-rejection-codes)
          type: string
          example: "1002"
        createdAtDatetime:
          description: denotes the time the otc trade was ACK'd by the exchange, ISO 8601 with millisecond as string
          allOf:
            - $ref: "#/components/schemas/DateTime"
        createdAtTimestamp:
          description: denotes the time the otc trade was ACK'd by the exchange
          allOf:
            - $ref: "#/components/schemas/TimeStampAsString"
        expireDatetime:
          description: denotes the time the otc trade would expire, ISO 8601 with millisecond as string
          allOf:
            - $ref: "#/components/schemas/DateTime"
        expireTimestamp:
          description: denotes the time the otc trade would expire
          allOf:
            - $ref: "#/components/schemas/TimeStampAsString"
        remarks:
          $ref: "#/components/schemas/Remarks"
        idbRemarks:
          $ref: "#/components/schemas/IdbRemarks"
        trades:
          type: array
          minItems: 0
          maxItems: 25
          nullable: false
          description: all trades for the OTC trade
          items:
            allOf:
              - $ref: "#/components/schemas/IdbOtcTradeLegView"
        brokeredBy:
          $ref: "#/components/schemas/IdbShortCode"
    IdbOtcTradeLegView:
      description: a trade leg of a brokered OTC trade
      required:
        - symbol
        - price
        - quantity
        - side
        - isTaker
      properties:
        tradeId:
          description: unique trade ID
          allOf:
            - $ref: "#/components/schemas/TradeID"
        symbol:
          $ref: "#/components/schemas/OtcMarketSymbol"
        price:
          description: price, see [asset value](/rest/general/price-quantity-precision) format
          allOf:
            - $ref: "#/components/schemas/AssetValue"
        quantity:
          description: quantity, see [asset value](/rest/general/price-quantity-precision) format
          allOf:
            - $ref: "#/components/schemas/AssetValue"
        quoteAmount:
          description: notional value of the trade in quote or settlement asset, see [asset value](/rest/general/price-quantity-precision) format
          allOf:
            - $ref: "#/components/schemas/AssetValue"
        baseFee:
          description: base fee, see [asset value](/rest/general/price-quantity-precision) format
          allOf:
            - $ref: "#/components/schemas/AssetValue"
        quoteFee:
          description: quote fee, see [asset value](/rest/general/price-quantity-precision) format
          allOf:
            - $ref: "#/components/schemas/AssetValue"
        side:
          $ref: "#/components/schemas/TradeSideAsString"
        isTaker:
          description: denotes whether the role of the counterparty is Taker or Maker. The corresponding leg of the opposite side of the trade should have the inverse role to be successfully matched on the OTC Clearing Facility
          allOf:
            - $ref: "#/components/schemas/Boolean"
        createdAtDatetime:
          description: denotes the time the trade was executed by the exchange, ISO 8601 with millisecond as string
          allOf:
            - $ref: "#/components/schemas/DateTime"
        createdAtTimestamp:
          description: denotes the time the trade was executed by the exchange
          allOf:
            - $ref: "#/components/schemas/TimeStampAsString"
    IdbCancelOtcTradeCommand:
      type: object
      description: A command to cancel a dual-sided OTC trade using `sharedMatchKey`
      required:
        - commandType
        - sharedMatchKey
      properties:
        commandType:
          type: string
          description: Specifies the command type and must be 'V1IdbCancelOtcTrade' to indicate the cancellation of a dual-sided OTC trade.
        sharedMatchKey:
          $ref: "#/components/schemas/SharedMatchKey"
        idbRemarks:
          $ref: "#/components/schemas/IdbRemarks"
      example:
        commandType: V1IdbCancelOtcTrade
        sharedMatchKey: "a40d0c302d0448ce8e144c8312dd6ef0"
        idbRemarks: "Cancelled per client request via Bloomberg chat"
    IdbCancelOtcTradeResponse:
      description: A response for an acknowledged OTC command to cancel a dual-sided OTC trade
      required:
        - message
        - sharedMatchKey
        - maker
        - taker
      properties:
        message:
          type: string
          description: message indicating the status of the request
          example: Command acknowledged - IdbCancelOtcTrade
        sharedMatchKey:
          type: string
          description: system-generated unique identifier for the dual-sided brokered OTC trade
          example: a40d0c302d0448ce8e144c8312dd6ef0
        maker:
          $ref: "#/components/schemas/IdbRequestItem"
        taker:
          $ref: "#/components/schemas/IdbRequestItem"
      example:
        message: Command acknowledged - IdbCancelOtcTrade
        sharedMatchKey: "a40d0c302d0448ce8e144c8312dd6ef0"
        maker:
          requestId: "100000000000000147"
          otcTradeId: "200000000000000098"
        taker:
          requestId: "100000000000000148"
          otcTradeId: "200000000000000099"
    IdbUpdateRemarksCommand:
      type: object
      description: A command to update IDB remarks of a dual-sided OTC trade using `sharedMatchKey`
      required:
        - commandType
        - sharedMatchKey
        - idbRemarks
      properties:
        commandType:
          type: string
          description: Specifies the command type and must be 'V1IdbUpdateRemarks' to indicate the update of IDB remarks for a dual-sided OTC trade
        sharedMatchKey:
          $ref: "#/components/schemas/SharedMatchKey"
        idbRemarks:
          $ref: "#/components/schemas/IdbRemarks"
      example:
        commandType: "V1IdbUpdateRemarks"
        sharedMatchKey: "a40d0c302d0448ce8e144c8312dd6ef0"
        idbRemarks: "resubmitted by xyz"
    IdbUpdateRemarksResponse:
      description: A response for an acknowledged OTC command to update IDB remarks of a dual-sided OTC trade
      required:
        - message
        - sharedMatchKey
        - maker
        - taker
      properties:
        message:
          type: string
          description: message indicating the status of the request
          example: Command acknowledged - IdbUpdateRemarks
        sharedMatchKey:
          type: string
          description: system-generated unique identifier for the dual-sided brokered OTC trade
          example: a40d0c302d0448ce8e144c8312dd6ef0
        maker:
          $ref: "#/components/schemas/IdbRequestItem"
        taker:
          $ref: "#/components/schemas/IdbRequestItem"
      example:
        message: Command acknowledged - IdbUpdateRemarks
        sharedMatchKey: "a40d0c302d0448ce8e144c8312dd6ef0"
        maker:
          requestId: "100000000000000147"
          otcTradeId: "200000000000000098"
        taker:
          requestId: "100000000000000148"
          otcTradeId: "200000000000000099"
    GetMmpConfigurationResponse:
      type: object
      required:
        - tradingAccountId
        - message
        - mmpConfigurations
      properties:
        tradingAccountId:
          allOf:
            - $ref: "#/components/schemas/TradingAccountId"
        message:
          description: If there are no market maker protection configurations setup for this trading account or for the provided optional symbol under the same trading account, this field will be returned as "No mmp config setup".
          type: string
          example: "No mmp config setup"
        mmpConfigurations:
          description: A list of market maker protection configurations that the user has setup for each underlying asset symbol under the trading account provided. Supports filtering of symbol.
          type: array
          minItems: 0
          items:
            $ref: "#/components/schemas/MmpConfiguration"
    MmpConfiguration:
      type: object
      required:
        - underlyingAssetSymbol
        - windowTimeInSeconds
        - frozenTimeInSeconds
        - quantityLimit
        - deltaLimit
        - isActive
      properties:
        underlyingAssetSymbol:
          type: string
          description: Underlying Asset Symbol
          example: "BTC"
        windowTimeInSeconds:
          type: integer
          description: Time window during which the MMP checks are conducted. It helps in determining how frequently the system evaluates the market maker's activity against predefined thresholds. Value needs to be `> 0`. Maximum value is 600 seconds (10 minutes).
          example: 60
        frozenTimeInSeconds:
          type: integer
          description: The duration for which a market maker's trading activity is temporarily halted after a protective measure is triggered. Value needs to be `>= 0`. Maximum value is 3600 seconds (60 minutes).
          example: 120
        quantityLimit:
          type: string
          description: Cap on the total number of contracts that a market maker can trade within `windowTimeInSeconds`. This is direction(side) agnostic. Needs to be `> 0` if set.
          example: "100"
        deltaLimit:
          type: string
          description: Net delta exposure that a market maker can accumulate within `windowTimeInSeconds`
          example: "10"
        isActive:
          type: boolean
          description: This boolean indicates if this configuration is in effect or not.
          example: true
    MarketExpiryPriceResponse:
      type: object
      required:
        - symbol
        - expiryPrice
        - expiryNotional
        - expiryDatetime
        - expiryTimestamp
      properties:
        symbol:
          type: string
          description: Market Symbol
          example: "BTC-USDC-20250912-95000-C"
        expiryPrice:
          type: string
          description: Price used upon Expiry for an Options/Dated Futures contract
          example: "115123.2512"
        expiryNotional:
          type: string
          description: Difference between strike price and expiry price for an Options contract expressed in notional per unit contract
          example: "20123.3033"
        expiryDatetime:
          type: string
          description: Datetime by which the market expires at
          example: "2018-11-18T00:00:00.000Z"
        expiryTimestamp:
          type: string
          description: Timestamp by which the market expires at
          example: "1672041600000"
  examples:
    CreateLimitOrderCommand:
      value:
        commandType: "V3CreateOrder"
        clientOrderId: "1234"
        symbol:
          $ref: "#/components/schemas/MarketSymbol/example"
        type: "LIMIT"
        side: "BUY"
        price: "31000.1"
        quantity: "1.1"
        timeInForce: "GTC"
        allowBorrow: true
        tradingAccountId:
          $ref: "#/components/schemas/TradingAccountId/example"
    CreateMarketOrderCommand:
      value:
        commandType: "V3CreateOrder"
        clientOrderId: "1234"
        symbol:
          $ref: "#/components/schemas/MarketSymbol/example"
        type: "MARKET"
        side: "BUY"
        quantity: "1.1"
        timeInForce: "GTC"
        allowBorrow: true
        tradingAccountId:
          $ref: "#/components/schemas/TradingAccountId/example"
    CreateStopLimitOrderCommand:
      value:
        commandType: "V3CreateOrder"
        symbol:
          $ref: "#/components/schemas/MarketSymbol/example"
        type: "STOP_LIMIT"
        side: "BUY"
        price: "31000.1"
        stopPrice: "31000.8"
        quantity: "1.1"
        timeInForce: "GTC"
        tradingAccountId:
          $ref: "#/components/schemas/TradingAccountId/example"
    CreatePostOnlyOrderCommand:
      value:
        commandType: "V3CreateOrder"
        clientOrderId: "1234"
        symbol:
          $ref: "#/components/schemas/MarketSymbol/example"
        type: "POST_ONLY"
        side: "BUY"
        price: "31000.1"
        quantity: "1.1"
        timeInForce: "GTC"
        allowBorrow: true
        tradingAccountId:
          $ref: "#/components/schemas/TradingAccountId/example"
    SetMMPCommandV1:
      value:
        $ref: "#/components/schemas/SetMMPCommandV1/example"
    ResetMMPCommandV1:
      value:
        $ref: "#/components/schemas/ResetMMPCommandV1/example"
    SetMMPCommandResponse:
      value:
        $ref: "#/components/schemas/SetMMPCommandResponse/example"
    ResetMMPCommandResponse:
      value:
        $ref: "#/components/schemas/ResetMMPCommandResponse/example"
    CreateAMMInstructionCommand:
      value:
        $ref: "#/components/schemas/CreateAMMInstructionCommandV3/example"
    CancelOrderCommand:
      description: Only one of `orderId` or `clientOrderId` can be used in the cancel order command
      value:
        $ref: "#/components/schemas/CancelOrderCommandV3/example"
    CancelAllOrdersCommand:
      value:
        $ref: "#/components/schemas/CancelAllOrdersCommand/example"
    CancelAllOrdersByMarketCommand:
      value:
        $ref: "#/components/schemas/CancelAllOrdersByMarketCommand/example"
    DelayedCancelAllOrdersCommand:
      value:
        $ref: "#/components/schemas/DelayedCancelAllOrdersCommand/example"
    UnsetDelayedCancelAllOrdersCommand:
      value:
        $ref: "#/components/schemas/UnsetDelayedCancelAllOrdersCommand/example"
    AmendOrderCommand:
      value:
        $ref: "#/components/schemas/AmendOrderCommandV1/example"
    TerminateAMMInstructionCommand:
      value:
        $ref: "#/components/schemas/TerminateAMMInstructionCommandV3/example"
    TransferAssetCommand:
      value:
        $ref: "#/components/schemas/TransferAssetCommandV2/example"
    AmendOrderCommandResponse:
      value:
        $ref: "#/components/schemas/AmendOrderCommandResponseV1/example"
    CancelOrderCommandResponse:
      description: Only one of `orderId` or `clientOrderId` present
      value:
        $ref: "#/components/schemas/CancelOrderCommandResponseV3/example"
    CancelAllOrdersCommandResponse:
      value:
        $ref: "#/components/schemas/CancelAllOrdersCommandResponse/example"
    CancelAllOrdersByMarketCommandResponse:
      value:
        $ref: "#/components/schemas/CancelAllOrdersByMarketResponse/example"
    DelayedCancelAllOrdersCommandResponse:
      value:
        $ref: "#/components/schemas/DelayedCancelAllOrdersResponse/example"
    UnsetDelayedCancelAllOrdersCommandResponse:
      value:
        $ref: "#/components/schemas/UnsetDelayedCancelAllOrdersResponse/example"
    CreateAMMInstructionCommandResponse:
      value:
        $ref: "#/components/schemas/CreateAMMInstructionCommandResponseV3/example"
    TerminateAMMInstructionCommandResponse:
      value:
        $ref: "#/components/schemas/TerminateAMMInstructionCommandResponseV3/example"
    TransferAssetCommandResponse:
      value:
        $ref: "#/components/schemas/TradingAccountTransferResponse/example"
    ApproveOtcTradeCommand:
      value:
        $ref: "#/components/schemas/ApproveOtcTradeCommand/example"
    ApproveOtcTradeResponse:
      value:
        $ref: "#/components/schemas/ApproveOtcTradeResponse/example"
    CancelOtcTradeCommand:
      value:
        $ref: "#/components/schemas/CancelOtcTradeCommand/example"
    CancelAllOtcTradesCommand:
      value:
        $ref: "#/components/schemas/CancelAllOtcTradesCommand/example"
    CancelOtcTradeResponse:
      value:
        $ref: "#/components/schemas/CancelOtcTradeResponse/example"
    CancelAllOtcTradesResponse:
      value:
        $ref: "#/components/schemas/CancelAllOtcTradesResponse/example"
    IdbCancelOtcTradeCommand:
      value:
        $ref: "#/components/schemas/IdbCancelOtcTradeCommand/example"
    IdbCancelOtcTradeResponse:
      value:
        $ref: "#/components/schemas/IdbCancelOtcTradeResponse/example"
    IdbUpdateRemarksCommand:
      value:
        $ref: "#/components/schemas/IdbUpdateRemarksCommand/example"
    IdbUpdateRemarksResponse:
      value:
        $ref: "#/components/schemas/IdbUpdateRemarksResponse/example"
