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

# Get vault history

> Vault return curve, NAV curve, TVL curve, and annualized APR for an account over a time range.

### Parameters

| Parameter | Required | Type | Description |
| --------- | -------- | ---- | ----------- |
| address | yes | string (hex) | Account address. |
| from | yes | integer (int64) | Start timestamp in milliseconds (inclusive). Use 0 for all available history. |
| to | yes | integer (int64) | End timestamp in milliseconds (inclusive). Use 0 for the latest available snapshot. |
| interval | yes | string | Aggregation interval for the return and NAV curves. |

### Response fields

| Parameter | Required | Type | Description |
| --------- | -------- | ---- | ----------- |
| `apr` | yes | string | Annualized percentage return as a decimal string. |
| `nav` | yes | object[] | Per-share NAV curve normalized to 1.0 at the vault's first positive NAV. |
| `nav[].timestamp` | yes | integer (int64) | — |
| `nav[].value` | yes | string | — |
| `returns` | yes | object[] | Return curve derived from vault account equity snapshots. |
| `returns[].timestamp` | yes | integer (int64) | — |
| `returns[].value` | yes | string | — |
| `tvl` | yes | object[] | TVL curve derived from vault account equity snapshots. |
| `tvl[].timestamp` | yes | integer (int64) | — |
| `tvl[].value` | yes | string | — |
| `vaultStats` | yes | object | — |
| `vaultStats.averageReturns` | yes | string | — |
| `vaultStats.maxDrawdown` | yes | string | — |
| `vaultStats.returnsVolatility` | yes | string | — |
| `vaultStats.sharpeRatio` | yes | string | — |

### Response example

A sample **`200`** response body is attached to this operation as an OpenAPI **example** — see the **Example** panel on this page.



## OpenAPI

````yaml /specs/indexer-openapi.json get /vault-history
openapi: 3.1.0
info:
  title: Rocket Indexer API Documentation
  description: >-
    Welcome to the RocketChain Indexer API documentation!


    The indexer REST API serves historical and aggregated market data from
    ClickHouse. Endpoints cover candles, trades, order history, portfolio
    curves, funding events, bridge events, vault events, current/historical
    instruments, and live instrument details.
  license:
    name: MIT
    url: https://github.com/rocketfoundation/rocket-sdk-rust/blob/main/LICENSE
  version: '1.0'
  x-logo:
    altText: ROCKET
    backgroundColor: '#00000000'
    url: https://www.rocketfoundation.io/assets/rocket-logo.svg
servers:
  - url: https://beta.rocket-cluster-1.com/indexer
    description: Beta
  - url: https://testnet.rocket-cluster-1.com/indexer
    description: Testnet
  - url: https://devnet.rocket-cluster-1.com/indexer
    description: Devnet
security: []
tags:
  - name: Indexer REST-API
    description: >-
      Read-only REST endpoints backed by the RocketChain indexer. All routes are
      served over HTTP GET.
paths:
  /vault-history:
    get:
      tags:
        - Indexer REST-API
      summary: Get vault history
      description: >-
        Vault return curve, NAV curve, TVL curve, and annualized APR for an
        account over a time range.


        ### Parameters


        | Parameter | Required | Type | Description |

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

        | address | yes | string (hex) | Account address. |

        | from | yes | integer (int64) | Start timestamp in milliseconds
        (inclusive). Use 0 for all available history. |

        | to | yes | integer (int64) | End timestamp in milliseconds
        (inclusive). Use 0 for the latest available snapshot. |

        | interval | yes | string | Aggregation interval for the return and NAV
        curves. |


        ### Response fields


        | Parameter | Required | Type | Description |

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

        | `apr` | yes | string | Annualized percentage return as a decimal
        string. |

        | `nav` | yes | object[] | Per-share NAV curve normalized to 1.0 at the
        vault's first positive NAV. |

        | `nav[].timestamp` | yes | integer (int64) | — |

        | `nav[].value` | yes | string | — |

        | `returns` | yes | object[] | Return curve derived from vault account
        equity snapshots. |

        | `returns[].timestamp` | yes | integer (int64) | — |

        | `returns[].value` | yes | string | — |

        | `tvl` | yes | object[] | TVL curve derived from vault account equity
        snapshots. |

        | `tvl[].timestamp` | yes | integer (int64) | — |

        | `tvl[].value` | yes | string | — |

        | `vaultStats` | yes | object | — |

        | `vaultStats.averageReturns` | yes | string | — |

        | `vaultStats.maxDrawdown` | yes | string | — |

        | `vaultStats.returnsVolatility` | yes | string | — |

        | `vaultStats.sharpeRatio` | yes | string | — |


        ### Response example


        A sample **`200`** response body is attached to this operation as an
        OpenAPI **example** — see the **Example** panel on this page.
      operationId: getVaultHistory
      parameters:
        - name: address
          in: path
          description: Account address.
          required: true
          schema:
            type: string
            format: hex
          example: '0xf19e16fe3cf25c630f55f66d6c6cbf64f84fc86b'
        - name: from
          in: path
          description: >-
            Start timestamp in milliseconds (inclusive). Use 0 for all available
            history.
          required: true
          schema:
            $ref: '#/components/schemas/u64'
          example: 0
        - name: to
          in: path
          description: >-
            End timestamp in milliseconds (inclusive). Use 0 for the latest
            available snapshot.
          required: true
          schema:
            $ref: '#/components/schemas/u64'
          example: 1710086400000
        - name: interval
          in: path
          description: Aggregation interval for the return and NAV curves.
          required: true
          schema:
            $ref: '#/components/schemas/CandleTimeframe'
          example: 1d
      responses:
        '200':
          description: Vault history
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetVaultHistoryResponse'
              example:
                apr: '0.438'
                nav:
                  - timestamp: 1774360800000
                    value: '1.25'
                returns:
                  - timestamp: 1774360800000
                    value: '0.0012'
                tvl:
                  - timestamp: 1774360800000
                    value: '1250000.42'
                vaultStats:
                  averageReturns: '0.0012'
                  maxDrawdown: '0.031'
                  returnsVolatility: '0.0042'
                  sharpeRatio: '1.2'
        '400':
          description: Invalid query parameters
          content:
            text/plain:
              schema:
                type: string
        '500':
          description: Internal server error
          content:
            text/plain:
              schema:
                type: string
components:
  schemas:
    u64:
      type: integer
      format: int64
      minimum: 0
    CandleTimeframe:
      type: string
      description: Candle timeframe/interval for aggregation
      enum:
        - 1m
        - 5m
        - 15m
        - 30m
        - 1h
        - 4h
        - 1d
      example: 1h
    GetVaultHistoryResponse:
      type: object
      description: >-
        Response containing vault returns, NAV, TVL, annualized APR, and summary
        stats.
      required:
        - returns
        - nav
        - tvl
        - apr
        - vaultStats
      properties:
        apr:
          type: string
          description: Annualized percentage return as a decimal string.
        nav:
          type: array
          items:
            $ref: '#/components/schemas/PortfolioCurvePoint'
          description: >-
            Per-share NAV curve normalized to 1.0 at the vault's first positive
            NAV.
        returns:
          type: array
          items:
            $ref: '#/components/schemas/PortfolioCurvePoint'
          description: Return curve derived from vault account equity snapshots.
        tvl:
          type: array
          items:
            $ref: '#/components/schemas/PortfolioCurvePoint'
          description: TVL curve derived from vault account equity snapshots.
        vaultStats:
          $ref: '#/components/schemas/VaultStats'
          description: >-
            Summary stats derived from the per-share NAV returns over the
            requested range.
      examples:
        - apr: '0.438'
          nav:
            - timestamp: 1774360800000
              value: '1.25'
          returns:
            - timestamp: 1774360800000
              value: '0.0012'
          tvl:
            - timestamp: 1774360800000
              value: '1250000.42'
          vaultStats:
            averageReturns: '0.0012'
            maxDrawdown: '0.031'
            returnsVolatility: '0.0042'
            sharpeRatio: '1.2'
    PortfolioCurvePoint:
      type: object
      required:
        - timestamp
        - value
      properties:
        timestamp:
          $ref: '#/components/schemas/u64'
        value:
          type: string
    VaultStats:
      type: object
      required:
        - sharpeRatio
        - averageReturns
        - returnsVolatility
        - maxDrawdown
      properties:
        averageReturns:
          type: string
        maxDrawdown:
          type: string
        returnsVolatility:
          type: string
        sharpeRatio:
          type: string

````