openapi: 3.0.3
info:
  title: REST API
  description: "# Welcome to Coinbase INTX API\n## Introduction\nThe INTX APIs allow institutions to trade and manage orders on the International Exchange. The following API pages detail various REST API endpoints we offer.\n## Getting Started\nTo get started, please visit one of the following pages:\n- [Authentication](/intx/docs/rest-auth)\n- [Rate Limits](/intx/docs/rate-limits)\n- [Status Codes](/intx/docs/rest-overview)\n- [Quickstart](/intx/docs/quickstart)\n## FIX API\n- [FIX API reference](/intx/docs/fix-overview)\n## WebSocket API\n- [WebSocket API reference](/intx/docs/websocket-overview)"
  version: "1.0"
servers:
- url: 'https://api.international.coinbase.com'
paths:
  /api/v1/assets:
    get:
      tags:
      - Assets
      summary: List assets
      operationId: getAssets
      description: Returns a list of all supported assets.
      responses:
        '200':
          description: Asset list
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Asset_v1'
  /api/v1/assets/{asset}:
    get:
      tags:
      - Assets
      summary: Get asset details
      operationId: getAsset
      description: Retrieves information for a specific asset.
      parameters:
      - name: asset
        in: path
        description: Identifies the asset by name (e.g., `BTC`), UUID (e.g., `291efb0f-2396-4d41-ad03-db3b2311cb2c`), or asset ID (e.g., `1482439423963469`)
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Asset found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Asset_v1'
        '400':
          description: Invalid attribute
  /api/v1/assets/{asset}/networks:
    get:
      tags:
      - Assets
      summary: Get supported networks per asset
      operationId: getAssetNetworks
      description: Returns a list of supported networks and network information for a specific asset.
      parameters:
      - name: asset
        in: path
        description: Identifies the asset by name (e.g., `BTC`), UUID (e.g., `291efb0f-2396-4d41-ad03-db3b2311cb2c`), or asset ID (e.g., `1482439423963469`)
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Asset found
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/AssetNetwork_v1'
        '400':
          description: Invalid attribute
  /api/v1/index/{index}/composition:
    get:
      tags:
        - Index
      summary: Get index composition
      operationId: getIndexComposition
      description: Retrieves the latest index composition (metadata) with an ordered set of constituents.
      parameters:
        - name: index
          in: path
          description: Identifies the index by name (e.g., `COIN50`)
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Latest index composition
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/IndexComposition_v1"
        "400":
          description: Invalid attribute
        "401":
          description: Authentication error
      security:
        - auth_client_id: []
          auth_passphrase: []
          auth_signature: []
          auth_timestamp: []
  /api/v1/index/{index}/composition-history:
    get:
      tags:
        - Index
      summary: Get index composition history
      operationId: getIndexCompositionHistory
      description: Retrieves a history of index composition records in a descending time order. The results are an array of index composition data recorded at different "timestamps".
      parameters:
        - name: index
          in: path
          description: Identifies the index by name (e.g., `COIN50`)
          required: true
          schema:
            type: string
        - name: time_from
          in: query
          description: Filters look back history for returned data (accepts an ISO 8601 timestamp format)
          required: false
          schema:
            type: string
            example: "2024-10-31T00:00:00Z"
        - name: result_limit
          in: query
          description: The number of results to return (defaults to 5)
          required: false
          schema:
            type: integer
            example: 3
        - name: result_offset
          in: query
          description: The number of results from the beginning to skip past
          required: false
          schema:
            type: integer
            example: 0
      responses:
        '200':
          description: Index composition list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IndexComposition_v1'
        "400":
          description: Invalid attribute
        "401":
          description: Authentication error
      security:
        - auth_client_id: []
          auth_passphrase: []
          auth_signature: []
          auth_timestamp: []
  /api/v1/index/{index}/price:
    get:
      tags:
        - Index
      summary: Get index price
      operationId: getIndexPrice
      description: Retrieves the latest index price
      parameters:
        - name: index
          in: path
          description: Identifies the index by name (e.g., `COIN50`)
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Latest index price
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/IndexPrice_v1"
        "400":
          description: Invalid attribute
        "401":
          description: Authentication error
      security:
        - auth_client_id: []
          auth_passphrase: []
          auth_signature: []
          auth_timestamp: []
  /api/v1/index/{index}/candles:
    get:
      tags:
        - Index
      summary: Get index candles
      operationId: getIndexCandles
      description: Retrieves the historical daily index prices in time descending order. The daily values are represented as aggregated entries for the day in typical OHLC format.
      parameters:
        - name: index
          in: path
          description: Identifies the index by name (e.g., `COIN50`)
          required: true
          schema:
            type: string
        - name: granularity
          in: query
          description: The aggregation period of the candles data
          required: true
          type: string
          enum: [ "ONE_DAY", "ONE_HOUR" ]
        - name: start
          in: query
          description: Start timestamp in ISO 8601 timestamp format (e.g. `2024-10-21T00:00:00Z`)
          required: true
          schema:
            type: string
        - name: end
          in: query
          description: End timestamp in ISO 8601 timestamp format (e.g. `2024-10-31T00:00:00Z`)
          required: false
          schema:
            type: string
      responses:
        "200":
          description: Index Candle list
          content:
            application/json:
              schema:
                properties:
                  aggregations:
                    type: array
                    items:
                      $ref: '#/components/schemas/IndexCandles_v1'
        "400":
          description: Invalid attribute
        "401":
          description: Authentication error
      security:
        - auth_client_id: []
          auth_passphrase: []
          auth_signature: []
          auth_timestamp: []
  /api/v1/instruments:
    get:
      tags:
      - Instruments
      summary: List instruments
      operationId: getInstruments
      description: Returns all of the instruments available for trading.
      responses:
        '200':
          description: Instrument list
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Instrument_v1'
  /api/v1/instruments/{instrument}:
    get:
      tags:
      - Instruments
      summary: Get instrument details
      operationId: getInstrument
      description: Retrieves market information for a specific instrument.
      parameters:
      - name: instrument
        in: path
        description: Identifies the instrument by name (e.g., `BTC-USDC`), UUID (e.g., `ce55a827-f04a-45c0-9d9b-8bbdb9b48065`), or instrument ID (e.g., `7149252043835013`)
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Instrument
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Instrument_v1'
        '400':
          description: Invalid attribute
  /api/v1/instruments/{instrument}/quote:
    get:
      tags:
      - Instruments
      summary: Get quote per instrument
      operationId: getInstrumentQuote
      description: Retrieves the current quote for a specific instrument.
      parameters:
      - name: instrument
        in: path
        description: Identifies the instrument by name (e.g., `BTC-USDC`), UUID (e.g., `ce55a827-f04a-45c0-9d9b-8bbdb9b48065`), or instrument ID (e.g., `7149252043835013`)
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Instrument list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InstrumentQuote_v1'
        '400':
          description: Invalid attribute
  /api/v1/instruments/volumes/daily:
    get:
      tags:
        - Instruments
      summary: Get daily trading volumes
      operationId: getInstrumentVolumesDaily
      description: Retrieves the trading volumes for each instrument separated by day.
      parameters:
        - name: instruments
          in: query
          description: Identifies the instruments by name in a comma separated list (e.g., `BTC-PERP,ETH-PERP`)
          required: true
          schema:
            type: string
        - name: result_limit
          in: query
          description: The number of results to return (defaults to 60 with a max supported value of 100)
          required: false
          schema:
            type: integer
            example: 30
        - name: result_offset
          in: query
          description: The number of results from the beginning to skip past
          required: false
          schema:
            type: integer
            example: 5
        - name: time_from
          in: query
          description: The first date to include data from in ISO 8601 timestamp format (e.g. `2024-03-01T00:00:00Z`)
          required: false
          schema:
            type: string
        - name: show_other
          in: query
          description: Return an `OTHER` bucket in the instrument list containing the volume of all instruments filtered out by the `instruments` query parameter
          required: false
          schema:
            type: boolean
      responses:
        '200':
          description: Instrument list
          content:
            application/json:
              schema:
                properties:
                  pagination:
                    $ref: '#/components/schemas/PaginationBase_v1'
                  results:
                    type: array
                    items:
                      $ref: '#/components/schemas/InstrumentDailyVolume_v1'
        '400':
          description: Invalid attribute
  /api/v1/instruments/{instrument}/candles:
    get:
      tags:
        - Instruments
      summary: Get aggregated candles data per instrument
      operationId: getInstrumentCandles
      description: Retrieves a list of aggregated candles data for a given instrument, granularity and time range
      parameters:
        - name: instrument
          in: path
          description: Identifies the instrument by name (e.g., `BTC-PERP`)
          required: true
          schema:
            type: string
        - name: granularity
          in: query
          description: The aggregation period of the candles data. End timestamp in ISO 8601 timestamp format (e.g. 2024-03-01T00:00:00Z).
          required: true
          type: string
          enum: [ "ONE_DAY", "SIX_HOUR", "TWO_HOUR", "ONE_HOUR", "THIRTY_MINUTE", "FIFTEEN_MINUTE", "FIVE_MINUTE", "ONE_MINUTE" ]
        - name: start
          in: query
          description: Start timestamp in ISO 8601 timestamp format (e.g. `2024-03-01T00:00:00Z`)
          required: true
          schema:
            type: string
        - name: end
          in: query
          description: End timestamp in ISO 8601 timestamp format (e.g. `2024-03-01T00:00:00Z`)
          required: false
          schema:
            type: string
      responses:
        '200':
          description: Instrument list
          content:
            application/json:
              schema:
                properties:
                  aggregations:
                    type: array
                    items:
                      $ref: '#/components/schemas/InstrumentCandlesAggregation_v1'
        '400':
          description: Invalid attribute
  /api/v1/instruments/{instrument}/funding:
    get:
      tags:
      - Instruments
      summary: Get historical funding rates
      operationId: getInstrumentFunding
      description: Retrieves the historical funding rates for a specific instrument.
      parameters:
      - name: instrument
        in: path
        description: Identifies the instrument by name (e.g., `BTC-PERP`), UUID (e.g., `ce55a827-f04a-45c0-9d9b-8bbdb9b48065`), or instrument ID (e.g., `7149252043835013`)
        required: true
        schema:
          type: string
      - name: result_limit
        in: query
        description: The number of results to return (defaults to 25 with a max supported value of 100)
        required: false
        schema:
          type: integer
          example: 30
      - name: result_offset
        in: query
        description: The number of results from the beginning to skip past
        required: false
        schema:
          type: integer
          example: 50
      responses:
        '200':
          description: Funding Rates list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InstrumentFunding_v1'
        '400':
          description: Invalid attribute
  /api/v1/position-offsets:
    get:
      tags:
      - Position Offsets
      summary: List position offsets
      operationId: getPositionOffsets
      description: Returns all active position offsets
      responses:
        '200':
          description: Position offsets list
          content:
            application/json:
              schema:
                type: object
                properties:
                  position_offsets:
                    type: array
                    items:
                      $ref: '#/components/schemas/InstrumentPositionOffsetPair_v1'
  /api/v1/orders:
    post:
      tags:
      - Orders
      summary: Create order
      operationId: createOrder
      description: Creates a new order.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
              - client_order_id
              - side
              - size
              - tif
              - type
              - instrument
              properties:
                client_order_id:
                  description: "A unique identifier assigned by the client. Must meet one of the following constraints:\n - 18 characters long using all ASCII characters\n - 20 characters long using alphanumeric characters and dash (-)\n - 31 characters long using hexadecimal characters (0-9, a-f, lowercase and no preceding 0s)\n - A UUID using standard hyphenation and all lowercase (e.g., 36a9d3ee-32b7-460e-979a-121735af4824)"
                  type: string
                side:
                  $ref: "#/components/schemas/OrderSide"
                size:
                  description: The amount in base asset units
                  type: string
                tif:
                  $ref: "#/components/schemas/TimeInForce"
                  description: The time in force applied to an order. A Good Till Cancel (GTC) or Good Till Time (GTT) can last up to 30 days. An Immediate or Cancel (IOC) attempts to fill as much of the order as possible and/or cancels immediately when no resting orders meet or improve the order's price limit. A Fill or Kill (FOK) is canceled without filling if it does not completely fill immediately. Required for all order types except market orders.
                instrument:
                  description: The name, ID, or UUID of the instrument the order wants to transact
                  type: string
                type:
                  $ref: "#/components/schemas/OrderType"
                  description: The type of order being submitted
                price:
                  description: The max or min price limit in quote asset units to buy or sell at (respectively). Only used for limit and stop limit order types.
                  type: string
                stop_price:
                  description: The market price that activates a stop order
                  type: string
                stop_limit_price:
                  description: The limit price at which the TP/SL stop leg order will be placed. Only used for TP/SL order type.
                  type: string
                expire_time:
                  description: The expiration time required for orders with the time in force set to GTT. Must not go beyond 30 days of the current time. Uses ISO-8601 format (e.g., 2023-03-16T23:59:53Z).
                  type: string
                  format: date-time
                portfolio:
                  description: The ID or UUID of the portfolio the order belongs to (uses default portfolio if not defined)
                  type: string
                stp_mode:
                  $ref: "#/components/schemas/SelfTradePreventionMode"
                  description: Specifies the behavior for self match handling. None disables the functionality, new cancels the newest order, and both cancels both orders.
                post_only:
                  description: Only submit the order if it will rest on the order book
                  type: boolean
                close_only:
                  description: Only submit the order if it will close an existing order
                  type: boolean
                algo_strategy:
                    $ref: "#/components/schemas/AlgoStrategy"
                    description: The algorithmic trading strategy to use for the order
      responses:
        '200':
          description: Order submitted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderResult_v1'
        '400':
          description: Invalid attribute
      security:
        - auth_client_id: []
          auth_passphrase: []
          auth_signature: []
          auth_timestamp: []
    get:
      tags:
      - Orders
      summary: List open orders
      operationId: getOrders
      description: Returns a list of active orders resting on the order book matching the requested criteria. Does not return any rejected, cancelled, or fully filled orders as they are not active.
      parameters:
      - name: portfolio
        in: query
        required: false
        description: Identifies the portfolio by UUID (e.g., `892e8c7c-e979-4cad-b61b-55a197932cf1`) or portfolio ID (e.g., `5189861793641175`)
        schema:
          type: string
      - name: instrument
        in: query
        required: false
        description: Identifies the instrument by name (e.g., `BTC-USDC`), UUID (e.g., `ce55a827-f04a-45c0-9d9b-8bbdb9b48065`), or instrument ID (e.g., `7149252043835013`)
        schema:
          type: string
      - name: instrument_type
        in: query
        required: false
        description: "Identifies the instruments by type . Allowed values: SPOT, PERPETUAL_FUTURE"
        schema:
          type: string
      - name: client_order_id
        in: query
        required: false
        description: The client order ID that was used when the order was created
        schema:
          type: string
      - name: event_type
        in: query
        required: false
        description: "The most recent type of event that happened to the order. Allowed values: NEW, TRADE, REPLACED"
        schema:
          $ref: "#/components/schemas/OrderEventType"
      - name: order_type
        in: query
        required: false
        description: "The type of order. Allowed values: LIMIT, MARKET, STOP, STOP_LIMIT"
        schema:
          $ref: "#/components/schemas/OrderType"
      - name: side
        in: query
        required: false
        description: "Identifies the side by name (e.g., `BUY`, `SELL`)"
        schema:
          $ref: "#/components/schemas/OrderSide"
      - $ref: "#/components/parameters/ref_datetime"
      - $ref: "#/components/parameters/result_limit"
      - $ref: "#/components/parameters/result_offset"
      responses:
        '200':
          description: Order matches found
          content:
            application/json:
              schema:
                type: object
                properties:
                  pagination:
                    $ref: '#/components/schemas/Pagination_v1'
                  results:
                    type: array
                    items:
                      $ref: '#/components/schemas/OrderResult_v1'
        '400':
          description: Invalid attribute
      security:
        - auth_client_id: []
          auth_passphrase: []
          auth_signature: []
          auth_timestamp: []
    delete:
      tags:
      - Orders
      summary: Cancel orders
      operationId: cancelOrders
      description: Cancels all orders matching the requested criteria.
      parameters:
      - name: portfolio
        in: query
        required: true
        description: Identifies the portfolio by UUID (e.g., `892e8c7c-e979-4cad-b61b-55a197932cf1`) or portfolio ID (e.g., `5189861793641175`)
        schema:
          type: string
      - name: instrument
        in: query
        required: false
        description: Identifies the instrument by name (e.g., `BTC-USDC`), UUID (e.g., `ce55a827-f04a-45c0-9d9b-8bbdb9b48065`), or instrument ID (e.g., `7149252043835013`)
        schema:
          type: string
      - name: side
        in: query
        required: false
        description: Identifies the side by name (e.g., `BUY`, `SELL`)
      - name: instrument_type
        in: query
        required: false
        description: "Identifies the instruments by type . Allowed values: SPOT, PERPETUAL_FUTURE"
        schema:
          type: string
      responses:
        '200':
          description: Order submitted
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/OrderResult_v1'
        '400':
          description: Invalid attribute
      security:
        - auth_client_id: []
          auth_passphrase: []
          auth_signature: []
          auth_timestamp: []
  /api/v1/orders/{id}:
    put:
      tags:
      - Orders
      summary: Modify open order
      operationId: modifyOrder
      description: Modifies an open order.
      parameters:
      - name: id
        in: path
        required: true
        description: The exchange order ID or Client Order ID of the order being modified
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
              - client_order_id
              - portfolio
              properties:
                client_order_id:
                  description: "A unique identifier assigned by the client to the modified order. Must meet one of the following constraints:\n - 18 characters long using all ASCII characters\n - 20 characters long using alphanumeric characters and dash (-)\n - 31 characters long using hexadecimal characters (0-9, a-f, lowercase and no preceding 0s)\n - A UUID using standard hyphenation and all lowercase (e.g., 36a9d3ee-32b7-460e-979a-121735af4824)"
                  type: string
                  format: uuid
                portfolio:
                  description: Identifies the portfolio by UUID (e.g., `892e8c7c-e979-4cad-b61b-55a197932cf1`) or portfolio ID (e.g., `5189861793641175`); must match the original order referenced in the ID of the path
                  type: string
                  format: uuid
                price:
                  description: The max or min price limit in quote asset units to buy or sell at (respectively). Only used for limit and stop limit order types.
                  type: string
                stop_price:
                  description: The market price that activates a stop order
                  type: string
                size:
                  description: The amount in base asset units
                  type: string
                stop_limit_price:
                  description: The limit price at which the TP/SL stop leg order will be placed. Only used for TP/SL order type.
                  type: string
      responses:
        '200':
          description: Order modified
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderResult_v1'
        '400':
          description: Invalid attribute
      security:
        - auth_client_id: []
          auth_passphrase: []
          auth_signature: []
          auth_timestamp: []
    get:
      tags:
      - Orders
      summary: Get order details
      operationId: getOrder
      description: Retrieves a single order. The order retrieved can be either active or inactive.
      parameters:
      - name: id
        in: path
        description: The exchange order ID of the order (not the client order ID)
        required: true
        schema:
          type: string
      - name: portfolio
        in: query
        required: true
        description: Identifies the portfolio by UUID (e.g., `892e8c7c-e979-4cad-b61b-55a197932cf1`) or portfolio ID (e.g., `5189861793641175`)
        schema:
          type: string
      responses:
        '200':
          description: Order found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderResult_v1'
        '400':
          description: Invalid attribute
      security:
        - auth_client_id: []
          auth_passphrase: []
          auth_signature: []
          auth_timestamp: []
    delete:
      tags:
      - Orders
      summary: Cancel order
      operationId: cancelOrder
      description: Cancels a single open order.
      parameters:
      - name: id
        in: path
        description: The exchange order ID or Client Order ID of the order
        required: true
        schema:
          type: string
      - name: portfolio
        in: query
        required: true
        description: Identifies the portfolio by UUID (e.g., `892e8c7c-e979-4cad-b61b-55a197932cf1`) or portfolio ID (e.g., `5189861793641175`)
        schema:
          type: string
      responses:
        '200':
          description: Order canceled
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderResult_v1'
        '400':
          description: Invalid attribute
      security:
        - auth_client_id: []
          auth_passphrase: []
          auth_signature: []
          auth_timestamp: []
  /api/v1/orders/preview:
    post:
      tags:
      - false # Hide from Swagger UI. UI specific endpoint.
      summary: Preview order
      operationId: previewOrder
      description: Previews a new order.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
              - portfolio
              - side
              - size
              - type
              - instrument
              properties:
                side:
                  $ref: "#/components/schemas/OrderSide"
                size:
                  description: The amount in base asset units
                  type: string
                tif:
                  $ref: "#/components/schemas/TimeInForce"
                  description: The time in force applied to an order. A Good Till Cancel (GTC) or Good Till Time (GTT) can last up to 30 days while an Immediate Or Cancel (IOC) attempts to fill as much of the order as possible and/or cancels immediately when no resting orders meet or improve the order's price limit. Required for all order types except market orders.
                instrument:
                  description: The name, ID, or UUID of the instrument the order wants to transact
                  type: string
                type:
                  $ref: "#/components/schemas/OrderType"
                  description: The type of order being submitted
                price:
                  description: The max or min price limit in quote asset units to buy or sell at (respectively). Only used for limit and stop limit order types.
                  type: string
                stop_price:
                  description: The market price that activates a stop order
                  type: string
                stop_limit_price:
                  description: The limit price at which the TP/SL stop leg order will be placed. Only used for TP/SL order type.
                  type: string
                expire_time:
                  description: The expiration time required for orders with the time in force set to GTT. Must not go beyond 30 days of the current time. Uses ISO-8601 format (e.g., 2023-03-16T23:59:53Z).
                  type: string
                  format: date-time
                portfolio:
                  description: The ID or UUID of the portfolio the order belongs to (uses default portfolio if not defined)
                  type: string
                stp_mode:
                  $ref: "#/components/schemas/SelfTradePreventionMode"
                  description: Specifies the behavior for self match handling. None disables the functionality, new cancels the newest order, and both cancels both orders.
                post_only:
                  description: Only submit the order if it will rest on the order book
                  type: boolean
                close_only:
                  description: Only submit the order if it will close an existing order
                  type: boolean
      responses:
        '200':
          description: Order previewed
          content:
            application/json:
              schema:
                type: object
                properties:
                  is_valid:
                    description: Returns whether or not the order form values are valid
                    type: boolean
                  best_bid_price:
                    description: The highest buy order price resting on the book
                    type: string
                    example: 20000.50
                  best_ask_price:
                    description: The lowest sell order price resting on the book
                    type: string
                    example: 20001.75
                  mark_price:
                    description: The current mark price value used in risk and margin calculations
                    type: string
                    example: 20000.63
                  new_open_size:
                    description: TBD
                    type: string
                    example: 10.0
                  open_size_delta:
                    description: TBD
                    type: string
                    example: 10
                  new_open_notional:
                    description: TBD
                    type: string
                    example: 20002.23
                  open_notional_delta:
                    description: TBD
                    type: string
                    example: 20002.23
                  new_total_value_usd:
                    description: TBD
                    type: string
                    example: 200020.23
                  new_open_cost_basis:
                    description: TBD
                    type: string
                    example: 2000.0
                  new_margin_fraction:
                    description: TBD
                    type: string
                    example: 99.9996
                  maker_fee_estimate:
                    description: The estimated fee rate charged for order making liquidity
                    type: string
                    example: 0.02
                  taker_fee_estimate:
                    description: The estimated fee rate charged for orders taking liquidity
                    type: string
                    example: 0.04
                  initial_margin:
                    description: TBD
                    type: string
                    example: 40000.0
                  required_margin_delta:
                    description: TBD
                    type: string
                    example: 40000.0
                  reject_reason:
                    description: TBD
                    type: string
                    example: 40000.0
                  reject_details:
                    description: TBD
                    type: string
        '400':
          description: Invalid attribute
      security:
        - auth_client_id: []
          auth_passphrase: []
          auth_signature: []
          auth_timestamp: []
  /api/v1/portfolios:
    get:
      tags:
      - Portfolios
      summary: List all user portfolios
      operationId: getPortfolios
      description: Returns all of the user's portfolios.
      responses:
        '200':
          description: Portfolio list
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Portfolio_v1'
        '400':
          description: Invalid attribute
      security:
        - auth_client_id: []
          auth_passphrase: []
          auth_signature: []
          auth_timestamp: []
    post:
      tags:
      - Portfolios
      summary: Create portfolio
      operationId: createPortfolio
      description: Create a new portfolio. Request will fail if no name is provided or if user already has max number of portfolios. Max number of portfolios is 20.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
              - name
              properties:
                name:
                  description: The name of the portfolio
                  type: string
      responses:
        '200':
          description: New portfolio created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Portfolio_v1'
        '400':
          description: Invalid attribute
      security:
        - auth_client_id: []
          auth_passphrase: []
          auth_signature: []
          auth_timestamp: []
  /api/v1/portfolios/{portfolio}:
    get:
      tags:
      - Portfolios
      summary: Get user portfolio
      operationId: getPortfolio
      description: Returns the user's specified portfolio.
      parameters:
      - name: portfolio
        in: path
        description: Identifies the portfolio by UUID (e.g., `892e8c7c-e979-4cad-b61b-55a197932cf1`) or portfolio ID (e.g., `5189861793641175`)
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Portfolio
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Portfolio_v1'
        '400':
          description: Invalid attribute
      security:
        - auth_client_id: []
          auth_passphrase: []
          auth_signature: []
          auth_timestamp: []
    put:
      tags:
      - Portfolios
      summary: Update portfolio
      operationId: updatePortfolio
      description: Update existing user portfolio.
      parameters:
      - name: portfolio
        in: path
        description: Identifies the portfolio by UUID (e.g., `892e8c7c-e979-4cad-b61b-55a197932cf1`) or portfolio ID (e.g., `5189861793641175`)
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
              - name
              properties:
                name:
                  description: A unique name for the portfolio
                  type: string
      responses:
        '200':
          description: Portfolio
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Portfolio_v1'
        '400':
          description: Invalid attribute
      security:
        - auth_client_id: []
          auth_passphrase: []
          auth_signature: []
          auth_timestamp: []
    patch:
      tags:
        - Portfolios
      summary: Patch portfolio
      operationId: patchPortfolio
      description: Update parameters for existing portfolio
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                auto_margin_enabled:
                  description: Whether auto margin is enabled for the portfolio
                  type: boolean
                cross_collateral_enabled:
                  description: Whether cross collateral is enabled for the portfolio
                  type: boolean
                position_offsets_enabled:
                  description: Whether position offsets is enabled for the portfolio
                  type: boolean
                pre_launch_trading_enabled:
                  description: Whether pre-launch trading is enabled for the portfolio
                  type: boolean
                marginCallEnabled:
                  description: Whether margin call is enabled for the portfolio
                  type: boolean
                portfolio_name:
                  description: Display name for portfolio
                  type: string
      responses:
        '200':
          description: Portfolio is updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Portfolio_v1'
        '400':
          description: Portfolio update failed
        '403':
          description: Invalid permission
      security:
        - auth_client_id: [ ]
          auth_passphrase: [ ]
          auth_signature: [ ]
          auth_timestamp: [ ]
  /api/v1/portfolios/{portfolio}/detail:
    get:
      tags:
      - Portfolios
      summary: Get portfolio details
      operationId: getPortfolioDetail
      description: Retrieves the summary, positions, and balances of a portfolio.
      parameters:
      - name: portfolio
        in: path
        description: Identifies the portfolio by UUID (e.g., `892e8c7c-e979-4cad-b61b-55a197932cf1`) or portfolio ID (e.g., `5189861793641175`)
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Portfolio information
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PortfolioDetail_v1'
        '400':
          description: Invalid attribute
      security:
        - auth_client_id: []
          auth_passphrase: []
          auth_signature: []
          auth_timestamp: []
  /api/v1/portfolios/{portfolio}/summary:
    get:
      tags:
      - Portfolios
      summary: Get portfolio summary
      operationId: getPortfolioSummary
      description: Retrieves the high level overview of a portfolio.
      parameters:
      - name: portfolio
        in: path
        description: Identifies the portfolio by UUID (e.g., `892e8c7c-e979-4cad-b61b-55a197932cf1`) or portfolio ID (e.g., `5189861793641175`)
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Portfolio information
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PortfolioSummary_v1'
        '400':
          description: Invalid attribute
      security:
        - auth_client_id: []
          auth_passphrase: []
          auth_signature: []
          auth_timestamp: []
  /api/v1/portfolios/{portfolio}/balances:
    get:
      tags:
      - Portfolios
      summary: List portfolio balances
      operationId: getPortfolioBalances
      description: Returns all of the balances for a given portfolio.
      parameters:
      - name: portfolio
        in: path
        description: Identifies the portfolio by UUID (e.g., `892e8c7c-e979-4cad-b61b-55a197932cf1`) or portfolio ID (e.g., `5189861793641175`)
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Balance information
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PortfolioBalance_v1'
        '400':
          description: Invalid attribute
      security:
        - auth_client_id: []
          auth_passphrase: []
          auth_signature: []
          auth_timestamp: []
  /api/v1/portfolios/{portfolio}/balances/{asset}:
    get:
      tags:
      - Portfolios
      summary: Get balance for portfolio/asset
      operationId: getPortfolioBalance
      description: Retrieves the balance for a given portfolio and asset.
      parameters:
      - name: portfolio
        in: path
        description: Identifies the portfolio by UUID (e.g., `892e8c7c-e979-4cad-b61b-55a197932cf1`) or portfolio ID (e.g., `5189861793641175`)
        required: true
        schema:
          type: string
      - name: asset
        in: path
        description: Identifies the asset by name (e.g., `BTC`), UUID (e.g., `291efb0f-2396-4d41-ad03-db3b2311cb2c`), or asset ID (e.g., `1482439423963469`)
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Balance information
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PortfolioBalance_v1'
        '400':
          description: Invalid attribute
      security:
        - auth_client_id: []
          auth_passphrase: []
          auth_signature: []
          auth_timestamp: []
  /api/v1/portfolios/{portfolio}/loans:
    get:
      tags:
        - Portfolios
      summary: List active loans for the portfolio
      operationId: getPortfolioLoans
      description: Retrieves all loan info for a given portfolio.
      parameters:
        - name: portfolio
          in: path
          description: Identifies the portfolio by UUID (e.g., `892e8c7c-e979-4cad-b61b-55a197932cf1`) or portfolio ID (e.g., `5189861793641175`)
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Loan information
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PortfolioLoanInfoResult_v1'
        '400':
          description: Invalid attribute
      security:
        - auth_client_id: []
          auth_passphrase: []
          auth_signature: []
          auth_timestamp: []
  /api/v1/portfolios/{portfolio}/loans/{asset}:
    get:
      tags:
        - Portfolios
      summary: Get loan info for portfolio/asset
      operationId: getPortfolioLoan
      description: Retrieves the loan info for a given portfolio and asset.
      parameters:
        - name: portfolio
          in: path
          description: Identifies the portfolio by UUID (e.g., `892e8c7c-e979-4cad-b61b-55a197932cf1`) or portfolio ID (e.g., `5189861793641175`)
          required: true
          schema:
            type: string
        - name: asset
          in: path
          description: Identifies the asset by name (e.g., `BTC`), UUID (e.g., `291efb0f-2396-4d41-ad03-db3b2311cb2c`), or asset ID (e.g., `1482439423963469`)
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Loan information
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PortfolioLoanInfoResult_v1'
        '400':
          description: Invalid attribute
      security:
        - auth_client_id: []
          auth_passphrase: []
          auth_signature: []
          auth_timestamp: []
    post:
      tags:
        - Portfolios
      summary: Acquire/repay loan
      operationId: updatePortfolioLoan
      description: Acquire or repay loan for a given portfolio and asset.
      parameters:
        - name: portfolio
          in: path
          description: Identifies the portfolio by UUID (e.g., `892e8c7c-e979-4cad-b61b-55a197932cf1`) or portfolio ID (e.g., `5189861793641175`)
          required: true
          schema:
            type: string
        - name: asset
          in: path
          description: Identifies the asset by name (e.g., `BTC`), UUID (e.g., `291efb0f-2396-4d41-ad03-db3b2311cb2c`), or asset ID (e.g., `1482439423963469`)
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - action
                - amount
              properties:
                action:
                  $ref: "#/components/schemas/LoanUpdateAction"
                  description: The loan update action to take
                amount:
                  description: The amount of the loan to acquire or repay in quantity
                  type: string
                  example: 1000
      responses:
        '200':
          description: Loan update result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PortfolioUpdateLoanResult_v1'
        '400':
          description: Invalid attribute
      security:
        - auth_client_id: []
          auth_passphrase: []
          auth_signature: []
          auth_timestamp: []
  /api/v1/portfolios/{portfolio}/loans/{asset}/preview:
    post:
      tags:
        - Portfolios
      summary: Preview loan update
      operationId: previewUpdatePortfolioLoan
      description: Preview acquire or repay loan for a given portfolio and asset.
      parameters:
        - name: portfolio
          in: path
          description: Identifies the portfolio by UUID (e.g., `892e8c7c-e979-4cad-b61b-55a197932cf1`) or portfolio ID (e.g., `5189861793641175`)
          required: true
          schema:
            type: string
        - name: asset
          in: path
          description: Identifies the asset by name (e.g., `BTC`), UUID (e.g., `291efb0f-2396-4d41-ad03-db3b2311cb2c`), or asset ID (e.g., `1482439423963469`)
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - action
                - amount
              properties:
                action:
                  $ref: "#/components/schemas/LoanUpdateAction"
                  description: The loan update action to take
                amount:
                  description: The amount of the loan to acquire or repay in quantity
                  type: string
                  example: 1000
      responses:
        '200':
          description: Loan update preview result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PortfolioPreviewLoanUpdateResult_v1'
        '400':
          description: Invalid attribute
      security:
        - auth_client_id: []
          auth_passphrase: []
          auth_signature: []
          auth_timestamp: []

  /api/v1/portfolios/{portfolio}/loans/{asset}/availability:
    get:
      tags:
        - Portfolios
      summary: View max loan availability
      operationId: portfolioLoanAvailability
      description: View the maximum amount of loan that could be acquired now
      parameters:
        - name: portfolio
          in: path
          description: Identifies the portfolio by UUID (e.g., `892e8c7c-e979-4cad-b61b-55a197932cf1`) or portfolio ID (e.g., `5189861793641175`)
          required: true
          schema:
            type: string
        - name: asset
          in: path
          description: Identifies the asset by name (e.g., `BTC`), UUID (e.g., `291efb0f-2396-4d41-ad03-db3b2311cb2c`), or asset ID (e.g., `1482439423963469`)
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Max loan amount available
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PortfolioGetAvailableLoanResult_v1'
        '400':
          description: Invalid attribute
      security:
        - auth_client_id: []
          auth_passphrase: []
          auth_signature: []
          auth_timestamp: []

  /api/v1/portfolios/{portfolio}/positions:
    get:
      tags:
      - Portfolios
      summary: List portfolio positions
      operationId: getPortfolioPositions
      description: Returns all of the positions for a given portfolio.
      parameters:
      - name: portfolio
        in: path
        description: Identifies the portfolio by UUID (e.g., `892e8c7c-e979-4cad-b61b-55a197932cf1`) or portfolio ID (e.g., `5189861793641175`)
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Position information
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PortfolioPosition_v1'
        '400':
          description: Invalid attribute
      security:
        - auth_client_id: []
          auth_passphrase: []
          auth_signature: []
          auth_timestamp: []
  /api/v1/portfolios/{portfolio}/positions/{instrument}:
    get:
      tags:
      - Portfolios
      summary: Get position for portfolio/instrument
      operationId: getPortfolioPosition
      description: Retrieves the position for a given portfolio and symbol.
      parameters:
      - name: portfolio
        in: path
        description: Identifies the portfolio by UUID (e.g., `892e8c7c-e979-4cad-b61b-55a197932cf1`) or portfolio ID (e.g., `5189861793641175`)
        required: true
        schema:
          type: string
      - name: instrument
        in: path
        description: Identifies the instrument by name (e.g., `BTC-USDC`), UUID (e.g., `ce55a827-f04a-45c0-9d9b-8bbdb9b48065`), or instrument ID (e.g., `7149252043835013`)
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Position information
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PortfolioPosition_v1'
        '400':
          description: Invalid attribute
      security:
        - auth_client_id: []
          auth_passphrase: []
          auth_signature: []
          auth_timestamp: []
  /api/v1/portfolios/{portfolio}/position-limits:
    get:
      tags:
        - Portfolios
      summary: Get the total open position limit the portfolio
      operationId: getPortfolioPositionLimits
      description: Retrieves the total open position limit across instruments for a given portfolio.
      parameters:
        - name: portfolio
          in: path
          description: Identifies the portfolio by UUID (e.g., `892e8c7c-e979-4cad-b61b-55a197932cf1`) or portfolio ID (e.g., `5189861793641175`)
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Position limits information
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BeneficialOwnerTotalOpenPositionLimits_V1'
        '400':
          description: Invalid attribute
      security:
        - auth_client_id: []
          auth_passphrase: []
          auth_signature: []
          auth_timestamp: []
  /api/v1/portfolios/{portfolio}/position-limits/positions:
          get:
            tags:
              - Portfolios
            summary: List the open position limits for all instruments
            operationId: getPortfolioPositionLimitsAllInstruments
            description: Retrieves position limits for all positions a given portfolio currently has or has opened in the past.
            parameters:
              - name: portfolio
                in: path
                description: Identifies the portfolio by UUID (e.g., `892e8c7c-e979-4cad-b61b-55a197932cf1`) or portfolio ID (e.g., `5189861793641175`)
                required: true
                schema:
                  type: string
            responses:
              '200':
                description: Position limits information
                content:
                  application/json:
                    schema:
                      type: array
                      items:
                        $ref: '#/components/schemas/BeneficialOwnerPosition_V1'
              '400':
                description: Invalid attribute
            security:
              - auth_client_id: []
                auth_passphrase: []
                auth_signature: []
                auth_timestamp: []
  /api/v1/portfolios/{portfolio}/position-limits/positions/{instrument}:
          get:
            tags:
              - Portfolios
            summary: Get the open position limits for the portfolio instrument
            operationId: getPortfolioPositionLimitsInstrument
            description: Retrieves the position limits for a given portfolio and symbol.
            parameters:
              - name: portfolio
                in: path
                description: Identifies the portfolio by UUID (e.g., `892e8c7c-e979-4cad-b61b-55a197932cf1`) or portfolio ID (e.g., `5189861793641175`)
                required: true
                schema:
                  type: string
              - name: instrument
                in: path
                description: Identifies the instrument by name (e.g., `BTC-USDC`), UUID (e.g., `ce55a827-f04a-45c0-9d9b-8bbdb9b48065`), or instrument ID (e.g., `7149252043835013`)
                required: true
                schema:
                  type: string
            responses:
              '200':
                description: Position limits information
                content:
                  application/json:
                    schema:
                      $ref: '#/components/schemas/BeneficialOwnerPosition_V1'
              '400':
                description: Invalid attribute
            security:
              - auth_client_id: []
                auth_passphrase: []
                auth_signature: []
                auth_timestamp: []
  /api/v1/portfolios/fills:
    get:
      tags:
      - Portfolios
      summary: List fills by portfolios
      operationId: getMultiPortfolioFills
      description: Returns fills for specified portfolios or fills for all portfolios if none are provided.
      parameters:
      - name: portfolios
        in: query
        description: The UUID of the portfolio that has filled orders. Can multiple values in the query
        required: false
        schema:
          type: string
          example: 17ac272b-18af-4d12-91de-d0182d559a3c
      - name: order_id
        in: query
        description: A specific order for which to fetch fills identified by order ID
        required: false
        schema:
          type: string
          example: 43877033468085758
      - name: client_order_id
        in: query
        description: Fetch fills for all orders with the given client order ID
        required: false
        schema:
          type: string
          example: ABC123
      - $ref: "#/components/parameters/ref_datetime"
      - $ref: "#/components/parameters/result_limit"
      - $ref: "#/components/parameters/result_offset"
      - $ref: "#/components/parameters/time_from"
      responses:
        '200':
          description: Fill information
          content:
            application/json:
              schema:
                type: object
                properties:
                  pagination:
                    $ref: '#/components/schemas/Pagination_v1'
                  results:
                    type: array
                    items:
                      $ref: '#/components/schemas/PortfolioFill_v1'
        '400':
          description: Invalid attribute
      security:
        - auth_client_id: []
          auth_passphrase: []
          auth_signature: []
          auth_timestamp: []
  /api/v1/portfolios/{portfolio}/fills:
    get:
      tags:
      - Portfolios
      summary: List portfolio fills
      operationId: getPortfolioFills
      description: Returns all of the fills for a given portfolio.
      parameters:
      - name: portfolio
        in: path
        description: Identifies the portfolio by UUID (e.g., `892e8c7c-e979-4cad-b61b-55a197932cf1`) or portfolio ID (e.g., `5189861793641175`)
        required: true
        schema:
          type: string
      - name: order_id
        in: query
        description: A specific order for which to fetch fills identified by order ID
        required: false
        schema:
          type: string
          example: 43877033468085758
      - name: client_order_id
        in: query
        description: Fetch fills for all orders with the given client order ID
        required: false
        schema:
          type: string
          example: ABC123
      - $ref: "#/components/parameters/ref_datetime"
      - $ref: "#/components/parameters/result_limit"
      - $ref: "#/components/parameters/result_offset"
      - $ref: "#/components/parameters/time_from"
      responses:
        '200':
          description: Fill information
          content:
            application/json:
              schema:
                type: object
                properties:
                  pagination:
                    $ref: '#/components/schemas/Pagination_v1'
                  results:
                    type: array
                    items:
                      $ref: '#/components/schemas/PortfolioFill_v1'
        '400':
          description: Invalid attribute
      security:
        - auth_client_id: []
          auth_passphrase: []
          auth_signature: []
          auth_timestamp: []
  /api/v1/portfolios/{portfolio}/margin-call-status:
    get:
      tags:
      - Portfolios
      summary: Get portfolio margin call status
      operationId: getPortfolioMarginCallStatus
      description: Returns the margin call status for a given portfolio.
      parameters:
      - name: portfolio
        in: path
        description: Identifies the portfolio by UUID (e.g., `892e8c7c-e979-4cad-b61b-55a197932cf1`) or portfolio ID (e.g., `5189861793641175`)
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Margin call status
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PortfolioMarginCallStatusReadResult_V1'
        '400':
          description: Invalid attribute
      security:
        - auth_client_id: []
          auth_passphrase: []
          auth_signature: []
          auth_timestamp: []
  /api/v1/portfolios/{portfolio}/cross-collateral-enabled:
    post:
      tags:
      - Portfolios
      summary: Enable/Disable portfolio cross collateral
      operationId: crossCollateralEnabled
      description: Enable or disable the cross collateral feature for the portfolio, which allows the portfolio to use non-USDC assets as collateral for margin trading.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - enabled
              properties:
                enabled:
                  description: Whether cross collateral is enabled for the portfolio
                  type: boolean
      responses:
        '200':
          description: Cross collateral setting updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Portfolio_v1'
        '400':
          description: Cross collateral setting update failed
        '403':
          description: Invalid permission
      security:
        - auth_client_id: [ ]
          auth_passphrase: [ ]
          auth_signature: [ ]
          auth_timestamp: [ ]
  /api/v1/portfolios/{portfolio}/auto-margin-enabled:
    post:
      tags:
        - Portfolios
      summary: Enable/Disable portfolio auto margin mode
      operationId: autoMarginEnabled
      description: Enable or disable the auto margin feature, which lets the portfolio automatically post margin amounts required to exceed the high leverage position restrictions.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - enabled
              properties:
                enabled:
                  description: Whether auto margin is enabled for the portfolio
                  type: boolean
      responses:
        '200':
          description: Auto margin setting updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Portfolio_v1'
        '400':
          description: Auto margin setting update failed
        '403':
          description: Invalid permission
      security:
        - auth_client_id: [ ]
          auth_passphrase: [ ]
          auth_signature: [ ]
          auth_timestamp: [ ]
  /api/v1/portfolios/margin:
    post:
      tags:
      - Portfolios
      summary: Set portfolio margin override
      operationId: setPortfolioMarginOverride
      description: Specify the margin override value for a portfolio to either increase notional requirements or opt-in to higher leverage.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
              - portfolio_id
              - margin_override
              properties:
                portfolio_id:
                  description: Identifies the portfolio by UUID (e.g., `892e8c7c-e979-4cad-b61b-55a197932cf1`) or portfolio ID (e.g., `5189861793641175`)
                  type: string
                margin_override:
                  description: The margin override value for the portfolio. Specified as a decimal value representing notional requirement (e.g., 0.1 = 10% notional requirement, 0.25 = 25% notional requirement)
                  type: string
      responses:
        '200':
          description: Portfolio margin override set
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PortfolioUpdateMarginOverride_v1'
        '400':
          description: Invalid attribute
        '403':
          description: Invalid permission
      security:
        - auth_client_id: [ ]
          auth_passphrase: [ ]
          auth_signature: [ ]
          auth_timestamp: [ ]
  /api/v1/portfolios/transfer/{portfolio}/{asset}/transfer-limit:
    get:
      tags:
        - Portfolios
      summary: Get fund transfer limit between portfolios
      operationId: getPortfolioAssetTransferLimit
      description: Get fund transfer limit between portfolios of the same beneficial owner
      parameters:
        - name: portfolio
          in: path
          description: Identifies the portfolio by UUID (e.g., `892e8c7c-e979-4cad-b61b-55a197932cf1`) or portfolio ID (e.g., `5189861793641175`)
          required: true
          schema:
            type: string
        - name: asset
          in: path
          description: Identifies the asset by name (e.g., `BTC`), UUID (e.g., `291efb0f-2396-4d41-ad03-db3b2311cb2c`), or asset ID (e.g., `1482439423963469`)
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Fund transfer limit
          content:
            application/json:
              schema:
                type: object
                properties:
                  max_portfolio_transfer_amount:
                    description: max portfolio transfer amount
                    type: string
        '400':
          description: Invalid attribute
        '403':
          description: Invalid permission
      security:
        - auth_client_id: []
          auth_passphrase: []
          auth_signature: []
          auth_timestamp: []
  /api/v1/portfolios/transfer:
    post:
      tags:
      - Portfolios
      summary: Transfer funds between portfolios
      operationId: createPortfolioAssetTransfer
      description: Transfer assets from one portfolio to another.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
              - from
              - to
              - asset
              - amount
              properties:
                from:
                  description: Identifies the portfolio by UUID (e.g., `892e8c7c-e979-4cad-b61b-55a197932cf1`) or portfolio ID (e.g., `5189861793641175`) to transfer funds from
                  type: string
                to:
                  description: Identifies the portfolio by UUID (e.g., `892e8c7c-e979-4cad-b61b-55a197932cf1`) or portfolio ID (e.g., `5189861793641175`) to transfer funds to
                  type: string
                asset:
                  description: Identifies the asset by name (e.g., `BTC`), UUID (e.g., `291efb0f-2396-4d41-ad03-db3b2311cb2c`), or asset ID (e.g., `1482439423963469`)
                  type: string
                amount:
                  description: The amount of the asset being transferred
                  type: string
      responses:
        '200':
          description: Transfer processed
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    description: true if the transfer was successful
                    type: boolean
                    example: true
        '400':
          description: Invalid attribute
        '403':
          description: Invalid permission
      security:
        - auth_client_id: []
          auth_passphrase: []
          auth_signature: []
          auth_timestamp: []
  /api/v1/portfolios/transfer-position:
    post:
      tags:
        - Portfolios
      summary: Transfer positions between portfolios
      operationId: createPortfolioPositionTransfer
      description: Transfer an existing position from one portfolio to another. The position transfer must fulfill the same portfolio-level margin requirements as submitting a new order on the opposite side for the sender's portfolio and a new order on the same side  for the recipient's portfolio. Additionally, organization-level requirements must be satisfied when evaluating the outcome of the position transfer.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - from
                - to
                - instrument
                - quantity
                - side
              properties:
                from:
                  description: Identifies the portfolio by UUID (e.g., `892e8c7c-e979-4cad-b61b-55a197932cf1`) or portfolio ID (e.g., `5189861793641175`) to transfer positions from
                  type: string
                to:
                  description: Identifies the portfolio by UUID (e.g., `892e8c7c-e979-4cad-b61b-55a197932cf1`) or portfolio ID (e.g., `5189861793641175`) to transfer positions to
                  type: string
                instrument:
                  description: Identifies the instrument by name (e.g., `BTC-PERP`), UUID (e.g., `291efb0f-2396-4d41-ad03-db3b2311cb2c`), or instrument ID (e.g., `1482439423963469`)
                  type: string
                quantity:
                  description: The full or partial quantity of the position being transferred
                  type: string
                side:
                  description: The side of the position being transferred, BUY or SELL
                  type: string
      responses:
        '200':
          description: Transfer processed
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    description: true if the transfer was successful
                    type: boolean
                    example: true
        '400':
          description: Invalid attribute
        '403':
          description: Invalid permission
      security:
        - auth_client_id: []
          auth_passphrase: []
          auth_signature: []
          auth_timestamp: []
  /api/v1/portfolios/fee-rates:
    get:
      tags:
      - Portfolios
      summary: List portfolio fee rates
      operationId: getPortfoliosFeeRates
      description: Retrieves the Perpetual Future and Spot fee rate tiers for the user.
      responses:
        '200':
          description: Fee rate tiers list
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PortfolioFeeRate_v1'
        '400':
          description: Invalid attribute
      security:
        - auth_client_id: []
          auth_passphrase: []
          auth_signature: []
          auth_timestamp: []
  /api/v1/rankings/statistics:
    get:
      tags:
        - Rankings
      summary: Get your rankings
      operationId: getStatistics
      description: Retrieve your volume rankings for maker, taker, and total volume.
      parameters:
        - name: instrument_type
          in: query
          required: true
          description: "Identifies the instruments by type . Allowed values: SPOT, PERPETUAL_FUTURE"
          schema:
            type: string
            enum: [ "SPOT", "PERPETUAL_FUTURE" ]
        - name: period
          in: query
          required: false
          description: "Identifies the lookback window for the query . Allowed values: YESTERDAY, LAST_7_DAYS, THIS_MONTH, LAST_30_DAYS, LAST_MONTH. Default: THIS_MONTH"
          schema:
            type: string
            enum: [ "YESTERDAY", "LAST_7_DAYS", "THIS_MONTH", "LAST_30_DAYS", "LAST_MONTH" ]
        - name: instruments
          in: query
          description: One or more instrument identifiers, such as name (e.g., `BTC-USDC`), UUID (e.g., `ce55a827-f04a-45c0-9d9b-8bbdb9b48065`), or instrument ID (e.g., `7149252043835013`). If not provided, the query will return the rankings for all instruments of the specified type. If one or more instruments are specified, the query will return the volume and relative percent for all specified instruments, but the returned rank will be "--".
          required: false
          schema:
            type: string
      responses:
        '200':
          description: Ranking information
          content:
            application/json:
              schema:
                type: object
                properties:
                  last_updated:
                    description: The time of the most recent status change of the statistics
                    type: string
                    format: date-time
                    example: 2023-01-29T14:32:28Z
                  statistics:
                    type: object
                    properties:
                      maker:
                        $ref: '#/components/schemas/Rankings_v1'
                      taker:
                        $ref: '#/components/schemas/Rankings_v1'
                      total:
                        $ref: '#/components/schemas/Rankings_v1'
        '400':
          description: Invalid attribute
        '401':
          description: Authentication error
      security:
        - auth_client_id: []
          auth_passphrase: []
          auth_signature: []
          auth_timestamp: []
  /api/v1/transfers:
    get:
      tags:
      - Transfers
      summary: List matching transfers
      operationId: getTransfers
      parameters:
      - name: portfolio [DEPRECATED]
        in: query
        description: Identifies a portfolio by UUID (e.g., `892e8c7c-e979-4cad-b61b-55a197932cf1`) or portfolio ID (e.g., `5189861793641175`). If a portfolio identifier is provided under this param, it will be added to the list of values under `portfolios`
        schema:
          type: string
      - name: portfolios
        in: query
        description: Identifies the portfolios by UUID (e.g., `892e8c7c-e979-4cad-b61b-55a197932cf1`) or portfolio ID (e.g., `5189861793641175`). Can provide single or multiple portfolios to filter by or fetches transfers for all portfolios if none are provided.
        schema:
          type: string
      - name: time_from
        in: query
        description: Only find transfers updated after this time. Uses ISO-8601 format (e.g., 2023-03-16T23:59:53Z)
        schema:
          type: string
          format: date-time
          example: 2023-03-16T23:59:53Z
      - name: time_to
        in: query
        description: Only find transfers updated before this time. Uses ISO-8601 format (e.g., 2023-03-16T23:59:53Z)
        schema:
          type: string
          format: date-time
          example: 2023-03-16T23:59:53Z
      - $ref: "#/components/parameters/result_limit"
      - $ref: "#/components/parameters/result_offset"
      - name: status
        in: query
        description: The current status of transfer
        schema:
          $ref: "#/components/schemas/TransferStatus"
      - name: type
        in: query
        description: The type of transfer (defaults to ALL if not defined)
        schema:
          $ref: "#/components/schemas/TransferType"
      responses:
        '200':
          description: Matching transfers
          content:
            application/json:
              schema:
                type: object
                properties:
                  pagination:
                    $ref: '#/components/schemas/PaginationBase_v1'
                  results:
                    type: array
                    items:
                      $ref: '#/components/schemas/Transfer_v1'
        '400':
          description: Invalid attribute
      security:
        - auth_client_id: []
          auth_passphrase: []
          auth_signature: []
          auth_timestamp: []
  /api/v1/transfers/{transfer_uuid}:
    get:
      tags:
      - Transfers
      summary: Get transfer
      operationId: getTransfer
      parameters:
      - name: transfer_uuid
        in: path
        description: The UUID of the transfer request
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '200':
          description: Matching transfer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Transfer_v1'
        '400':
          description: Invalid attribute
      security:
        - auth_client_id: []
          auth_passphrase: []
          auth_signature: []
          auth_timestamp: []
  /api/v1/transfers/withdraw:
    post:
      tags:
      - Transfers
      summary: Withdraw to crypto address
      operationId: withdraw
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
              - portfolio
              - asset
              - amount
              - add_network_fee_to_total
              - network_arn_id
              - address
              properties:
                portfolio:
                  description: Identifies the portfolio by UUID (e.g., `892e8c7c-e979-4cad-b61b-55a197932cf1`) or portfolio ID (e.g., `5189861793641175`)
                  type: string
                asset:
                  description: Identifies the asset by name (e.g., `BTC`), UUID (e.g., `291efb0f-2396-4d41-ad03-db3b2311cb2c`), or asset ID (e.g., `1482439423963469`)
                  type: string
                amount:
                  description: The amount of the asset being transferred
                  type: string
                add_network_fee_to_total:
                  description: if true, deducts network fee from the portfolio, otherwise deduct fee from the withdrawal
                  type: boolean
                network_arn_id:
                  description: Identifies the blockchain network (e.g., `networks/ethereum-mainnet/assets/313ef8a9-ae5a-5f2f-8a56-572c0e2a4d5a`)
                  type: string
                  example: networks/ethereum-mainnet/assets/313ef8a9-ae5a-5f2f-8a56-572c0e2a4d5a
                address:
                  description: Crypto address being validated against
                  type: string
                  example: 0x999e7e2dbce48fb973dff84926c4d24abe59d33c
                nonce:
                  description: a unique integer representing the withdrawal request
                  type: integer
                  example: 30
                destination_tag:
                  description: An identifier used to determine the account a crypto transfer should be credited to. Not present for all asset types.
                  type: string
      responses:
        '200':
          description: Withdrawal Successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateCryptoWithdrawalResult_V1'
        '400':
          description: Withdrawal Failed
      security:
        - auth_client_id: []
          auth_passphrase: []
          auth_signature: []
          auth_timestamp: []
  /api/v1/transfers/address:
    post:
      tags:
      - Transfers
      summary: Create crypto address
      operationId: createAddress
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
              - portfolio
              - asset
              - network_arn_id
              properties:
                portfolio:
                  description: Identifies the portfolio by UUID (e.g., `892e8c7c-e979-4cad-b61b-55a197932cf1`) or portfolio ID (e.g., `5189861793641175`)
                  type: string
                asset:
                  description: Identifies the asset by name (e.g., `BTC`), UUID (e.g., `291efb0f-2396-4d41-ad03-db3b2311cb2c`), or asset ID (e.g., `1482439423963469`)
                  type: string
                network_arn_id:
                  description: Identifies the blockchain network (e.g., `networks/ethereum-mainnet/assets/313ef8a9-ae5a-5f2f-8a56-572c0e2a4d5a`)
                  type: string
                  example: networks/ethereum-mainnet/assets/313ef8a9-ae5a-5f2f-8a56-572c0e2a4d5a
      responses:
        '200':
          description: Address created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AddressResponse_v1'
        '400':
          description: Invalid attribute
      security:
        - auth_client_id: []
          auth_passphrase: []
          auth_signature: []
          auth_timestamp: []
  /api/v1/transfers/create-counterparty-id:
    post:
      tags:
      - Transfers
      summary: Create counterparty Id
      operationId: createCounterpartyId
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
              - portfolio
              properties:
                portfolio:
                  description: Identifies the portfolio by UUID (e.g., `892e8c7c-e979-4cad-b61b-55a197932cf1`) or portfolio ID (e.g., `5189861793641175`)
                  type: string
      responses:
        '200':
          description: Counterparty Id created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateCounterpartyIdResponse_v1'
        '400':
          description: Invalid attribute
      security:
        - auth_client_id: []
          auth_passphrase: []
          auth_signature: []
          auth_timestamp: []
  /api/v1/transfers/validate-counterparty-id:
    post:
      tags:
      - Transfers
      summary: Validate counterparty Id
      operationId: validateCounterpartyId
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
              - counterparty_id
              properties:
                counterparty_id:
                  description: Counterparty Id to be validated
                  type: string
                  example: CBTQDGENHE
      responses:
        '200':
          description: Return whether the counterparty Id is valid to withdraw to
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidateCounterpartyIdResponse_v1'
        '400':
          description: Invalid attribute
      security:
        - auth_client_id: []
          auth_passphrase: []
          auth_signature: []
          auth_timestamp: []
  /api/v1/transfers/withdraw/{portfolio}/{asset}/counterparty-withdrawal-limit:
    get:
      tags:
        - Transfers
      summary: Get counterparty withdrawal limit
      operationId: getCounterpartyWithdrawalLimit
      description: Get counterparty withdrawal limit within coinbase transfer network
      parameters:
        - name: portfolio
          in: path
          description: Identifies the portfolio by UUID (e.g., `892e8c7c-e979-4cad-b61b-55a197932cf1`) or portfolio ID (e.g., `5189861793641175`)
          required: true
          schema:
            type: string
        - name: asset
          in: path
          description: Identifies the asset by name (e.g., `BTC`), UUID (e.g., `291efb0f-2396-4d41-ad03-db3b2311cb2c`), or asset ID (e.g., `1482439423963469`)
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Counterparty withdrawal limit
          content:
            application/json:
              schema:
                type: object
                properties:
                  max_ctn_withdraw_amount:
                    description: counterparty withdrawal limit
                    type: string
        '400':
          description: Invalid attribute
        '403':
          description: Invalid permission
      security:
        - auth_client_id: []
          auth_passphrase: []
          auth_signature: []
          auth_timestamp: []
  /api/v1/transfers/withdraw/counterparty:
    post:
      tags:
      - Transfers
      summary: Withdraw to counterparty Id
      operationId: counterpartyWithdraw
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
              - portfolio
              - counterparty_id
              - asset
              - amount
              - nonce
              properties:
                portfolio:
                  description: Identifies the portfolio to withdraw from by UUID (e.g., `892e8c7c-e979-4cad-b61b-55a197932cf1`) or portfolio ID (e.g., `5189861793641175`)
                  type: string
                counterparty_id:
                  description: Counterparty Id to withdraw to
                  type: string
                  example: CBTQDGENHE
                asset:
                  description: Identifies the asset by name (e.g., `BTC`), UUID (e.g., `291efb0f-2396-4d41-ad03-db3b2311cb2c`), or asset ID (e.g., `1482439423963469`)
                  type: string
                amount:
                  description: The amount of the asset being transferred
                  type: string
                nonce:
                  description: A unique positive integer representing the withdrawal request
                  type: integer
                  example: 30
      responses:
        '200':
          description: Counterparty withdrawal initiated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateCounterpartyWithdrawResult_v1'
        '400':
          description: Counterparty withdrawal Failed
      security:
        - auth_client_id: []
          auth_passphrase: []
          auth_signature: []
          auth_timestamp: []
  /api/v1/transfers/fee-estimate:
    post:
      tags:
        - false # Hide from Swagger UI. UI specific endpoint.
      summary: Get fee estimate
      operationId: fee-estimate
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - asset
                - network_arn
              properties:
                asset:
                  description: Identifies the asset by name (e.g., `BTC`), UUID (e.g., `291efb0f-2396-4d41-ad03-db3b2311cb2c`), or asset ID (e.g., `1482439423963469`)
                  type: string
                network_arn:
                  description: Identifies the blockchain network (e.g., `networks/ethereum-mainnet`)
                  type: string
                  example: networks/ethereum-mainnet
      responses:
        '200':
          description: Complete
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FeeEstimateResponse'
        '400':
          description: Invalid attribute
      security:
        - auth_client_id: []
          auth_passphrase: []
          auth_signature: []
          auth_timestamp: []
  /api/v1/transfers/address/validate:
    post:
      tags:
        - false # Hide from Swagger UI. UI specific endpoint.
      summary: Validate network address
      operationId: validate-address
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - address
                - asset
                - network_arn_id
              properties:
                address:
                  description: Crypto address being validated against
                  type: string
                  example: 0x999e7e2dbce48fb973dff84926c4d24abe59d33c
                asset:
                  description: Identifies the asset by name (e.g., `BTC`), UUID (e.g., `291efb0f-2396-4d41-ad03-db3b2311cb2c`), or asset ID (e.g., `1482439423963469`)
                  type: string
                network_arn_id:
                  description: Identifies the blockchain network (e.g., `networks/ethereum-mainnet`)
                  type: string
                  example: networks/ethereum-mainnet
      responses:
        '200':
          description: Complete
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AddressValidationResponse'
        '400':
          description: Invalid attribute
      security:
        - auth_client_id: []
          auth_passphrase: []
          auth_signature: []
          auth_timestamp: []
  /api/v1/fee-rate-tiers:
    get:
      tags:
      - Fee Rates
      summary: List fee rate tiers
      operationId: getFeeRateTiers
      description: Return all the fee rate tiers.
      responses:
        '200':
          description: Fee rate tiers list
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/FeeRateTier_v1'
components:
  schemas:
    PaginationBase_v1:
      type: object
      properties:
        result_limit:
          description: The number of results to return (defaults to 25 with a max supported value of 100)
          type: integer
          example: 30
        result_offset:
          description: The number of results from the beginning to skip past
          type: integer
          example: 50
    Pagination_v1:
      allOf:
      - $ref: "#/components/schemas/PaginationBase_v1"
      type: object
      properties:
        ref_datetime:
          description: The datetime from which to search (results are returned from `ref_datetime` in chronological order starting with the most recent). Uses ISO-8601 format (e.g., 2023-03-16T23:59:53Z)
          type: string
          format: date-time
          example: 2023-03-16T23:59:53Z
    Asset_v1:
      type: object
      properties:
        asset_id:
          description: A unique identifier to represent the asset specifically on the exchange
          type: string
          example: 3351829018369611
        asset_uuid:
          description: A UUID to represent the asset (portable across other Coinbase systems)
          type: string
          format: uuid
          example: 592a8039-db3e-45ed-b752-ffd1983eead2
        asset_name:
          description: The name of the asset
          type: string
          example: BTC
        status:
          $ref: "#/components/schemas/AssetStatus"
        collateral_weight:
          description: The haircut value applied to the asset when used as collateral
          type: number
          format: double
          example: 0.90
        supported_networks_enabled:
          type: boolean
          example: true
        min_borrow_qty:
          type: string
          example: 10
        max_borrow_qty:
          type: string
          example: 1000000
        loan_collateral_requirement_multiplier:
          type: number
          format: double
          example: 1.2
        # account_collateral_limit:
        #   type: string
        #   example: 1000
        ecosystem_collateral_limit_breached:
          type: boolean
          example: false
        loan_initial_margin:
          description: The initial margin requirement for borrowing this asset
          type: string
          example: 0.15
        max_loan_leverage:
          description: The maximum amount of leverage a user can have on a loan of this asset
          type: string
          example: 3
    AssetNetwork_v1:
      type: object
      properties:
        asset_id:
          description: A unique identifier to represent the asset
          type: string
          example: 3379757734632303
        asset_uuid:
          description: A UUID to represent the asset
          type: string
          format: uuid
          example: 592a8039-db3e-45ed-b752-ffd1983eead2
        asset_name:
          description: The name of the asset
          type: string
          example: ETH
        network_arn_id:
          description: A unique identifier representing the combination of the network and asset
          type: string
          example: networks/ethereum-mainnet/assets/313ef8a9-ae5a-5f2f-8a56-572c0e2a4d5a
        min_withdrawal_amt:
          description: The minimum amount of the asset that can be withdrawn from the network
          type: string
          example: 0.001
        max_withdrawal_amt:
          description: The maximum amount of the asset that can be withdrawn from the network
          type: string
          example: 355.575
        network_confirms:
          description: The number of confirmations required on the network for a transaction
          type: integer
          example: 5
        processing_time:
          description: Number of seconds estimated to process a transaction on the network
          type: integer
          example: 3600
        is_default:
          description: Indicates whether this is the default network for the asset
          type: boolean
        network_name:
          description: The common name of the network
          type: string
          example: ethereum
        display_name:
          description: The human readable name of the network
          type: string
          example: Ethereum
    IndexComposition_v1:
      type: object
      properties:
        product_id:
          description: The Product ID for the index
          type: string
          example: "COIN50"
        divisor:
          description: The index divisor
          type: string
          example: 3935813421.91702
        timestamp:
          description: The snapshot timestamp for this index composition
          type: string
          example: "2024-11-11T14:47:26Z"
        inception_timestamp:
          description: The timestamp of when this index was first created
          type: string
          example: "2020-12-31T00:00:00Z"
        last_rebalance:
          description: The timestamp of when the last index rebalance occurred
          type: string
          example: "2024-08-30T00:00:00Z"
        constituents:
          type: array
          items:
            $ref: '#/components/schemas/IndexConstituent_v1'
    IndexConstituent_v1:
      type: object
      properties:
        symbol:
          description: The constituent asset pair symbol
          type: string
          example: "BTC-USD"
        name:
          description: The constituent name
          type: string
          example: "Bitcoin"
        rank:
          description: The constituent rank order in the index
          type: number
          format: double
          example: 1.0
        cap_factor:
          description: The constituent market cap factor (or multiplier)
          type: string
          example: "0.456192678887042"
        amount:
          description: The constituent amount
          type: string
          example: "19745468"
        market_cap:
          description: The constituent total market cap
          type: string
          example: "1625637364529.9463"
        index_market_cap:
          description: The constituent market cap represented in the index
          type: string
          example: "741603864223.787"
        weight:
          description: The weight of the constituent in the index
          type: string
          example: "0.5130230783794717"
        running_weight:
          description: The running weight of the constituent in the index
          type: string
          example: "0.5130230783794717"
    IndexPrice_v1:
      type: object
      properties:
        product_id:
          description: The Product ID for the index
          type: string
          example: "COIN50"
        status:
          description: The status of the index price
          type: string
          example: "STATE_OK"
        timestamp:
          description: The timestamp of the index price
          type: string
          example: "2024-11-11T20:42:33Z"
        price:
          description: The latest index price
          type: string
          example: "388.91871799439963"
        price_24hr_change:
          description: The price 24hr change percent (negative values denote change down)
          type: string
          example: "8.940862872710408"
    IndexCandles_v1:
      type: object
      properties:
        start:
          description: The start time of the aggregation
          type: string
          example: "2024-10-31T00:00:00Z"
        open:
          description: The opening price at the start of the aggregation time period
          type: string
          example: "311.4512360891112"
        high:
          description: The maximum price in the aggregation time period
          type: string
          example: "312.4418815371496"
        low:
          description: The minimum price in the aggregation time period
          type: string
          example: "297.4296073392959"
        close:
          description: The closing price at the end of the aggregation time period
          type: string
          example: "299.5950052685418"
    Instrument_v1:
      type: object
      properties:
        instrument_id:
          description: A unique integer identifier to represent the instrument
          type: string
          example: 22653087021498353
        instrument_uuid:
          description: A UUID to represent the instrument
          type: string
          format: uuid
          example: 97645486-8058-4d98-aa1e-5ab2685d09c8
        symbol:
          description: A human readable representation of the instrument
          type: string
          example: BTC-USDC
        type:
          $ref: "#/components/schemas/InstrumentType"
        mode:
          $ref: "#/components/schemas/InstrumentMode"
        base_asset_id:
          description: The identifier of the base asset
          type: string
          example: 2919822098049565
        base_asset_uuid:
          description: A UUID to represent the base asset
          type: string
          format: uuid
          example: 592a8039-db3e-45ed-b752-ffd1983eead2
        base_asset_name:
          description: The name of the base asset
          type: string
          example: BTC
        quote_asset_id:
          description: The identifier of the quote asset
          type: string
          example: 45922259775510765
        quote_asset_uuid:
          description: A UUID to represent the quote asset
          type: string
          format: uuid
          example: a96dc949-7650-4a70-8227-955366a22297
        quote_asset_name:
          description: The name of the quote asset
          type: string
          example: USDC
        base_increment:
          description: The minimum allowed quantity change of the base asset
          type: string
          example: 0.000001
        quote_increment:
          description: The minimum allowed price change of the quote asset
          type: string
          example: 0.01
        price_band_percent:
          description: The max percentage from BBO permitted for order placement
          type: number
          format: double
          example: 0.02
        market_order_percent:
          description: The percentage from BBO used to price bound market orders
          type: number
          format: double
          example: 0.015
        qty_24hr:
          description: The qty traded over the last 24hr period
          type: string
          example: 4318.12
        notional_24hr:
          description: The notional amount in USDC traded over the last 24hr period
          type: string
          example: 86362400
        avg_daily_qty:
          description: The 30 day average daily traded qty updated daily
          type: string
          example: 5741.531
        avg_daily_notional:
          description: The 30 day average daily traded notional amount in USDC updated daily
          type: string
          example: 109430620
        previous_day_qty:
          description: The traded qty in the previous day (It gets disseminated daily around 12am UTC.)
          type: string
          example: 5741.531
        open_interest:
          description: The total number of active positions held by traders
          type: string
          example: 100
        position_limit_qty:
          description: The max qty allowed for a position
          type: string
        position_limit_adq_pct:
          description: The max percentage of ADQ allowed for a position
          type: number
          format: double
          example: 0.03
        position_notional_limit:
          description: The max notional value allowed for a position
          type: string
          example: "57509393.1183"
        open_interest_notional_limit:
          description: The total notional value of active positions held by traders
          type: string
          example: "299974395.974"
        replacement_cost:
          description: The replacement cost used in the margin calculations
          type: string
          example: 421.31
        base_imf:
          description: The margin requirement corresponding to maximum allowed leverage when trading on margin
          type: number
          format: double
          example: 0.1
        default_imf:
          description: The margin requirement needed to exceed the high leverage position restrictions
          type: number
          format: double
          example: 0.2
        min_notional_value:
          description: The smallest notional amount in USDC allowed to place an order
          type: string
          example: 10.00
        funding_interval:
          description: The amount of time in nanoseconds between funding intervals
          type: string
          example: 36000000000
        trading_state:
          $ref: "#/components/schemas/InstrumentTradingState"
        quote:
          $ref: '#/components/schemas/InstrumentQuote_v1'
        base_asset_multiplier:
          description: The multiply factor to indicate the number of units in one contract
          type: string
          example: 1.0
        underlying_type:
          description: The type of the underlying asset. Value can be INDEX when underlying asset represents an index or SPOT when underlying asset is a spot.
          type: string
          example: "SPOT"
        rfq_maker_fee_rate:
          description: The fee rate charged for RFQ quotes.
          type: string
          example: 0.01
    InstrumentQuote_v1:
      type: object
      properties:
        best_bid_price:
          description: The highest buy order price resting on the book
          type: string
          example: 20000.50
        best_bid_size:
          description: The total amount available at the best bid price
          type: string
          example: 3.541424
        best_ask_price:
          description: The lowest sell order price resting on the book
          type: string
          example: 20001.75
        best_ask_size:
          description: The total amount available at the best ask price
          type: string
          example: 2.8754
        trade_price:
          description: The price of the most recent trade
          type: string
          example: 20000.63
        trade_qty:
          description: The size of the most recent trade
          type: string
          example: 0.73
        index_price:
          description: For perpetual futures only, the index price used for the funding process
          type: string
          example: 20001.45
        mark_price:
          description: The current mark price value used in risk and margin calculations
          type: string
          example: 20000.63
        settlement_price:
          description: The most recent settlement price value
          type: string
          example: 20000.23
        limit_up:
          description: The max price the book allows buy orders to trade
          type: string
          example: 21056.35
        limit_down:
          description: The min price the book allows sell orders to trade
          type: string
          example: 19531.50
        predicted_funding:
          description: The predicted funding rate based on the current state of a rolling calculation
          type: string
          example: 0.1543
        timestamp:
          description: The timestamp of the last quote update
          type: string
          format: date-time
    InstrumentDailyVolume_v1:
      type: object
      properties:
        timestamp:
          description: The date of the aggregated volume data
          type: string
          example: "2024-04-23T00:00:00Z"
        instruments:
          description: List of instruments with their respective daily volumes
          type: array
          items:
            $ref: '#/components/schemas/InstrumentDailyVolumeEntry_v1'
        totals:
          $ref: '#/components/schemas/InstrumentDailyVolumeTotals_v1'
    InstrumentDailyVolumeEntry_v1:
      type: object
      properties:
        symbol:
          description: The instrument symbol
          type: string
          example: "BTC-PERP"
        volume:
          description: Daily volume for that instrument denominated in base asset quantity
          type: string
          example: "2180.5428999997785"
        notional:
          description: Daily notional volume for that instrument
          type: string
          example: "145087054.13650635"
    InstrumentDailyVolumeTotals_v1:
      type: object
      properties:
        total_instruments_volume:
          description: Daily volume for all instruments denominated in base asset quantity
          type: string
          example: "255682824.87039998"
        total_instruments_notional:
          description: Daily notional volume for all instruments
          type: string
          example: "2180.5428999997785"
        total_exchange_volume:
          description: Daily volume for all instruments denominated in base asset quantity
          type: string
          example: "255682824.87039998"
        total_exchange_notional:
          description: Daily notional volume for all instruments
          type: string
          example: "2180.5428999997785"
    InstrumentCandlesAggregation_v1:
      type: object
      properties:
        start:
          description: The start time of the aggregation
          type: string
          example: "2024-04-23T00:00:00Z"
        open:
          description: The opening price at the start of the aggregation time period
          type: string
          example: "62884.4"
        high:
          description: The maximum price in the aggregation time period
          type: string
          example: "64710.6"
        low:
          description: The minimum price in the aggregation time period
          type: string
          example: "62884.4"
        close:
          description: The closing price at the end of the aggregation time period
          type: string
          example: "63508.4"
        volume:
          description: The total trading volume during the aggregation time period
          type: string
          example: "3253.9983"
    InstrumentFunding_v1:
      type: object
      properties:
        instrument_id:
          description: The unique identifier of the instrument for which the funding rate applies
          type: string
          example: 14thr7ft-1-0
        funding_rate:
          description: The final funding rate based on the state of the rolling calculation at the `event_time`.
          type: string
          example: 0.1543
        mark_price:
          description: The current mark price value used in risk and margin calculations
          type: string
          example: 20000.63
        event_time:
          description: The time that the final funding rate was determined. Uses ISO-8601 format (e.g., 2023-03-16T23:59:53Z)
          type: string
          format: date-time
          example: 2023-03-16T23:59:53Z
    InstrumentPositionOffsetPair_v1:
      type: object
      properties:
        primary_instrument_id:
          description: The unique identifier of the primary instrument
          type: string
          example: 14thr7ft-1-0
        secondary_instrument_id:
          description: The unique identifier of the secondary instrument
          type: string
          example: 31bpa1qz-1-1
        offset:
          description: The offset value for the pair
          type: string
          example: 0.02
    Portfolio_v1:
      type: object
      properties:
        portfolio_id:
          description: A unique identifier for the portfolio
          type: string
          example: 14thr7ft-1-0
        portfolio_uuid:
          description: A UUID for the portfolio
          type: string
          format: uuid
          example: 3d50e347-6a59-4965-a4cd-b25934d84126
        name:
          description: A human readable name for the portfolio
          type: string
          example: Investment Account
        user_uuid:
          description: A user UUID for brokers that attribute a single user per portfolio
          type: string
          format: uuid
          example: f67de785-60a7-45ea-b87a-07e83eae7c12
        maker_fee_rate:
          description: The fee rate charged for order making liquidity
          type: string
          example: 0.02
        taker_fee_rate:
          description: The fee rate charged for orders taking liquidity
          type: string
          example: 0.04
        trading_lock:
          description: Indicates if the portfolio has been locked from trading
          type: boolean
        borrow_disabled:
          description: Indicates whether or not the portfolio can borrow
          type: boolean
        is_lsp:
          description: Indicates if the portfolio is setup to take liquidation assignments
          type: boolean
        is_default:
          description: Indicates if the portfolio is the account default portfolio
          type: boolean
        cross_collateral_enabled:
          description: Indicates if the cross collateral is enabled for the portfolio
          type: boolean
        pre_launch_trading_enabled:
          description: Indicates if pre-launch trading is enabled for the portfolio
          type: boolean
    PortfolioSummary_v1:
      type: object
      properties:
        collateral:
          description: The total collateral value in USDC for the portfolio
          type: string
          example: 14750.53
        unrealized_pnl:
          description: The profit or loss of all open positions (resets to 0 after settlement)
          type: string
          example: 2953.01
        unrealized_pnl_percent:
          description: The profit or loss percentage of all open positions (resets to 0 after settlement)
          type: string
          example: 0
        position_notional:
          description: The position value in USDC of all positions
          type: string
          example: 1050.32
        open_position_notional:
          description: The notional value of all open orders and positions
          type: string
          example: 3010.02
        pending_fees:
          description: Accrued fees that haven't been paid yet
          type: string
          example: 120.31
        borrow:
          description: Total borrow amount in USDC (nets the USDC balance, position PNL, held USDC, accrued interest and rolling debt)
          type: string
          example: 4111.32
        accrued_interest:
          description: Interest charged for borrowed USDC balances
          type: string
          example: 10.02
        rolling_debt:
          description: Amount of settled transactions that haven't been paid
          type: string
          example: 311.02
        balance:
          description: The net balance available in the portfolio (collateral + unrealized_pnl - pending_fees - accrued_interest - rolling_debt)
          type: string
          example: 15751.60
        buying_power:
          description: The amount of buying power available in the portfolio (balance - (open_position_notional * portfolio_initial_margin))
          type: string
          example: 14964.02
        portfolio_initial_margin:
          description: The weighted average of all the position's initial margin utilization
          type: number
          format: double
          example: 0.05
        portfolio_current_margin:
          description: The current margin level of the portfolio
          type: number
          format: double
          example: 0.05
        portfolio_maintenance_margin:
          description: The maintenance margin of the portfolio
          type: number
          format: double
          example: 0.033
        portfolio_close_out_margin:
          description: The close out margin of the portfolio
          type: number
          format: double
          example: 0.01665
        in_liquidation:
          description: Indicates whether the portfolio is in process of liquidation
          type: boolean
        portfolio_initial_margin_notional:
          description: The notional initial margin of the portfolio
          type: number
          format: double
          example: 1571.5345
        portfolio_current_margin_notional:
          description: The notional current margin level of the portfolio
          type: number
          format: double
          example: 1571.5345
        portfolio_maintenance_margin_notional:
          description: The notional maintenance margin of the portfolio
          type: number
          format: double
          example: 1023.3081
        portfolio_close_out_margin_notional:
          description: The notional close out margin of the portfolio
          type: number
          format: double
          example: 482.6651
        margin_override:
          description: The margin override value for the portfolio, indicating notional requirement to hold futures positions
          type: number
          format: double
          example: 0.20
        lock_up_initial_margin:
          description: The effective margin requirement value for the portfolio `(max(portfolio_initial_margin, margin_override))`
          type: number
          format: double
          example: 0.30
        loan_collateral_requirement:
          type: string
          example: 0
        position_offset_notional:
          description: The notional value of margin relief provided by position offsets
          type: double
          example: 3010.02
    PortfolioBalance_v1:
      type: object
      properties:
        asset_id:
          description: The unique identifier of the asset
          type: string
          example: 14thr7fc-1-1
        asset_name:
          description: Name of the asset
          type: string
          example: BTC
        asset_uuid:
          description: The UUID of the asset
          type: string
          format: uuid
          example: d92669ba-8a04-46d8-9b28-a2bbaeee3b9a
        quantity:
          description: The total amount of the asset in the portfolio
          type: string
          example: 1.75
        hold:
          description: The amount of the balance held from trading activity
          type: string
          example: 0.50
        hold_available_for_collateral:
          description: The amount of the held balance eligible for collateral
          type: string
          example: 0.50
        transfer_hold:
          description: The amount of the balance held from a pending transfer
          type: string
          example: 0.25
        collateral_value:
          description: The collateral value provided by this asset balance
          type: string
          example: 0.90
        max_withdraw_amount:
          description: The maximum amount of this asset that can be withdrawn on-chain at this time given margin requirement constraints
          type: string
          example: 0.90
        loan:
          description: The total quantity of the asset borrowed by the portfolio
          type: string
          example: 1.0
        loan_collateral_requirement:
          description: The notional collateral requirement to hold the loan
          type: string
          example: 0
        pledged_collateral_quantity:
          description: The amount of the asset pledged as collateral
          type: string
          example: 0.50
        loan_initial_margin_contribution:
          description: The notional amount this loan contributes to the portfolio initial margin notional value
          format: string
          example: 0.07
        collateral_backed_overdraft_loan:
          description: The quantity of the asset automatically borrowed by the portfolio to cover USDC deficits
          type: string
          example: 100.50
        user_requested_loan:
          description: The quantity of the asset borrowed by the portfolio upon explicit request
          type: string
          example: 548.50
    PortfolioLoanInfoResult_v1:
      type: object
      properties:
        portfolio_id:
          description: The unique identifier of the portfolio the fill was executed under
          type: string
          example: t4umaqa-1-1
        asset_id:
          description: The unique identifier of the asset
          type: string
          example: 14thr7fc-1-1
        asset_uuid:
          description: The UUID of the asset
          type: string
          format: uuid
          example: d92669ba-8a04-46d8-9b28-a2bbaeee3b9a
        asset:
          description: Name of the asset
          type: string
          example: USDC
        total_loan:
          description: The total quantity of the asset borrowed by the portfolio
          type: string
          example: 100.75
        collateral_backed_overdraft_loan:
          description: The quantity of the asset automatically borrowed by the portfolio to cover USDC deficits
          type: string
          example: 10.50
        user_requested_loan:
          description: The quantity of the asset borrowed by the portfolio upon explicit request
          type: string
          example: 64.50
        collateral_requirement:
          description: The notional collateral requirement to hold the loan
          type: string
          example: 10.01
        initial_margin_contribution:
          description: The notional amount this loan contributes to the portfolio initial margin notional value
          format: string
          example: 0.07
        initial_margin_requirement:
          description: The initial margin requirement of the loan
          format: string
          example: 0.15
        current_interest_rate:
          description: The annualized interest rate to hold the loan
          type: string
          example: 0.085
        pending_interest_charge:
          description: The pending USDC charge for the loan that will be charged at UTC midnight
          type: string
          example: 0.90
    PortfolioPreviewLoanUpdateResult_v1:
      type: object
      properties:
        initial_margin_contribution:
          description: The notional amount this loan contributes to the portfolio initial margin notional value
          format: string
          example: 0.07
        initial_margin_delta:
          description: The delta of notional amount this loan contributes to the portfolio initial margin notional value
          format: string
          example: 0.07
        portfolio_initial_margin:
          description: The weighted average of all initial margin utilization
          type: string
          example: 0.15
        portfolio_initial_margin_notional:
          description: The notional initial margin of the portfolio
          type: string
          example: 1571.5345
        loan_collateral_requirement:
          description: The notional collateral requirement to hold the loan
          type: string
          example: 10.01
        loan_collateral_requirement_delta:
          description: The delta of notional collateral requirement to hold the loan
          type: string
          example: 10.01
        total_loan:
          description: The total quantity of the asset borrowed by the portfolio
          type: string
          example: 100.75
        loan_delta:
          description: The delta of the total quantity of the asset borrowed by the portfolio
          type: string
          example: 10.75
        max_available:
          description: The maximum remaining amount of this asset that can be borrowed at this time
          type: string
          example: 500.90
        reject_details:
          description: The reason for the rejection of the loan preview request
          type: string
        is_valid:
          description: Indicates whether the requested loan preview could be executed
          type: boolean
    PortfolioUpdateLoanResult_v1:
      type: object
      properties:
        portfolio_id:
          description: The unique identifier of the portfolio
          type: string
          example: t4umaqa-1-1
        asset_id:
          description: The unique identifier of the asset
          type: string
          example: 14thr7fc-1-1
        delta:
          description: The change in the loan amount
          type: number
          format: double
          example: 10.75
        total:
          description: The total quantity of the asset borrowed by the portfolio
          type: number
          format: double
          example: 100.75
        asset_uuid:
          description: The UUID of the asset
          type: string
          format: uuid
          example: d92669ba-8a04-46d8-9b28-a2bbaeee3b9a
        portfolio_uuid:
          description: The UUID of the portfolio
          type: string
          format: uuid
          example: 018ab3b1-d38a-750e-8a1d-8b7815ea8bfb
    PortfolioGetAvailableLoanResult_v1:
      type: object
      properties:
        available:
          type: string
          example: 50000
    PortfolioPosition_v1:
      type: object
      properties:
        id:
          description: The unique identifier of the position
          type: string
          example: 1tvrktwe-1-457
        symbol:
          description: Name of the instrument the position is in
          type: string
          example: BTC-PERP
        instrument_id:
          description: The unique identifier of the instrument the position is in
          type: string
          example: 14thr7ft-1-0
        instrument_uuid:
          description: The UUID of the instrument the position is in
          type: string
          format: uuid
          example: 8ca6c040-48df-426b-bb4e-74413909da26
        vwap:
          description: The price of your position based on the last settlement period. During each settlement period (5 minute interval), the VWAP is set to equal the mark_price.
          type: string
          example: 31011.75
        net_size:
          description: The size of the position with positive values reflecting a long position and negative values reflecting a short position
          type: string
          example: 1.75
        buy_order_size:
          description: Cumulative size of all the open buy orders
          type: string
          example: 2.65
        sell_order_size:
          description: Cumulative size of all the open sell orders
          type: string
          example: 1.2
        im_contribution:
          description: The amount this position contributes to the initial margin
          type: number
          format: double
          example: 0.07
        unrealized_pnl:
          description: The profit or loss of this position (resets to 0 after settlement)
          type: string
          example: 2953.01
        mark_price:
          description: The current mark price value for the instrument of this position used in risk and margin calculations
          type: string
          example: 20000.63
        entry_vwap:
          description: Volume weighted entry price of the position (not reset to the last funding price)
          type: string
          example: 34021.45
    BeneficialOwnerTotalOpenPositionLimits_V1:
      type: object
      properties:
        total_open_position_notional_limit:
          description: The total notional limit across all instrument positions allowed to be opened. The value is not present if total_open_position_notional_limit_enforced is false.
          type: string
          format: number
          example: 2250000000.0
        total_open_position_notional_limit_enforced:
          description: Whether total notional limit across all instrument positions allowed to be opened is enforced.
          type: boolean
    BeneficialOwnerPosition_V1:
      type: object
      properties:
        symbol:
          description: Name of the instrument the position is in
          type: string
          example: BTC-PERP
        instrument_id:
          description: The unique identifier of the instrument the position is in
          type: string
          example: 14thr7ft-1-0
        instrument_uuid:
          description: The UUID of the instrument the position is in
          type: string
          format: uuid
          example: 8ca6c040-48df-426b-bb4e-74413909da26
        open_position_notional_limit:
          description: The notional limit of the instrument position allowed to be opened
          type: string
          format: number
          example: 250000000.0
    PortfolioDetail_v1:
      type: object
      properties:
        summary:
          $ref: '#/components/schemas/PortfolioSummary_v1'
        balances:
          type: array
          items:
            $ref: '#/components/schemas/PortfolioBalance_v1'
        positions:
          type: array
          items:
            $ref: '#/components/schemas/PortfolioPosition_v1'
    PortfolioFill_v1:
      type: object
      properties:
        portfolio_id:
          description: The unique identifier of the portfolio the fill was executed under
          type: string
          example: t4umaqa-1-1
        portfolio_uuid:
          description: The UUID of the portfolio the fill was executed under
          type: string
          example: 018ab3b1-d38a-750e-8a1d-8b7815ea8bfb
        portfolio_name:
          description: The name of the portfolio the fill was executed under
          type: string
          example: portfolio1
        fill_id:
          description: A unique identifier for the fill event
          type: string
          example: 14thr7g8-1-1
        exec_id:
          description: A unique fill_id represented in numeric format
          type: string
          example: 224040873497739742
        order_id:
          description: The original order id
          type: string
          example: 14thr7eg-1-1
        instrument_id:
          description: The unique identifier of the instrument the fill is in
          type: string
          example: 14thr7dw-1-0
        instrument_uuid:
          description: The UUID of the instrument the fill is in
          type: string
          format: uuid
          example: c3f2130a-1e47-4f33-9a88-beffc11fdd50
        symbol:
          description: Name of the instrument the fill is in
          type: string
          example: BTC-PERP
        match_id:
          description: A unique identifier for the match event that is used on both sides of the trade
          type: string
          example: 14thr75g-0-0
        fill_price:
          description: The price that this fill traded at
          type: string
          example: 31011.75
        fill_qty:
          description: The amount traded in this fill event
          type: string
          example: 0.2
        client_id:
          description: The API key of the client that submitted the order
          type: string
          example: 4V5LrMqiJPU44hpQ
        client_order_id:
          description: The client specific order ID sent on the order
          type: string
          example: ABC123
        order_qty:
          description: The quantity specified on the order
          type: string
          example: 1.2
        limit_price:
          description: The limit price specified on the order (specific to limit orders)
          type: string
          example: 31012.00
        total_filled:
          description: The total amount filled on the order so far
          type: string
          example: 0.1
        filled_vwap:
          description: The weighted average price of the total amount filled on the order so far
          type: string
          example: 31011.1
        expire_time:
          description: The expiration time for orders with the time in force set to GTT. Uses ISO-8601 format (e.g., 2023-03-16T23:59:53Z).
          type: string
          format: date-time
          example: 2023-03-16T23:59:53Z
        stop_price:
          description: The trigger price for a stop order (specific to stop orders)
          type: string
          example: 31010.5
        side:
          $ref: "#/components/schemas/OrderSide"
        tif:
          $ref: "#/components/schemas/TimeInForce"
        stp_mode:
          $ref: "#/components/schemas/SelfTradePreventionMode"
        flags:
          description: Additional order flags
          type: string
        fee:
          description: The fee charged on the fill
          type: string
          example: 75.53
        fee_asset:
          description: The asset type the fee was charged in
          type: string
          example: USDC
        order_status:
          $ref: "#/components/schemas/OrderStatus"
        event_time:
          description: The time that the fill event occurred. Uses ISO-8601 format (e.g., 2023-03-16T23:59:53Z)
          type: string
          format: date-time
          example: 2023-03-16T23:59:53Z
        source:
          $ref: "#/components/schemas/Source"
        execution_venue:
          description: Mechanism by which the match was found. CLOB for central limit order book matching, RFQ for the request-for-quote feature.
          type: string
          example: CLOB
    PortfolioUpdateMarginOverride_v1:
      type: object
      properties:
        portfolio_id:
          description: The unique identifier of the portfolio the fill was executed under
          type: string
          format: string
          example: t4umaqa-1-1
        margin_override:
          description: The margin override value for the portfolio, indicating notional requirement to hold futures positions
          type: number
          format: double
          example: 0.20
    OrderResult_v1:
      type: object
      properties:
        order_id:
          description: A unique identifier assigned by the exchange
          type: string
          example: 43877033468085758
        client_order_id:
          description: A unique identifier assigned by the client
          type: string
          example: ABC123
        side:
          $ref: "#/components/schemas/OrderSide"
        instrument_id:
          description: The unique identifier of the instrument the order wants to transact in
          type: string
          example: 2562519737567269
        instrument_uuid:
          description: The UUID of the instrument the order wants to transact in
          type: string
          format: uuid
          example: 359f66d8-4235-47c3-9733-0fbfe2cfaa0a
        symbol:
          description: The name of the instrument the order wants to transact in
          type: string
          example: BTC-PERP
        portfolio_id:
          description: The unique identifier of the portfolio the order was submitted under
          type: string
          format: string
          example: 1724343681801273
        portfolio_uuid:
          description: The UUID of the portfolio the order was submitted under
          type: string
          format: uuid
          example: b80ec69b-1229-4bcf-a6a8-c506ffd74c20
        type:
          $ref: "#/components/schemas/OrderType"
        price:
          description: The max or min price limit in quote asset units to buy or sell at (respectively). Only used for limit and stop limit order types.
          type: string
          example: 20215.53
        stop_price:
          description: The market price that activates a stop order
          type: string
          example: 20015.53
        stop_limit_price:
          description: The limit price at which the TP/SL stop leg order will be placed. Only used for TP/SL order type.
          type: string
          example: 20015.53
        size:
          description: The amount in base asset units
          type: string
          example: 1.5423
        tif:
          $ref: "#/components/schemas/TimeInForce"
        expire_time:
          description: The expiration time for orders with the time in force set to GTT. Uses ISO-8601 format (e.g., 2023-03-16T23:59:53Z).
          type: string
          format: date-time
          example: 2023-03-16T23:59:53Z
        stp_mode:
          $ref: "#/components/schemas/SelfTradePreventionMode"
        event_type:
          $ref: "#/components/schemas/OrderEventType"
        event_time:
          type: string
          format: date-time
          example: 2023-03-16T23:59:53Z
        submit_time:
          type: string
          format: date-time
          example: 2023-03-16T23:59:53Z
        order_status:
          $ref: "#/components/schemas/OrderStatus"
        leaves_qty:
          description: The amount of the order remaining open on the exchange
          type: string
        exec_qty:
          description: The traded quantity on the order
          type: string
        avg_price:
          description: The average price that the order has traded at so far
          type: string
        fee:
          description: The exchange fee affiliated with the trade (only for trade events)
          type: string
        post_only:
          description: Indicates that the order was submitted with the `post_only` instruction
          type: boolean
        close_only:
          description: Indicates that the order was submitted with the `close_only` instruction
          type: boolean
        algo_strategy:
          $ref: "#/components/schemas/AlgoStrategy"
        text:
          description: A text message that gets populated for canceled orders
          type: string
          example: client cancel
    AddressResponse_v1:
      type: object
      properties:
        address:
          description: The crypto address generated from the request
          type: string
          example: 1KpPmua1jzSxMMZ5iPGizyetpCPkZHNKTd
        network_arn_id:
          description: A unique identifier representing the combination of the network and asset
          type: string
          example: networks/ethereum-mainnet/assets/313ef8a9-ae5a-5f2f-8a56-572c0e2a4d5a
        destination_tag:
          description: An identifier used to determine the account a crypto transfer should be credited to. Not present for all asset types.
          type: string
    CreateCryptoWithdrawalResult_V1:
      type: object
      properties:
        idem:
          description: Idempotent UUID representing the successful withdraw
          type: string
          example: 253b30a5-9b03-4cd2-9c76-d0f32b2bd733
    FeeEstimateResponse:
      type: object
      properties:
        estimated_fee:
          type: object
          properties:
            value:
              type: string
              example: 0.0
            currency:
              type: string
              example: USDC
          description: Total Estimated Fee
        estimated_fee_before_subsidy:
          type: object
          properties:
            value:
              type: string
              example: 0.078908
            currency:
              type: string
              example: USDC
          description: Estimated fee before subsidies (ie. before free USDC transfers)
        expiresAt:
          description: Time when estimated fee is no longer valid for.
          type: string
          example: 2023-08-10T17:25:22Z
    AddressValidationResponse:
      type: object
      properties:
        is_valid:
          description: Returns whether or not the crypto address on that specific network is valid
          type: boolean
    Transfer_v1:
      type: object
      properties:
        transfer_uuid:
          description: A unique identifier for the transfer
          type: string
          format: uuid
          example: 7975e6ab-57ed-4751-b359-13f63f4da793
        transfer_type:
          $ref: "#/components/schemas/TransferType"
        amount:
          description: The amount of the asset being transferred
          type: string
          example: 5100.50
        asset:
          description: The asset being transferred
          type: string
          example: USDC
        status:
          $ref: "#/components/schemas/TransferStatus"
        network_name:
          description: The common name of the network on which the transfer occurred
          type: string
          example: ethereum
        created_at:
          description: The time the transfer was created
          type: string
          format: date-time
          example: 2023-01-29T14:32:28Z
        updated_at:
          description: The time of the most recent status change of the transfer
          type: string
          format: date-time
          example: 2023-01-29T14:32:28Z
        from_portfolio:
          description: portfolio identifiers of the transfer source
          type: object
          properties:
            id:
              type: string
              example: 14thr7ft-1-0
            uuid:
              type: string
              format: uuid
              example: 7975e6ab-57ed-4751-b359-13f63f4da793
            name:
              type: string
              example: portfolio1
        to_portfolio:
          description: portfolio identifiers of the transfer target
          type: object
          properties:
            id:
              type: string
              example: 14thr7ft-1-0
            uuid:
              type: string
              format: uuid
              example: 7975e6ab-57ed-4751-b359-13f63f4da793
            name:
              type: string
              example: portfolio1
        from_address:
          description: blockchain address of transfer source
          type: string
          example: 0x29d2D586e222D0610b04e71974699589379F13b5
        to_address:
          description: blockchain address of transfer target
          type: string
          example: 0x29d2D586e222D0610b04e71974699589379F13b5
        from_cb_account:
          description: Coinbase account Id of transfer source
          type: string
          example: 64ac90a106d1db7863f9ab7d
        to_cb_account:
          description: Coinbase account Id of transfer target
          type: string
          example: 64ac90a106d1db7863f9ab7d
        from_counterparty_id:
          description: Coinbase counterparty Id of transfer source if it is a counterparty transfer
          type: string
          example: CBTQDGENHE
        to_counterparty_id:
          description: Coinbase counterparty Id of transfer target if it is a counterparty transfer
          type: string
          example: CBA6POFJW7
        instrument_id:
          description: The unique identifier of the instrument associated with the funding event
          type: string
          example: 2562519737567269
        instrument_symbol:
          description: The name of the instrument associated with the funding event
          type: string
          example: BTC-PERP
        txn_hash:
          description: transaction hash associated with an on-chain deposit or on-chain withdrawal
          type: string
          example: Z3dQkmcWeuQxHKFPfsQs8QA8Jq9PFWr5yCwUjhQKcX5o99q3BmnyFfqZGNqRg9CWY9xV6QDBdDA9pH3AM6Ajpaq
        position_id:
          description: id of the position used to calculate the funding payment
          type: string
          example: 14thr7ft-1-0
    CreateCounterpartyIdResponse_v1:
      type: object
      properties:
        portfolio_uuid:
          description: UUID for the portfolio
          type: string
          format: uuid
          example: 3d50e347-6a59-4965-a4cd-b25934d84126
        counterparty_id:
          description: Counterparty Id for the portfolio
          type: string
          example: CBTQDGENHE
    ValidateCounterpartyIdResponse_v1:
      type: object
      properties:
        counterparty_id:
          description: Counterparty Id
          type: string
          example: CBTQDGENHE
        valid:
          description: Whether the counterparty Id is valid to withdraw to
          type: boolean
          example: true
    CreateCounterpartyWithdrawResult_v1:
      type: object
      properties:
        idem:
          description: Idempotent UUID representing the successful withdraw
          type: string
          example: 253b30a5-9b03-4cd2-9c76-d0f32b2bd733
        portfolio_uuid:
          description: UUID for the portfolio where the withdraw was initiated
          type: string
          format: uuid
          example: 3d50e347-6a59-4965-a4cd-b25934d84126
        source_counterparty_id:
          description: Counterparty Id of the source portfolio
          type: string
          example: CBTQDGENHE
        target_counterparty_id:
          description: Counterparty Id of the target portfolio
          type: string
          example: CBA6POFJW7
        asset:
          description: The asset being transferred
          type: string
          example: USDC
        amount:
          description: The amount of the asset being transferred
          type: string
          example: 5100.50
    FeeRateTier_v1:
      type: object
      properties:
        fee_tier_type:
          $ref: "#/components/schemas/FeeTierType"
        instrument_type:
          $ref: "#/components/schemas/InstrumentType"
        fee_tier_id:
          description: Fee tier id
          type: string
          example: 1
        fee_tier_name:
          description: Name for the fee rate tier
          type: string
          example: Public Tier 1
        maker_fee_rate:
          description: The fee rate charged for order making liquidity
          type: string
          example: 0.02
        taker_fee_rate:
          description: The fee rate charged for orders taking liquidity
          type: string
          example: 0.04
        min_balance:
          description: The minimum USDC balance required to qualify for the fee tier
          type: string
          example: 1000.00
        min_volume:
          description: The minimum 30 days volume required to qualify for the fee tier. For liquidity program tiers, this is the percentage of volume
          type: string
          example: 1000.00
        require_balance_and_volume:
          description: Whether the fee tier requires both a minimum balance and volume to qualify
          type: boolean
    PortfolioFeeRate_v1:
      type: object
      properties:
        instrument_type:
          $ref: "#/components/schemas/InstrumentType"
        fee_tier_id:
          description: Fee tier id
          type: string
          example: 1
        is_vip_tier:
          description: Whether the fee tier is a VIP tier
          type: boolean
        fee_tier_name:
          description: Name for the fee rate tier
          type: string
          example: Public Tier 1
        maker_fee_rate:
          description: The fee rate charged for order making liquidity
          type: string
          example: 0.02
        taker_fee_rate:
          description: The fee rate charged for orders taking liquidity
          type: string
          example: 0.04
        is_override:
          description: Whether maker/taker fee rates are manually overridden
          type: boolean
        trailing_30day_volume:
          description: Sum of trading volume from last rolling 30 days
          type: string
          example: 1000.00
        trailing_24hr_usdc_balance:
          description: Average of all hourly USDC balance snapshots from the last rolling 24 hours
          type: string
          example: 1000.00
    Rankings_v1:
      type: object
      properties:
        rank:
          description: Ranking of the user based on the volume traded. If the user has not traded, the value returned is "--". If the instrumentType parameter is PERPETUAL_FUTURE then the user will see their rank if they are in the top 10, otherwise the value of `rank` will be 10+. If the instrumentType parameter is SPOT then the user will see their rank if they are in the top 3, otherwise the value of `rank` will be 3+.
          type: string
          example: 1
        relative_percent:
          description: percentage of the total volume traded by this user
          type: string
          example: 30.0
        volume:
          description: total volume traded by this user
          type: string
          example: 1000000
    PortfolioMarginCallStatusReadResult_V1:
      type: object
      properties:
        portfolio_id:
          description: portfolio ID
          type: string
          example: 14thr7ft-1-0
        status:
          description: The status of the margin call
          type: string
          enum: [ "NOT_LIQUIDATING", "MARGIN_CALL_PENDING", "LIQUIDATING" ]
          example: MARGIN_CALL_PENDING
        margin_call_duration:
          description: the ISO 8601 duration from a margin call start to expiry
          type: string
          example: 6H
        active_margin_call:
          $ref: '#/components/schemas/ActiveMarginCall'
    ActiveMarginCall:
      description: details of an active margin call if there is one
      type: object
      properties:
        start_time:
          description: the start time of the margin call in UTC
          type: string
          example: 2023-01-29T14:32:28Z
        expiry_time:
          description: the expiry time of the margin call in UTC
          type: string
          example: 2023-01-29T20:32:28Z
        margin_call_amount:
          description: the collateral value required to bring the portfolio back to healthy, of which at least `usdc_requirement` has to be USDC.
          type: number
          example: 10200
        usdc_requirement:
          description: the usdc value required to resolve rolling debt
          type: number
          example: 500
        cure_requirements:
          description: the requirements to cure a margin call
          type: object
          properties:
            initial_margin_deficit:
              description: the portfolio equity has to meet the initial margin requirement
              type: boolean
            usdc_requirement:
              description: the portfolio has to repay rolling debt
              type: boolean
    AlgoStrategy:
      description: Specifies the algorithmic trading strategy for the order
      type: string
      enum: [ "TWAP" ]
      example: TWAP
    AssetStatus:
      description: An asset level status that would affect all markets with the asset
      type: string
      enum: ["ACTIVE", "DISABLED"]
      example: ACTIVE
    InstrumentType:
      description: The type of instrument
      type: string
      enum: ["SPOT", "PERP"]
      example: PERP
    InstrumentMode:
      description: The mode of instrument
      type: string
      enum: [ "STANDARD", "PRE_LAUNCH", "PRE_LAUNCH_CONVERTING"]
      example: STANDARD
    InstrumentTradingState:
      description: An market level status affecting all trading within the market
      type: string
      enum: ["TRADING", "PAUSED", "HALT", "DELISTED", "EXTERNAL"]
      example: TRADING
    Source:
      description: The source of the fill
      type: string
      enum: ["LIQUIDATION", "ASSIGNMENT", "CLIENT_ORDER"]
      example: LIQUIDATION
    OrderSide:
      description: The side of the transaction
      type: string
      enum: ["BUY", "SELL"]
      example: BUY
    OrderStatus:
      description: The type of the order
      type: string
      enum: ["WORKING", "DONE"]
      example: WORKING
    OrderType:
      description: The type of the order
      type: string
      enum: ["LIMIT", "MARKET", "STOP_LIMIT", "STOP", "TAKE_PROFIT_STOP_LOSS"]
      example: LIMIT
    LoanUpdateAction:
      description: The type of loan update action
      type: string
      enum: ["ACQUIRE", "REPAY"]
      example: ACQUIRE
    OrderEventType:
      description: The most recent type of event that happened to the order
      type: string
      enum: ["NEW", "TRADE", "CANCELED", "REPLACED", "PENDING_CANCEL", "REJECTED", "PENDING_NEW", "EXPIRED", "PENDING_REPLACE", "STOP_TRIGGERED"]
      example: TRADE
    TimeInForce:
      description: The time in force applied to an order. A Good Till Cancel (GTC) can last up to 30 days. An Immediate or Cancel (IOC) attempts to fill as much of the order as possible and/or cancels immediately when no resting orders meet or improve the order's price limit. A Fill or Kill (FOK) is canceled without filling if it does not completely fill immediately. This will not be populated for assignments
      type: string
      enum: ["GTC", "IOC", "GTT", "FOK"]
      example: GTC
    SelfTradePreventionMode:
      description: Specifies the behavior for self match handling. None disables the functionality, new cancels the newest order, and both cancels both
      type: string
      enum: ["NONE", "AGGRESSING", "RESTING", "BOTH", "DECREMENT_AND_CANCEL"]
      example: AGGRESSING
    TransferType:
      description: The type of transfer
      type: string
      enum: ["DEPOSIT", "WITHDRAW", "STIPEND", "INTERNAL", "FUNDING", "ALL", "LOAN_ACQUIRE", "LOAN_REPAY", "LOAN_INTEREST_CHARGE", "REAL_TIME_SETTLEMENT", "ALL_LOANS", "LIQUIDATION_EQUITY_CLAWBACK"]
      example: DEPOSIT
    TransferStatus:
      description: The current status of the transfer
      type: string
      enum: ["PROCESSED", "NEW", "FAILED", "STARTED"]
      example: PROCESSED
    FeeTierType:
      description: The type of fee tier
      type: string
      enum: ["REGULAR", "LIQUIDITY_PROGRAM"]
      example: LIQUIDITY_PROGRAM
  parameters:
    time_from:
      name: time_from
      in: query
      description: The minimum `event_time` for results. Uses ISO-8601 format (e.g., 2023-03-16T23:59:53Z)
      schema:
        type: string
        format: date-time
        example: 2023-03-16T23:59:53Z
    ref_datetime:
      name: ref_datetime
      in: query
      description: The maximum `event_time` for results. Can be used in pagination to keep result set static. Uses ISO-8601 format (e.g., 2023-03-16T23:59:53Z)
      # description: The datetime from which to search (results are returned from `ref_datetime` in chronological order starting with the most recent). Uses ISO-8601 format (e.g., 2023-03-16T23:59:53Z)
      required: false
      schema:
        type: string
        format: date-time
        example: 2023-03-16T23:59:53Z
    result_limit:
      name: result_limit
      in: query
      description: The number of results to return (defaults to 25 with a max supported value of 100)
      required: false
      schema:
        type: integer
        example: 30
    result_offset:
      name: result_offset
      in: query
      description: The number of results from the beginning to skip past
      required: false
      schema:
        type: integer
        example: 50
  securitySchemes:
    auth_client_id:
      type: apiKey
      name: CB-ACCESS-KEY
      in: header
      description: The Client ID that owns the API Key for the request
    auth_timestamp:
      type: apiKey
      name: CB-ACCESS-TIMESTAMP
      in: header
      description: The timestamp of when the request is being made
    auth_passphrase:
      type: apiKey
      name: CB-ACCESS-PASSPHRASE
      in: header
      description: The pass phrase affiliated with the API Key
    auth_signature:
      type: apiKey
      name: CB-ACCESS-SIGN
      in: header
      description: A HMAC SHA-256 signature using the API Key secret on the string TIMESTAMP, METHOD, REQUEST_PATH, BODY
