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

# GetAllOrders

> Returns a paginated, platform-wide list of orders, optionally filtered
to one wallet and/or to open orders. Results are ordered by timestamp
descending, most recent first.



## OpenAPI

````yaml /developers/api-reference/openapi.yaml post /order_service.v1.OrderService/GetAllOrders
openapi: 3.1.0
info:
  title: Fairground.Fi API
  description: |
    API for the Fairground Perpetuals trading platform.

    This API uses ConnectRPC which accepts JSON over HTTP POST requests.
    All service endpoints follow the pattern: `/package.ServiceName/MethodName`
  version: 1.0.0
  contact:
    name: Forte Service Company
    url: https://github.com/Forte-Service-Company-Ltd/perpetuals-api-server
  license:
    name: Proprietary
    identifier: UNLICENSED
servers:
  - url: https://api.fairground.fi
    description: Production API server
security:
  - bearerAuth: []
tags:
  - name: Trades
    description: Wallet trade/fill history
  - name: Markets
    description: Market configuration and summary endpoints
  - name: Orderbook
    description: Orderbook data retrieval
  - name: Orders
    description: Order management operations
  - name: Portfolio
    description: Aggregated per-wallet portfolio data
  - name: Positions
    description: Position management operations
  - name: Prices
    description: Oracle price and historical price data
paths:
  /order_service.v1.OrderService/GetAllOrders:
    post:
      tags:
        - Orders
      summary: GetAllOrders
      description: |-
        Returns a paginated, platform-wide list of orders, optionally filtered
        to one wallet and/or to open orders. Results are ordered by timestamp
        descending, most recent first.
      operationId: order_service.v1.OrderService.GetAllOrders
      parameters:
        - name: Connect-Protocol-Version
          in: header
          required: true
          schema:
            $ref: '#/components/schemas/connect-protocol-version'
        - name: Connect-Timeout-Ms
          in: header
          schema:
            $ref: '#/components/schemas/connect-timeout-header'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/order_service.v1.GetAllOrdersRequest'
        required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/order_service.v1.GetAllOrdersResponse'
              example:
                orders:
                  - owner: '0x8ba1f109551bd432803012645ac136ddd64dba7'
                    orderId: '50011'
                    timestamp: '2026-07-09T09:15:42Z'
                    marketId: '2'
                    market: ETH-PERP
                    type: ORDER_TYPE_MARKET
                    side: SIDE_SHORT
                    thresholdPrice: 3400.25
                    size: 5000
                    leverage: 10
                    status: ORDER_STATUS_PENDING
                    filledSize: 0
                    unfilledSize: 5000
                    reduceOnly: false
                    canceled: false
                    initialMargin: 500
                    tickDecimals: 2
                    fees: 0
                    rebates: 0
                    reduceOrderType: ''
                    initialNotional: 5000
                    stopLossPrice: 0
                    takeProfitPrice: 0
                pagination:
                  limit: 50
                  offset: 0
                  totalCount: '1'
components:
  schemas:
    connect-protocol-version:
      type: number
      title: Connect-Protocol-Version
      enum:
        - 1
      description: Define the version of the Connect protocol. If omitted, use 1.
      const: 1
      default: 1
    connect-timeout-header:
      type: number
      title: Connect-Timeout-Ms
      description: Define the timeout, in ms
    order_service.v1.GetAllOrdersRequest:
      type: object
      properties:
        limit:
          type: integer
          title: limit
          description: |-
            Maximum number of orders to return in this page.
            Defaults to 50 when omitted. Values above 1000 are capped
            to 1000 rather than rejected.
        offset:
          type: integer
          title: offset
          description: |-
            Number of matching orders to skip before collecting this page.
            Defaults to 0.
        address:
          type:
            - string
            - 'null'
          title: address
          description: |-
            Optional wallet address filter, matched case-insensitively.
            When omitted, orders from every wallet are returned.
        onlyOpen:
          type:
            - boolean
            - 'null'
          title: only_open
          description: |-
            Optional filter to active orders only: `PENDING`,
            `PARTIALLY_FILLED`, or `PARTIALLY_MERGED`. When omitted or
            `false`, orders in any status are returned.
      title: GetAllOrdersRequest
      additionalProperties: false
    order_service.v1.GetAllOrdersResponse:
      type: object
      properties:
        orders:
          type: array
          items:
            $ref: '#/components/schemas/base_objects.v1.Order'
          title: orders
          description: >-
            Matching orders for this page, ordered by timestamp descending (most
            recent first).
        pagination:
          $ref: '#/components/schemas/order_service.v1.PaginationInfo'
          title: pagination
          description: >-
            Effective limit/offset used for this query and the total number of
            matching orders across all pages.
      title: GetAllOrdersResponse
      additionalProperties: false
    base_objects.v1.Order:
      type: object
      properties:
        owner:
          type: string
          title: owner
          description: Lowercase EVM wallet address that owns the order.
        orderId:
          type: string
          title: order_id
          format: int64
          description: >-
            On-chain order identifier.

            Unique together with `marketId` and `reduceOnly`. Connect/JSON
            encodes

            this uint64 as a decimal string.
        timestamp:
          $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: timestamp
          description: >-
            Order-creation timestamp from the submission event, in RFC 3339
            format.
        marketId:
          type: string
          title: market_id
          format: int64
          description: |-
            On-chain market identifier.
            Connect/JSON encodes this uint64 as a decimal string.
        market:
          type: string
          title: market
          description: >-
            Human-readable market name, such as `BTC-PERP`.

            Falls back to `MARKET-{marketId}` when market metadata is
            unavailable.
        type:
          $ref: '#/components/schemas/base_objects.v1.OrderType'
          title: type
          description: Order-type classification. Currently always `ORDER_TYPE_MARKET`.
        side:
          $ref: '#/components/schemas/base_objects.v1.Side'
          title: side
          description: >-
            Position direction.

            For reduce-only orders, inherited from the associated
            position-opening

            order.
        thresholdPrice:
          type: number
          title: threshold_price
          format: float
          description: >-
            Execution price threshold in quote asset terms per underlying asset.

            Converted using the market's tick precision. This is not necessarily
            the

            fill price.
        size:
          type: number
          title: size
          format: float
          description: Amount exposed for the order.
        leverage:
          type: number
          title: leverage
          format: float
          description: >-
            Leverage multiplier.

            For reduce-only orders, inherited from the associated
            position-opening

            order when available.
        status:
          $ref: '#/components/schemas/base_objects.v1.OrderStatus'
          title: status
          description: Current order lifecycle state.
        filledSize:
          type: number
          title: filled_size
          format: float
          description: Order Amount that has been filled
        unfilledSize:
          type: number
          title: unfilled_size
          format: float
          description: Order amount remaining to be filled
        reduceOnly:
          type: boolean
          title: reduce_only
          description: >-
            Whether the order is reducing an existing position.

            False for orders that open or increase exposure; true for orders
            that

            reduce exposure.
        canceled:
          type: boolean
          title: canceled
          description: |-
            Legacy field that the server does not populate.
            Use `status` to determine whether an order was cancelled.
        initialMargin:
          type: number
          title: initial_margin
          format: float
          description: >-
            Initial collateral or threshold-price notional, denominated in quote
            asset units.

            For position-opening orders, this is the initial collateral.
        tickDecimals:
          type: integer
          title: tick_decimals
          description: Market price precision used to convert raw on-chain price values.
        fees:
          type: number
          title: fees
          format: float
          description: Fees recorded for the order, denominated in quote asset units.
        rebates:
          type: number
          title: rebates
          format: float
          description: >-
            Direct order-side rebates recorded for reduce fills, denominated in
            quote asset units.
        reduceOrderType:
          type: string
          title: reduce_order_type
          description: >-
            Reduce-order classification.

            Values are `MANUAL`, `STOP_LOSS`, `TAKE_PROFIT`, `LIQUIDATION`, or
            `ADL`.

            Empty for position-opening orders.
        initialNotional:
          type: number
          title: initial_notional
          format: float
          description: >-
            Initial notional amount for a position-opening order.

            Calculated as `initialMargin * leverage`. Zero for reduce-only
            orders.
        stopLossPrice:
          type: number
          title: stop_loss_price
          format: float
          description: >-
            Stop-loss trigger price attached to a position-opening order, in
            quote asset units.

            Zero when no stop-loss is configured.
        takeProfitPrice:
          type: number
          title: take_profit_price
          format: float
          description: >-
            Take-profit trigger price attached to a position-opening order, in
            quote asset units.

            Zero when no take-profit is configured.
      title: Order
      additionalProperties: false
      description: |-
        Current stored state of a position-opening or reduce-only order.
        Because both order kinds share this message, some numeric fields have
        different meanings and units. Use `reduceOnly` when interpreting them.
    order_service.v1.PaginationInfo:
      type: object
      properties:
        limit:
          type: integer
          title: limit
          description: |-
            Effective page size used for this query, after defaulting and
            capping. May be larger than the number of orders actually
            returned if fewer matched.
        offset:
          type: integer
          title: offset
          description: Number of matching records skipped before this page.
        totalCount:
          type:
            - integer
            - string
          title: total_count
          format: int64
          description: >-
            Total number of matching orders across all pages, not just this
            page.
      title: PaginationInfo
      additionalProperties: false
      description: Pagination metadata for list responses.
    google.protobuf.Timestamp:
      type: string
      examples:
        - '2023-01-15T01:30:15.01Z'
        - '2024-12-25T12:00:00Z'
      format: date-time
    base_objects.v1.OrderType:
      type: string
      title: OrderType
      enum:
        - ORDER_TYPE_MARKET
      description: >-
        Order-type classification used by the API. Currently only market orders
        are returned.
    base_objects.v1.Side:
      type: string
      title: Side
      enum:
        - SIDE_LONG
        - SIDE_SHORT
      description: Direction of the position represented by an order.
    base_objects.v1.OrderStatus:
      type: string
      title: OrderStatus
      enum:
        - ORDER_STATUS_PENDING
        - ORDER_STATUS_PARTIALLY_FILLED
        - ORDER_STATUS_FULLY_FILLED
        - ORDER_STATUS_CLOSED
        - ORDER_STATUS_CANCELLED
        - ORDER_STATUS_MERGED
        - ORDER_STATUS_PARTIALLY_MERGED
        - ORDER_STATUS_PARTIALLY_CANCELLED
      description: Current lifecycle state of an order.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````