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

# API del gráfico de patrimonio neto de wallets de Solana

> Historial del patrimonio neto de una wallet de Solana por hora o por día, con posiciones DeFi incluidas y variación en 24h y 30d.

El patrimonio neto de la wallet a lo largo del tiempo, en USD y SOL. Cada punto es el patrimonio neto al final de esa hora o ese día (UTC).

* El patrimonio neto se registra para las wallets consultadas con Wallet V2 y se sigue registrando durante 30 días después de la última consulta. Consultar una wallet que aún no se registra empieza a registrarla.
* Los puntos anteriores al inicio del registro cuentan solo tokens, no posiciones DeFi, y tienen `includesPositions: false`. Pasa `includesPositions=true` para excluirlos.
* `changePercent` es la variación respecto al punto anterior. Es `null` donde el gráfico pasa de puntos solo de tokens a puntos completos.
* `change` compara el último punto con 24 horas y 30 días antes. La variación de 30 días necesita un rango de más de 30 días.

`time` en la respuesta está en milisegundos Unix; `time_from` y `time_to` están en segundos Unix.

## SDK Example

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

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

const data = await client.getWalletChartV2('CN8w8cuh87gZYjhpaPxbD78GTrBmUKmVysqgsC9uYu9i', {
  interval: '1d', // Or '1h', up to 90 days.
  timeFrom: Math.floor(Date.now() / 1000) - 30 * 86400, // Unix seconds.
  includesPositions: true, // Leaves out the older tokens-only points.
});

console.log(data.change['24h'].percent, data.points.at(-1)?.usd);
```


## OpenAPI

````yaml /es/data-api/wallet-v2/openapi.json get /v2/wallet/{wallet}/chart
openapi: 3.1.0
info:
  title: Solana Tracker Wallet API v2
  version: 2.0.0
  description: >-
    Lo que una wallet de Solana tiene y gana: sus tokens y sus posiciones DeFi
    en plataformas de préstamos, liquidez, staking, apalancamiento y órdenes,
    valorados en USD y SOL, con rendimiento, recompensas por reclamar e
    historial de patrimonio neto. Los porcentajes son números simples (6.99
    significa 6,99 %) y los tiempos son milisegundos Unix salvo que se indique
    lo contrario.
  contact:
    email: contact@solanatracker.io
servers:
  - url: https://data.solanatracker.io
    description: Production server
security:
  - apiKey: []
tags:
  - name: Wallet
    description: >-
      Patrimonio neto, tokens, posiciones DeFi e historial de patrimonio neto de
      una wallet.
  - name: Platforms
    description: Las plataformas DeFi compatibles con Wallet V2.
paths:
  /v2/wallet/{wallet}/chart:
    get:
      tags:
        - Wallet
      summary: Get Wallet Net Worth Chart
      description: >-
        El patrimonio neto de la wallet a lo largo del tiempo, un punto por hora
        o por día (UTC), con la variación en 24 horas y en 30 días.
      operationId: getWalletChartV2
      parameters:
        - $ref: '#/components/parameters/Wallet'
        - $ref: '#/components/parameters/Interval'
        - $ref: '#/components/parameters/TimeFrom'
        - $ref: '#/components/parameters/TimeTo'
        - $ref: '#/components/parameters/IncludesPositions'
      responses:
        '200':
          description: El historial de patrimonio neto de la wallet.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WalletV2ChartResponse'
              example:
                wallet: CN8w8cuh87gZYjhpaPxbD78GTrBmUKmVysqgsC9uYu9i
                interval: 1d
                change:
                  24h:
                    usd: -158.388082
                    percent: -0.13
                  30d:
                    usd: null
                    percent: null
                points:
                  - time: 1787011200000
                    usd: 6923.059
                    sol: 91.06526
                    includesPositions: false
                    changePercent: null
                  - time: 1795132800000
                    usd: 122629.863201
                    sol: 1781.128012921
                    includesPositions: true
                    changePercent: null
                  - time: 1795219200000
                    usd: 122824.201652
                    sol: 1750.387522537
                    includesPositions: true
                    changePercent: 0.16
                  - time: 1795305600000
                    usd: 122665.81357
                    sol: 1778.432891944
                    includesPositions: true
                    changePercent: -0.13
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '503':
          $ref: '#/components/responses/Unavailable'
      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.getWalletChartV2('CN8w8cuh87gZYjhpaPxbD78GTrBmUKmVysqgsC9uYu9i',
            {
              interval: '1d', // Or '1h', up to 90 days.
              timeFrom: Math.floor(Date.now() / 1000) - 30 * 86400, // Unix seconds.
              includesPositions: true, // Leaves out the older tokens-only points.
            });


            console.log(data.change['24h'].percent, data.points.at(-1)?.usd);
      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.getWalletChartV2('CN8w8cuh87gZYjhpaPxbD78GTrBmUKmVysqgsC9uYu9i',
            {
              interval: '1d', // Or '1h', up to 90 days.
              timeFrom: Math.floor(Date.now() / 1000) - 30 * 86400, // Unix seconds.
              includesPositions: true, // Leaves out the older tokens-only points.
            });


            console.log(data.change['24h'].percent, data.points.at(-1)?.usd);
components:
  parameters:
    Wallet:
      name: wallet
      in: path
      required: true
      schema:
        type: string
        default: CN8w8cuh87gZYjhpaPxbD78GTrBmUKmVysqgsC9uYu9i
      description: Dirección de la wallet.
    Interval:
      name: interval
      in: query
      schema:
        type: string
        enum:
          - 1d
          - 1h
        default: 1d
      description: >-
        `1d` para un punto por día (hasta 5 años por solicitud, 365 días por
        defecto) o `1h` para un punto por hora (hasta 90 días por solicitud, 7
        días por defecto).
    TimeFrom:
      name: time_from
      in: query
      schema:
        type: integer
      description: >-
        Hora de inicio en segundos Unix, inclusive. Por defecto, 7 días (`1h`) o
        365 días (`1d`) antes de `time_to`.
    TimeTo:
      name: time_to
      in: query
      schema:
        type: integer
      description: >-
        Hora de fin en segundos Unix, inclusive. Por defecto, ahora. No puede
        ser anterior a `time_from`.
    IncludesPositions:
      name: includesPositions
      in: query
      schema:
        type: boolean
      description: >-
        `true` devuelve solo los puntos que incluyen posiciones DeFi y deja
        fuera los puntos anteriores que solo cuentan tokens.
  schemas:
    WalletV2ChartResponse:
      type: object
      required:
        - wallet
        - interval
        - change
        - points
      properties:
        wallet:
          type: string
        interval:
          type: string
          enum:
            - 1h
            - 1d
        change:
          type: object
          description: >-
            Change between the latest point and the points 24 hours and 30 days
            earlier. Null when there is no earlier point to compare with, or
            when one of the two points counts tokens only. The 30-day change
            needs a time range longer than 30 days.
          required:
            - 24h
            - 30d
          properties:
            24h:
              type: object
              required:
                - usd
                - percent
              properties:
                usd:
                  type:
                    - number
                    - 'null'
                  description: Change in USD over 24 hours.
                percent:
                  type:
                    - number
                    - 'null'
                  description: >-
                    Change in percent (6.99 means 6.99%). Null when the earlier
                    value was 0.
            30d:
              type: object
              required:
                - usd
                - percent
              properties:
                usd:
                  type:
                    - number
                    - 'null'
                  description: Change in USD over 30 days.
                percent:
                  type:
                    - number
                    - 'null'
                  description: >-
                    Change in percent (6.99 means 6.99%). Null when the earlier
                    value was 0.
        points:
          type: array
          items:
            type: object
            required:
              - time
              - usd
              - sol
              - includesPositions
              - changePercent
            properties:
              time:
                type: integer
                description: Start of the hour or day (UTC), in Unix milliseconds.
              usd:
                type: number
                description: Net worth in USD.
              sol:
                type:
                  - number
                  - 'null'
                description: Net worth in SOL. Null when the SOL price was unavailable.
              includesPositions:
                type: boolean
                description: >-
                  `false` on older points that count tokens only, without DeFi
                  positions. Their `usd` can't be compared with full points.
              changePercent:
                type:
                  - number
                  - 'null'
                description: >-
                  Change in percent from the previous point. Null on the first
                  point, after a point worth 0, and where tokens-only points
                  switch to full points.
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: Error message.
  responses:
    BadRequest:
      description: Dirección de wallet o parámetro de consulta no válido.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: 'Invalid sort. Valid options are: value, amount, change24h'
    Unauthorized:
      description: Falta la API key o no es válida.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unavailable:
      description: >-
        No se puede cargar la wallet en este momento. Reintenta tras
        `Retry-After` segundos.
      headers:
        Retry-After:
          description: Segundos que hay que esperar antes de reintentar.
          schema:
            type: integer
            example: 1
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: Wallet data is temporarily unavailable, please retry
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: API Key for authentication

````

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