> ## 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 User-Specific Token Trades

> Consulta actividad dentro del alcance de token, pool y wallet de este endpoint. Usa `events=all` para combinar swaps con depósitos y retiros de liquidez, o `events=liquidity` para obtener solo liquidez. Omite `events` para conservar la respuesta de swaps. Añade `enrich=identity` para identificar wallets en ambos tipos de evento.

Los eventos de liquidez usan `add_liquidity` o `remove_liquidity`, un único `pool` y cantidades exactas como cadenas en `tokens[]`; no incluyen precios de swap, volumen ni PnL. Consulta la [guía de liquidez](/es/guides/liquidity) para ejemplos REST, paginación y salas en vivo.

## SDK Example

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

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

const data = await client.getUserTokenTradeHistory('6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN', 'FbMxP3GVq8TQ36nbYgx4NP9iygMpwAwFWJwW81ioCiSF', {
  events: 'all', // Use 'liquidity' for LP adds/removes only, or 'trades' for swaps.
  enrich: 'identity',
  limit: 100,
  sortDirection: 'DESC',
});
```


## OpenAPI

````yaml /es/data-api/openapi.json get /trades/{tokenAddress}/by-wallet/{owner}
openapi: 3.1.0
info:
  title: API de datos Solana Tracker
  description: >-
    API de datos de Solana Tracker: precios de tokens, tenedores, operaciones,
    gráficos, datos de cartera, señales de riesgo y analítica de mercado.
  version: 1.0.0
  contact:
    email: contact@solanatracker.io
servers:
  - url: https://data.solanatracker.io
    description: Entorno de producción
security:
  - apiKey: []
paths:
  /trades/{tokenAddress}/by-wallet/{owner}:
    get:
      tags:
        - Trades
      summary: Get User-Specific Token Trades
      description: >-
        Consulta actividad dentro del alcance de token, pool y wallet de este
        endpoint. Usa `events=all` para combinar swaps con depósitos y retiros
        de liquidez, o `events=liquidity` para obtener solo liquidez. Omite
        `events` para conservar la respuesta de swaps. Añade `enrich=identity`
        para identificar wallets en ambos tipos de evento.


        Los eventos de liquidez usan `add_liquidity` o `remove_liquidity`, un
        único `pool` y cantidades exactas como cadenas en `tokens[]`; no
        incluyen precios de swap, volumen ni PnL. Consulta la [guía de
        liquidez](/es/guides/liquidity) para ejemplos REST, paginación y salas
        en vivo.
      parameters:
        - name: tokenAddress
          in: path
          required: true
          schema:
            type: string
        - name: owner
          in: path
          required: true
          schema:
            type: string
        - name: events
          in: query
          schema:
            type: string
            enum:
              - trades
              - all
              - liquidity
            default: trades
          description: >-
            Elige trades (predeterminado), all (swaps y liquidez) o liquidity
            (solo depósitos y retiros). Todos los modos devuelven un array
            trades. Los valores no válidos devuelven HTTP 400.
        - name: enrich
          in: query
          schema:
            type: string
          example: identity
          description: >-
            Usa identity para añadir la identidad actual de la wallet a cada
            swap o evento de liquidez: perfiles KOL, etiquetas, plataformas,
            roles de desarrollador/pool y nombres SNS disponibles. Las wallets
            desconocidas devuelven identity: null. Si se omite, no se consulta
            la identidad. all y * también la activan; pool y developer son alias
            de compatibilidad.
        - name: cursor
          in: query
          schema:
            type: string
          description: >-
            Devuelve nextCursor sin modificar. El modo predeterminado usa una
            marca de tiempo; events=all y events=liquidity usan una cadena opaca
            asociada al token, pool, wallet, events y sortDirection. Mantén esos
            filtros entre páginas.
        - name: limit
          in: query
          schema:
            type: integer
            minimum: 1
            maximum: 500
            default: 250
          description: >-
            Número de resultados: 250 por defecto, máximo 500. Con events=all o
            events=liquidity, el rango es 1–500.
        - name: sortDirection
          in: query
          schema:
            type: string
            enum:
              - ASC
              - DESC
            default: DESC
          description: >-
            Orden cronológico: DESC (más recientes primero) o ASC (más antiguos
            primero). Los valores no válidos devuelven HTTP 400.
        - name: showMeta
          in: query
          schema:
            type: boolean
          description: >-
            Usa true para añadir metadatos de los tokens de origen y destino a
            los swaps. Los eventos de liquidez conservan su array tokens sin
            metadatos de swap.
        - name: hideArb
          in: query
          schema:
            type: boolean
          description: >-
            Usa true para conservar los swaps que incluyan el token solicitado.
            Las acciones de liquidez se mantienen.
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TokenTradesResponse'
              examples:
                trades:
                  summary: 'Default: swaps only'
                  value:
                    trades:
                      - tx: >-
                          5V4apVkgHf49J5acYPiuh5rB89EGsF8ocSysgnD9vFfZsTtDamhN3MFDKJSq7Dn7Z6Y5XhjghuVYuvvYWnSFpnvW
                        amount: 90
                        priceUsd: 6
                        volume: 540
                        volumeSol: 3
                        type: sell
                        wallet: F7R61te4Ac8xZ4pfkJUdF6iaaHy9tnM8nVRUPv8H8EMi
                        time: 1789722000000
                        program: pumpfun-amm
                        pools:
                          - 9d9mb8kooFfaD3SctgZtkxQypkshx6ezhbKio89ixyy2
                    nextCursor: null
                    hasNextPage: false
                    sortDirection: DESC
                liquidity:
                  summary: 'events=liquidity: exact token amounts'
                  value:
                    trades:
                      - tx: >-
                          5V4apVkgHf49J5acYPiuh5rB89EGsF8ocSysgnD9vFfZsTtDamhN3MFDKJSq7Dn7Z6Y5XhjghuVYuvvYWnSFpnvW
                        type: add_liquidity
                        program: pumpfun-amm
                        programId: pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA
                        instruction: deposit
                        pool: 9d9mb8kooFfaD3SctgZtkxQypkshx6ezhbKio89ixyy2
                        wallet: F7R61te4Ac8xZ4pfkJUdF6iaaHy9tnM8nVRUPv8H8EMi
                        time: 1789722000000
                        slot: 370000000
                        amountBasis: transfer
                        tokens:
                          - address: 6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN
                            amount: '123.000001'
                            amountRaw: '123000001'
                            decimals: 6
                          - address: So11111111111111111111111111111111111111112
                            amount: '9.000000001'
                            amountRaw: '9000000001'
                            decimals: 9
                    nextCursor: null
                    hasNextPage: false
                    sortDirection: DESC
        '400':
          description: Invalid token, pool, wallet, events, sort direction or event cursor.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-codeSamples:
        - lang: shell
          label: Liquidity events
          source: >-
            curl --get
            "https://data.solanatracker.io/trades/{tokenAddress}/by-wallet/{owner}"
            \
              --header "x-api-key: YOUR_API_KEY" \
              --data-urlencode "events=liquidity" \
              --data-urlencode "enrich=identity" \
              --data-urlencode "limit=50"
        - lang: typescript
          label: SDK
          source: >
            import { Client } from '@solana-tracker/data-api';


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


            const data = await
            client.getUserTokenTradeHistory('6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN',
            'FbMxP3GVq8TQ36nbYgx4NP9iygMpwAwFWJwW81ioCiSF', {
              events: 'all', // Use 'liquidity' for LP adds/removes only, or 'trades' for swaps.
              enrich: 'identity',
              limit: 100,
              sortDirection: 'DESC',
            });
      x-code-samples:
        - lang: shell
          label: Liquidity events
          source: >-
            curl --get
            "https://data.solanatracker.io/trades/{tokenAddress}/by-wallet/{owner}"
            \
              --header "x-api-key: YOUR_API_KEY" \
              --data-urlencode "events=liquidity" \
              --data-urlencode "enrich=identity" \
              --data-urlencode "limit=50"
        - lang: typescript
          label: SDK
          source: >
            import { Client } from '@solana-tracker/data-api';


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


            const data = await
            client.getUserTokenTradeHistory('6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN',
            'FbMxP3GVq8TQ36nbYgx4NP9iygMpwAwFWJwW81ioCiSF', {
              events: 'all', // Use 'liquidity' for LP adds/removes only, or 'trades' for swaps.
              enrich: 'identity',
              limit: 100,
              sortDirection: 'DESC',
            });
components:
  schemas:
    TokenTradesResponse:
      type: object
      properties:
        trades:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/TokenTrade'
              - $ref: '#/components/schemas/LiquidityEvent'
        nextCursor:
          type:
            - integer
            - string
            - 'null'
          description: >-
            Timestamp for trades-only requests; opaque string for
            events=all/liquidity. Pass back unchanged with the same filters.
            Null at the end.
        hasNextPage:
          type: boolean
        sortDirection:
          type: string
          enum:
            - ASC
            - DESC
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Error message
      required:
        - error
    TokenTrade:
      type: object
      properties:
        tx:
          type: string
        amount:
          type: number
        priceUsd:
          type: number
        volume:
          type: number
        volumeSol:
          type: number
        type:
          type: string
          enum:
            - buy
            - sell
        wallet:
          type: string
        time:
          type: integer
        program:
          type: string
        pools:
          type: array
          items:
            type: string
        identity:
          description: >-
            Present only with enrich=identity. Current wallet labels, including
            available KOL, platform, developer/pool and SNS identity. Null when
            no identity is known.
          anyOf:
            - $ref: '#/components/schemas/EnrichedIdentity'
            - type: 'null'
      required:
        - tx
        - type
        - wallet
        - time
    LiquidityEvent:
      type: object
      required:
        - tx
        - type
        - program
        - programId
        - instruction
        - pool
        - wallet
        - time
        - slot
        - amountBasis
        - tokens
      properties:
        tx:
          type: string
        type:
          type: string
          enum:
            - add_liquidity
            - remove_liquidity
        program:
          type: string
        programId:
          type: string
        instruction:
          type: string
        pool:
          type: string
        wallet:
          type: string
        time:
          type: integer
          description: Unix milliseconds
        slot:
          type: integer
        amountBasis:
          type: string
          enum:
            - transfer
            - principal
          description: >-
            Transfer amounts are gross, before Token-2022 withholding. Principal
            separates CLMM fees and DLMM/Orca rebalancing.
        tokens:
          type: array
          minItems: 1
          items:
            type: object
            required:
              - address
              - amount
              - amountRaw
              - decimals
            properties:
              address:
                type: string
              amount:
                type: string
                description: Exact decimal amount
              amountRaw:
                type: string
                pattern: ^[0-9]+$
              decimals:
                type: integer
                minimum: 0
                maximum: 255
              feeAmountRaw:
                type: string
              transferredAmountRaw:
                type: string
        identity:
          description: >-
            Present only with enrich=identity. Current wallet labels, including
            available KOL, platform, developer/pool and SNS identity. Null when
            no identity is known.
          anyOf:
            - $ref: '#/components/schemas/EnrichedIdentity'
            - type: 'null'
    EnrichedIdentity:
      type: object
      description: >-
        Optional token-context identity enrichment for a holder wallet. Only
        known fields are returned. Common `type` values include `pool`, `bot`,
        `kol`, `developer`, and platform tags.
      properties:
        name:
          type: string
        twitter:
          type: string
        avatar:
          type: string
        type:
          type: string
          description: >-
            Primary label for single-badge UIs, such as `pool`, `bot`, `kol`,
            `developer`, or a platform tag.
        tags:
          type: array
          items:
            type: string
        platforms:
          type: array
          items:
            type: string
        pool:
          type: object
          properties:
            program:
              type: string
            poolAddress:
              type: string
        developer:
          type: object
          properties:
            token:
              type: string
            via:
              type: array
              items:
                type: string
            pools:
              type: array
              items:
                type: string
            creationTx:
              type: string
            createdAt:
              type: integer
        bot:
          type: object
          properties:
            name:
              type:
                - string
                - 'null'
            avatar:
              type:
                - string
                - 'null'
              format: uri
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: Clave API para autenticación

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.