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

# Solana Wallet Net Worth Chart API

> Get a Solana wallet's net worth history by hour or day, including DeFi positions, with 24h and 30d change.

The wallet's net worth over time, in USD and SOL. Each point is the net worth at the end of that hour or day (UTC).

* Net worth is recorded for wallets requested through Wallet V2, and keeps being recorded for 30 days after the last request. Requesting a wallet that isn't recorded yet starts recording it.
* Points from before a wallet was first recorded count tokens only, not DeFi positions. They have `includesPositions: false`. Pass `includesPositions=true` to leave them out.
* `changePercent` is the change from the previous point. It is `null` where the chart switches from tokens-only points to full points.
* `change` compares the latest point with 24 hours and 30 days earlier. The 30-day change needs a time range longer than 30 days.

`time` in the response is in Unix milliseconds; `time_from` and `time_to` are in Unix seconds.

## 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 /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: >-
    What a Solana wallet holds and earns: its tokens and its DeFi positions on
    lending, liquidity, staking, leverage and order platforms, valued in USD and
    SOL, with yield, claimable rewards and net worth history. Percentages are
    plain numbers (6.99 means 6.99%) and times are Unix milliseconds unless
    stated otherwise.
  contact:
    email: contact@solanatracker.io
servers:
  - url: https://data.solanatracker.io
    description: Production server
security:
  - apiKey: []
tags:
  - name: Wallet
    description: A wallet's net worth, tokens, DeFi positions and net worth history.
  - name: Platforms
    description: The DeFi platforms Wallet V2 supports.
paths:
  /v2/wallet/{wallet}/chart:
    get:
      tags:
        - Wallet
      summary: Get Wallet Net Worth Chart
      description: >-
        The wallet's net worth over time, one point per hour or day (UTC), with
        the change over 24 hours and 30 days.
      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: The wallet's net worth history.
          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: Wallet address.
    Interval:
      name: interval
      in: query
      schema:
        type: string
        enum:
          - 1d
          - 1h
        default: 1d
      description: >-
        `1d` for one point per day (up to 5 years per request, 365 days by
        default) or `1h` for one point per hour (up to 90 days per request, 7
        days by default).
    TimeFrom:
      name: time_from
      in: query
      schema:
        type: integer
      description: >-
        Start time in Unix seconds, inclusive. Defaults to 7 days (`1h`) or 365
        days (`1d`) before `time_to`.
    TimeTo:
      name: time_to
      in: query
      schema:
        type: integer
      description: >-
        End time in Unix seconds, inclusive. Defaults to now. Must not be before
        `time_from`.
    IncludesPositions:
      name: includesPositions
      in: query
      schema:
        type: boolean
      description: >-
        `true` returns only points that include DeFi positions, leaving out
        older tokens-only points.
  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: Invalid wallet address or query parameter.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: 'Invalid sort. Valid options are: value, amount, change24h'
    Unauthorized:
      description: Missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unavailable:
      description: The wallet can't be loaded right now. Retry after `Retry-After` seconds.
      headers:
        Retry-After:
          description: Seconds to wait before retrying.
          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.