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

> Query for period-filtered turnover, trades, open interest, and per-market stats.



## OpenAPI

````yaml /api-reference/openapi.json get /api/v1/market/stats
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.cnt.ekiden.fi/
    description: Testnet
  - url: https://api.canton.ekiden.fi/
    description: Staging
security: []
paths:
  /api/v1/market/stats:
    get:
      tags:
        - Market
      summary: Get Stats
      description: >-
        Query for period-filtered turnover, trades, open interest, and
        per-market stats.
      operationId: get_stats
      parameters:
        - name: period
          in: query
          required: true
          schema:
            type: string
            description: Stats period. `24h`, `7d`, `30d`, or `all_time`.
            enum:
              - 24h
              - 7d
              - 30d
              - all_time
      responses:
        '200':
          description: Stats
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetStatsResponse'
        '400':
          description: Bad Request
components:
  schemas:
    GetStatsResponse:
      type: object
      description: Stats response.
      required:
        - period
        - summary
        - list
      properties:
        list:
          type: array
          items:
            $ref: '#/components/schemas/StatsMarket'
        period:
          $ref: '#/components/schemas/StatsPeriod'
        summary:
          $ref: '#/components/schemas/StatsSummary'
    StatsMarket:
      type: object
      required:
        - symbol
        - last_price
        - price_change
        - avg_funding_rate
        - turnover
        - open_interest_value
        - buy_ratio
        - sell_ratio
        - next_funding_time
      properties:
        avg_funding_rate:
          type: string
          description: Average funding rate
        buy_ratio:
          type: string
          description: The ratio of the number of long position
        last_price:
          type: string
          description: Last traded price
        next_funding_time:
          type: string
          format: date-time
          description: Next funding time (ms)
          example: '1672531200000'
        open_interest_value:
          type: string
          description: Open interest value
        price_change:
          type: string
          description: Price change
        sell_ratio:
          type: string
          description: The ratio of the number of short position
        symbol:
          $ref: '#/components/schemas/Symbol'
          description: Symbol name
        turnover:
          type: string
          description: Turnover
    StatsPeriod:
      type: string
      description: Stats period. `24h`, `7d`, `30d`, or `all_time`.
      enum:
        - 24h
        - 7d
        - 30d
        - all_time
    StatsSummary:
      type: object
      required:
        - turnover
        - turnover_change
        - active_traders
        - active_traders_change
        - trades
        - trades_change
        - open_interest_value
        - open_interest_value_change
      properties:
        active_traders:
          type: string
          description: Active traders
        active_traders_change:
          type: string
          description: Active traders change
        open_interest_value:
          type: string
          description: Open interest value
        open_interest_value_change:
          type: string
          description: Open interest value change
        trades:
          type: string
          description: Matched trades
        trades_change:
          type: string
          description: Matched trades change
        turnover:
          type: string
          description: Turnover
        turnover_change:
          type: string
          description: Turnover change
    Symbol:
      type: string
      example: BTC-USDCx

````