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

# GetPositionFeeInfo

> Returns the trading fee paid and the rebate accrued so far for one
 specific position, identified by the composite key `position_id` +
 `market_id` + `address` (owner). All three must match an existing
 position, or the request fails.



## OpenAPI

````yaml /developers/api-reference/openapi.yaml post /position_service.v1.PositionService/GetPositionFeeInfo
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:
  /position_service.v1.PositionService/GetPositionFeeInfo:
    post:
      tags:
        - Positions
      summary: GetPositionFeeInfo
      description: |-
        Returns the trading fee paid and the rebate accrued so far for one
         specific position, identified by the composite key `position_id` +
         `market_id` + `address` (owner). All three must match an existing
         position, or the request fails.
      operationId: position_service.v1.PositionService.GetPositionFeeInfo
      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/position_service.v1.GetPositionFeeInfoRequest
        required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/position_service.v1.GetPositionFeeInfoResponse
              example:
                fees: 9
                estimatedRebate: 3.2
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
    position_service.v1.GetPositionFeeInfoRequest:
      type: object
      properties:
        address:
          type: string
          title: address
          description: >-
            Wallet address that owns the position. Must match the position's
            actual owner, or the lookup fails.
        positionId:
          type: string
          title: position_id
          format: int64
          description: On-chain position identifier (same as the opening order's ID).
        marketId:
          type: string
          title: market_id
          format: int64
          description: Market the position belongs to.
      title: GetPositionFeeInfoRequest
      additionalProperties: false
    position_service.v1.GetPositionFeeInfoResponse:
      type: object
      properties:
        fees:
          type: number
          title: fees
          format: double
          description: |-
            Trading fee paid when the position was opened, in USDC,
            recomputed from the position's entry price and the market's
            fee rate. `-1` if required market configuration is unavailable.
        estimatedRebate:
          type: number
          title: estimatedRebate
          format: double
          description: |-
            Rebate accrued to the position so far, in USDC — the same
            calculation as `Position.estimatedRebate`. `-1` if required
            market configuration is unavailable.
      title: GetPositionFeeInfoResponse
      additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````