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

# GetMarketConfigs

> Returns the full configuration for one market, resolved by numeric
 `market_id` or by `market_symbol`.



## OpenAPI

````yaml /developers/api-reference/openapi.yaml post /market_service.v1.MarketService/GetMarketConfigs
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:
  /market_service.v1.MarketService/GetMarketConfigs:
    post:
      tags:
        - Markets
      summary: GetMarketConfigs
      description: |-
        Returns the full configuration for one market, resolved by numeric
         `market_id` or by `market_symbol`.
      operationId: market_service.v1.MarketService.GetMarketConfigs
      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/market_service.v1.GetMarketconfigRequest'
        required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/market_service.v1.GetMarketconfigResponse'
              example:
                marketConfig:
                  marketId: '1'
                  marketName: BTC-PERP
                  minLeverage: 1
                  maxLeverage: 20
                  minTradeSize: 10
                  maxTradeSize: 500000
                  tickDecimals: 1
                  lotSize: 0.0001
                  sizeDecimals: 8
                  creator: '0x71c7656ec7ab88b098defb751b7401b5f6d8976'
                  feeConfig:
                    marketId: '1'
                    tradeFeePct: 45
                    maxEntitlement: 500
                    insuranceFundEntitlementPct: 20
                    maxImbalance: 100000
                  adlConfig:
                    maintenanceMarginRatio: 50
                    seizureThreshold: 66
                    adlThreshold: 10
                    shockFactor: 1
                    maxIfFractionAllowed: 10
                  maintenanceMarginRate: '50'
                  tradeFeePct: 45
                  longRevenue: 1234.5
                  shortRevenue: 987.6
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
    market_service.v1.GetMarketconfigRequest:
      type: object
      properties:
        market:
          description: Market to look up, 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: GetMarketconfigRequest
      required:
        - market
      additionalProperties: false
    market_service.v1.GetMarketconfigResponse:
      type: object
      properties:
        marketConfig:
          $ref: '#/components/schemas/base_objects.v1.MarketConfig'
          title: market_config
          description: Full configuration for the requested market.
      title: GetMarketconfigResponse
      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.MarketConfig:
      type: object
      properties:
        marketId:
          type: string
          title: market_id
          format: int64
          description: On-chain market identifier.
        marketName:
          type: string
          title: market_name
          description: Human-readable market name, such as `BTC-PERP`.
        minLeverage:
          type: number
          title: min_leverage
          format: float
          description: >-
            Minimum leverage multiplier allowed when opening a position in this
            market.
        maxLeverage:
          type: number
          title: max_leverage
          format: float
          description: >-
            Maximum leverage multiplier allowed when opening a position in this
            market.
        minTradeSize:
          type: number
          title: min_trade_size
          format: float
          description: >-
            Minimum position notional allowed when opening a position in this
            market, in quote asset units.
        maxTradeSize:
          type: number
          title: max_trade_size
          format: float
          description: >-
            Maximum position notional allowed when opening a position in this
            market, in quote asset units.
        tickDecimals:
          type: integer
          title: tick_decimals
          description: >-
            Number of decimal places used to convert this market's raw on-chain
            prices to quote asset values.
        lotSize:
          type: number
          title: lot_size
          format: float
          description: >-
            Minimum position-size increment for this market, in the underlying
            asset's units.
        sizeDecimals:
          type: integer
          title: size_decimals
          description: >-
            Number of decimal places used to convert this market's raw on-chain
            size values to asset units.
        creator:
          type: string
          title: creator
          description: Address that created this market.
        feeConfig:
          $ref: '#/components/schemas/base_objects.v1.FeeConfig'
          title: fee_config
          description: Fee parameters for this market.
        adlConfig:
          $ref: '#/components/schemas/base_objects.v1.ADLConfig'
          title: adl_config
          description: ADL and liquidation threshold parameters for this market.
        maintenanceMarginRate:
          type: string
          title: maintenance_margin_rate
          description: |-
            Raw configured maintenance margin rate as a whole-number
            percentage string (e.g. `"50"` = 50%).
        tradeFeePct:
          type:
            - integer
            - 'null'
          title: trade_fee_pct
          description: |-
            Same value as `feeConfig.tradeFeePct`, kept for backwards
            compatibility.
        longRevenue:
          type:
            - number
            - 'null'
          title: long_revenue
          format: float
          description: |-
            Cumulative per-unit revenue accrued to long positions in this
            market
        shortRevenue:
          type:
            - number
            - 'null'
          title: short_revenue
          format: float
          description: |-
            Cumulative per-unit revenue accrued to short positions in this
            market
      title: MarketConfig
      additionalProperties: false
    base_objects.v1.FeeConfig:
      type: object
      properties:
        marketId:
          type: string
          title: market_id
          format: int64
          description: On-chain Market ID
        tradeFeePct:
          type: number
          title: tradeFeePct
          format: float
          description: Market Fee in basis points.
        maxEntitlement:
          type: number
          title: maxEntitlement
          format: float
          description: Max Entitlement percentage with 2 decimals (5 = 0.05%, 500 = 5%)
        insuranceFundEntitlementPct:
          type: number
          title: insuranceFundEntitlementPct
          format: float
          description: >-
            Insurance Fund Entitlement percentage with 2 decimals (5 = 0.05%,
            500 = 5%)
        maxImbalance:
          type: number
          title: maxImbalance
          format: float
          description: Max Imbalance allowed in quote asset terms
      title: FeeConfig
      additionalProperties: false
    base_objects.v1.ADLConfig:
      type: object
      properties:
        maintenanceMarginRatio:
          type: number
          title: maintenance_margin_ratio
          format: float
          description: |-
            Maintenance margin ratio as a whole-number percentage (e.g. `50`
            = 50%)
        seizureThreshold:
          type: number
          title: seizure_threshold
          format: float
          description: |-
            Margin-ratio threshold below which a position becomes eligible
            for seizure, as a whole-number percentage (e.g. `66` ≈ 2/3 =
            66%)
        adlThreshold:
          type: number
          title: adl_threshold
          format: float
          description: |-
            Margin-ratio threshold below which a position is scanned for
            ADL, as a whole-number percentage (e.g. `10` = 10%)
        shockFactor:
          type: number
          title: shock_factor
          format: float
          description: |-
            Shock factor used in ADL shock-test simulations, as a
            whole-number percentage
        maxIfFractionAllowed:
          type: number
          title: max_if_fraction_allowed
          format: float
          description: |-
            Maximum fraction of the insurance fund allowed to be spent on
            this market's close-outs, as a whole-number percentage
      title: ADLConfig
      additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````