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

# Get Top Traders Aggregation

> Returns the top N traders by volume



## OpenAPI

````yaml /api-specs/public-rest-unified.json get /stats/api/v1/aggregations/traders
openapi: 3.1.0
info:
  title: DerivaDEX API Documentation
  version: '1.0'
  description: ''
servers:
  - url: https://testnet.derivadex.io
    description: DerivaDEX testnet
security: []
tags:
  - name: Venue-Wide Tables
    description: These APIs expose venue-wide public tables and reference data.
    x-source-api: Public REST API
  - name: System
    description: These APIs return system info.
    x-source-api: Public REST API
  - name: Trade
    description: These APIs provide data for a particular trader.
    x-source-api: Public REST API
  - name: Market
    description: These APIs return key high level metrics for markets.
    x-source-api: Public REST API
  - name: Trade
    description: These APIs provide data for a particular trader.
    x-source-api: Public Exchange REST API
  - name: Market
    description: These APIs return key high level metrics for markets.
    x-source-api: Public Exchange REST API
  - name: System
    description: These APIs return system info.
    x-source-api: Public Exchange REST API
paths:
  /stats/api/v1/aggregations/traders:
    get:
      tags:
        - Market
      summary: Get Top Traders Aggregation
      description: Returns the top N traders by volume
      parameters:
        - in: query
          name: trader
          schema:
            type: string
          description: The trader address, with the discriminant prefix.
          example: '0x00b993e587c15a9e0a0fe4f111de98fd6b5ce7067d'
        - in: query
          name: limit
          schema:
            type: integer
            default: 500
          description: The number of rows to return
        - in: query
          name: cursor
          schema:
            type: integer
          description: >-
            The cursor for the beginning of the next page of top traders to
            fetch.
          example: 1000.5
        - in: query
          name: topTradersOrdering
          schema:
            type: string
            default: volume
            enum:
              - volume
              - pnl
              - accountValue
          description: The order by which to fetch top traders.
          example: volume
        - in: query
          name: order
          schema:
            type: string
            enum:
              - asc
              - desc
            default: asc
          description: The ordering of the results.
      responses:
        '200':
          description: Top Traders data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TopTradersAPISuccessResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StatsAPIErrorResponse'
        '500':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StatsAPIErrorResponse'
components:
  schemas:
    TopTradersAPISuccessResponse:
      type: object
      additionalProperties: false
      properties:
        value:
          type: array
          items:
            type: object
            properties:
              trader:
                type: string
                description: The trader address prefixed with the blockchain discriminant.
                examples:
                  - '0x00b993e587c15a9e0a0fe4f111de98fd6b5ce7067d'
              volume:
                type:
                  - string
                  - 'null'
                description: The notional sum of the asset traded.
                examples:
                  - '18026.42'
              realizedPnl:
                type:
                  - string
                  - 'null'
                description: >-
                  The total realized pnl for the trader, excluding funding
                  payments.
                examples:
                  - '173.10'
              accountValue:
                type:
                  - string
                  - 'null'
                description: The total amount of usdc collateral held by this trader.
                examples:
                  - '5600'
            required:
              - trader
              - volume
              - realizedPnl
              - accountValue
            additionalProperties: false
            description: Entity which represents the address and volume of a trader.
          description: The value of the response
        nextCursor:
          type:
            - number
            - 'null'
          description: >-
            The cursor for the beginning of the next page of top traders to
            fetch.
          examples:
            - 100
            - null
        success:
          type: boolean
          const: true
          description: Whether the request was successful
        timestamp:
          type: number
          description: The timestamp of the response
          examples:
            - 1673031089
      required:
        - nextCursor
        - success
        - timestamp
        - value
      description: Successful response for the TopTraders API
    StatsAPIErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          const: false
        errorMsg:
          anyOf:
            - type: string
            - type: array
              items:
                type: object
                additionalProperties: false
      required:
        - success
      additionalProperties: false

````