components:
  parameters:
    x-qfex-hmac-signature:
      description: >-
        HMAC-SHA256 signature for request validation, hex-encoded. Generated by
        computing HMAC-SHA256 of the string `${nonce}:${unix_ts}` using your
        secret key, then hex-encoding the result.
      in: header
      name: x-qfex-hmac-signature
      required: true
      schema:
        type: string
    x-qfex-nonce:
      description: >-
        A cryptographically secure random nonce (hex encoded, max 100
        characters). Used to prevent replay attacks. Must be unique within a 15
        minute window.
      in: header
      name: x-qfex-nonce
      required: true
      schema:
        type: string
    x-qfex-public-key:
      description: >-
        The public key associated with your API credentials. Used to identify
        the requester.
      in: header
      name: x-qfex-public-key
      required: true
      schema:
        type: string
    x-qfex-requested-account-id:
      description: >-
        Requested account ID for the request. If not provided, the primary
        account ID will be used.
      examples:
        example:
          description: Example
          summary: Example
          value: 75cb3b4e-7d6e-4283-a913-73ce6e1e32fb
      explode: false
      in: header
      name: x-qfex-requested-account-id
      schema:
        type: string
    x-qfex-timestamp:
      description: >-
        Unix timestamp (in seconds) of when the request was created. Used for
        request validation and replay attack prevention. The timestamp should be
        within an acceptable time window (typically ±5 minutes).
      explode: false
      in: header
      name: x-qfex-timestamp
      required: true
      schema:
        type: string
  schemas:
    AccountEquityPoint:
      additionalProperties: false
      properties:
        value:
          format: double
          type: number
        window_start:
          format: date-time
          type: string
      required:
        - window_start
        - value
      type: object
    AccountEquityResponseBody:
      additionalProperties: false
      properties:
        $schema:
          description: A URL to the JSON Schema for this object.
          examples:
            - https://api.qfex.com/schemas/AccountEquityResponseBody.json
          format: uri
          readOnly: true
          type: string
        count:
          format: int64
          type: integer
        data:
          items:
            $ref: '#/components/schemas/AccountEquityPoint'
          type:
            - array
            - 'null'
        duration:
          type: string
        end:
          format: date-time
          type: string
        interval_minutes:
          format: int64
          type: integer
        start:
          format: date-time
          type: string
      required:
        - duration
        - interval_minutes
        - end
        - data
        - count
      type: object
    BalancePublic:
      additionalProperties: false
      properties:
        available_balance:
          format: double
          type: number
        deposit:
          format: double
          type: number
        net_funding:
          format: double
          type: number
        order_margin:
          format: double
          type: number
        position_margin:
          format: double
          type: number
        realised_pnl:
          format: double
          type: number
        unrealised_pnl:
          format: double
          type: number
      required:
        - deposit
        - realised_pnl
        - order_margin
        - position_margin
        - unrealised_pnl
        - net_funding
        - available_balance
      type: object
    Candle:
      additionalProperties: false
      properties:
        baseTokenVolume:
          type: string
        close:
          type: string
        high:
          type: string
        low:
          type: string
        open:
          type: string
        orderbookMidPriceClose:
          type: string
        orderbookMidPriceOpen:
          type: string
        resolution:
          type: string
        startedAt:
          type: string
        startingOpenInterest:
          type: string
        ticker:
          type: string
        trades:
          format: int64
          minimum: 0
          type: integer
        usdVolume:
          type: string
      required:
        - startedAt
        - ticker
        - resolution
        - low
        - high
        - open
        - close
        - baseTokenVolume
        - usdVolume
        - trades
        - startingOpenInterest
        - orderbookMidPriceOpen
        - orderbookMidPriceClose
      type: object
    CandlesResponseBody:
      additionalProperties: false
      properties:
        $schema:
          description: A URL to the JSON Schema for this object.
          examples:
            - https://api.qfex.com/schemas/CandlesResponseBody.json
          format: uri
          readOnly: true
          type: string
        candles:
          items:
            $ref: '#/components/schemas/Candle'
          type:
            - array
            - 'null'
      required:
        - candles
      type: object
    CreateSubaccountResponseBody:
      additionalProperties: false
      properties:
        $schema:
          description: A URL to the JSON Schema for this object.
          examples:
            - https://api.qfex.com/schemas/CreateSubaccountResponseBody.json
          format: uri
          readOnly: true
          type: string
        account_id:
          format: uuid
          type: string
      required:
        - account_id
      type: object
    ErrorDetail:
      additionalProperties: false
      properties:
        location:
          description: >-
            Where the error occurred, e.g. 'body.items[3].tags' or
            'path.thing-id'
          type: string
        message:
          description: Error message text
          type: string
        value:
          description: The value at the given location
      type: object
    ErrorModel:
      additionalProperties: false
      properties:
        $schema:
          description: A URL to the JSON Schema for this object.
          examples:
            - https://api.qfex.com/schemas/ErrorModel.json
          format: uri
          readOnly: true
          type: string
        detail:
          description: >-
            A human-readable explanation specific to this occurrence of the
            problem.
          examples:
            - Property foo is required but is missing.
          type: string
        errors:
          description: Optional list of individual error details
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type:
            - array
            - 'null'
        instance:
          description: >-
            A URI reference that identifies the specific occurrence of the
            problem.
          examples:
            - https://example.com/error-log/abc123
          format: uri
          type: string
        status:
          description: HTTP status code
          examples:
            - 400
          format: int64
          type: integer
        title:
          description: >-
            A short, human-readable summary of the problem type. This value
            should not change between occurrences of the error.
          examples:
            - Bad Request
          type: string
        type:
          default: about:blank
          description: A URI reference to human-readable documentation for the error.
          examples:
            - https://example.com/errors/example
          format: uri
          type: string
      type: object
    FeeEntry:
      additionalProperties: false
      properties:
        maker_fee:
          format: int64
          type: integer
        taker_fee:
          format: int64
          type: integer
      required:
        - maker_fee
        - taker_fee
      type: object
    FeesResponseBody:
      additionalProperties: false
      properties:
        $schema:
          description: A URL to the JSON Schema for this object.
          examples:
            - https://api.qfex.com/schemas/FeesResponseBody.json
          format: uri
          readOnly: true
          type: string
        fees:
          additionalProperties:
            $ref: '#/components/schemas/FeeEntry'
          examples:
            - AUD-USD:
                maker_fee: 10000
                taker_fee: 20000
              EUR-USD:
                maker_fee: 10000
                taker_fee: 20000
          type: object
      required:
        - fees
      type: object
    FundingHistoricResponseBody:
      additionalProperties: false
      properties:
        $schema:
          description: A URL to the JSON Schema for this object.
          examples:
            - https://api.qfex.com/schemas/FundingHistoricResponseBody.json
          format: uri
          readOnly: true
          type: string
        count:
          format: int64
          type: integer
        data:
          items:
            $ref: '#/components/schemas/FundingPoint'
          type:
            - array
            - 'null'
      required:
        - data
        - count
      type: object
    FundingPoint:
      additionalProperties: false
      properties:
        intervalMinutes:
          format: int64
          type: integer
        rate:
          format: double
          type:
            - number
            - 'null'
        symbol:
          type: string
        windowStart:
          type: string
      required:
        - symbol
        - intervalMinutes
        - windowStart
        - rate
      type: object
    HistoricOrder:
      additionalProperties: false
      properties:
        avg_price:
          format: double
          type:
            - number
            - 'null'
        client_order_id:
          type: string
        execution_state:
          type: string
        filled_qty:
          format: double
          type: number
        first_fill_ts:
          format: date-time
          type:
            - string
            - 'null'
        last_fill_ts:
          format: date-time
          type:
            - string
            - 'null'
        order_id:
          type: string
        passive_qty:
          format: double
          type: number
        price:
          format: double
          type: number
        quantity:
          format: double
          type: number
        side:
          type: string
        status_ts:
          format: date-time
          type: string
        symbol:
          type: string
        terminal_status:
          type: string
        time_in_force:
          type: string
        type:
          type: string
      required:
        - order_id
        - terminal_status
        - status_ts
        - symbol
        - side
        - type
        - time_in_force
        - quantity
        - price
        - client_order_id
        - passive_qty
        - filled_qty
        - avg_price
        - first_fill_ts
        - last_fill_ts
        - execution_state
      type: object
    HistoricOrdersResponseBody:
      additionalProperties: false
      properties:
        $schema:
          description: A URL to the JSON Schema for this object.
          examples:
            - https://api.qfex.com/schemas/HistoricOrdersResponseBody.json
          format: uri
          readOnly: true
          type: string
        count:
          format: int64
          type: integer
        data:
          items:
            $ref: '#/components/schemas/HistoricOrder'
          type:
            - array
            - 'null'
      required:
        - data
        - count
      type: object
    HistoricTwap:
      additionalProperties: false
      properties:
        average_fill_price:
          format: double
          type: number
        client_twap_id:
          type:
            - string
            - 'null'
        created_at:
          format: date-time
          type:
            - string
            - 'null'
        filled_num_orders:
          format: int64
          minimum: 0
          type: integer
        filled_quantity:
          format: double
          type: number
        order_interval_secs:
          format: int64
          minimum: 0
          type: integer
        reduce_only:
          type: boolean
        side:
          type: string
        status:
          type: string
        symbol:
          type: string
        total_num_orders:
          format: int64
          minimum: 0
          type: integer
        total_quantity:
          format: double
          type: number
        twap_id:
          type: string
        updated_at:
          format: date-time
          type:
            - string
            - 'null'
      required:
        - twap_id
        - client_twap_id
        - status
        - symbol
        - total_quantity
        - filled_quantity
        - average_fill_price
        - total_num_orders
        - filled_num_orders
        - order_interval_secs
        - reduce_only
        - side
        - updated_at
        - created_at
      type: object
    HistoricTwapsResponseBody:
      additionalProperties: false
      properties:
        $schema:
          description: A URL to the JSON Schema for this object.
          examples:
            - https://api.qfex.com/schemas/HistoricTwapsResponseBody.json
          format: uri
          readOnly: true
          type: string
        count:
          format: int64
          type: integer
        data:
          items:
            $ref: '#/components/schemas/HistoricTwap'
          type:
            - array
            - 'null'
      required:
        - data
        - count
      type: object
    HistoricUserPnlPoint:
      additionalProperties: false
      properties:
        value:
          format: double
          type: number
        window_start:
          format: date-time
          type: string
      required:
        - window_start
        - value
      type: object
    HistoricUserPnlResponseBody:
      additionalProperties: false
      properties:
        $schema:
          description: A URL to the JSON Schema for this object.
          examples:
            - https://api.qfex.com/schemas/HistoricUserPnlResponseBody.json
          format: uri
          readOnly: true
          type: string
        count:
          format: int64
          type: integer
        data:
          items:
            $ref: '#/components/schemas/HistoricUserPnlPoint'
          type:
            - array
            - 'null'
        duration:
          type: string
        end:
          format: date-time
          type: string
        interval_minutes:
          format: int64
          type: integer
        start:
          format: date-time
          type: string
        symbols:
          items:
            type: string
          type:
            - array
            - 'null'
        unit:
          type: string
      required:
        - duration
        - unit
        - interval_minutes
        - end
        - data
        - count
      type: object
    HourlyPnlResponseBody:
      additionalProperties: false
      properties:
        $schema:
          description: A URL to the JSON Schema for this object.
          examples:
            - https://api.qfex.com/schemas/HourlyPnlResponseBody.json
          format: uri
          readOnly: true
          type: string
        count:
          format: int64
          type: integer
        data:
          items:
            $ref: '#/components/schemas/PnlHour'
          type:
            - array
            - 'null'
      required:
        - data
        - count
      type: object
    ListSubaccountsResponseBody:
      additionalProperties: false
      properties:
        $schema:
          description: A URL to the JSON Schema for this object.
          examples:
            - https://api.qfex.com/schemas/ListSubaccountsResponseBody.json
          format: uri
          readOnly: true
          type: string
        account_ids:
          items:
            type: string
          type:
            - array
            - 'null'
      required:
        - account_ids
      type: object
    OpenInterestHistoricResponseBody:
      additionalProperties: false
      properties:
        $schema:
          description: A URL to the JSON Schema for this object.
          examples:
            - https://api.qfex.com/schemas/OpenInterestHistoricResponseBody.json
          format: uri
          readOnly: true
          type: string
        count:
          format: int64
          type: integer
        data:
          items:
            $ref: '#/components/schemas/OpenInterestPoint'
          type:
            - array
            - 'null'
      required:
        - data
        - count
      type: object
    OpenInterestPoint:
      additionalProperties: false
      properties:
        intervalMinutes:
          format: int64
          type: integer
        openInterest:
          format: double
          type:
            - number
            - 'null'
        symbol:
          type: string
        windowStart:
          type: string
      required:
        - symbol
        - intervalMinutes
        - windowStart
        - openInterest
      type: object
    PersonaDecision:
      additionalProperties: true
      properties:
        outcome:
          type: string
        reasons:
          items:
            $ref: '#/components/schemas/PersonaReason'
          type:
            - array
            - 'null'
        result:
          type: string
        status:
          type: string
      required:
        - status
        - outcome
        - result
        - reasons
      type: object
    PersonaEvent:
      additionalProperties: true
      properties:
        data:
          $ref: '#/components/schemas/PersonaEventData'
      required:
        - data
      type: object
    PersonaEventAttributes:
      additionalProperties: true
      properties:
        event_type:
          type: string
        name:
          type: string
        payload:
          $ref: '#/components/schemas/PersonaPayload'
      required:
        - name
        - payload
      type: object
    PersonaEventData:
      additionalProperties: true
      properties:
        attributes:
          $ref: '#/components/schemas/PersonaEventAttributes'
        id:
          type: string
        type:
          type: string
      required:
        - id
        - type
        - attributes
      type: object
    PersonaInquiryAttrs:
      additionalProperties: true
      properties:
        decision:
          $ref: '#/components/schemas/PersonaDecision'
        failure-reasons:
          items:
            $ref: '#/components/schemas/PersonaReason'
          type:
            - array
            - 'null'
        inquiry-status:
          type: string
        outcome:
          type: string
        reasons:
          items:
            $ref: '#/components/schemas/PersonaReason'
          type:
            - array
            - 'null'
        reference-id:
          type: string
        result:
          type: string
        review:
          $ref: '#/components/schemas/PersonaReview'
        review-result:
          type: string
        review-status:
          type: string
        status:
          type: string
        summary:
          $ref: '#/components/schemas/PersonaSummary'
        tags:
          items:
            type: string
          type:
            - array
            - 'null'
      required:
        - status
        - reference-id
      type: object
    PersonaPayload:
      additionalProperties: true
      properties:
        data:
          $ref: '#/components/schemas/PersonaPayloadData'
      required:
        - data
      type: object
    PersonaPayloadData:
      additionalProperties: true
      properties:
        attributes:
          $ref: '#/components/schemas/PersonaInquiryAttrs'
        id:
          type: string
        relationships:
          additionalProperties: {}
          type: object
        type:
          type: string
      required:
        - id
        - type
        - attributes
      type: object
    PersonaReason:
      additionalProperties: true
      properties:
        code:
          type: string
        description:
          type: string
        detail:
          type: string
        message:
          type: string
        name:
          type: string
        reason:
          type: string
      required:
        - code
        - name
        - message
        - description
        - detail
        - reason
      type: object
    PersonaReview:
      additionalProperties: true
      properties:
        reasons:
          items:
            $ref: '#/components/schemas/PersonaReason'
          type:
            - array
            - 'null'
        result:
          type: string
        status:
          type: string
      required:
        - status
        - result
        - reasons
      type: object
    PersonaSummary:
      additionalProperties: true
      properties:
        outcome:
          type: string
        reasons:
          items:
            $ref: '#/components/schemas/PersonaReason'
          type:
            - array
            - 'null'
        result:
          type: string
        status:
          type: string
      required:
        - status
        - result
        - outcome
        - reasons
      type: object
    PersonaWebhookResponseBody:
      additionalProperties: false
      type: object
    PnlHour:
      additionalProperties: false
      properties:
        cost:
          format: double
          type: number
        fees:
          format: double
          type: number
        hour:
          format: date-time
          type: string
        net_funding:
          format: double
          type: number
        quantity:
          format: double
          type: number
        realised_pnl:
          format: double
          type: number
        symbol:
          type: string
        unrealised_pnl:
          format: double
          type: number
      required:
        - symbol
        - hour
        - realised_pnl
        - unrealised_pnl
        - net_funding
        - fees
        - quantity
        - cost
      type: object
    PositionPublic:
      additionalProperties: false
      properties:
        average_price:
          format: double
          type: number
        initial_margin:
          format: double
          type: number
        leverage:
          format: double
          type: number
        maintenance_margin:
          format: double
          type: number
        net_funding:
          format: double
          type: number
        open_orders:
          format: int64
          type: integer
        open_quantity:
          format: double
          type: number
        position:
          format: double
          type: number
        realised_pnl:
          format: double
          type: number
        symbol:
          type: string
        unrealised_pnl:
          format: double
          type: number
      required:
        - symbol
        - position
        - realised_pnl
        - unrealised_pnl
        - net_funding
        - open_orders
        - open_quantity
        - leverage
        - initial_margin
        - maintenance_margin
        - average_price
      type: object
    PositionsBalanceResponseBody:
      additionalProperties: false
      properties:
        $schema:
          description: A URL to the JSON Schema for this object.
          examples:
            - https://api.qfex.com/schemas/PositionsBalanceResponseBody.json
          format: uri
          readOnly: true
          type: string
        balance:
          $ref: '#/components/schemas/BalancePublic'
        positions:
          items:
            $ref: '#/components/schemas/PositionPublic'
          type:
            - array
            - 'null'
      required:
        - positions
        - balance
      type: object
    RefdataResponse:
      additionalProperties: false
      properties:
        $schema:
          description: A URL to the JSON Schema for this object.
          examples:
            - https://api.qfex.com/schemas/RefdataResponse.json
          format: uri
          readOnly: true
          type: string
        data:
          items:
            $ref: '#/components/schemas/RefdataSymbol'
          type:
            - array
            - 'null'
        type:
          type: string
      required:
        - type
        - data
      type: object
    RefdataSymbol:
      additionalProperties: false
      properties:
        base_asset:
          type: string
        clobPairId:
          type: string
        default_max_leverage:
          format: int64
          minimum: 0
          type: integer
        lot_size:
          type: string
        margin_asset:
          type: string
        market_hours:
          additionalProperties: {}
          type: object
        max_price:
          type: string
        max_quantity:
          type: string
        min_price:
          type: string
        min_quantity:
          type: string
        order_time_in_force:
          items:
            type: string
          type:
            - array
            - 'null'
        order_types:
          items:
            type: string
          type:
            - array
            - 'null'
        price_change_24h:
          type: string
        product_category:
          type: string
        quote_asset:
          type: string
        status:
          type: string
        symbol:
          type: string
        tick_size:
          type: string
        underlier_price:
          type: string
      required:
        - clobPairId
        - symbol
        - underlier_price
        - price_change_24h
        - default_max_leverage
        - tick_size
        - lot_size
        - min_price
        - max_price
        - min_quantity
        - max_quantity
        - base_asset
        - quote_asset
        - margin_asset
        - order_time_in_force
        - order_types
        - market_hours
        - status
        - product_category
      type: object
    ReferralReward:
      additionalProperties: false
      properties:
        amount:
          format: double
          type: number
        reward_date:
          format: date-time
          type: string
      required:
        - reward_date
        - amount
      type: object
    ReferralRewardsResponseBody:
      additionalProperties: false
      properties:
        $schema:
          description: A URL to the JSON Schema for this object.
          examples:
            - https://api.qfex.com/schemas/ReferralRewardsResponseBody.json
          format: uri
          readOnly: true
          type: string
        count:
          format: int64
          type: integer
        data:
          items:
            $ref: '#/components/schemas/ReferralReward'
          type:
            - array
            - 'null'
        duration:
          type: string
        end:
          format: date-time
          type: string
        interval:
          type: string
        start:
          format: date-time
          type: string
        total_amount:
          format: double
          type: number
      required:
        - duration
        - interval
        - end
        - data
        - count
        - total_amount
      type: object
    SetUserLeverageRequestBody:
      additionalProperties: false
      properties:
        $schema:
          description: A URL to the JSON Schema for this object.
          examples:
            - https://api.qfex.com/schemas/SetUserLeverageRequestBody.json
          format: uri
          readOnly: true
          type: string
        leverage:
          format: float
          type: number
        symbol:
          type: string
      required:
        - leverage
        - symbol
      type: object
    SetUserLeverageResponseBody:
      additionalProperties: false
      properties:
        $schema:
          description: A URL to the JSON Schema for this object.
          examples:
            - https://api.qfex.com/schemas/SetUserLeverageResponseBody.json
          format: uri
          readOnly: true
          type: string
        leverage:
          format: float
          type: number
      required:
        - leverage
      type: object
    SettlementCalendarEntry:
      additionalProperties: false
      properties:
        $schema:
          description: A URL to the JSON Schema for this object.
          examples:
            - https://api.qfex.com/schemas/SettlementCalendarEntry.json
          format: uri
          readOnly: true
          type: string
        active_until:
          description: >-
            Last timestamp at which this dated future remains active for oracle
            and settlement purposes for the QFEX symbol.
          examples:
            - '2026-04-13T21:30:00Z'
          format: date-time
          type: string
        expiration:
          description: Expiration timestamp of the underlying dated future contract.
          examples:
            - '2026-04-21T21:30:00Z'
          format: date-time
          type: string
        future_symbol:
          description: >-
            Dated futures contract used for pricing, for example `CLK6` or
            `NQM6`.
          examples:
            - CLK6
          type: string
        qfex_symbol:
          description: QFEX perpetual symbol whose oracle references the dated future.
          examples:
            - CL-USD
          type: string
      required:
        - expiration
        - active_until
        - future_symbol
        - qfex_symbol
      type: object
    SettlementPrice:
      additionalProperties: false
      properties:
        asof:
          type: string
        future_settlement_price:
          format: double
          type: number
        future_symbol:
          type: string
        inserted_at:
          format: date-time
          type: string
        spot_settlement_price:
          format: double
          type: number
        spot_to_future_ratio:
          format: double
          type: number
        symbol:
          type: string
      required:
        - symbol
        - future_symbol
        - future_settlement_price
        - spot_settlement_price
        - asof
        - inserted_at
        - spot_to_future_ratio
      type: object
    SettlementPricesResponseBody:
      additionalProperties: false
      properties:
        $schema:
          description: A URL to the JSON Schema for this object.
          examples:
            - https://api.qfex.com/schemas/SettlementPricesResponseBody.json
          format: uri
          readOnly: true
          type: string
        count:
          format: int64
          type: integer
        data:
          items:
            $ref: '#/components/schemas/SettlementPrice'
          type:
            - array
            - 'null'
      required:
        - data
        - count
      type: object
    SymbolLongShortHistoricResponseBody:
      additionalProperties: false
      properties:
        $schema:
          description: A URL to the JSON Schema for this object.
          examples:
            - >-
              https://api.qfex.com/schemas/SymbolLongShortHistoricResponseBody.json
          format: uri
          readOnly: true
          type: string
        count:
          format: int64
          type: integer
        data:
          items:
            $ref: '#/components/schemas/SymbolLongShortPoint'
          type:
            - array
            - 'null'
      required:
        - data
        - count
      type: object
    SymbolLongShortPoint:
      additionalProperties: false
      properties:
        interval:
          type: string
        longUsers:
          format: int64
          minimum: 0
          type: integer
        shortUsers:
          format: int64
          minimum: 0
          type: integer
        symbol:
          type: string
        windowStart:
          type: string
      required:
        - symbol
        - interval
        - windowStart
        - longUsers
        - shortUsers
      type: object
    SymbolMetrics:
      additionalProperties: false
      properties:
        current_mark_price:
          format: double
          type: number
        funding_rate_bps:
          format: double
          type: number
        mark_price_change_24h_pct:
          format: double
          type: number
        open_interest:
          format: double
          type: number
        symbol:
          type: string
        volume_24h_usd_notional:
          format: double
          type: number
      required:
        - symbol
        - current_mark_price
        - volume_24h_usd_notional
        - mark_price_change_24h_pct
        - open_interest
        - funding_rate_bps
      type: object
    SymbolMetricsResponseBody:
      additionalProperties: false
      properties:
        $schema:
          description: A URL to the JSON Schema for this object.
          examples:
            - https://api.qfex.com/schemas/SymbolMetricsResponseBody.json
          format: uri
          readOnly: true
          type: string
        count:
          format: int64
          type: integer
        data:
          items:
            $ref: '#/components/schemas/SymbolMetrics'
          type:
            - array
            - 'null'
      required:
        - data
        - count
      type: object
    TakerVolumeHistoricResponseBody:
      additionalProperties: false
      properties:
        $schema:
          description: A URL to the JSON Schema for this object.
          examples:
            - https://api.qfex.com/schemas/TakerVolumeHistoricResponseBody.json
          format: uri
          readOnly: true
          type: string
        count:
          format: int64
          type: integer
        data:
          items:
            $ref: '#/components/schemas/TakerVolumePoint'
          type:
            - array
            - 'null'
      required:
        - data
        - count
      type: object
    TakerVolumePoint:
      additionalProperties: false
      properties:
        intervalMinutes:
          format: int64
          type: integer
        netTakerQty:
          format: double
          type: number
        symbol:
          type: string
        takerBuyNotional:
          format: double
          type: number
        takerBuyQty:
          format: double
          type: number
        takerSellNotional:
          format: double
          type: number
        takerSellQty:
          format: double
          type: number
        windowStart:
          type: string
      required:
        - symbol
        - intervalMinutes
        - windowStart
        - takerBuyQty
        - takerSellQty
        - takerBuyNotional
        - takerSellNotional
        - netTakerQty
      type: object
    Trade:
      additionalProperties: false
      properties:
        fee:
          format: double
          type: number
        id:
          type: string
        margin_used:
          format: double
          type: number
        order_id:
          type: string
        order_timestamp:
          format: double
          type: number
        order_type:
          type: string
        price:
          format: double
          type: number
        quantity:
          format: double
          type: number
        realised_pnl_change:
          format: double
          type: number
        side:
          type: string
        symbol:
          type: string
        tif:
          type: string
      required:
        - id
        - order_timestamp
        - symbol
        - price
        - quantity
        - side
        - fee
        - margin_used
        - order_type
        - tif
        - order_id
        - realised_pnl_change
      type: object
    TradesResponseBody:
      additionalProperties: false
      properties:
        $schema:
          description: A URL to the JSON Schema for this object.
          examples:
            - https://api.qfex.com/schemas/TradesResponseBody.json
          format: uri
          readOnly: true
          type: string
        count:
          format: int64
          type: integer
        data:
          items:
            $ref: '#/components/schemas/Trade'
          type:
            - array
            - 'null'
      required:
        - data
        - count
      type: object
    TransferRequestBody:
      additionalProperties: false
      properties:
        $schema:
          description: A URL to the JSON Schema for this object.
          examples:
            - https://api.qfex.com/schemas/TransferRequestBody.json
          format: uri
          readOnly: true
          type: string
        amount:
          format: double
          type: number
      required:
        - amount
      type: object
    UnderlierHistoricResponseBody:
      additionalProperties: false
      properties:
        $schema:
          description: A URL to the JSON Schema for this object.
          examples:
            - https://api.qfex.com/schemas/UnderlierHistoricResponseBody.json
          format: uri
          readOnly: true
          type: string
        count:
          format: int64
          type: integer
        data:
          items:
            $ref: '#/components/schemas/UnderlierPoint'
          type:
            - array
            - 'null'
      required:
        - data
        - count
      type: object
    UnderlierPoint:
      additionalProperties: false
      properties:
        closePrice:
          format: double
          type: number
        highPrice:
          format: double
          type: number
        interval:
          type: string
        lowPrice:
          format: double
          type: number
        openPrice:
          format: double
          type: number
        symbol:
          type: string
        windowStart:
          type: string
      required:
        - symbol
        - interval
        - windowStart
        - openPrice
        - closePrice
        - highPrice
        - lowPrice
      type: object
    UserVolumePoint:
      additionalProperties: false
      properties:
        date:
          format: date-time
          type: string
        maker_volume:
          format: double
          type: number
        taker_volume:
          format: double
          type: number
        volume:
          format: double
          type: number
      required:
        - date
        - maker_volume
        - taker_volume
        - volume
      type: object
    UserVolumeResponseBody:
      additionalProperties: false
      properties:
        $schema:
          description: A URL to the JSON Schema for this object.
          examples:
            - https://api.qfex.com/schemas/UserVolumeResponseBody.json
          format: uri
          readOnly: true
          type: string
        count:
          format: int64
          type: integer
        data:
          items:
            $ref: '#/components/schemas/UserVolumePoint'
          type:
            - array
            - 'null'
        end:
          format: date-time
          type: string
        interval:
          type: string
        range:
          type: string
        start:
          format: date-time
          type: string
        symbols:
          items:
            type: string
          type:
            - array
            - 'null'
        total_maker_volume:
          format: double
          type: number
        total_taker_volume:
          format: double
          type: number
        total_volume:
          format: double
          type: number
      required:
        - range
        - interval
        - end
        - data
        - count
        - total_maker_volume
        - total_taker_volume
        - total_volume
      type: object
  securitySchemes:
    HMACSignature:
      description: HMAC-SHA256 signature (hex-encoded).
      in: header
      name: x-qfex-hmac-signature
      type: apiKey
      x-stoplight:
        hideExamples: true
    Nonce:
      description: Unique request nonce (hex encoded, max 100 characters).
      in: header
      name: x-qfex-nonce
      type: apiKey
      x-stoplight:
        hideExamples: true
    PublicKey:
      description: >-
        QFEX API Authentication requires these headers:


        - **x-qfex-public-key**: Your public API key

        - **x-qfex-hmac-signature**: HMAC signature of the request (hex encoded)

        - **x-qfex-nonce**: Unique nonce for the request (hex encoded, max 100
        characters)

        - **x-qfex-timestamp**: Unix timestamp of the request


        These four are required. Optionally send **x-qfex-requested-account-id**
        (UUID) to act as a subaccount; see Signature Generation below.


        **Signature Generation:**


        1. Generate a cryptographically secure random nonce (hex encoded, max
        100 characters) and capture the current Unix timestamp.

        2. Build the string `${nonce}:${unix_ts}` and compute an HMAC-SHA256
        using your secret key.

        3. Hex-encode the HMAC result to get the signature.

        4. Send the required auth headers below. The nonce must be unique within
        a 15 minute window.


        **Important:** The signature itself must be hex-encoded before being
        sent in the `x-qfex-hmac-signature` header.


        **Optional header:** `x-qfex-requested-account-id` (UUID) selects a
        subaccount; omit it to use the primary account.
      in: header
      name: x-qfex-public-key
      type: apiKey
      x-stoplight:
        hideExamples: true
    Timestamp:
      description: Unix timestamp (seconds since epoch).
      in: header
      name: x-qfex-timestamp
      type: apiKey
      x-stoplight:
        hideExamples: true
info:
  contact:
    email: support@qfex.com
    name: QFEX Support
  description: REST API for QFEX
  license:
    name: QFEX License
    url: https://qfex.com/license
  title: QFEX REST API
  version: 0.1.0
openapi: 3.1.0
paths:
  /candles/{symbol}:
    get:
      description: Return OHLCV candles for a symbol over a time range.
      operationId: read-candles
      parameters:
        - in: path
          name: symbol
          required: true
          schema:
            type: string
        - explode: false
          in: query
          name: resolution
          required: true
          schema:
            type: string
        - explode: false
          in: query
          name: fromISO
          required: true
          schema:
            type: string
        - explode: false
          in: query
          name: toISO
          required: true
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CandlesResponseBody'
          description: OK
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Error
      security: []
      summary: Candles
      tags:
        - market-data
  /funding/{symbol}:
    get:
      description: >-
        Return historic funding rates for a symbol over a time range with
        forward filling.
      operationId: read-funding-historic
      parameters:
        - in: path
          name: symbol
          required: true
          schema:
            type: string
        - explode: false
          in: query
          name: intervalMinutes
          required: true
          schema:
            format: int64
            type: integer
        - explode: false
          in: query
          name: fromISO
          required: true
          schema:
            type: string
        - explode: false
          in: query
          name: toISO
          required: true
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FundingHistoricResponseBody'
          description: OK
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Error
      security: []
      summary: Funding Historic
      tags:
        - market-data
  /historic-orders-csv:
    get:
      description: Stream a CSV of all historic orders for the authenticated user.
      operationId: read-historic-orders-csv
      responses:
        '200':
          description: OK
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Error
      security:
        - HMACSignature: []
          Nonce: []
          PublicKey: []
          Timestamp: []
      summary: Stream Historic Orders CSV
      tags:
        - user
  /historic-twaps-csv:
    get:
      description: Stream a CSV of all historic TWAPs for the authenticated user.
      operationId: read-historic-twaps-csv
      parameters:
        - explode: false
          in: query
          name: symbol
          schema:
            type: string
      responses:
        '200':
          description: OK
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Error
      security:
        - HMACSignature: []
          Nonce: []
          PublicKey: []
          Timestamp: []
      summary: Stream Historic TWAPs CSV
      tags:
        - user
  /open-interest/{symbol}:
    get:
      description: >-
        Return historic open interest for a symbol over a time range with
        forward filling.
      operationId: read-open-interest-historic
      parameters:
        - in: path
          name: symbol
          required: true
          schema:
            type: string
        - explode: false
          in: query
          name: intervalMinutes
          required: true
          schema:
            format: int64
            type: integer
        - explode: false
          in: query
          name: fromISO
          required: true
          schema:
            type: string
        - explode: false
          in: query
          name: toISO
          required: true
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OpenInterestHistoricResponseBody'
          description: OK
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Error
      security: []
      summary: Open Interest Historic
      tags:
        - market-data
  /pnl:
    get:
      description: >-
        Return approximate first position per symbol per hour for the user,
        including realised/unrealised pnl, net_funding, fees, quantity, and
        cost.
      operationId: read-hourly-pnl
      parameters:
        - explode: false
          in: query
          name: symbol
          schema:
            type: string
        - explode: false
          in: query
          name: start
          schema:
            format: date-time
            type: string
        - explode: false
          in: query
          name: end
          schema:
            format: date-time
            type: string
        - explode: false
          in: query
          name: limit_hours
          schema:
            default: 168
            format: int64
            maximum: 2160
            minimum: 1
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HourlyPnlResponseBody'
          description: OK
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Error
      security:
        - HMACSignature: []
          Nonce: []
          PublicKey: []
          Timestamp: []
      summary: Hourly PnL (approx. first position per hour)
      tags:
        - pnl
  /refdata:
    get:
      description: Return symbol reference data.
      operationId: read-refdata
      parameters:
        - explode: false
          in: query
          name: ticker
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RefdataResponse'
          description: OK
          headers:
            Cache-Control:
              schema:
                type: string
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Error
      security: []
      summary: Refdata
      tags:
        - market-data
  /settlement-calendar:
    get:
      description: >-
        Return the settlement calendar entry used to resolve the dated future
        for a futures-based QFEX product at a given time. This is the source of
        truth for oracle roll state for symbols such as CL-USD, US100-USD,
        COPPER-USD, and NATGAS-USD. If `time` is omitted, the currently active
        contract is returned.
      operationId: read-settlement-calendar
      parameters:
        - explode: false
          in: query
          name: symbol
          required: true
          description: >-
            QFEX symbol to resolve, for example `CL-USD`, `US100-USD`,
            `COPPER-USD`, or `NATGAS-USD`.
          schema:
            example: CL-USD
            type: string
        - explode: false
          in: query
          name: time
          description: >-
            Optional timestamp to resolve against the settlement calendar. If
            omitted, QFEX returns the currently active dated future.
          schema:
            example: '2026-04-14T00:00:00Z'
            format: date-time
            type: string
      responses:
        '200':
          content:
            application/json:
              examples:
                example:
                  summary: Example settlement calendar entry
                  value:
                    $schema: https://api.qfex.com/schemas/SettlementCalendarEntry.json
                    expiration: '2026-04-21T21:30:00Z'
                    active_until: '2026-04-13T21:30:00Z'
                    future_symbol: CLK6
                    qfex_symbol: CL-USD
              schema:
                $ref: '#/components/schemas/SettlementCalendarEntry'
          description: OK
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Error
      security: []
      summary: Settlement Calendar
      tags:
        - market-data
  /settlement-prices:
    get:
      description: Return current and historic settlement prices and ratios.
      operationId: read-settlement-prices
      parameters:
        - explode: false
          in: query
          name: symbol
          schema:
            type: string
        - explode: false
          in: query
          name: start
          schema:
            format: date-time
            type: string
        - explode: false
          in: query
          name: end
          schema:
            format: date-time
            type: string
        - explode: false
          in: query
          name: limit
          schema:
            default: 100
            format: int64
            maximum: 1000
            minimum: 1
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SettlementPricesResponseBody'
          description: OK
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Error
      security: []
      summary: Settlement Prices
      tags:
        - market-data
  /symbol-long-short/{symbol}:
    get:
      description: >-
        Return historic long and short user counts for a symbol over a time
        range.
      operationId: read-symbol-long-short-historic
      parameters:
        - in: path
          name: symbol
          required: true
          schema:
            type: string
        - explode: false
          in: query
          name: interval
          required: true
          schema:
            type: string
        - explode: false
          in: query
          name: fromISO
          required: true
          schema:
            type: string
        - explode: false
          in: query
          name: toISO
          required: true
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SymbolLongShortHistoricResponseBody'
          description: OK
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Error
      security: []
      summary: Symbol Long Short Historic
      tags:
        - market-data
  /taker-volume/{symbol}:
    get:
      description: Return historic taker volume metrics for a symbol over a time range.
      operationId: read-taker-volume-historic
      parameters:
        - in: path
          name: symbol
          required: true
          schema:
            type: string
        - explode: false
          in: query
          name: intervalMinutes
          required: true
          schema:
            format: int64
            type: integer
        - explode: false
          in: query
          name: fromISO
          required: true
          schema:
            type: string
        - explode: false
          in: query
          name: toISO
          required: true
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TakerVolumeHistoricResponseBody'
          description: OK
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Error
      security: []
      summary: Taker Volume Historic
      tags:
        - market-data
  /trades-csv:
    get:
      description: Stream a CSV of all trades for the authenticated user.
      operationId: read-trades-csv
      responses:
        '200':
          description: OK
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Error
      security:
        - HMACSignature: []
          Nonce: []
          PublicKey: []
          Timestamp: []
      summary: Stream Trades CSV
      tags:
        - user
  /underlier/{symbol}:
    get:
      description: Return historic underlier OHLC data for a symbol over a time range.
      operationId: read-underlier-historic
      parameters:
        - in: path
          name: symbol
          required: true
          schema:
            type: string
        - explode: false
          in: query
          name: interval
          required: true
          schema:
            type: string
        - explode: false
          in: query
          name: fromISO
          required: true
          schema:
            type: string
        - explode: false
          in: query
          name: toISO
          required: true
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnderlierHistoricResponseBody'
          description: OK
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Error
      security: []
      summary: Underlier Historic
      tags:
        - market-data
  /user/account-equity:
    get:
      description: Return total account equity over time for preset durations.
      operationId: read-account-equity
      parameters:
        - explode: false
          in: query
          name: duration
          schema:
            default: 1w
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccountEquityResponseBody'
          description: OK
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Error
      security:
        - HMACSignature: []
          Nonce: []
          PublicKey: []
          Timestamp: []
      summary: Account Equity
      tags:
        - user
  /user/fees:
    get:
      description: Return Fees data for the authenticated user.
      operationId: read-user-fees
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FeesResponseBody'
          description: OK
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Error
      security:
        - HMACSignature: []
          Nonce: []
          PublicKey: []
          Timestamp: []
      summary: User Fees
      tags:
        - user
  /user/historic-orders:
    get:
      description: >-
        Return historic orders (filled or terminally closed) for the
        authenticated user.
      operationId: read-historic-orders
      parameters:
        - explode: false
          in: query
          name: symbol
          schema:
            type: string
        - explode: false
          in: query
          name: client_order_id
          schema:
            type: string
        - explode: false
          in: query
          name: start
          schema:
            format: date-time
            type: string
        - explode: false
          in: query
          name: end
          schema:
            format: date-time
            type: string
        - explode: false
          in: query
          name: limit
          schema:
            default: 100
            format: int64
            maximum: 1000
            minimum: 1
            type: integer
        - explode: false
          in: query
          name: offset
          schema:
            default: 0
            format: int64
            minimum: 0
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HistoricOrdersResponseBody'
          description: OK
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Error
      security:
        - HMACSignature: []
          Nonce: []
          PublicKey: []
          Timestamp: []
      summary: Historic Orders
      tags:
        - user
  /user/historic-pnl:
    get:
      description: >-
        Return historic user pnl change over preset durations. Supports number
        and percent units, and optional comma-separated symbol filters.
      operationId: read-historic-user-pnl
      parameters:
        - explode: false
          in: query
          name: duration
          schema:
            default: 1w
            type: string
        - explode: false
          in: query
          name: unit
          schema:
            default: number
            type: string
        - explode: false
          in: query
          name: symbol
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HistoricUserPnlResponseBody'
          description: OK
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Error
      security:
        - HMACSignature: []
          Nonce: []
          PublicKey: []
          Timestamp: []
      summary: Historic User PnL
      tags:
        - user
  /user/historic-twaps:
    get:
      description: >-
        Return historic TWAPs (cancelled or completed) for the authenticated
        user.
      operationId: read-historic-twaps
      parameters:
        - explode: false
          in: query
          name: symbol
          schema:
            type: string
        - explode: false
          in: query
          name: limit
          schema:
            default: 100
            format: int64
            maximum: 1000
            minimum: 1
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HistoricTwapsResponseBody'
          description: OK
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Error
      security:
        - HMACSignature: []
          Nonce: []
          PublicKey: []
          Timestamp: []
      summary: Historic TWAPs
      tags:
        - user
  /user/leverage:
    post:
      description: Set the leverage for the authenticated user.
      operationId: set-user-leverage
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SetUserLeverageRequestBody'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SetUserLeverageResponseBody'
          description: OK
          headers:
            StatusCode:
              schema:
                format: int64
                type: integer
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Error
      security:
        - HMACSignature: []
          Nonce: []
          PublicKey: []
          Timestamp: []
      summary: Set User Leverage
      tags:
        - user
  /user/positions:
    get:
      description: Return current positions for the authenticated user.
      operationId: read-user-positions
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PositionsBalanceResponseBody'
          description: OK
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Error
      security:
        - HMACSignature: []
          Nonce: []
          PublicKey: []
          Timestamp: []
      summary: User Positions
      tags:
        - user
  /user/referral-rewards:
    get:
      description: Return daily referral rewards for the authenticated user.
      operationId: read-user-referral-rewards
      parameters:
        - explode: false
          in: query
          name: duration
          schema:
            default: 1w
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReferralRewardsResponseBody'
          description: OK
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Error
      security:
        - HMACSignature: []
          Nonce: []
          PublicKey: []
          Timestamp: []
      summary: User Referral Rewards
      tags:
        - user
  /user/subaccounts:
    get:
      description: >-
        Returns subaccount IDs for the authenticated user excluding the master
        account ID.
      operationId: list-subaccounts
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListSubaccountsResponseBody'
          description: OK
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Error
      security:
        - HMACSignature: []
          Nonce: []
          PublicKey: []
          Timestamp: []
      summary: List Subaccounts
      tags:
        - user
    post:
      description: >-
        Allocates a new subaccount ID for the authenticated user and returns it
        in the response body.
      operationId: create-subaccount
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateSubaccountResponseBody'
          description: OK
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Error
      security:
        - HMACSignature: []
          Nonce: []
          PublicKey: []
          Timestamp: []
      summary: Create Subaccount
      tags:
        - user
  /user/trade:
    get:
      description: Return trades for the authenticated user.
      operationId: read-user-trades
      parameters:
        - explode: false
          in: query
          name: exchange_order_id
          schema:
            type: string
        - explode: false
          in: query
          name: start
          schema:
            format: date-time
            type: string
        - explode: false
          in: query
          name: end
          schema:
            format: date-time
            type: string
        - explode: false
          in: query
          name: start_time
          schema:
            format: date-time
            type: string
        - explode: false
          in: query
          name: end_time
          schema:
            format: date-time
            type: string
        - explode: false
          in: query
          name: symbol
          schema:
            type: string
        - explode: false
          in: query
          name: ordertype
          schema:
            type: string
        - explode: false
          in: query
          name: orderdirection
          schema:
            type: string
        - explode: false
          in: query
          name: limit
          schema:
            default: 100
            format: int64
            maximum: 1000
            minimum: 1
            type: integer
        - explode: false
          in: query
          name: offset
          schema:
            default: 0
            format: int64
            minimum: 0
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TradesResponseBody'
          description: OK
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Error
      security:
        - HMACSignature: []
          Nonce: []
          PublicKey: []
          Timestamp: []
      summary: User Trades
      tags:
        - user
  /user/transfer:
    post:
      description: >-
        Transfer available balance between two of the authenticated user's
        accounts (master account or subaccounts).
      operationId: transfer-balance
      parameters:
        - explode: false
          in: query
          name: src_account_id
          required: true
          schema:
            type: string
        - explode: false
          in: query
          name: dst_account_id
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TransferRequestBody'
        required: true
      responses:
        '204':
          description: No Content
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Error
      security:
        - HMACSignature: []
          Nonce: []
          PublicKey: []
          Timestamp: []
      summary: Transfer Balance
      tags:
        - user
  /user/volume:
    get:
      description: >-
        Return daily user notional volume for one of: 1w, 1m, ytd, or all time.
        Supports optional comma-separated symbol filters.
      operationId: read-user-volume
      parameters:
        - explode: false
          in: query
          name: range
          schema:
            default: 1w
            type: string
        - explode: false
          in: query
          name: symbol
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserVolumeResponseBody'
          description: OK
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Error
      security:
        - HMACSignature: []
          Nonce: []
          PublicKey: []
          Timestamp: []
      summary: User Volume
      tags:
        - user
servers:
  - description: Production server
    url: https://api.qfex.com
