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

# GetPrice

> Returns the current oracle price for one market, along with a signed
 price payload suitable for on-chain submission.



## OpenAPI

````yaml /developers/api-reference/openapi.yaml post /price_service.v1.PriceService/GetPrice
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:
  /price_service.v1.PriceService/GetPrice:
    post:
      tags:
        - Prices
      summary: GetPrice
      description: |-
        Returns the current oracle price for one market, along with a signed
         price payload suitable for on-chain submission.
      operationId: price_service.v1.PriceService.GetPrice
      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/price_service.v1.GetPriceRequest'
        required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/price_service.v1.GetPriceResponse'
              example:
                price:
                  marketId: '1'
                  marketName: BTC-PERP
                  symbol: BTC-PERP
                  price: 65420
                  volume24h: 0
                  priceChange24h: 0
                  timestamp: '2026-07-11T14:32:07Z'
                  source: ''
                signedPricePayload: 0x1a2b3c4d...
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
    price_service.v1.GetPriceRequest:
      type: object
      properties:
        market:
          description: Market to fetch a price for, by `market_id` or `market_symbol`.
          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
      title: GetPriceRequest
      required:
        - market
      additionalProperties: false
    price_service.v1.GetPriceResponse:
      type: object
      properties:
        price:
          $ref: '#/components/schemas/base_objects.v1.Price'
          title: price
          description: Current price data for the requested market.
        signedPricePayload:
          type:
            - string
            - 'null'
          title: signed_price_payload
          description: |-
            Signed price attestation from the upstream pricing oracle,
            suitable for on-chain submission (e.g. to settle trades or
            trigger liquidations). Opaque/encoded; format is defined by the
            pricing oracle, not by this API.
      title: GetPriceResponse
      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.Price:
      type: object
      properties:
        marketId:
          type: string
          title: market_id
          format: int64
          description: On-chain market identifier.
        marketName:
          type: string
          title: market_name
          description: |-
            Same value as `symbol` on this object (both are set from
            whichever selector form the request used — see `symbol`).
        symbol:
          type: string
          title: symbol
          description: |-
            Echoes back however the market was identified in the request:
            the bare asset symbol (e.g. `"BTC"`) if the request used
            `market_symbol`, or the full market name (e.g. `"BTC-PERP"`) if
            the request used `market_id`. `marketName` always mirrors this
            same value.
        price:
          type: number
          title: price
          format: float
          description: Current price in USD.
        volume24h:
          type: number
          title: volume_24h
          format: float
          description: 24-hour trading volume in the market's quote units.
        priceChange24h:
          type: number
          title: price_change_24h
          format: float
          description: 24-hour price change, as a percentage.
        timestamp:
          $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: timestamp
          description: When the price was recorded by the upstream pricing service.
        source:
          type: string
          title: source
          description: Price feed source
      title: Price
      additionalProperties: false
    google.protobuf.Timestamp:
      type: string
      examples:
        - '2023-01-15T01:30:15.01Z'
        - '2024-12-25T12:00:00Z'
      format: date-time
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````