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

# Get Token First Buyers

> Returns the same trader dataset as `/traders`, but only in chronological earliest-first order. Omit `sort` or use `sort=first_trade`, and use `direction=asc`. For ROI, PnL, position size, latest trade, or descending order, use `/v2/pnl/tokens/{token}/traders`.

## SDK Example

<CodeGroup>
  ```typescript SDK
  import { Client } from '@solana-tracker/data-api';

  const client = new Client({ apiKey: 'YOUR_API_KEY' });

  const data = await client.getPnlV2TokenFirstBuyers('6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN', { limit: 50 });

  ```
</CodeGroup>


## OpenAPI

````yaml /data-api/pnl-v2/openapi.json get /v2/pnl/tokens/{token}/first-buyers
openapi: 3.1.0
info:
  title: SolanaTracker PnL V2 API
  description: >-
    Profit-and-loss tracking for Solana wallets. Provides wallet PnL summaries,
    token-level positions, leaderboards, KOL rankings, risk analysis, and
    historical performance data. All monetary values are in USD. All timestamps
    are Unix milliseconds unless noted otherwise.
  version: 2.0.0
servers:
  - url: https://data.solanatracker.io
    description: Production
security:
  - apiKey: []
tags:
  - name: Leaderboard
    description: Top traders, whales, and KOL rankings
  - name: Token
    description: Per-token trader and holder data
  - name: Wallet
    description: Wallet-level PnL, positions, history, and analysis
  - name: Batch
    description: Bulk wallet summaries and position lookups
paths:
  /v2/pnl/tokens/{token}/first-buyers:
    get:
      tags:
        - Token
      summary: Get Token First Buyers
      description: >-
        Returns the same trader dataset as `/traders`, but only in chronological
        earliest-first order. Omit `sort` or use `sort=first_trade`, and use
        `direction=asc`. For ROI, PnL, position size, latest trade, or
        descending order, use `/v2/pnl/tokens/{token}/traders`.
      operationId: getTokenFirstBuyers
      parameters:
        - $ref: '#/components/parameters/tokenPath'
        - name: sort
          in: query
          description: Chronological sort only. Omit this parameter or use `first_trade`.
          schema:
            type: string
            enum:
              - first_trade
            default: first_trade
        - name: direction
          in: query
          description: Earliest-first only. Any value other than `asc` is rejected.
          schema:
            type: string
            enum:
              - asc
            default: asc
        - $ref: '#/components/parameters/limit'
          schema:
            type: integer
            default: 100
            maximum: 200
        - $ref: '#/components/parameters/cursor'
        - $ref: '#/components/parameters/platform'
        - $ref: '#/components/parameters/excludeArbitrage'
        - $ref: '#/components/parameters/excludeZeroBuys'
        - name: activeOnly
          in: query
          description: Only include wallets currently holding the token.
          schema:
            type: string
            enum:
              - 'true'
              - 'false'
            default: 'false'
        - name: minTrades
          in: query
          description: Minimum trade count.
          schema:
            type: integer
            default: 0
      responses:
        '200':
          description: Successful response.
          content:
            application/json:
              schema:
                type: object
                properties:
                  meta:
                    $ref: '#/components/schemas/TokenMeta'
                  traders:
                    type: array
                    items:
                      $ref: '#/components/schemas/Holder'
                  pagination:
                    $ref: '#/components/schemas/Pagination'
              example:
                meta:
                  symbol: TRUMP
                  name: OFFICIAL TRUMP
                  image: >-
                    https://image.solanatracker.io/proxy?url=https%3A%2F%2Farweave.net%2FVQrPjACwnQRmxdKBTqNwPiyo65x7LAT773t8Kd7YBzw
                  decimals: 6
                  price: 2.8078556911015307
                  snapshotPrice: null
                  marketCap: 2807853276.49
                  liquidity: 66749438.29
                  primaryMarket: meteora-dlmm
                traders:
                  - wallet: 6QSc2CxSdkUQSXttkceR9yMuxMf36L75fS8624wJ9tXv
                    pnl:
                      token:
                        realized: 0
                        unrealized: 0
                        total: 0
                      wallet:
                        realized: 58523.47
                        unrealized: -11351.36
                        total: 47172.11
                        invested: 699558.43
                        proceeds: 758081.9
                        totalTrades: 13111
                        tokensTraded: 2258
                    identity:
                      platforms:
                        - axiom
                      type: axiom
                      tags:
                        - axiom
                    position:
                      balance: 0
                      costBasis: 1096109
                      value: 0
                      price: 2.8078556911015307
                    buyUsd: 1096109
                    sellUsd: 0
                    counts:
                      buys: 1
                      sells: 0
                      total: 1
                    roi: 0
                    invested: 1096109
                    proceeds: 0
                    volume:
                      tokensBought: 390375.34
                      tokensSold: 0
                      buyUsd: 1096109
                      sellUsd: 0
                    averages:
                      buy: 1096109
                      sell: 0
                    current:
                      balance: 0
                      costBasis: 1096109
                      value: 0
                      price: 2.8078556911015307
                      avgCost: 2.8079
                    timing:
                      firstTrade: 1737165693000
                      lastTrade: 1737165693000
                      firstBuy: 1737165693000
                      lastBuy: 1737165693000
                      firstSell: null
                      lastSell: null
                      holdTimeSecs: 0
                  - wallet: GoM5z4nTyMcU5ewJ6hamXo4PDKnc8u1HPNkHpNdZeotR
                    pnl:
                      token:
                        realized: 852242.51
                        unrealized: 0
                        total: 852242.51
                      wallet:
                        realized: 4554030.67
                        unrealized: 32140.55
                        total: 4586171.22
                        invested: 2314000
                        proceeds: 6868030
                        totalTrades: 18432
                        tokensTraded: 1247
                    identity:
                      type: developer
                      tags:
                        - developer
                      developer:
                        token: TRUMPSo1111111111111111111111111111111111111
                        via:
                          - token_creator
                    position:
                      balance: 0
                      costBasis: 0.34
                      value: 0
                      price: 2.8078556911015307
                    buyUsd: 500000.34
                    sellUsd: 1352242.51
                    counts:
                      buys: 3
                      sells: 113
                      total: 116
                    roi: 170.45
                    invested: 500000.34
                    proceeds: 1352242.51
                    volume:
                      tokensBought: 178000.12
                      tokensSold: 178000.12
                      buyUsd: 500000.34
                      sellUsd: 1352242.51
                    averages:
                      buy: 166666.78
                      sell: 11966.75
                    current:
                      balance: 0
                      costBasis: 0.34
                      value: 0
                      price: 2.8078556911015307
                      avgCost: 0
                    timing:
                      firstTrade: 1737165694000
                      lastTrade: 1739980499000
                      firstBuy: 1737165694000
                      lastBuy: 1737165694000
                      firstSell: 1737165700000
                      lastSell: 1739980499000
                      holdTimeSecs: 2814805
                pagination:
                  hasMore: true
                  nextCursor: >-
                    eyJzb3J0VmFsdWUiOiIxNzM3MTY1Njk0MDAwIiwidGllQnJlYWtlciI6MTAwNzQ1OX0=
                  count: 2
                  total: 2
        '400':
          description: Invalid request parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      x-codeSamples:
        - lang: typescript
          label: SDK
          source: >
            import { Client } from '@solana-tracker/data-api';


            const client = new Client({ apiKey: 'YOUR_API_KEY' });


            const data = await
            client.getPnlV2TokenFirstBuyers('6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN',
            { limit: 50 });
      x-code-samples:
        - lang: typescript
          label: SDK
          source: >
            import { Client } from '@solana-tracker/data-api';


            const client = new Client({ apiKey: 'YOUR_API_KEY' });


            const data = await
            client.getPnlV2TokenFirstBuyers('6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN',
            { limit: 50 });
components:
  parameters:
    tokenPath:
      name: token
      in: path
      required: true
      description: Solana token mint address (base58, 32-44 characters).
      schema:
        type: string
        pattern: ^[1-9A-HJ-NP-Za-km-z]{32,44}$
    limit:
      name: limit
      in: query
      description: Number of results per page.
      schema:
        type: integer
        default: 100
    cursor:
      name: cursor
      in: query
      description: >-
        Opaque pagination cursor returned from the previous page's
        `pagination.nextCursor`.
      schema:
        type: string
    platform:
      name: platform
      in: query
      description: >-
        Filter traders by the trading platform(s) they use. Comma-separated
        list.
      schema:
        type: string
        enum:
          - axiom
          - axiom-flash
          - bloom
          - photon
    excludeArbitrage:
      name: excludeArbitrage
      in: query
      description: Exclude wallets flagged as arbitrage bots. Pass `false` to include them.
      schema:
        type: string
        enum:
          - 'true'
          - 'false'
        default: 'true'
    excludeZeroBuys:
      name: excludeZeroBuys
      in: query
      description: >-
        Exclude wallets with zero buy transactions. Pass `false` to include
        them.
      schema:
        type: string
        enum:
          - 'true'
          - 'false'
        default: 'true'
  schemas:
    TokenMeta:
      type: object
      description: Basic token metadata and current market data.
      properties:
        symbol:
          type:
            - string
            - 'null'
        name:
          type:
            - string
            - 'null'
        decimals:
          type:
            - integer
            - 'null'
        price:
          type:
            - number
            - 'null'
          description: Current price in USD.
        liquidity:
          type:
            - number
            - 'null'
          description: Current liquidity in USD.
        marketCap:
          type:
            - number
            - 'null'
          description: Current market cap in USD.
        primaryMarket:
          type:
            - string
            - 'null'
          description: Primary DEX where this token trades (e.g. Raydium, Orca).
    Holder:
      type: object
      description: >-
        A wallet's position in a specific token, as returned by `/traders` and
        `/first-buyers`. Legacy fields (`wallet`, `pnl`, `position`, `buyUsd`,
        `sellUsd`, `counts`, `roi`, `timing.firstTrade`, `timing.lastTrade`) are
        unchanged. Additive fields (`invested`, `proceeds`, `volume`,
        `averages`, `current`, extended `timing`) align with
        `/v2/pnl/wallets/:wallet/positions` and
        `/tokens/:token/holders?enrich=walletPnl` for the same wallet-token
        pair.
      properties:
        wallet:
          type: string
        pnl:
          type: object
          properties:
            token:
              $ref: '#/components/schemas/PnlBlock'
            wallet:
              $ref: '#/components/schemas/WalletLifetimePnl'
        identity:
          $ref: '#/components/schemas/Identity'
        position:
          type: object
          description: Legacy position snapshot. Same underlying values as `current`.
          properties:
            balance:
              type:
                - number
                - 'null'
              description: Current token balance.
            costBasis:
              type:
                - number
                - 'null'
            value:
              type:
                - number
                - 'null'
              description: Current USD value.
            price:
              type:
                - number
                - 'null'
              description: Current token price.
        buyUsd:
          type:
            - number
            - 'null'
          description: >-
            Total USD spent on buys (legacy; same value as `invested` and
            `volume.buyUsd`).
        sellUsd:
          type:
            - number
            - 'null'
          description: >-
            Total USD received from sells (legacy; same value as `proceeds` and
            `volume.sellUsd`).
        counts:
          type: object
          properties:
            buys:
              type: integer
            sells:
              type: integer
            total:
              type: integer
        roi:
          type:
            - number
            - 'null'
        invested:
          type:
            - number
            - 'null'
          description: Total cost basis (USD spent buying this token).
        proceeds:
          type:
            - number
            - 'null'
          description: Total USD received from sales of this token.
        volume:
          type: object
          properties:
            tokensBought:
              type:
                - number
                - 'null'
              description: Total tokens purchased (native units).
            tokensSold:
              type:
                - number
                - 'null'
              description: Total tokens sold (native units).
            buyUsd:
              type:
                - number
                - 'null'
              description: Total USD spent on buys.
            sellUsd:
              type:
                - number
                - 'null'
              description: Total USD received from sells.
        averages:
          type: object
          properties:
            buy:
              type:
                - number
                - 'null'
              description: Average buy size in USD.
            sell:
              type:
                - number
                - 'null'
              description: Average sell size in USD.
        current:
          type: object
          description: >-
            Current position state. Mirrors `position` with an additional
            `avgCost` field.
          properties:
            balance:
              type:
                - number
                - 'null'
              description: Current token balance (native units).
            costBasis:
              type:
                - number
                - 'null'
              description: Cost basis of remaining held tokens.
            value:
              type:
                - number
                - 'null'
              description: Current USD value of held tokens.
            price:
              type:
                - number
                - 'null'
              description: Current token price in USD.
            avgCost:
              type:
                - number
                - 'null'
              description: Average cost per token in USD.
        timing:
          type: object
          properties:
            firstTrade:
              type:
                - integer
                - 'null'
              description: Unix ms.
            lastTrade:
              type:
                - integer
                - 'null'
              description: Unix ms.
            firstBuy:
              type:
                - integer
                - 'null'
              description: Unix ms.
            lastBuy:
              type:
                - integer
                - 'null'
              description: Unix ms.
            firstSell:
              type:
                - integer
                - 'null'
              description: Unix ms.
            lastSell:
              type:
                - integer
                - 'null'
              description: Unix ms.
            holdTimeSecs:
              type:
                - integer
                - 'null'
              description: >-
                How long the position has been (or was) held, in seconds (first
                buy to last sell for closed bags, live duration for open bags).
    Pagination:
      type: object
      description: Cursor-based pagination metadata.
      properties:
        hasMore:
          type: boolean
          description: Whether more pages exist after this one.
        nextCursor:
          type:
            - string
            - 'null'
          description: >-
            Opaque cursor to pass as `?cursor=` for the next page. Null when
            there are no more results.
        count:
          type: integer
          description: Number of items returned in this page.
        total:
          type: integer
          description: Total number of matching items across all pages.
        pnlMode:
          type: string
          enum:
            - strict
            - adjusted
            - raw
          description: Resolved PnL treatment mode when the endpoint supports `pnlMode`.
        enrich:
          type: array
          description: List of enrichment modules applied to the response when supported.
          items:
            type: string
      required:
        - hasMore
        - nextCursor
        - count
        - total
    Error:
      type: object
      properties:
        error:
          type: string
          description: Human-readable error message.
      required:
        - error
    PnlBlock:
      type: object
      description: Realized, unrealized, and total profit/loss in USD.
      properties:
        realized:
          type:
            - number
            - 'null'
          description: Profit/loss from closed trades (tokens fully or partially sold).
        realizedRaw:
          type:
            - number
            - 'null'
          description: >-
            Unfiltered realized PnL before `pnlMode` adjustments. Present on
            position rows and leaderboard period stats when available.
        unrealized:
          type:
            - number
            - 'null'
          description: >-
            Paper profit/loss on tokens still held, based on current market
            price.
        total:
          type:
            - number
            - 'null'
          description: Sum of realized + unrealized PnL.
    WalletLifetimePnl:
      type: object
      description: >-
        Lifetime PnL summary for a wallet, used on token-scoped enrichment
        responses.
      properties:
        realized:
          type:
            - number
            - 'null'
        unrealized:
          type:
            - number
            - 'null'
        total:
          type:
            - number
            - 'null'
        invested:
          type:
            - number
            - 'null'
        proceeds:
          type:
            - number
            - 'null'
        totalTrades:
          type: integer
        tokensTraded:
          type: integer
    Identity:
      type: object
      description: >-
        Unified wallet identity. Only fields with known values are returned; a
        wallet can carry multiple tags at once.
      properties:
        name:
          type:
            - string
            - 'null'
          description: Display name, if known.
        twitter:
          type:
            - string
            - 'null'
          description: Twitter/X handle, if known.
        avatar:
          type:
            - string
            - 'null'
          format: uri
          description: Avatar image URL.
        type:
          type:
            - string
            - 'null'
          description: >-
            Primary label for single-badge UIs, such as `kol`, `developer`,
            `pool`, `bot`, `hacker`, `spam_dusting`, `exchange`, or a platform
            tag.
        tags:
          type: array
          items:
            type: string
          description: >-
            All resolved labels for the wallet, including KOL, platform, pool,
            developer, bot, arbitrage, hacker, spam-dusting, or exchange tags.
        platforms:
          type: array
          items:
            type: string
          description: >-
            Normalized trading frontend tags such as `axiom`, `bloom`, or
            `photon`. Query filters also accept `axiom-flash`, which is
            normalized to `axiom` in identity responses.
        bot:
          type: object
          properties:
            name:
              type:
                - string
                - 'null'
            avatar:
              type:
                - string
                - 'null'
              format: uri
        pool:
          type: object
          properties:
            program:
              type:
                - string
                - 'null'
            poolAddress:
              type:
                - string
                - 'null'
        developer:
          type: object
          properties:
            token:
              type:
                - string
                - 'null'
            via:
              type: array
              items:
                type: string
            pools:
              type: array
              items:
                type: string
            creationTx:
              type:
                - string
                - 'null'
            createdAt:
              type:
                - integer
                - 'null'
              description: Unix timestamp in seconds.
        hacker:
          type: object
          description: Curated exploit/scam wallet label, when known.
          properties:
            label:
              type:
                - string
                - 'null'
        spamDusting:
          type: object
          description: Curated spam-dusting wallet label, when known.
          properties:
            label:
              type:
                - string
                - 'null'
        exchange:
          type: object
          description: Known centralized exchange hot wallet label, when known.
          properties:
            name:
              type:
                - string
                - 'null'
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: API Key for authentication

````