vaults.fyi
  • General
    • 🏦Overview
    • 💡Use Cases
      • For Wallets and Apps
      • For Analysts
      • For Protocols & Product Teams
    • 🔎Methodology
      • vaults.fyi USD benchmark rate
      • vaults.fyi ETH benchmark rate
    • ❓FAQ
      • Vault requirements for inclusion on vaults.fyi
    • 🤖AI
  • API
    • vaults.fyi API Overview
      • Insights API
      • Earn API
        • Product demo
        • Flow diagrams
      • Plans
        • Credits
    • Endpoints
      • Market data
        • Get historical data
          • Get historical APY and TVL data on single vault over timestamp range
          • Get historical APY on single vault over timestamp range
          • Get historical TVL on single vault at single timestamp
          • Get historical APY on single vault at single timestamp
        • Get data for multiple vaults
        • Get data on single vault
          • Get APY on single vault
        • Get benchmark rates
        • Get supported vaults, networks & tokens
          • /vaults
          • /networks
          • /tokens
          • /tags
      • Contextual insights
        • Top vault options for address
        • Get single top option for address
        • [Etherscan cards] Get top USD, top ETH vault for address
      • Generate payloads (Earn API)
        • Prepare calldata
          • Supply/Deposit
          • Withdraw/Redeem
            • Request redeem
            • Claim redeem
          • Claim rewards
        • Get contract interaction details
        • Get supported assets
        • Get supported vaults
      • Position tracking (Portfolio API)
        • Get user balances
        • Get user positions
        • Get list of past vault txns by user address
        • Get estimated returns for user's vault position
  • Case Studies
    • Kraken Wallet
    • Etherscan Cards
  • Links
    • vaults.fyi
    • X
    • Farcaster
    • Wallfacer Labs
Powered by GitBook
On this page
  1. API
  2. vaults.fyi API Overview
  3. Insights API
  4. Insights PRO

[PRO] Vault Range Historical APY

This endpoint is available to vaults.api premium subscribers. See Plans for details.

The Vault Range Historical APY (GET /v1/vaults/{network}/{vaultAddress}/historical-apy) endpoint provides a chronological series of APY data for a specified vault, covering a user-defined range of time. This endpoint is particularly useful for understanding APY fluctuations and trends over an extended period.

Parameters

  • interval (required): A query parameter that defines the resolution of the APY data (1day, 7day, 30day).

  • from_timestamp (required): The starting point of the requested time range, defined as a Unix timestamp.

  • to_timestamp (required): The end point of the requested time range, also specified as a Unix timestamp.

  • page: An optional query parameter indicating the page number of the results, for paginated output.

  • per_page: An optional query parameter setting the number of items per page for pagination, with a default of 10.

  • granularity (required): A query parameter that specifies the time interval between each data point in the response, allowing for granular control over the dataset density.

  • vaultAddress (required): The address of the vault for which historical APY data is being queried, included as a path parameter.

  • network (required): The network on which the vault is located, also a path parameter. Acceptable values include mainnet, arbitrum, optimism, polygon, base, and gnosis.

Responses

  • 200 OK: The successful response consists of a JSON object that includes pagination details and an array of data points, each point corresponding to a time and APY value within the requested range.

An example response is structured as follows:

{
  "next_page": 0,
  "data": [
    {
      "timestamp": 0,
      "blockNumber": 0,
      "apy": {
        "base": 0,
        "rewards": 0,
        "total": 0
      }
    }
    ...
  ]
}

In this response format:

  • next_page indicates the next page number to query if pagination is used.

  • data is an array where each element contains:

    • timestamp reflecting the time for the data point,

    • blockNumber correlating to the block on the blockchain,

    • apy providing the APY percentage value generated by the vault during that time, broken down into base, rewards and total APY.

The Vault Range Historical APY endpoint is designed for those who need a detailed and adjustable view of a vault's performance history. It provides valuable insights for analysts and investors interested in the DeFi space's historical yields.

Last updated 5 months ago