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

# Get Long Short Ratio

> This refers to the net long and short positions as percentages of all position holders during the selected time.
Long account ratio = Number of holders with long positions / Total number of holders
Short account ratio = Number of holders with short positions / Total number of holders
Long-short account ratio = Long account ratio / Short account ratio



## OpenAPI

````yaml /api-reference/openapi.json get /api/v1/market/account-ratio
openapi: 3.1.0
info:
  title: ekiden-gateway
  description: >-
    API Gateway and WebSocket proxy based on Axum and Utoipa, handling auth,
    rate limiting, and connection buffering.
  license:
    name: ''
  version: 0.1.1
servers:
  - url: https://api.ekiden.fi/
    description: Production
  - url: https://api.staging.ekiden.fi/
    description: Staging
  - url: https://api.dev.ekiden.fi/
    description: Development
  - url: http://localhost:4020/
    description: Local
security: []
paths:
  /api/v1/market/account-ratio:
    get:
      tags:
        - Market
      summary: Get Long Short Ratio
      description: >-
        This refers to the net long and short positions as percentages of all
        position holders during the selected time.

        Long account ratio = Number of holders with long positions / Total
        number of holders

        Short account ratio = Number of holders with short positions / Total
        number of holders

        Long-short account ratio = Long account ratio / Short account ratio
      operationId: get_long_short_ratio
      parameters:
        - name: symbol
          in: query
          required: true
          schema:
            $ref: '#/components/schemas/Symbol'
        - name: period
          in: query
          required: true
          schema:
            $ref: 5e40d9d7-61d2-4c0e-823f-d2b8d60ebdca
        - name: start_time
          in: query
          required: false
          schema:
            type:
              - string
              - 'null'
            format: date-time
        - name: end_time
          in: query
          required: false
          schema:
            type:
              - string
              - 'null'
            format: date-time
        - name: limit
          in: query
          required: false
          schema:
            type:
              - integer
              - 'null'
            format: int32
            minimum: 0
        - name: cursor
          in: query
          description: >-
            Cursor. Use the next_page_cursor token from the response to retrieve
            the next page of the data set
          required: false
          schema:
            type:
              - string
              - 'null'
      responses:
        '200':
          description: Long short ratio data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetLongShortRatioResponse'
components:
  schemas:
    Symbol:
      type: string
      example: BTCUSDC
    GetLongShortRatioResponse:
      type: object
      description: >-
        This refers to the net long and short positions as percentages of all
        position holders during the selected time.
      required:
        - list
        - next_page_cursor
      properties:
        list:
          type: array
          items:
            $ref: '#/components/schemas/LongShortRatio'
        next_page_cursor:
          type: string
    LongShortRatio:
      type: object
      required:
        - symbol
        - buy_ratio
        - sell_ratio
        - timestamp
      properties:
        buy_ratio:
          type: string
          description: The ratio of the number of long position
        sell_ratio:
          type: string
          description: The ratio of the number of short position
        symbol:
          $ref: '#/components/schemas/Symbol'
        timestamp:
          type: string
          format: date-time
          example: '1672531200000'

````