# Funding Rate History

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v1/funding-rate/history:
    get:
      summary: Funding Rate History
      deprecated: false
      description: >-
        Retrieve the historical settled funding rates for one or more futures
        instruments. This endpoint provides the settled funding rates, updated
        at the end of each funding period (every 4 hours for crypto perpetuals).


        An instrument code is the `id` property from the
        [Instruments](https://docs.onetrading.com/rest/public/instruments.md)
        endpoint.


        `from`/`to` accept epoch (s, ms, µs or ns) or an ISO 8601 UTC timestamp
        ending in `Z` (or `YYYY-MM-DD`). `from` must be on or after 2024-01-01,
        not in the future, and strictly before `to`; `to` is exclusive. If
        neither is given, the window is the last 7 days (starting at 00:00 UTC).
        If only `from` is given, `to` is `from` + 7 days (capped at now); if
        only `to` is given, `from` is 7 days earlier (at 00:00 UTC). The range
        is applied to each record's `timestamp`.


        `cursor` is an opaque string. Pass the value from the previous response
        unchanged; it is `null` on the last page.


        Unknown query parameters are rejected with `400 UNEXPECTED_PARAMETERS`.



        :::info[]

        Funding rates are only available for futures markets.

        :::
      tags:
        - One Trading Public REST API/Futures
      parameters:
        - name: instrument_code
          in: query
          description: >-
            Instrument code (e.g. `BTC_USD_P`), or a comma-separated list of
            codes, to fetch settled funding rates for. If not provided, returns
            settled funding rates for all futures instruments.
          required: false
          example: BTC_USD_P
          schema:
            type: string
        - name: from
          in: query
          description: >-
            Start of the time range (inclusive). Epoch (s, ms, µs or ns), ISO
            8601 UTC timestamp ending in `Z`, or `YYYY-MM-DD`.
          required: false
          example: '1733397387858'
          schema:
            type: string
        - name: to
          in: query
          description: >-
            End of the time range (exclusive). Same formats as `from`. The range
            may span at most 366 days.
          required: false
          example: '1733411787858'
          schema:
            type: string
        - name: limit
          in: query
          description: Maximum number of funding rate history records to return per page.
          required: false
          example: 100
          schema:
            type: integer
            maximum: 100
            minimum: 1
            default: 10
        - name: cursor
          in: query
          description: >-
            Opaque pagination cursor from the previous response's `cursor`
            field.
          required: false
          schema:
            type: string
        - name: order
          in: query
          description: Sort order by timestamp. Case-insensitive.
          required: false
          example: DESC
          schema:
            type: string
            enum:
              - ASC
              - DESC
            default: DESC
      responses:
        '200':
          x-apidog-name: Success
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  funding_rates:
                    type: array
                    items:
                      $ref: '#/components/schemas/FundingRateSettled'
                  from:
                    type: string
                    format: date-time
                    description: >-
                      Effective start of the queried range (ISO 8601, nanosecond
                      precision).
                  to:
                    type: string
                    format: date-time
                    description: >-
                      Effective end of the queried range (ISO 8601, nanosecond
                      precision).
                  cursor:
                    type: string
                    description: Opaque cursor for the next page; `null` on the last page.
                    nullable: true
                required:
                  - funding_rates
                  - from
                  - to
                  - cursor
                x-apidog-orders:
                  - funding_rates
                  - from
                  - to
                  - cursor
                x-apidog-ignore-properties: []
              example:
                funding_rates:
                  - instrument_code: BTC_USD_P
                    funding_rate: '0.000017909161806883844'
                    mark_price: '87829.7'
                    time: '1766491200000'
                    timestamp: '2025-12-23T12:00:00Z'
                  - instrument_code: BTC_USD_P
                    funding_rate: '0.00002311127'
                    mark_price: '87612.4'
                    time: '1766476800000'
                    timestamp: '2025-12-23T08:00:00Z'
                from: '2025-12-17T00:00:00.000000000Z'
                to: '2025-12-24T09:30:00.000000000Z'
                cursor: eyJlcG9jaCI6MTc2NjQ3NjgwMDAwMDAwMX0=
          headers: {}
        '400':
          description: >-
            Invalid request. Possible codes: `INVALID_INSTRUMENT_CODE` (returned
            for any unknown, duplicated or empty `instrument_code` value; rely
            on `error` rather than `error_message` for this case),
            `INVALID_PAGE_SIZE` (`limit` not an integer between 1 and 100),
            `INVALID_FROM_TIMESTAMP` / `INVALID_TO_TIMESTAMP` (unparseable,
            before 2024-01-01, or `from` in the future), `INVALID_DATE_RANGE`
            (`from` not before `to`, or range longer than 366 days),
            `INVALID_ORDER`, `INVALID_CURSOR`, `UNEXPECTED_PARAMETERS`.
          content:
            application/json:
              schema: &ref_0
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                '2':
                  summary: INVALID_INSTRUMENT_CODE
                  value:
                    error: INVALID_INSTRUMENT_CODE
                '3':
                  summary: INVALID_PAGE_SIZE
                  value:
                    error: INVALID_PAGE_SIZE
                    error_message: 'page_size must be between 1 and 100, got: 500'
                '4':
                  summary: INVALID_FROM_TIMESTAMP
                  value:
                    error: INVALID_FROM_TIMESTAMP
                    error_message: From date cannot be before 2024-01-01
                '5':
                  summary: INVALID_TO_TIMESTAMP
                  value:
                    error: INVALID_TO_TIMESTAMP
                    error_message: To date must be a valid date format
                '6':
                  summary: INVALID_DATE_RANGE
                  value:
                    error: INVALID_DATE_RANGE
                    error_message: >-
                      Date range cannot exceed 366 days. Provided range was
                      greater than 400 days
                '7':
                  summary: INVALID_ORDER
                  value:
                    error: INVALID_ORDER
                    error_message: 'order must be ''ASC'' or ''DESC'', got: UP'
                '8':
                  summary: INVALID_CURSOR
                  value:
                    error: INVALID_CURSOR
                    error_message: The cursor parameter is invalid or malformed
                '9':
                  summary: UNEXPECTED_PARAMETERS
                  value:
                    error: UNEXPECTED_PARAMETERS
                    error_message: >-
                      Unsupported parameter: foo. Allowed: from, to,
                      instrument_code, cursor, limit, order
          headers: {}
          x-apidog-name: Bad Request
        '500':
          description: Unexpected server error.
          content:
            application/json:
              schema: *ref_0
              example:
                error: SERVER_ERROR
                error_message: An internal server error occurred
          headers: {}
          x-apidog-name: Server Error
      security: []
      x-apidog-folder: One Trading Public REST API/Futures
      x-apidog-status: developing
      x-run-in-apidog: https://app.eu.apidog.com/web/project/349694/apis/api-3642952-run
components:
  schemas:
    FundingRateSettled:
      type: object
      properties:
        instrument_code:
          type: string
          description: The unique identifier for the instrument
          x-apidog-mock: BTC_USD_P
        funding_rate:
          type: string
          description: >-
            The funding rate applied at the time of settlement in fractional
            form. Negative rates indicate shorts paying longs, and positive
            rates indicate longs paying shorts.
          x-apidog-mock: '0.000017909161806883844'
        mark_price:
          type: string
          description: >-
            The mark price of the instrument at the time the funding rate was
            settled.
          x-apidog-mock: '87829.7'
        time:
          type: string
          description: >-
            Millisecond Unix timestamp, as a numeric string, indicating the end
            of the funding period (deprecated; will be removed in future
            versions). Use `timestamp` instead.
          x-apidog-mock: '1766491200000'
          deprecated: true
        timestamp:
          type: string
          description: >-
            Timestamp indicating the end of the funding period (ISO 8601 format,
            seconds precision).
          x-apidog-mock: '2025-12-23T12:00:00Z'
      x-apidog-orders:
        - instrument_code
        - funding_rate
        - mark_price
        - time
        - timestamp
      required:
        - instrument_code
        - funding_rate
        - mark_price
        - time
        - timestamp
      x-apidog-folder: ''
      x-apidog-ignore-properties: []
    ErrorResponse:
      type: object
      description: >-
        Error body. `error` is a machine-readable code (e.g.
        `INVALID_INSTRUMENT_CODE`) on most endpoints; a few older endpoints
        return a human-readable message in `error` instead and omit
        `error_message`.
      properties:
        error:
          type: string
          description: Error code (or, on older endpoints, a human-readable message).
        error_message:
          type: string
          description: >-
            Human-readable detail. Present on endpoints that return an error
            code in `error`.
      required:
        - error
      x-apidog-orders:
        - error
        - error_message
      x-apidog-folder: ''
      x-apidog-ignore-properties: []
  securitySchemes:
    bearerAuth:
      type: bearer
      scheme: bearer
      description: >-
        API key issued to the account holder, sent as `Authorization: Bearer
        <token>`. The key must hold the `SUBACCOUNT_TRANSFER` scope.
    bearer:
      type: bearer
      scheme: bearer
servers:
  - url: https://api.onetrading.com/fast
    description: Production Env
security: []

```