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

> Returns a paginated leaderboard of subaccounts ranked by PnL for the given timeframe. Timeframe is required and relative to now (today, 7d, 30d, or all). Default limit 10, max 100; default offset 0.



## OpenAPI

````yaml /api-reference/openapi.json get /api/v1/user/leaderboard
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.cnt.ekiden.fi/
    description: Testnet
  - url: https://api.canton.ekiden.fi/
    description: Staging
security: []
paths:
  /api/v1/user/leaderboard:
    get:
      tags:
        - Leaderboard
      summary: Get Leaderboard
      description: >-
        Returns a paginated leaderboard of subaccounts ranked by PnL for the
        given timeframe. Timeframe is required and relative to now (today, 7d,
        30d, or all). Default limit 10, max 100; default offset 0.
      operationId: get_leaderboard
      parameters:
        - name: offset
          in: query
          description: Pagination offset (default 0).
          required: false
          schema:
            type:
              - integer
              - 'null'
            format: int32
            minimum: 0
        - name: limit
          in: query
          description: Max number of entries to return (default 10, max 100).
          required: false
          schema:
            type:
              - integer
              - 'null'
            format: int32
            minimum: 0
        - name: timeframe
          in: query
          description: Ranking window.
          required: true
          schema:
            type: string
            description: >-
              Leaderboard ranking window: today, last 7 days, last 30 days, or
              all time.
            enum:
              - today
              - 7d
              - 30d
              - all
      responses:
        '200':
          description: Leaderboard
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LeaderboardResponse'
components:
  schemas:
    LeaderboardResponse:
      type: object
      description: Paginated leaderboard list response.
      required:
        - data
        - meta
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/LeaderboardData'
          description: Leaderboard rows.
        meta:
          $ref: '#/components/schemas/LeaderboardMeta'
          description: Pagination info.
    LeaderboardData:
      type: object
      description: 'A single leaderboard row: subaccount, rank, and metrics.'
      required:
        - account_value
        - place
        - pnl
        - ranked
        - roi
        - sub_account_address
        - volume
        - trading_xp
        - referral_xp
        - total_xp
      properties:
        account_value:
          type: string
          description: Equity in quote units (e.g. USDC).
        place:
          type: string
          description: Rank position (1-based), or "0" when not ranked.
        pnl:
          type: string
          description: PnL in quote units for the selected ranking window.
        ranked:
          type: boolean
          description: Whether this entry is on the board (false when not ranked).
        referral_xp:
          type: integer
          format: int64
          description: XP earned from referral bonuses.
        roi:
          type: string
          description: Return on investment as a decimal string (e.g. "0.05" for 5%).
        sub_account_address:
          type: string
          description: Subaccount address.
        total_xp:
          type: integer
          format: int64
          description: Total XP balance.
        trading_xp:
          type: integer
          format: int64
          description: XP earned from trading activity.
        volume:
          type: string
          description: Cumulative volume in quote units.
    LeaderboardMeta:
      type: object
      description: Pagination metadata for a leaderboard list response.
      required:
        - offset
        - limit
        - total
      properties:
        limit:
          type: integer
          format: int32
          description: Applied limit.
          minimum: 0
        offset:
          type: integer
          format: int32
          description: Applied offset.
          minimum: 0
        total:
          type: integer
          format: int64
          description: Total number of entries in the window.
          minimum: 0

````