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

# Get wallet balance chart by ecosystem

> Portfolio value over time for a wallet on the chains of one ecosystem.



## OpenAPI

````yaml /openapi-v1.yaml get /v1/{ecosystem}/wallets/{address}/charts/{chart_period}
openapi: 3.0.3
info:
  version: 1.0.0
  title: REST API
  description: REST-like API provides access to rich Zerion ecosystem.
  contact:
    name: Zerion API
    url: https://developers.zerion.io/
    email: api@zerion.io
servers:
  - description: Production API
    url: https://api.zerion.io
security:
  - APIKeyBasicAuth: []
tags:
  - name: wallets
    description: >-
      Operations related to wallets, such as portfolio charts, positions, and
      transactions.
  - name: wallet sets
    description: >-
      Operations on a wallet set, returning aggregated portfolio data across at
      most one EVM address and one Solana address queried together.
  - name: fungibles
    description: >-
      Operations related to fungible assets, such as list them all, search or
      get by ID.
  - name: chains
    description: Operations related to chains, such as list all chains.
  - name: swap
    description: Operations related to swapping and bridging assets.
  - name: gas
    description: Operations related to gas.
  - name: nfts
    description: >-
      Operations related to non fungible assets, such list them, search or get
      by ID.
  - name: dapps
    description: >-
      Operations related to decentralized applications, such as list them all,
      search or get by ID.
  - name: subscriptions to transactions
    description: Operations related to subscriptions to transactions.
paths:
  /v1/{ecosystem}/wallets/{address}/charts/{chart_period}:
    get:
      tags:
        - wallets
      summary: Get wallet balance chart by ecosystem
      description: >
        Returns a wallet's portfolio balance over time, for a wallet address of
        the ecosystem named in the path. Parameters and responses are the same
        as `GET /v1/wallets/{address}/charts/{chart_period}`, with these
        differences:


        - The wallet address must be valid for `ecosystem`. Nothing is inferred
        from it.

        - Only chains of `ecosystem` are served. A `filter[chain_ids]` list that
        names no chain of `ecosystem` returns `400`.

        - When no chain of `ecosystem` supports charts, the request returns
        `400`, with `detail` reading `charts is not supported for <ecosystem>`.
      operationId: getEcosystemWalletChart
      parameters:
        - $ref: '#/components/parameters/Ecosystem'
        - $ref: '#/components/parameters/ChartPeriod'
        - $ref: '#/components/parameters/Currency'
        - $ref: '#/components/parameters/EcosystemWalletAddress'
        - $ref: '#/components/parameters/ChartFilterChainIDs'
        - $ref: '#/components/parameters/ChartFilterFungibleIDs'
        - $ref: '#/components/parameters/ChartFilterExcludeFungibleIDs'
        - $ref: '#/components/parameters/ChartFilterPoolAddresses'
        - $ref: '#/components/parameters/ChartFilterExcludePoolAddresses'
        - $ref: '#/components/parameters/ChartFilterPositions'
      responses:
        '200':
          $ref: '#/components/responses/ChartsResponse'
        '400':
          $ref: '#/components/responses/MalformedParameters'
        '401':
          $ref: '#/components/responses/UnauthenticatedError'
        '404':
          $ref: '#/components/responses/EcosystemNotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '503':
          $ref: '#/components/responses/RetryAfter'
components:
  parameters:
    Ecosystem:
      name: ecosystem
      in: path
      required: true
      description: >-
        The ecosystem of the wallet address: `eip155` for EVM chains (`evm` is
        an alias of it), or `solana`. The endpoint serves only chains of this
        ecosystem. An unknown ecosystem returns `404`.
      example: eip155
      schema:
        type: string
        enum:
          - eip155
          - evm
          - solana
    ChartPeriod:
      name: chart_period
      in: path
      required: true
      description: >
        Chart period. Determines both the time window covered and the spacing

        between chart points (`points`). Each period samples the window at a
        fixed

        interval, so the number of points is roughly constant (~290–460)
        regardless

        of period:


        | Period     | Point interval | Time window         |

        | ---------- | -------------- | ------------------- |

        | `hour`     | 10 seconds     | last 1 hour         |

        | `day`      | 5 minutes      | last 24 hours       |

        | `week`     | 30 minutes     | last 7 days         |

        | `month`    | 2 hours        | last 30 days        |

        | `3months`  | 6 hours        | last 90 days        |

        | `6months`  | 12 hours       | last 180 days       |

        | `year`     | 1 day          | last 365 days       |

        | `5years`   | 4 days         | last 5 years        |

        | `max`      | varies         | full available history |


        Point counts are approximate, and `begin_at` / `end_at` are aligned to
        the

        interval. For `max`, the interval is derived from the amount of
        available

        history (targeting ~400 points), so it varies; for wallet and wallet-set

        charts the spacing is at least 1 day.
      schema:
        type: string
        minLength: 3
        maxLength: 7
        default: day
        enum:
          - hour
          - day
          - week
          - month
          - 3months
          - 6months
          - year
          - 5years
          - max
    Currency:
      name: currency
      in: query
      required: false
      description: Denominated currency value of returned prices
      schema:
        type: string
        default: usd
        enum:
          - eth
          - btc
          - usd
          - eur
          - krw
          - rub
          - gbp
          - aud
          - cad
          - inr
          - jpy
          - nzd
          - try
          - zar
          - cny
          - chf
    EcosystemWalletAddress:
      name: address
      in: path
      required: true
      description: >-
        The wallet address, valid for the `ecosystem` in the path: a `0x` EVM
        address for `eip155` or `evm`, a Solana address for `solana`. The
        ecosystem is not inferred from the address, so an address of another
        ecosystem returns `400`, for example `wallet address must be a valid
        Solana address`. Under `eip155` and `evm` the zero address returns
        `400`. The transactions, balance chart and PnL endpoints additionally
        require an address Zerion tracks, as they do on `/v1/wallets/{address}/`
        paths. An EVM address that is not tracked, such as a token contract,
        router or exchange hot wallet, returns `400`, with `detail` reading
        `untrackable wallet address` on transactions and balance charts. Solana
        addresses always count as tracked.
      example: '0x42b9df65b219b3dd36ff330a4dd8f327a6ada990'
      schema:
        oneOf:
          - $ref: '#/components/schemas/EVMAddress'
          - $ref: '#/components/schemas/SolanaAddress'
    ChartFilterChainIDs:
      name: filter[chain_ids]
      in: query
      style: form
      explode: false
      description: >-
        Chart only the balance on these chains (comma-separated list). A listed
        chain is used only when it reports both `supports_transactions` and
        `supports_positions` in the `flags` of `GET /v1/chains/` and belongs to
        the network family of the wallet address; on `/v1/{ecosystem}/wallets/`
        paths that family is the path's ecosystem. A listed chain that fails
        either rule is ignored when the list also names a chain that passes
        both. When no listed chain passes, the request returns `400` rather than
        an empty result, and `detail` names the first chain in the list, as
        `chain <id> does not support charts` (for example `chain bob does not
        support charts`), or `chain <id> does not support this wallet address
        type` when that chain reports those flags but is of another network
        family. When the filter is omitted, chains that fail either rule are
        left out of `data` silently, with no error and no `meta` signal.
      schema:
        type: array
        example:
          - aurora
        maxItems: 25
        items:
          type: string
    ChartFilterFungibleIDs:
      name: filter[fungible_ids]
      in: query
      style: form
      explode: false
      description: >-
        Chart only the balance of these fungible IDs (comma-separated list).
        Can't be combined with `filter[exclude_fungible_ids]`. Passing both
        returns `400`.
      schema:
        type: array
        maxItems: 25
        items:
          type: string
          maxLength: 44
    ChartFilterExcludeFungibleIDs:
      name: filter[exclude_fungible_ids]
      in: query
      style: form
      explode: false
      description: >-
        Leave these fungible IDs out of the chart (comma-separated list). Use it
        when the set to drop is smaller than the set to keep. Can't be combined
        with `filter[fungible_ids]`. Passing both returns `400`.
      schema:
        type: array
        maxItems: 25
        items:
          type: string
          maxLength: 44
    ChartFilterPoolAddresses:
      name: filter[pool_addresses]
      in: query
      style: form
      explode: false
      description: >
        Chart only these liquidity pool or vault positions (comma-separated
        list). Simple token and native-coin balances are left out.


        Each protocol takes a different value:


        - **Uniswap V2** - the LP token contract address, for example
        `0xb4e16d0168e52d35cacd2c6185b44281ec28c9dc`.

        - **Uniswap V3** - the pool contract address, for example
        `0x4e68ccd3e89f51c3074ca5072bbac773960dfa36`. The LP NFT form also works
        and selects the same position.

        - **Uniswap V4** - the LP NFT as
        `<position_manager_address>:<token_id>`, for example
        `0xbd216513d74c8cf14cf4747e6aaa6420ff64ee9e:229217`. `token_id` must be
        a canonical unsigned 256-bit decimal: digits only, no leading zeros,
        from `0` through `2^256 - 1`
        (`115792089237316195423570985008687907853269984665640564039457584007913129639935`)
        inclusive. Invalid or out-of-range values return `400`. Raw V4 pool IDs
        are 32-byte hashes, not contract addresses, and return `400`.

        - **ERC-4626 vaults** (for example Morpho) - the vault contract address.


        Get these values from the positions endpoint with
        `filter[positions]=no_filter`. `attributes.pool_address` holds the pool
        contract address,
        `attributes.receipt.fungible_info.implementations[].address` the LP
        token or vault share address, and `attributes.receipt.nft_info` the LP
        NFT's `contract_address` and `token_id`. Join those two with a colon.


        Addresses are case-insensitive. A syntactically valid address that
        matches none of the wallet's positions isn't an error: the response is
        `200` with an all-zero series.


        These are protocol positions, so combining this filter with
        `filter[positions]=only_simple` returns `400`. If `filter[positions]` is
        omitted, it defaults to `no_filter` instead of `only_simple`, so the
        selected positions are charted. Can't be combined with
        `filter[exclude_pool_addresses]`: passing both returns `400`.
      schema:
        type: array
        maxItems: 25
        items:
          type: string
          maxLength: 121
    ChartFilterExcludePoolAddresses:
      name: filter[exclude_pool_addresses]
      in: query
      style: form
      explode: false
      description: >
        Leave these liquidity pool or vault positions out of the chart
        (comma-separated list). The rest of the portfolio, simple balances
        included, is kept.


        Values take the same form as in `filter[pool_addresses]`: the Uniswap V2
        LP token address, the Uniswap V3 pool contract address, the Uniswap V4
        LP NFT as `<position_manager_address>:<token_id>`, or the ERC-4626 vault
        address. All come from the positions endpoint and are case-insensitive.
        A syntactically valid address that matches none of the wallet's
        positions excludes nothing and returns `200`. A raw V4 pool ID returns
        `400`. `token_id` must be a canonical unsigned 256-bit decimal: digits
        only, no leading zeros, from `0` through `2^256 - 1`
        (`115792089237316195423570985008687907853269984665640564039457584007913129639935`)
        inclusive. Invalid or out-of-range values return `400`.


        These are protocol positions, so combining this filter with
        `filter[positions]=only_simple` returns `400`: `only_simple` already
        drops every protocol position, so the exclusion would do nothing. If
        `filter[positions]` is omitted, it defaults to `no_filter` instead of
        `only_simple`. Can't be combined with `filter[pool_addresses]`: passing
        both returns `400`.
      schema:
        type: array
        maxItems: 25
        items:
          type: string
          maxLength: 121
    ChartFilterPositions:
      name: filter[positions]
      in: query
      style: form
      explode: false
      description: >
        Which positions count toward the chart. Defaults to `only_simple`.


        - `only_simple` - tokens and native coins held directly in the wallet.
        DeFi protocol positions are left out.

        - `only_complex` - DeFi protocol positions only, such as liquidity pool
        and vault positions.

        - `no_filter` - both simple and protocol positions.


        Supported protocols today: Uniswap V2, V3 and V4 liquidity positions and
        ERC-4626 vault positions (for example Morpho). More are being added.


        With `filter[pool_addresses]` or `filter[exclude_pool_addresses]` and no
        `filter[positions]`, the default is `no_filter` instead: pool filters
        select protocol positions, so `only_simple` would make them do nothing.
      schema:
        type: string
        default: only_simple
        enum:
          - only_simple
          - only_complex
          - no_filter
  responses:
    ChartsResponse:
      description: Resource for the requested wallet chart
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Response'
    MalformedParameters:
      description: Parameters are malformed
      content:
        application/json:
          schema:
            type: object
            properties:
              errors:
                type: array
                items:
                  type: object
                  properties:
                    title:
                      type: string
                      description: Error short title
                      example: Parameter is malformed
                    detail:
                      type: string
                      description: Long description of the error
                      example: Some validation errors will be described here
    UnauthenticatedError:
      description: Unathenticated request
      content:
        application/json:
          schema:
            type: object
            properties:
              errors:
                type: array
                items:
                  type: object
                  properties:
                    title:
                      type: string
                      description: Error short title
                      example: Unauthorized Error
                    detail:
                      type: string
                      description: Long description of the error
                      example: >-
                        The API key is invalid, please, make sure that you are
                        using a valid key
    EcosystemNotFound:
      description: The `ecosystem` in the path is unknown.
    TooManyRequests:
      description: Too many requests error
      content:
        application/json:
          schema:
            type: object
            properties:
              errors:
                type: array
                items:
                  type: object
                  properties:
                    title:
                      type: string
                      description: Error short title
                      example: Too many requests
                    detail:
                      type: string
                      description: Long description of the error
                      example: Your request had been throttled
    RetryAfter:
      description: >
        Service is temporarily unavailable.


        A transient state: the data is being prepared. Retry after the delay
        given in the

        `Retry-After` header. Wallets with long histories can need several
        attempts.
      headers:
        Retry-After:
          description: >
            Indicates how long the client should wait before making a follow-up
            request.
          schema:
            type: integer
            example: 10
            description: Number of seconds to wait.
      content:
        application/json:
          schema:
            type: object
            properties:
              errors:
                type: array
                items:
                  type: object
                  properties:
                    title:
                      type: string
                      description: Error short title
                      example: Service is temporarily unavailable
                    detail:
                      type: string
                      description: Long description of the error
                      example: Please, retry later (check the Retry-After header)
  schemas:
    EVMAddress:
      type: string
      description: Ethereum-compatible address (EVM).
      pattern: ^0x[a-fA-F0-9]{40}$
      example: '0x42b9df65b219b3dd36ff330a4dd8f327a6ada990'
    SolanaAddress:
      type: string
      description: Solana address
      pattern: ^[1-9A-HJ-NP-Za-km-z]{32,44}$
      example: 8BH9pjtgyZDC4iAQH5ZiYDZ1MDWC98xki2V8NzqqKW3K
    Response:
      type: object
      required:
        - links
        - data
      properties:
        links:
          $ref: '#/components/schemas/ResponseLinks'
        data:
          $ref: '#/components/schemas/Container'
    ResponseLinks:
      type: object
      properties:
        self:
          type: string
          format: url
          example: >-
            https://api.zerion.io/v1/wallets/0x42b9df65b219b3dd36ff330a4dd8f327a6ada990/charts/day
    Container:
      type: object
      required:
        - type
        - id
      properties:
        type:
          type: string
          description: Resource type
          enum:
            - wallet_chart
        id:
          type: string
          description: Wallet chart unique identifier
          example: 0x42b9df65b219b3dd36ff330a4dd8f327a6ada990-day
        attributes:
          $ref: '#/components/schemas/Attributes'
    Attributes:
      type: object
      required:
        - begin_at
        - end_at
      properties:
        begin_at:
          type: string
          description: Begin timestamp of the chart
          example: '2023-01-18T11:00:00Z'
        end_at:
          type: string
          description: End timestamp of the chart
          example: '2023-01-25T10:30:00Z'
        points:
          type: array
          description: >-
            Sorted list of chart points. The spacing between points depends on
            `chart_period`. See that parameter for the per-period interval.
          items:
            type: array
            description: >-
              Chart point - tuple of two items, the first one is timestamp, the
              second one is a balance in requested currency
            items:
              oneOf:
                - type: integer
                - type: number
            minItems: 2
            maxItems: 2
            example:
              - 1674039600
              - 1145.00999
  securitySchemes:
    APIKeyBasicAuth:
      type: http
      scheme: basic
      description: >-
        To test endpoints here, paste your API key from the
        [Dashboard](https://dashboard.zerion.io/) into the username field and
        leave the password empty.

````

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