> ## 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.

# GetOrdersStreaming

> Server-streaming endpoint. Opens a long-lived Connect/gRPC-Web stream
 and sends a `GetOrdersStreamingResponse` message immediately, then
 again on a fixed interval, until the client disconnects. Each
 message is a full snapshot of the current matching orders, not a
 diff against the previous message.

 `update_interval_ms` defaults to 250ms when omitted, and is clamped
 to the 100–60000ms range rather than rejected.

NOTE: Mintlify's request-based API explorer cannot exercise a real
streaming response.



## OpenAPI

````yaml /developers/api-reference/openapi.yaml post /order_service.v1.OrderService/GetOrdersStreaming
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/GetOrdersStreaming:
    post:
      tags:
        - Orders
      summary: GetOrdersStreaming
      description: |-
        Server-streaming endpoint. Opens a long-lived Connect/gRPC-Web stream
         and sends a `GetOrdersStreamingResponse` message immediately, then
         again on a fixed interval, until the client disconnects. Each
         message is a full snapshot of the current matching orders, not a
         diff against the previous message.

         `update_interval_ms` defaults to 250ms when omitted, and is clamped
         to the 100–60000ms range rather than rejected.

        NOTE: Mintlify's request-based API explorer cannot exercise a real
        streaming response.
      operationId: order_service.v1.OrderService.GetOrdersStreaming
      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.GetOrdersStreamingRequest'
        required: true
      responses:
        '200':
          description: >-
            One streamed message (the server sends a sequence of these, not a
            single response).
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/order_service.v1.GetOrdersStreamingResponse
              example:
                orders:
                  - owner: '0x71c7656ec7ab88b098defb751b7401b5f6d8976'
                    orderId: '48213'
                    timestamp: '2026-07-11T14:32:07Z'
                    marketId: '1'
                    market: BTC-PERP
                    type: ORDER_TYPE_MARKET
                    side: SIDE_LONG
                    thresholdPrice: 65000.5
                    size: 6000
                    leverage: 5
                    status: ORDER_STATUS_PARTIALLY_FILLED
                    filledSize: 4000
                    unfilledSize: 6000
                    reduceOnly: false
                    canceled: false
                    initialMargin: 2000
                    tickDecimals: 1
                    fees: 2.7
                    rebates: 0
                    reduceOrderType: ''
                    initialNotional: 10000
                    stopLossPrice: 60000
                    takeProfitPrice: 72000
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.GetOrdersStreamingRequest:
      type: object
      properties:
        address:
          type: string
          title: address
          description: |-
            Wallet address to filter the stream to. Trimmed and matched
            case-insensitively, same as on `GetOrders`.
        market:
          description: |-
            Optional market filter. When omitted, or when the selector
            doesn't resolve to a known market, orders from all markets are
            streamed.
          oneOf:
            - type: object
              title: market_id
              properties:
                marketId:
                  type: string
                  format: int64
                  title: market_id
              required:
                - marketId
              additionalProperties: false
            - type: object
              title: market_symbol
              properties:
                marketSymbol:
                  $ref: '#/components/schemas/base_objects.v1.MarketSymbol'
                  title: market_symbol
              required:
                - marketSymbol
              additionalProperties: false
            - type: 'null'
        updateIntervalMs:
          type:
            - integer
            - 'null'
          title: update_interval_ms
          description: |-
            Interval between stream updates, in milliseconds. Defaults to
            250 when omitted or zero, and is clamped to the 100–60000 range.
      title: GetOrdersStreamingRequest
      additionalProperties: false
    order_service.v1.GetOrdersStreamingResponse:
      type: object
      properties:
        orders:
          type: array
          items:
            $ref: '#/components/schemas/base_objects.v1.Order'
          title: orders
          description: |-
            Full snapshot of orders matching `address` and `market` as of
            this message. Not a diff against the previous message.
      title: GetOrdersStreamingResponse
      additionalProperties: false
    base_objects.v1.MarketSymbol:
      type: object
      properties:
        assetSymbol:
          type: string
          title: asset_symbol
          description: |-
            Underlying asset symbol, e.g. `"BTC"`. Matched case-insensitively
            and trimmed.
        quoteSymbol:
          type: string
          title: quote_symbol
          description: |-
            Quote symbol, e.g. `"PERP"`. Technically optional, but omitting
            it looks up a market named exactly by `assetSymbol` alone (e.g.
            `"BTC"`) rather than `"BTC-PERP"`, which will not resolve to any
            real market. In practice, always set this.
      title: MarketSymbol
      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.
    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

````