> ## Documentation Index
> Fetch the complete documentation index at: https://api.docs.rocketfi.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Get order history

> Non-fill order events for an account over a time range.

### Parameters

| Parameter | Required | Type | Description |
| --------- | -------- | ---- | ----------- |
| account | yes | string (hex) | Account address (hex-encoded, `0x...`). |
| startTime | yes | integer (int64) | Start timestamp in milliseconds (optional, defaults to 24h ago). |
| endTime | yes | integer (int64) | End timestamp in milliseconds (optional, defaults to now). |
| limit | yes | integer | null | Maximum number of order events to return (optional, defaults to 500, max 1000). |

### Response fields

| Parameter | Required | Type | Description |
| --------- | -------- | ---- | ----------- |
| `orderHistory` | yes | object[] | Non-fill order events for the requested account. |
| `orderHistory[].account` | yes | string (hex) | An Ethereum-style account address (20 bytes). |
| `orderHistory[].eventIndex` | yes | integer (int32) | — |
| `orderHistory[].eventType` | yes | string | — |
| `orderHistory[].feeAmount` | yes | string | — |
| `orderHistory[].feeRate` | yes | string | — |
| `orderHistory[].instrument` | yes | string (decimal) | An instrument identifier (8-byte hash). |
| `orderHistory[].isAdl` | yes | boolean | — |
| `orderHistory[].isLiquidation` | yes | boolean | — |
| `orderHistory[].isPassive` | yes | boolean | — |
| `orderHistory[].orderId` | yes | integer (int64) | — |
| `orderHistory[].pnl` | yes | string | — |
| `orderHistory[].price` | yes | string | — |
| `orderHistory[].round` | yes | integer (int64) | — |
| `orderHistory[].settlementAsset` | yes | integer | — |
| `orderHistory[].size` | yes | string | — |
| `orderHistory[].timestamp` | yes | integer (int64) | — |
| `orderHistory[].txIndex` | yes | integer (int32) | — |

### Response example

A sample **`200`** response body is attached to this operation as an OpenAPI **example** — see the **Example** panel on this page.



## OpenAPI

````yaml /specs/indexer-openapi.json get /order-history
openapi: 3.1.0
info:
  title: Rocket Indexer API Documentation
  description: >-
    Welcome to the RocketChain Indexer API documentation!


    The indexer REST API serves historical and aggregated market data from
    ClickHouse. Endpoints cover candles, trades, order history, portfolio
    curves, funding events, bridge events, vault events, current/historical
    instruments, and live instrument details.
  license:
    name: MIT
    url: https://github.com/rocketfoundation/rocket-sdk-rust/blob/main/LICENSE
  version: '1.0'
  x-logo:
    altText: ROCKET
    backgroundColor: '#00000000'
    url: https://www.rocketfoundation.io/assets/rocket-logo.svg
servers:
  - url: https://beta.rocket-cluster-1.com/indexer
    description: Beta
  - url: https://testnet.rocket-cluster-1.com/indexer
    description: Testnet
  - url: https://devnet.rocket-cluster-1.com/indexer
    description: Devnet
security: []
tags:
  - name: Indexer REST-API
    description: >-
      Read-only REST endpoints backed by the RocketChain indexer. All routes are
      served over HTTP GET.
paths:
  /order-history:
    get:
      tags:
        - Indexer REST-API
      summary: Get order history
      description: >-
        Non-fill order events for an account over a time range.


        ### Parameters


        | Parameter | Required | Type | Description |

        | --------- | -------- | ---- | ----------- |

        | account | yes | string (hex) | Account address (hex-encoded, `0x...`).
        |

        | startTime | yes | integer (int64) | Start timestamp in milliseconds
        (optional, defaults to 24h ago). |

        | endTime | yes | integer (int64) | End timestamp in milliseconds
        (optional, defaults to now). |

        | limit | yes | integer | null | Maximum number of order events to
        return (optional, defaults to 500, max 1000). |


        ### Response fields


        | Parameter | Required | Type | Description |

        | --------- | -------- | ---- | ----------- |

        | `orderHistory` | yes | object[] | Non-fill order events for the
        requested account. |

        | `orderHistory[].account` | yes | string (hex) | An Ethereum-style
        account address (20 bytes). |

        | `orderHistory[].eventIndex` | yes | integer (int32) | — |

        | `orderHistory[].eventType` | yes | string | — |

        | `orderHistory[].feeAmount` | yes | string | — |

        | `orderHistory[].feeRate` | yes | string | — |

        | `orderHistory[].instrument` | yes | string (decimal) | An instrument
        identifier (8-byte hash). |

        | `orderHistory[].isAdl` | yes | boolean | — |

        | `orderHistory[].isLiquidation` | yes | boolean | — |

        | `orderHistory[].isPassive` | yes | boolean | — |

        | `orderHistory[].orderId` | yes | integer (int64) | — |

        | `orderHistory[].pnl` | yes | string | — |

        | `orderHistory[].price` | yes | string | — |

        | `orderHistory[].round` | yes | integer (int64) | — |

        | `orderHistory[].settlementAsset` | yes | integer | — |

        | `orderHistory[].size` | yes | string | — |

        | `orderHistory[].timestamp` | yes | integer (int64) | — |

        | `orderHistory[].txIndex` | yes | integer (int32) | — |


        ### Response example


        A sample **`200`** response body is attached to this operation as an
        OpenAPI **example** — see the **Example** panel on this page.
      operationId: getOrderHistory
      parameters:
        - name: account
          in: path
          description: Account address (hex-encoded, `0x...`).
          required: true
          schema:
            type: string
            format: hex
          example: '0xf19e16fe3cf25c630f55f66d6c6cbf64f84fc86b'
        - name: startTime
          in: path
          description: Start timestamp in milliseconds (optional, defaults to 24h ago).
          required: true
          schema:
            oneOf:
              - type: 'null'
              - $ref: '#/components/schemas/u64'
          example: 1710000000000
        - name: endTime
          in: path
          description: End timestamp in milliseconds (optional, defaults to now).
          required: true
          schema:
            oneOf:
              - type: 'null'
              - $ref: '#/components/schemas/u64'
          example: 1710086400000
        - name: limit
          in: path
          description: >-
            Maximum number of order events to return (optional, defaults to 500,
            max 1000).
          required: true
          schema:
            type:
              - integer
              - 'null'
            default: 500
            minimum: 0
          example: 500
      responses:
        '200':
          description: Order history
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetOrderHistoryResponse'
              example:
                orderHistory:
                  - account: '0xf19e16fe3cf25c630f55f66d6c6cbf64f84fc86b'
                    eventIndex: 0
                    eventType: placed
                    feeAmount: '0'
                    feeRate: '0'
                    instrument: '0x85d55cb42a3e6b50'
                    isAdl: false
                    isLiquidation: false
                    isPassive: true
                    orderId: 989078
                    pnl: '0'
                    price: '89.701'
                    round: 29083401
                    settlementAsset: 0
                    size: '0.5'
                    timestamp: 1774368107590
                    txIndex: 0
        '400':
          description: Invalid query parameters
          content:
            text/plain:
              schema:
                type: string
        '500':
          description: Internal server error
          content:
            text/plain:
              schema:
                type: string
components:
  schemas:
    u64:
      type: integer
      format: int64
      minimum: 0
    GetOrderHistoryResponse:
      type: object
      required:
        - orderHistory
      properties:
        orderHistory:
          type: array
          items:
            $ref: '#/components/schemas/OrderHistoryResponseItem'
          description: Non-fill order events for the requested account.
      examples:
        - orderHistory:
            - account: '0xf19e16fe3cf25c630f55f66d6c6cbf64f84fc86b'
              eventIndex: 0
              eventType: placed
              feeAmount: '0'
              feeRate: '0'
              instrument: '0x85d55cb42a3e6b50'
              isAdl: false
              isLiquidation: false
              isPassive: true
              orderId: 989078
              pnl: '0'
              price: '89.701'
              round: 29083401
              settlementAsset: 0
              size: '0.5'
              timestamp: 1774368107590
              txIndex: 0
    OrderHistoryResponseItem:
      type: object
      required:
        - timestamp
        - round
        - txIndex
        - eventIndex
        - account
        - instrument
        - orderId
        - eventType
        - price
        - size
        - settlementAsset
        - pnl
        - feeAmount
        - feeRate
        - isPassive
        - isLiquidation
        - isAdl
      properties:
        account:
          $ref: '#/components/schemas/AccountAddress'
        eventIndex:
          type: integer
          format: int32
          minimum: 0
        eventType:
          type: string
        feeAmount:
          type: string
        feeRate:
          type: string
        instrument:
          $ref: '#/components/schemas/InstrumentId'
        isAdl:
          type: boolean
        isLiquidation:
          type: boolean
        isPassive:
          type: boolean
        orderId:
          $ref: '#/components/schemas/u64'
        pnl:
          type: string
        price:
          type: string
        round:
          type: integer
          format: int64
          minimum: 0
        settlementAsset:
          $ref: '#/components/schemas/usize'
        size:
          type: string
        timestamp:
          $ref: '#/components/schemas/u64'
        txIndex:
          type: integer
          format: int32
          minimum: 0
    AccountAddress:
      type: string
      format: hex
      description: An Ethereum-style account address (20 bytes).
      example: '0xf19e16fe3cf25c630f55f66d6c6cbf64f84fc86b'
    InstrumentId:
      type: string
      format: decimal
      description: An instrument identifier (8-byte hash).
      example: '42'
    usize:
      type: integer
      minimum: 0

````