# Table of Contents - [vaults.fyi ETH benchmark rate | vaults.fyi](#vaults-fyi-eth-benchmark-rate-vaults-fyi) - [vaults.fyi USD benchmark rate | vaults.fyi](#vaults-fyi-usd-benchmark-rate-vaults-fyi) - [Overview | vaults.fyi](#overview-vaults-fyi) - [Insights API | vaults.fyi](#insights-api-vaults-fyi) - [Vault requirements for inclusion on vaults.fyi | vaults.fyi](#vault-requirements-for-inclusion-on-vaults-fyi-vaults-fyi) - [vaults.fyi API Overview | vaults.fyi](#vaults-fyi-api-overview-vaults-fyi) - [Earn API | vaults.fyi](#earn-api-vaults-fyi) - [FAQ | vaults.fyi](#faq-vaults-fyi) - [Endpoints | vaults.fyi](#endpoints-vaults-fyi) - [Flow diagrams | vaults.fyi](#flow-diagrams-vaults-fyi) - [Methodology | vaults.fyi](#methodology-vaults-fyi) - [Product demo | vaults.fyi](#product-demo-vaults-fyi) - [Get historical data | vaults.fyi](#get-historical-data-vaults-fyi) - [Market data | vaults.fyi](#market-data-vaults-fyi) - [Get historical TVL on single vault | vaults.fyi](#get-historical-tvl-on-single-vault-vaults-fyi) - [Get historical data on single vault | vaults.fyi](#get-historical-data-on-single-vault-vaults-fyi) - [Get supported vaults, networks & tokens | vaults.fyi](#get-supported-vaults-networks-tokens-vaults-fyi) - [Get historical APY on single vault | vaults.fyi](#get-historical-apy-on-single-vault-vaults-fyi) - [Get data for multiple vaults | vaults.fyi](#get-data-for-multiple-vaults-vaults-fyi) - [/tokens | vaults.fyi](#-tokens-vaults-fyi) - [Get data on single vault | vaults.fyi](#get-data-on-single-vault-vaults-fyi) - [/vaults | vaults.fyi](#-vaults-vaults-fyi) - [Get benchmark rates | vaults.fyi](#get-benchmark-rates-vaults-fyi) - [Contextual insights | vaults.fyi](#contextual-insights-vaults-fyi) - [Get APY on single vault | vaults.fyi](#get-apy-on-single-vault-vaults-fyi) - [Top vault options for address | vaults.fyi](#top-vault-options-for-address-vaults-fyi) - [[Etherscan cards] Get top USD, top ETH vault for address | vaults.fyi](#-etherscan-cards-get-top-usd-top-eth-vault-for-address-vaults-fyi) - [/networks | vaults.fyi](#-networks-vaults-fyi) - [/tags | vaults.fyi](#-tags-vaults-fyi) - [Get single top option for address | vaults.fyi](#get-single-top-option-for-address-vaults-fyi) - [Transactional (Earn API) | vaults.fyi](#transactional-earn-api-vaults-fyi) - [Claim rewards | vaults.fyi](#claim-rewards-vaults-fyi) - [Prepare transaction calldata | vaults.fyi](#prepare-transaction-calldata-vaults-fyi) - [Get transaction prep details | vaults.fyi](#get-transaction-prep-details-vaults-fyi) --- # vaults.fyi ETH benchmark rate | vaults.fyi [Previousvaults.fyi USD benchmark rate](/general/methodology/vaults.fyi-usd-benchmark-rate) [NextFAQ](/general/faq) Last updated 8 months ago The **vaults.fyi ETH benchmark rate** is an indicative metric for ETH staking yields. As of today, the benchmark rate reflects the weighted average APY across the four largest liquid staking tokens (LSTs) on Ethereum mainnet, weighted by total value locked: * Lido stETH * ether.fi eETH * Coinbase cbETH * Rocket Pool rETH The **vaults.fyi ETH benchmark rate** is available today at [vaults.fyi/chart-explorer](https://www.vaults.fyi/chart-explorer) . It will be available via [Insights API](/api/vaults.fyi-api-overview/insights-api) endpoint in the future. #### [](#partnership-requests) Partnership requests Please DM us via Twitter ([@vaultsfyi](https://twitter.com/vaultsfyi) ) if you would like to feature the **vaults.fyi ETH benchmark rate** rate in your product, or if you have any other requests. 🔎 ![](https://docs.vaults.fyi/~gitbook/image?url=https%3A%2F%2F3226304686-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FEkGaXDNnZOBpJqpoGvSf%252Fuploads%252FGC6cNOpUfojhFHjfQSLQ%252Fimage.png%3Falt%3Dmedia%26token%3D0248fefd-7a4e-42cc-8794-416a0f7733ed&width=768&dpr=4&quality=100&sign=cf4d8289&sv=2) **vaults.fyi ETH benchmark rate, as shown on** [vaults.fyi/chart-explorer](https://www.vaults.fyi/chart-explorer) --- # vaults.fyi USD benchmark rate | vaults.fyi [PreviousMethodology](/general/methodology) [Nextvaults.fyi ETH benchmark rate](/general/methodology/vaults.fyi-eth-benchmark-rate) Last updated 8 months ago The **vaults.fyi USD benchmark rate** is an indicative metric for stablecoin lending rates across DeFi markets. As of today, the USD benchmark rate reflects the weighted average lending APY across the following markets on Ethereum mainnet, weighted by total value locked: * Aave v3 USDT * Aave v3 USDC * MakerDAO Savings DAI (sDAI) * Compound v3 USDC The **vaults.fyi USD benchmark rate** is available today at [vaults.fyi/chart-explorer](https://www.vaults.fyi/chart-explorer) . It will be available via [Insights API](/api/vaults.fyi-api-overview/insights-api) endpoint in the future. #### [](#partnership-requests) Partnership requests Please DM us via Twitter ([@vaultsfyi](https://twitter.com/vaultsfyi) ) if you would like to feature the **vaults.fyi USD benchmark rate** rate in your product, or if you have any other requests. 🔎 ![](https://docs.vaults.fyi/~gitbook/image?url=https%3A%2F%2F3226304686-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FEkGaXDNnZOBpJqpoGvSf%252Fuploads%252FJswZAZWPLmaKjIPvNmZ4%252Fimage.png%3Falt%3Dmedia%26token%3D05b943a1-7962-40fd-843a-a56da5733bdb&width=768&dpr=4&quality=100&sign=d86963f2&sv=2) The **vaults.fyi USD benchmark rate, as shown on** [vaults.fyi/chart-explorer](https://www.vaults.fyi/chart-explorer) --- # Overview | vaults.fyi [**vaults.fyi**](https://vaults.fyi/) is the homepage of onchain yield. We connect users to lending, staking, and more onchain yields. With integrations for >500 DeFi vaults across 50+ protocols on Ethereum and L2s, vaults.fyi provides: 1. Accurate, standardized data on onchain lending, staking, and more. 2. A single interface for transaction capabilities (deposit, redeem, etc.), with no intermediaries. vaults.fyi is entirely non-custodial, preserving users' autonomy and security. Read more [here](/api/vaults.fyi-api-overview/earn-api) . The [vaults.fyi API](/api/vaults.fyi-api-overview) makes it easy for builders to integrate DeFi into external products and workflows: * [Insights API](/api/vaults.fyi-api-overview/insights-api) : Get market data on DeFi pools and wallet-based, contextual insights * [Earn API](/api/vaults.fyi-api-overview/earn-api) : Get transactional capabilities across dozens of protocols through one unified interface [](#key-features) Key features ----------------------------------- **Standardized Analytics for DeFi Yields** vaults.fyi provides current and historical yield data across leading protocols, such as Aave, Morpho, Euler, MakerDAO, Lido, and Compound. We provide standardized yield metrics including 1-day, 7-day and 30-day average Annual Percent Yield (APY) derived entirely from onchain data we index from node providers. **Detailed Breakdowns on Lending & Staking** Our data helps decipher "Where does the yield come from?" With vaults.fyi, our users can get detailed information on lending/staking vaults' past performance, broken down into base asset yield vs. reward token yields. [NextMethodology](/general/methodology) Last updated 26 days ago 🏦 --- # Insights API | vaults.fyi Our Insights API endpoints provide a wealth of analytics across leading DeFi lending and staking pools. Whether you are building financial tools, applications, or conducting in-depth market research, our Insights API endpoints offer the necessary tools to leverage reliable onchain data. [](#what-is-the-insights-api) What is the Insights API? ------------------------------------------------------------ The Insights API provides deliver in-depth analytics for the decentralized finance (DeFi) ecosystem, empowering users with reliable on-chain data across leading lending and staking pools. Endpoints provide access to broad market analysis metrics and detailed individual vault information, such as TVL and APY, in both real-time and historical contexts. [](#key-benefits) Key Benefits ----------------------------------- ### [](#get-the-best-data-on-defi-yields) Get the best data on DeFi yields Gain edge by accessing accurate and timely DeFi market data. Save time backtesting strategies by getting standardized data on leading DeFi pools through our unified API. Drive decision making with clean, accurate data on the market's top lending and staking markets. ### [](#integrate-defi-data-into-your-product) Integrate DeFi data into your product By integrating extensive market metrics, including real-time and historical TVL and APY data, you can enhance your platform's functionality and provide your users with the insights needed to navigate the complex DeFi landscape effectively. [](#explore-endpoints) Explore endpoints --------------------------------------------- Try out Insights API endpoints here: [Market data](/api/endpoints/market-data) [Contextual insights](/api/endpoints/contextual-insights) Got questions or feedback? Reach out to us on [X](https://twitter.com/vaultsfyi) or [Farcaster](https://warpcast.com/vaultsfyi) . [Previousvaults.fyi API Overview](/api/vaults.fyi-api-overview) [NextEarn API](/api/vaults.fyi-api-overview/earn-api) Last updated 26 days ago --- # Vault requirements for inclusion on vaults.fyi | vaults.fyi For vaults to be included on vaults.fyi, **all key data must be available onchain.** ### [](#what-we-look-for) What we look for From an input contract address(es), we need to extract the following data: * _tvl_ - total value locket in the vault, denominated in underlying token * _totalSupply_ - total supply of the lp token issued by vault (if it exists) * _pricePerShare_ - normally if we have both, it is tvl/totalSupply (if not there needs to be another way to get the indicator of growth in time) * _maxDeposit_ - the maximum amount of the tokens any user can deposit into the vault * _liquidity_ - the amount of tokens directly available for withdrawal * _asset_ - the address of underlying erc20 token of the vault * _name_ - the name of the vault * _lpTokenAddress_ - the address of lp token issued by the vault * _rewardTokens_ - addresses of reward tokens distributed for the vault * _rewardTokenEmissionsPerSecond_ - emissions per second of the reward distributed for the vault Vaults conforming to [ERC-4626](https://ethereum.org/en/developers/docs/standards/tokens/erc-4626/) standards make finding this data straightforward. For vaults where we need to extract this data from multiple contracts through some chain of commands, we appreciate teams reaching out to us with instructions on how to find the data listed above. [PreviousFAQ](/general/faq) [Nextvaults.fyi API Overview](/api/vaults.fyi-api-overview) Last updated 9 months ago ❓ --- # vaults.fyi API Overview | vaults.fyi vaults.fyi API endpoints provide market data and transactional support across leading DeFi lending and staking protocols, including Aave, Morpho, Euler, MakerDAO, Sky, Compound, and more. Whether you are building an application or conducting in-depth market research, our APIs provide access to accurate onchain data for 400+ pools on 50+ protocols across multiple networks. [](#what-is-the-insights-api) What is the Insights API? ------------------------------------------------------------ The [Insights API](/api/vaults.fyi-api-overview/insights-api) provides deliver in-depth market data across the decentralized finance (DeFi) ecosystem, empowering users with reliable onchain data across leading lending and staking pools. Endpoints provide access detailed real-time and historical metrics on pools and protocol, including the [accurate, standardized data](/general/methodology) on returns (APY) and assets secured (TVL). Additionally, our API provides access to differentiated market indicators, including market [benchmark rates](/general/methodology/vaults.fyi-usd-benchmark-rate) for stablecoins and ETH. Additionally, the API helps to increase user engagement through contextual insights, helping users find the most relevant DeFi opportunities, based upon held balances and expressed preferences. Try our Insights API [Market data](/api/endpoints/market-data) and [Contextual insights](/api/endpoints/contextual-insights) endpoints. [](#what-is-the-earn-api) What is the Earn API? ---------------------------------------------------- Our Earn API is entirely non-custodial, preserving users' autonomy and security. At a high level, the [Earn API](/api/vaults.fyi-api-overview/earn-api) provides the following transactional support and position monitoring capabilities: * **Transaction execution:** make transactions a breeze by preparing transaction details and calldata for deposits, withdrawals, and reward token claiming interactions. Additionally, our API simulates transactions and helps protect end users against malicious transactions. * **Position monitoring**: track an address’s positions on DeFi lending and staking protocols, providing key metrics on position current value, historical value, and returns. Try our [Transactional (Earn API)](/api/endpoints/transactional-earn-api) and [Position tracking (Portfolio API)](/api/endpoints/position-tracking-portfolio-api) endpoints. [PreviousVault requirements for inclusion on vaults.fyi](/general/faq/vault-requirements-for-inclusion-on-vaults.fyi) [NextInsights API](/api/vaults.fyi-api-overview/insights-api) Last updated 26 days ago --- # Earn API | vaults.fyi Our Earn API endpoints make it seamless to integrate DeFi experiences into your product by enabling a unified interface across dozens of staking and lending protocols. [](#what-is-the-earn-api) What is the Earn API? ---------------------------------------------------- At a high level, our Earn API provides the following capabilities: * **Transaction execution:** prepare transaction details and calldata for deposits, withdrawals, and rewards-related interactions on leading DeFi yield vaults. Additionally, our API simulates transactions and helps protect end users against malicious transactions. * **Position monitoring**: track an address’s positions on DeFi lending and staking protocols, providing key metrics on position current value, historical value, and returns. **The Earn API is entirely non-custodial, preserving users' autonomy and security.** _How it works:_ The Earn API prepares transaction details and calldata, facilitating transactions related to staking/lending without holding or controlling user funds. [](#key-benefits) Key Benefits ----------------------------------- ### [](#increase-user-engagement-with-contextual-insights) **Increase user engagement, with contextual insights** * **Find yield opportunities for a given address, based upon its balances and preferences** * **Present user with easy to parse list of yield opportunities** ### [](#make-transactions-a-breeze) **Make transactions a breeze** * **Perpare vault interactions:** Use our endpoints to prepare necessary interactions with each vault. Our API can prepare txn details and calldata, as well as return simulations for each transaction. * **Supply/Deposit transactions:** Prepare transaction details and calldata for deposit transactions. * **Redeem transactions:** Prepare transaction details and calldata for withdrawals from vaults. * **Claim rewards:** Prepare transaction details and calldata for claiming rewards accrued by a user for a specified vault. ### [](#track-portfolio-performance) Track portfolio performance * **Get user balances of idle assets** * **Get user balances of active lending/staking/LP positions**, along with total returns estimates and average APYs for positions. [](#tl-dr) TL;DR --------------------- * Enhance your platform's functionality with robust DeFi staking & lending capabilities * Integrate your choice of 200+ DeFi opportunities through our unified API * Simplify DeFi lending and staking experiences for users * Maintain the non-custodial nature of your service [](#where-can-i-see-a-demo) Where can I see a demo? -------------------------------------------------------- Go to the [vaults.fyi app](https://app.vaults.fyi/) to see the full power of our APIs. Everything on our app is powered by our APIs. [](#how-does-it-work) How does it work? -------------------------------------------- For a simplified overview, view our [Flow diagrams](/api/vaults.fyi-api-overview/earn-api/flow-diagrams) . Contact us for API access and to learn more. [PreviousInsights API](/api/vaults.fyi-api-overview/insights-api) [NextProduct demo](/api/vaults.fyi-api-overview/earn-api/product-demo) Last updated 1 day ago --- # FAQ | vaults.fyi ### [](#who-chooses-which-vaults-are-shown-on-vaults.fyi) Who chooses which vaults are shown on vaults.fyi? Our team started with yield opportunities for stablecoins, ETH, and liquid staking tokens across a handful of “blue-chip” DeFi protocols such as Aave, Compound, MakerDAO, Yearn, Lido stETH, and Rocket Pool rETH. We continue to add new vaults as they launch and as users request them, with a slight preference for ERC-4626 compatible protocols. Keep in mind that we carefully curate the opportunities shown on vaults.fyi and research new vaults before adding them to the list. ### [](#what-causes-significant-fluctuations-in-apy) What causes significant fluctuations in APY? One challenge we face is accounting for the irregular intervals at which some vaults update their earnings — leading to sudden and significant fluctuations in APY. Understanding this nuance is essential for accurately interpreting discrepancies on vaults.fyi. See our [methodology](/general/methodology) for more information. ### [](#how-can-i-stay-up-to-date-with-the-latest-activity) How can I stay up to date with the latest activity? Follow [@vaultsfyi](https://twitter.com/vaultsfyi) on X/Farcaster for new product updates, vaults and insights on DeFi yield and TVL trends. ### [](#how-do-i-request-new-vaults-or-features) How do I request new vaults or features? Reach out to [@vaultsfyi](https://twitter.com/vaultsfyi) on X or Farcaster! ### [](#what-are-the-requirements-for-vaults-to-be-displayed-on-vaults.fyi) What are the requirements for vaults to be displayed on vaults.fyi? Read more [here](/general/faq/vault-requirements-for-inclusion-on-vaults.fyi) . [Previousvaults.fyi ETH benchmark rate](/general/methodology/vaults.fyi-eth-benchmark-rate) [NextVault requirements for inclusion on vaults.fyi](/general/faq/vault-requirements-for-inclusion-on-vaults.fyi) Last updated 9 months ago ❓ --- # Endpoints | vaults.fyi [Market data](/api/endpoints/market-data) [Contextual insights](/api/endpoints/contextual-insights) [Transactional (Earn API)](/api/endpoints/transactional-earn-api) [Position tracking (Portfolio API)](/api/endpoints/position-tracking-portfolio-api) [PreviousCredits](/api/vaults.fyi-api-overview/plans/credits) [NextMarket data](/api/endpoints/market-data) --- # Flow diagrams | vaults.fyi [PreviousProduct demo](/api/vaults.fyi-api-overview/earn-api/product-demo) [NextPlans](/api/vaults.fyi-api-overview/plans) Last updated 7 months ago The vaults.fyi DeFi API serves both EOA and [ERC-4337](https://www.erc4337.io/) compatible smart contract wallets. Notably, our API enables users to interact with DeFi vaults without inserting additional layers of smart contracts between users and protocols. ### [](#for-eoa-wallets) For EOA wallets ### [](#for-smart-contract-wallets) For Smart Contract Wallets ![](https://docs.vaults.fyi/~gitbook/image?url=https%3A%2F%2Flh7-rt.googleusercontent.com%2Fdocsz%2FAD_4nXdzxQSRJQdswgB6s3UdyXGh708tOzp2Niey-ZCLFTW73QMTrOlIN6V5Pe-xb92Hsyuv2jG6L-6O1W28mh0b8My-EW_QliyAkK3phe0vYEGmzfAR6rIGPY02cLsSJpMeE4-VvUXTQipmBWFKQJqT5S5WLNo%3Fkey%3DG5jZ1EWdCnH8htLUY3ddAA&width=768&dpr=4&quality=100&sign=5b5fa757&sv=2) ![](https://docs.vaults.fyi/~gitbook/image?url=https%3A%2F%2Flh7-rt.googleusercontent.com%2Fdocsz%2FAD_4nXfdn6eQbS6MuTPlkQhPTC1HEAKB4HaZF5eCUMxMNxr7ZFxv7eOK0xW-frICn5ve4djp6n5ZJGBqvGzLvgv2AHYc6qWeHc-rNnOjDcGi7lHzsIu1biAE3UFB-uTR5eppmZiDhVMkN_vofGYJDOU0uyCApEIb%3Fkey%3DG5jZ1EWdCnH8htLUY3ddAA&width=768&dpr=4&quality=100&sign=4b94c1ee&sv=2) --- # Methodology | vaults.fyi [vaults.fyi](https://www.vaults.fyi/vaults) utilizes onchain data to track yields over a given period of time. We query blockchains hourly and obtain the share price of the specific DeFi vaults curated on our platform. This share price, indicative of a lender’s stake in a vault, can be used to calculate yield over time. By sourcing data directly and avoiding external API endpoints, we strive for accuracy and dependability. For example, when calculating a vault’s 7-day APY on January 7th, we compare the share price on that day with the share price from January 1st and then extrapolate this difference over an entire year. This method is similarly applied when determining 1-day and 30-day APYs. To efficiently automate this process, we implement specialized smart contracts that fetch and transform data using a single function. These contracts are deployed in a static call, which is temporary and does not affect blockchain storage, thereby incurring any cost. This method allows us to read data directly from the blockchain. Our approach saves on calls and enables the use of one result to calculate the next within the same call, a technique not possible with standard multi-call processes. We use services like Infura, Alchemy, and Ankr RPCs to execute these calls. Once the data is retrieved, it is stored in our backend database. [](#calculating-apy-from-historical-data) Calculating APY from historical data ----------------------------------------------------------------------------------- Due to the vast amount of data involved and the limitations in indexing speed, it is impractical to query blockchains every time a new block is added. Instead, we calculate yield using accrued interest, an obtainable figure for most yield-bearing products. This allows APY to be extrapolated from limited data points. ### [](#simple-interest) Simple interest We use the following formula to calculate APY for simple (i.e., not compounding) interest: APY\=interest rate×yeartime \\text{APY} = \\text{interest rate} \\times \\frac{\\text{year}}{\\text{time}} APY\=interest rate×timeyear​ ### [](#compounding-interest) Compounding interest To determine compounding interest, we use the following formula: APY\=\[(1+interest rate)yeartime\]−1\\text{APY} = \\left\[ \\left(1 + \\text{interest rate}\\right)^\\frac{\\text{year}}{\\text{time}} \\right\] - 1APY\=\[(1+interest rate)timeyear​\]−1 ### [](#interest-rate-calculation) Interest Rate Calculation The interest rate at any given point in time is determined by: interest rate\=current share priceprevious share price−1\\text{interest rate} = \\frac{\\text{current share price}}{\\text{previous share price}} - 1 interest rate\=previous share pricecurrent share price​−1 Where the share price is: share price\=total shares valuetotal shares\\text{share price} = \\frac{\\text{total shares value}}{\\text{total shares}}share price\=total sharestotal shares value​ ### [](#range-apy) Range APY To offer a more representative APY, especially in scenarios with fluctuating yields, we compute a range APY. This involves calculating a weighted average of interest rates over a specified period (`x` days). ### [](#weighting-mechanism-for-range-apy) Weighting Mechanism for Range APY In calculating the weighted average interest rate for the range APY, each point in time within the range is assigned a weight. This weight is determined by taking the minimum of the TVL at that specific time (TVLti)(TVL\_{t\_{i}})(TVLti​​) and the TVL at the preceding time (TVLti−1)(TVL\_{t\_{i-1}})(TVLti−1​​). weightti\=min(TVLti,TVLti−1)\\text{weight}\_{t\_{i}}=min(\\text{TVL}\_{t\_{i}},\\text{TVL}\_{t\_{i-1}})weightti​​\=min(TVLti​​,TVLti−1​​) #### [](#rationale) Rationale The TVL between two consecutive points in time (t\_{i} and t\_{i-1}) is inherently uncertain. To maintain a conservative approach and avoid overestimating the yield, we choose to underestimate the TVL during that interval by selecting the lower of the two TVL values. This ensures that the calculated APY reflects a more realistic, if not slightly lower, yield. With this weighting method the average interest rate over a given period is determined by interest rateti,xday\=(∑j:ti−tj\=xdayishare pricetjshare pricetj−1∗weighttj∑j:ti−tj\=xdayiweighttj)i−j−1\\text{interest rate}\_{t\_{i},xday}=(\\frac{\\sum\_{j:t\_{i}-t\_{j}=xday}^{i}\\frac{\\text{share price}\_{t\_{j}}}{\\text{share price}\_{t\_{j-1}}}\*weight\_{t\_{j}}}{\\sum\_{j:t\_{i}-t\_{j}=xday}^{i}weight\_{t\_{j}}})^{i-j} - 1interest rateti​,xday​\=(∑j:ti​−tj​\=xdayi​weighttj​​∑j:ti​−tj​\=xdayi​share pricetj−1​​share pricetj​​​∗weighttj​​​)i−j−1 ### [](#rewards-apy) Rewards APY To calculate the rewards APY for a desired time range (1 day, 7 days, 30 days), we: 1. Estimate the number of reward tokens distributed per token deposited in the vault during the chosen period by taking a weighted average of emissions based on the TVL. 2. Calculate the average price ratio between the reward token and the deposited token for that period. 3. Use this ratio to convert the accumulated reward tokens' value to a single deposited token's value. 4. Compare this converted value to the initial deposit to determine the APY. The average of the reward token price (**PIT** \- Price In Token) to deposited token price is calculated using the formula: PIT‾ti,xday\=∑j:ti−tj\=xdayirewardTokenPriceInUSDtj−1underlyingTokenPriceInUSDtj−1∗(tj−tj−1)ti−tj\\overline{PIT}\_{t\_{i},xday}=\\frac{\\sum\_{j:t\_{i}-t\_{j}=xday}^{i}\\frac{rewardTokenPriceInUSD\_{t\_{j-1}}}{underlyingTokenPriceInUSD\_{t\_{j-1}}} \* (t\_{j}-t\_{j-1})}{t\_{i}-t\_{j}}PITti​,xday​\=ti​−tj​∑j:ti​−tj​\=xdayi​underlyingTokenPriceInUSDtj−1​​rewardTokenPriceInUSDtj−1​​​∗(tj​−tj−1​)​ The APY at time range of `xday` is calculated using the formula: APYti,xday\=∑j:ti−tj\=xdayiemissionsPerSecondtj−1×year×PIT‾tj,xday×(tj−tj−1)∑j:ti−tj\=xdayiTVLtj×(tj−tj−1)\\text{APY}\_{t\_{i},xday}=\\frac{\\sum\_{j:t\_{i}-t\_{j}=xday}^{i}emissionsPerSecond\_{t\_{j-1}}\\times year\\times\\overline{PIT}\_{t\_{j},xday}\\times (t\_{j}-t\_{j-1}) }{\\sum\_{j:t\_{i}-t\_{j}=xday}^{i}TVL\_{t\_{j}}\\times (t\_{j}-t\_{j-1}) }APYti​,xday​\=∑j:ti​−tj​\=xdayi​TVLtj​​×(tj​−tj−1​)∑j:ti​−tj​\=xdayi​emissionsPerSecondtj−1​​×year×PITtj​,xday​×(tj​−tj−1​)​ [](#obtaining-the-data-we-need) Obtaining the data we need --------------------------------------------------------------- In order to execute the calculations outlined above, accessing onchain data is essential. Our method of obtaining a vault's share price depends on the type of vault. You can read more about each method below. ### [](#erc-4626) ERC-4626 In the case of ERC-4626 vaults, we can call the `totalSupply` and `totalAssets` smart contract functions to calculate share price. `totalSupply` = total shares `totalAssets` = total shares value ### [](#not-erc-4626) Not ERC-4626 If a vault is not ERC-4626 compliant, proxies for the above functions can usually be found in the following functions: * `mint` * `deposit` * `burn` * `redeem` You can see an example of this in the code snippets below. Copy function deposit(uint256 _amount, address _receiver) external nonReentrant isNotPastMaturity whenNotPaused approvedLender(_receiver) returns (uint256 _sharesReceived) { _addInterest(); VaultAccount memory _totalAsset = totalAsset; _sharesReceived = _totalAsset.toShares(_amount, false); _deposit(_totalAsset, _amount.toUint128(), _sharesReceived, _receiver); } Copy function toShares( VaultAccount memory total, uint256 amount, bool roundUp ) internal pure returns (uint256 shares) { if (total.amount == 0) { shares = amount; } else { shares = (amount * total.shares) / total.amount; if (roundUp && (shares * total.amount) / total.shares < amount) { shares = shares + 1; } } } The functions provided are typical examples and not an exhaustive list; some vaults may require individual solutions. ### [](#liquid-staking-tokens) Liquid staking tokens To calculate APY for LSTs (e.g., [Lido](https://www.vaults.fyi/vaults/mainnet/0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84) ) and other vaults that periodically update their earnings (e.g., [Yearn vaults](https://yearn.vaults.fyi/vaults) ), we use the `totalSupply` and `getEthValue(totalSupply)`functions. `totalSupply` = total shares `getEthValue(totalSupply)`\= total shares value One challenge we face is accounting for the irregular intervals at which some vaults update their earnings — leading to sudden and significant fluctuations in APY. Understanding this nuance is essential for accurately interpreting discrepancies on vaults.fyi. ### [](#rebasing-supply-vaults) Rebasing supply vaults Vaults that gradually increase the user's LP token balance, such as those on [Aave](https://www.vaults.fyi/vaults?selectedProtocols=aave) , are known as rebasing supply vaults. We calculate the share price for rebasing supply vaults with the `totalSupply` and `scaledTotalSupply` functions. `scaledTotalSupply` = total shares `totalSupply` = total shares value ### [](#staking-mechanism-vaults) Staking mechanism vaults Vaults that do not compound automatically (e.g., [StakeWise](https://www.vaults.fyi/vaults?selectedProtocols=stakewise) ) are known as staking mechanism vaults. These vaults do not compound interest automatically, instead making users periodically harvest and redeposit it to maximize yield. Calculating returns in such scenarios can be complex, as the total shares:value ratio does not reflect share price accurately. Instead, we can ascertain the actual share price with the following formulas: total principal value\=sETH2.totalSupply()total rewards value\=rETH2.totalSupply()TVL\=total principal value+total rewards valueshare price\=1+rETH2.rewardPerToken()totalSupply\=TVLshare price\\text{total principal value} = \\text{sETH2.totalSupply()} \\\\ \\text{total rewards value} = \\text{rETH2.totalSupply()} \\\\ \\text{TVL} = \\text{total principal value} + \\text{total rewards value} \\\\ \\text{share price} = 1 + \\text{rETH2.rewardPerToken()} \\\\ \\text{totalSupply} = \\frac{\\text{TVL}}{\\text{share price}} total principal value\=sETH2.totalSupply()total rewards value\=rETH2.totalSupply()TVL\=total principal value+total rewards valueshare price\=1+rETH2.rewardPerToken()totalSupply\=share priceTVL​ These formulas result in a simulated calculation of `totalSupply`. It is not directly fetched from the blockchain. ### [](#real-world-assets) Real-world assets [RWAs on vaults.fyi](https://www.vaults.fyi/vaults?selectedTags=RWA) are ERC-20 tokens that reflect investments in offchain financial assets. To assess the yield of RWAs we use: * The `totalSupply` function to calculate total shares. * The `RWAOracle.price` function to fetch share price. * The `StablecoinOracle.price` function to fetch the underlying asset's (i.e, a stablecoin) price. These functions are used in the following formulas to calculate yield: total shares\=totalSupply()share asset price\=RWAOracle.price()underlying asset price\=StablecoinOracle.price()total shares in USD\=total shares×share asset pricetotal shares in asset\=total shares in USDunderlying asset pricetotal shares value\=total shares in asset\\begin{align\*} \\text{total shares} &= \\text{totalSupply()} \\\\ \\text{share asset price} &= \\text{RWAOracle.price()} \\\\ \\text{underlying asset price} &= \\text{StablecoinOracle.price()} \\\\ \\text{total shares in USD} &= \\text{total shares} \\times \\text{share asset price} \\\\ \\text{total shares in asset} &= \\frac{\\text{total shares in USD}}{\\text{underlying asset price}} \\\\ \\text{total shares value} &= \\text{total shares in asset} \\end{align\*} total sharesshare asset priceunderlying asset pricetotal shares in USDtotal shares in assettotal shares value​\=totalSupply()\=RWAOracle.price()\=StablecoinOracle.price()\=total shares×share asset price\=underlying asset pricetotal shares in USD​\=total shares in asset​ [PreviousOverview](/) [Nextvaults.fyi USD benchmark rate](/general/methodology/vaults.fyi-usd-benchmark-rate) Last updated 7 months ago 🔎 --- # Product demo | vaults.fyi [PreviousEarn API](/api/vaults.fyi-api-overview/earn-api) [NextFlow diagrams](/api/vaults.fyi-api-overview/earn-api/flow-diagrams) Last updated 3 months ago To see our transactional Earn API endpoints in action, try out [app.vaults.fyi](https://app.vaults.fyi/) . Our app is powered fully by our API. Please contact us if you'd like to see more. See the demo below for how our API can power mobile experiences: Demo transactional experience powered by the vaults.fyi API Mobile transaction experience, powered by the vaults.fyi API ![](https://docs.vaults.fyi/~gitbook/image?url=https%3A%2F%2F3226304686-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FEkGaXDNnZOBpJqpoGvSf%252Fuploads%252FP4WxPuORpcXU9fIqnrLZ%252Fvaults_app_demo3_loop.gif%3Falt%3Dmedia%26token%3D49f55d38-879e-40cd-830a-c80b617251f1&width=768&dpr=4&quality=100&sign=d72f3964&sv=2) --- # Get historical data | vaults.fyi For rich historical data, use these endpoints available through our PRO-level subscription: * [Get historical data on single vault](/api/endpoints/market-data/get-historical-data/get-historical-data-on-single-vault) (returns both APY and TVL details) * [Get historical TVL on single vault](/api/endpoints/market-data/get-historical-data/get-historical-tvl-on-single-vault) * [Get historical APY on single vault](/api/endpoints/market-data/get-historical-data/get-historical-apy-on-single-vault) [PreviousMarket data](/api/endpoints/market-data) [NextGet historical data on single vault](/api/endpoints/market-data/get-historical-data/get-historical-data-on-single-vault) Last updated 27 days ago --- # Market data | vaults.fyi [PreviousEndpoints](/api/endpoints) [NextGet historical data](/api/endpoints/market-data/get-historical-data) Last updated 14 days ago Our Insights API endpoints provide a wealth of market data analytics across leading lending and staking vaults in leading protocols, such as Aave, Morpho, Euler, Compound, and Maker/Sky. Endpoints provide access to broad market analysis metrics and detailed individual vault information, such as TVL and APY, in both real-time and historical contexts. For detail on how we calculate standardized APYs, see [Methodology](/general/methodology) . [](#key-benefits) Key Benefits ----------------------------------- ### [](#get-the-best-data-on-defi-yields) Get the best data on DeFi yields Gain edge by accessing accurate and timely DeFi market data. Save time backtesting strategies by getting standardized data on leading DeFi pools through our unified API. Drive decision making with clean, accurate data on the market's top lending and staking markets. ### [](#integrate-defi-data-into-your-product) Integrate DeFi data into your product By integrating extensive market metrics, including real-time and historical TVL and APY data, you can enhance your platform's functionality and provide your users with the insights needed to navigate the complex DeFi landscape effectively. [](#explore-endpoints) Explore endpoints --------------------------------------------- [Get historical data](/api/endpoints/market-data/get-historical-data) [Get data for multiple vaults](/api/endpoints/market-data/get-data-for-multiple-vaults) [Get data on single vault](/api/endpoints/market-data/get-data-on-single-vault) [Get benchmark rates](/api/endpoints/market-data/get-benchmark-rates) [Get supported vaults, networks & tokens](/api/endpoints/market-data/get-supported-vaults-networks-and-tokens) --- # Get historical TVL on single vault | vaults.fyi [PreviousGet historical data on single vault](/api/endpoints/market-data/get-historical-data/get-historical-data-on-single-vault) [NextGet historical APY on single vault](/api/endpoints/market-data/get-historical-data/get-historical-apy-on-single-vault) get https://api.vaults.fyi//v1/vaults/{network}/{vaultAddress}/historical-tvl/{timestamp} Get historical TVL data for a vault for block with closest timestamp to the given one Authorizations Path parameters vaultAddressstringrequired Address of a vault Pattern: `^0x[a-fA-F0-9]{40}$` networkstring · enumrequired Network name or caip Available options: `mainnet``arbitrum``optimism``polygon``base``gnosis``unichain``eip155:1``eip155:42161``eip155:10``eip155:137``eip155:8453``eip155:100``eip155:130` timestampintegerrequired Timestamp of the historical data Responses 200 Object describing the TVL of the vault in given time application/json cURL JavaScript Python HTTP Copy curl -L \ --url 'https://api.vaults.fyi//v1/vaults/{network}/{vaultAddress}/historical-tvl/{timestamp}' \ --header 'x-api-key: YOUR_API_KEY' Test it 200 Copy { "timestamp": 1, "blockNumber": 1, "tvlDetails": { "tvlNative": "text", "tvlUsd": "text", "lockedNative": "text", "lockedUsd": "text", "liquidNative": "text", "liquidUsd": "text" } } Object describing the TVL of the vault in given time --- # Get historical data on single vault | vaults.fyi [PreviousGet historical data](/api/endpoints/market-data/get-historical-data) [NextGet historical TVL on single vault](/api/endpoints/market-data/get-historical-data/get-historical-tvl-on-single-vault) get https://api.vaults.fyi//v1/vaults/{network}/{vaultAddress}/historical-data Get historical APY data for a vault for blocks in given timestamp range Authorizations Path parameters vaultAddressstringrequired Address of a vault Pattern: `^0x[a-fA-F0-9]{40}$` networkstring · enumrequired Network name or caip Available options: `mainnet``arbitrum``optimism``polygon``base``gnosis``unichain``eip155:1``eip155:42161``eip155:10``eip155:137``eip155:8453``eip155:100``eip155:130` Query parameters pageinteger · default: 0optional Page number per\_pageinteger · max: 50 · default: 10optional Number of items per page intervalstring · enum · default: "7day"optional Resolution of the APY data Available options: `1day``7day``30day` from\_timestampinteger · default: 1739374158optional Timestamp of the beginning of the range in epoch seconds to\_timestampinteger · default: 1741966158optional Timestamp of the end of the range in epoch seconds granularityinteger · default: 86400optional Time difference between returned data points Responses 200 Default Response application/json cURL JavaScript Python HTTP Copy curl -L \ --url 'https://api.vaults.fyi//v1/vaults/{network}/{vaultAddress}/historical-data' \ --header 'x-api-key: YOUR_API_KEY' Test it 200 Copy { "next_page": 1, "data": [\ {\ "timestamp": 1,\ "blockNumber": 1,\ "apy": {\ "base": 1,\ "rewards": 1,\ "total": 1\ },\ "tvlDetails": {\ "tvlNative": "text",\ "tvlUsd": "text",\ "lockedNative": "text",\ "lockedUsd": "text",\ "liquidNative": "text",\ "liquidUsd": "text"\ }\ }\ ] } Default Response --- # Get supported vaults, networks & tokens | vaults.fyi [/vaults](/api/endpoints/market-data/get-supported-vaults-networks-and-tokens/vaults) [/networks](/api/endpoints/market-data/get-supported-vaults-networks-and-tokens/networks) [/tokens](/api/endpoints/market-data/get-supported-vaults-networks-and-tokens/tokens) [/tags](/api/endpoints/market-data/get-supported-vaults-networks-and-tokens/tags) [PreviousGet benchmark rates](/api/endpoints/market-data/get-benchmark-rates) [Next/vaults](/api/endpoints/market-data/get-supported-vaults-networks-and-tokens/vaults) --- # Get historical APY on single vault | vaults.fyi [PreviousGet historical TVL on single vault](/api/endpoints/market-data/get-historical-data/get-historical-tvl-on-single-vault) [NextGet data for multiple vaults](/api/endpoints/market-data/get-data-for-multiple-vaults) get https://api.vaults.fyi//v1/vaults/{network}/{vaultAddress}/historical-apy/{timestamp} Get historical APY data for a vault for block with closest timestamp to the given one Authorizations Path parameters vaultAddressstringrequired Address of a vault Pattern: `^0x[a-fA-F0-9]{40}$` networkstring · enumrequired Network name or caip Available options: `mainnet``arbitrum``optimism``polygon``base``gnosis``unichain``eip155:1``eip155:42161``eip155:10``eip155:137``eip155:8453``eip155:100``eip155:130` timestampintegerrequired Timestamp of the historical data Query parameters intervalstring · enumrequired Resolution of the APY data Available options: `1day``7day``30day` Responses 200 Object describing the APY of the vault in given time application/json cURL JavaScript Python HTTP Copy curl -L \ --url 'https://api.vaults.fyi//v1/vaults/{network}/{vaultAddress}/historical-apy/{timestamp}?interval=1day' \ --header 'x-api-key: YOUR_API_KEY' Test it 200 Copy { "timestamp": 1, "blockNumber": 1, "apy": { "base": 1, "rewards": 1, "total": 1 } } Object describing the APY of the vault in given time get https://api.vaults.fyi//v1/vaults/{network}/{vaultAddress}/historical-apy Get historical APY data for a vault for blocks in given timestamp range Authorizations Path parameters vaultAddressstringrequired Address of a vault Pattern: `^0x[a-fA-F0-9]{40}$` networkstring · enumrequired Network name or caip Available options: `mainnet``arbitrum``optimism``polygon``base``gnosis``unichain``eip155:1``eip155:42161``eip155:10``eip155:137``eip155:8453``eip155:100``eip155:130` Query parameters intervalstring · enumrequired Resolution of the APY data Available options: `1day``7day``30day` from\_timestampintegerrequired Timestamp of the beginning of the range to\_timestampintegerrequired Timestamp of the end of the range pageinteger · default: 0optional Page number per\_pageinteger · max: 50 · default: 10optional Number of items per page granularityintegerrequired Time difference between returned data points Responses 200 Default Response application/json cURL JavaScript Python HTTP Copy curl -L \ --url 'https://api.vaults.fyi//v1/vaults/{network}/{vaultAddress}/historical-apy?interval=1day&from_timestamp=1&to_timestamp=1&granularity=1' \ --header 'x-api-key: YOUR_API_KEY' Test it 200 Copy { "next_page": 1, "data": [\ {\ "timestamp": 1,\ "blockNumber": 1,\ "apy": {\ "base": 1,\ "rewards": 1,\ "total": 1\ }\ }\ ] } Default Response * [GET/v1/vaults/{network}/{vaultAddress}/historical-apy/{timestamp}](#v1-vaults-network-vaultaddress-historical-apy-timestamp) * [GET/v1/vaults/{network}/{vaultAddress}/historical-apy](#v1-vaults-network-vaultaddress-historical-apy) --- # Get data for multiple vaults | vaults.fyi [PreviousGet historical APY on single vault](/api/endpoints/market-data/get-historical-data/get-historical-apy-on-single-vault) [NextGet data on single vault](/api/endpoints/market-data/get-data-on-single-vault) get https://api.vaults.fyi//v1/detailed/vaults Get a detailed list of vaults filtered by given parameters Authorizations Query parameters pageinteger · default: 0optional Page number per\_pageinteger · max: 250 · default: 10optional Number of items per page tagsstring\[\]optional List of tags to filter by all of the tags must be present on the vault to be included in the results tokenstring · min: 1optional Name or symbol of the token to filter by networkstring · enumoptional Network name or caip to filter by Available options: `mainnet``arbitrum``optimism``polygon``base``gnosis``unichain``eip155:1``eip155:42161``eip155:10``eip155:137``eip155:8453``eip155:100``eip155:130` tvl\_minnumberoptional Minimum TVL in USD to filter by tvl\_maxnumberoptional Maximum TVL in USD to filter by transactionalOnlystring · enumoptional Return only vaults that support transactional endpoints Available options: `true``false` transactionalFeaturedOnlystring · enumoptional Return only vaults that support transactional endpoints and are featured in app.vaults.fyi Available options: `true``false` Responses 200 Default Response application/json cURL JavaScript Python HTTP Copy curl -L \ --url 'https://api.vaults.fyi//v1/detailed/vaults' \ --header 'x-api-key: YOUR_API_KEY' Test it 200 Copy { "next_page": 1, "data": [\ {\ "name": "text",\ "address": "text",\ "network": "mainnet",\ "protocol": "text",\ "tvlDetails": {\ "tvlNative": "text",\ "tvlUsd": "text",\ "lockedNative": "text",\ "lockedUsd": "text",\ "liquidNative": "text",\ "liquidUsd": "text"\ },\ "numberOfHolders": 1,\ "lendLink": "text",\ "tags": [\ "text"\ ],\ "token": {\ "name": "text",\ "assetAddress": "text",\ "assetCaip": "text",\ "symbol": "text",\ "decimals": 1\ },\ "apy": {\ "base": {\ "1day": 1,\ "7day": 1,\ "30day": 1\ },\ "rewards": {\ "1day": 1,\ "7day": 1,\ "30day": 1\ },\ "total": {\ "1day": 1,\ "7day": 1,\ "30day": 1\ }\ },\ "description": "text",\ "additionalIncentives": "text",\ "rewards": [\ {\ "apy": {\ "1day": 1,\ "7day": 1,\ "30day": 1\ },\ "assetPriceInUsd": 1,\ "asset": {\ "name": "text",\ "assetAddress": "text",\ "assetCaip": "text",\ "symbol": "text",\ "decimals": 1\ }\ }\ ],\ "isTransactional": true,\ "score": {\ "vaultScore": 1,\ "vaultTvlScore": 1,\ "protocolTvlScore": 1,\ "holderScore": 1,\ "networkScore": 1,\ "assetScore": 1\ }\ }\ ] } Default Response --- # /tokens | vaults.fyi [Previous/networks](/api/endpoints/market-data/get-supported-vaults-networks-and-tokens/networks) [Next/tags](/api/endpoints/market-data/get-supported-vaults-networks-and-tokens/tags) get https://api.vaults.fyi//v1/tokens Get list of tokens present in vaults.fyi database Authorizations Responses 200 Array of tokens application/json cURL JavaScript Python HTTP Copy curl -L \ --url 'https://api.vaults.fyi//v1/tokens' \ --header 'x-api-key: YOUR_API_KEY' Test it 200 Copy [\ {\ "assetAddress": "text",\ "assetCaip": "text",\ "decimals": 1,\ "name": "text",\ "network": {\ "name": "mainnet",\ "chainId": 1\ },\ "symbol": "text"\ }\ ] Array of tokens --- # Get data on single vault | vaults.fyi [PreviousGet data for multiple vaults](/api/endpoints/market-data/get-data-for-multiple-vaults) [NextGet APY on single vault](/api/endpoints/market-data/get-data-on-single-vault/get-apy-on-single-vault) get https://api.vaults.fyi//v1/vaults/{network}/{vaultAddress}/ Get a vault information given a specific address and network Authorizations Path parameters vaultAddressstringrequired Address of a vault Pattern: `^0x[a-fA-F0-9]{40}$` networkstring · enumrequired Network name or caip Available options: `mainnet``arbitrum``optimism``polygon``base``gnosis``unichain``eip155:1``eip155:42161``eip155:10``eip155:137``eip155:8453``eip155:100``eip155:130` Responses 200 Object describing the vault application/json cURL JavaScript Python HTTP Copy curl -L \ --url 'https://api.vaults.fyi//v1/vaults/{network}/{vaultAddress}/' \ --header 'x-api-key: YOUR_API_KEY' Test it 200 Copy { "name": "text", "address": "text", "network": "mainnet", "protocol": "text", "tvlDetails": { "tvlNative": "text", "tvlUsd": "text", "lockedNative": "text", "lockedUsd": "text", "liquidNative": "text", "liquidUsd": "text" }, "numberOfHolders": 1, "lendLink": "text", "tags": [\ "text"\ ], "token": { "name": "text", "assetAddress": "text", "assetCaip": "text", "symbol": "text", "decimals": 1 }, "apy": { "base": { "1day": 1, "7day": 1, "30day": 1 }, "rewards": { "1day": 1, "7day": 1, "30day": 1 }, "total": { "1day": 1, "7day": 1, "30day": 1 } }, "description": "text", "additionalIncentives": "text", "rewards": [\ {\ "apy": {\ "1day": 1,\ "7day": 1,\ "30day": 1\ },\ "assetPriceInUsd": 1,\ "asset": {\ "name": "text",\ "assetAddress": "text",\ "assetCaip": "text",\ "symbol": "text",\ "decimals": 1\ }\ }\ ], "isTransactional": true, "score": { "vaultScore": 1, "vaultTvlScore": 1, "protocolTvlScore": 1, "holderScore": 1, "networkScore": 1, "assetScore": 1 }, "assetPriceInUsd": 1, "topHolders": [\ {\ "address": "text",\ "balance": "text"\ }\ ], "holdersTotalBalance": "text" } Object describing the vault --- # /vaults | vaults.fyi [PreviousGet supported vaults, networks & tokens](/api/endpoints/market-data/get-supported-vaults-networks-and-tokens) [Next/networks](/api/endpoints/market-data/get-supported-vaults-networks-and-tokens/networks) Last updated 19 days ago get https://api.vaults.fyi//v1/vaults Get a list of vaults given a specific filters Authorizations Query parameters tagsstring\[\]optional List of tags to filter by all of the tags must be present on the vault to be included in the results tokenstring · min: 1optional Name or symbol of the token to filter by networkstring · enumoptional Network name or caip to filter by Available options: `mainnet``arbitrum``optimism``polygon``base``gnosis``unichain``eip155:1``eip155:42161``eip155:10``eip155:137``eip155:8453``eip155:100``eip155:130` tvl\_minnumberoptional Minimum TVL in USD to filter by tvl\_maxnumberoptional Maximum TVL in USD to filter by transactionalOnlystring · enumoptional Return only vaults that support transactional endpoints Available options: `true``false` transactionalFeaturedOnlystring · enumoptional Return only vaults that support transactional endpoints and are featured in app.vaults.fyi Available options: `true``false` Responses 200 Array of vaults addresses and their networks application/json cURL JavaScript Python HTTP Copy curl -L \ --url 'https://api.vaults.fyi//v1/vaults' \ --header 'x-api-key: YOUR_API_KEY' Test it 200 Copy [\ {\ "address": "text",\ "network": "mainnet"\ }\ ] Array of vaults addresses and their networks --- # Get benchmark rates | vaults.fyi [PreviousGet APY on single vault](/api/endpoints/market-data/get-data-on-single-vault/get-apy-on-single-vault) [NextGet supported vaults, networks & tokens](/api/endpoints/market-data/get-supported-vaults-networks-and-tokens) get https://api.vaults.fyi//v1/benchmarks Get vaults.fyi benchmark rates Authorizations Responses 200 Default Response application/json cURL JavaScript Python HTTP Copy curl -L \ --url 'https://api.vaults.fyi//v1/benchmarks' \ --header 'x-api-key: YOUR_API_KEY' Test it 200 Copy { "usd": { "name": "text", "apy": { "1day": 1, "7day": 1, "30day": 1 }, "vaults": [\ {\ "name": "text",\ "network": "mainnet",\ "address": "text"\ }\ ] }, "eth": { "name": "text", "apy": { "1day": 1, "7day": 1, "30day": 1 }, "vaults": [\ {\ "name": "text",\ "network": "mainnet",\ "address": "text"\ }\ ] } } Default Response --- # Contextual insights | vaults.fyi [Previous/tags](/api/endpoints/market-data/get-supported-vaults-networks-and-tokens/tags) [NextTop vault options for address](/api/endpoints/contextual-insights/top-vault-options-for-address) Last updated 14 days ago ### [](#increase-user-engagement-by-delivering-contextual-insights) Increase user engagement by delivering contextual insights Cut through the noise by giving users data based upon their wallet holdings and preferences. * **Find yield opportunities for a given address, based upon its balances and preferences:** use [/v1/portfolio/best-deposit-options/{userAddress}](/api/endpoints/contextual-insights/top-vault-options-for-address) or [/v1/portfolio/best-vault/{userAddress}](/api/endpoints/contextual-insights/get-single-top-option-for-address) to find opportunities that meet criteria defined in parameters, such as specified networks and/or assets or minimum TVL. For an example, see [Case Study: Etherscan Cards](/case-study-etherscan-cards) to show how the vaults.fyi API powers the _Yield Opportunity_ card on Etherscan. [](#explore-endpoints) Explore endpoints --------------------------------------------- [Top vault options for address](/api/endpoints/contextual-insights/top-vault-options-for-address) [Get single top option for address](/api/endpoints/contextual-insights/get-single-top-option-for-address) [\[Etherscan cards\] Get top USD, top ETH vault for address](/api/endpoints/contextual-insights/etherscan-cards-get-top-usd-top-eth-vault-for-address) --- # Get APY on single vault | vaults.fyi [PreviousGet data on single vault](/api/endpoints/market-data/get-data-on-single-vault) [NextGet benchmark rates](/api/endpoints/market-data/get-benchmark-rates) get https://api.vaults.fyi//v1/vaults/{network}/{vaultAddress}/apy Get APY data for a vault for given interval Authorizations Path parameters vaultAddressstringrequired Address of a vault Pattern: `^0x[a-fA-F0-9]{40}$` networkstring · enumrequired Network name or caip Available options: `mainnet``arbitrum``optimism``polygon``base``gnosis``unichain``eip155:1``eip155:42161``eip155:10``eip155:137``eip155:8453``eip155:100``eip155:130` Query parameters intervalstring · enumrequired Resolution of the APY data Available options: `1day``7day``30day` Responses 200 Object describing the APY of the vault in current time application/json cURL JavaScript Python HTTP Copy curl -L \ --url 'https://api.vaults.fyi//v1/vaults/{network}/{vaultAddress}/apy?interval=1day' \ --header 'x-api-key: YOUR_API_KEY' Test it 200 Copy { "base": 1, "rewards": 1, "total": 1 } Object describing the APY of the vault in current time --- # Top vault options for address | vaults.fyi [PreviousContextual insights](/api/endpoints/contextual-insights) [NextGet single top option for address](/api/endpoints/contextual-insights/get-single-top-option-for-address) Last updated 27 days ago Given a user address and specific preferences (e.g. networks and protocols to include/exclude, min. vault TVL, etc.), return a list of vault options for the user address. post https://api.vaults.fyi//v1/portfolio/best-deposit-options/{userAddress} Authorizations Path parameters userAddressstringrequired Pattern: `^0x[a-fA-F0-9]{40}$` Body apyIntervalstring · enum · default: "7day"optional Resolution of the APY data Available options: `1day``7day``30day` allowedNetworksstring · enum\[\] · default: \["base","mainnet","arbitrum","polygon"\]optional Networks to be included (name or CAIP) ### Show child attributes disallowedNetworksstring · enum\[\]optional Networks to be excluded (name or CAIP) ### Show child attributes allowedAssetsstring\[\]optional Assets to be included (by symbol/ticker) disallowedAssetsstring\[\]optional Assets to be excluded (by symbol/ticker) allowedProtocolsstring\[\]optional Protocols to be included (by name) disallowedProtocolsstring\[\]optional Protocols to be excluded (by name) minimumBalanceThresholdnumber · default: 1optional Minimum balance in USD of the assets to be included minimumVaultTvlnumber · default: 100000optional Minimum TVL in USD of the vaults to be included transactionalOnlybooleanoptional Boolean indicating if only transactional vaults should be included transactionalFeaturedOnlybooleanoptional Boolean indicating if only transactional vaults featured in app.vaults.fyi should be included maxVaultsPerAssetinteger · min: 1 · max: 5 · default: 3optional Maximum number of vaults per asset minApyintegeroptional Minimum APY(in BPS) of the vaults to be included alwaysReturnAssetsstring\[\] · default: \[\]optional Symbols/tickers of assets to always return, regardless of balance distinctProtocolsbooleanoptional Return only one vault per protocol for each asset Responses 200 Default Response application/json cURL JavaScript Python HTTP Copy curl -L \ --request POST \ --url 'https://api.vaults.fyi//v1/portfolio/best-deposit-options/{userAddress}' \ --header 'x-api-key: YOUR_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "apyInterval": "1day", "allowedNetworks": [\ "mainnet"\ ], "disallowedNetworks": [\ "mainnet"\ ], "allowedAssets": [\ "text"\ ], "disallowedAssets": [\ "text"\ ], "allowedProtocols": [\ "text"\ ], "disallowedProtocols": [\ "text"\ ], "minimumBalanceThreshold": 1, "minimumVaultTvl": 1, "transactionalOnly": true, "transactionalFeaturedOnly": true, "maxVaultsPerAsset": 1, "minApy": 1, "alwaysReturnAssets": [\ "text"\ ], "distinctProtocols": true }' Test it 200 Copy { "requestedAddress": "text", "userBalances": [\ {\ "asset": {\ "name": "text",\ "assetAddress": "text",\ "assetCaip": "text",\ "symbol": "text",\ "decimals": 1,\ "networkName": "mainnet",\ "networkCaip": "text",\ "balanceNative": "text",\ "balanceUsd": 1\ },\ "depositOptions": [\ {\ "name": "text",\ "protocol": {\ "name": "text",\ "product": "text",\ "version": "text",\ "protocolLogo": "https://example.com",\ "protocolUrl": "https://example.com",\ "description": "text"\ },\ "vaultAddress": "text",\ "vaultUrl": "https://example.com",\ "networkName": "mainnet",\ "networkCaip": "text",\ "tvlInUsd": 1,\ "apy": {\ "base": 1,\ "rewards": 1,\ "total": 1\ },\ "projectedAnnualEarnings": 1,\ "tags": [\ "text"\ ],\ "isTransactional": true\ }\ ]\ }\ ], "errors": { "unsupportedNetworks": [\ "text"\ ], "unsupportedAssets": [\ "text"\ ], "unsupportedProtocols": [\ "text"\ ] } } Default Response --- # [Etherscan cards] Get top USD, top ETH vault for address | vaults.fyi [PreviousGet single top option for address](/api/endpoints/contextual-insights/get-single-top-option-for-address) [NextTransactional (Earn API)](/api/endpoints/transactional-earn-api) Last updated 27 days ago This endpoint is used to power [Case Study: Etherscan Cards](/case-study-etherscan-cards) get https://api.vaults.fyi//v1/top-vault/{network}/{userAddress} Get the best vault for the user Authorizations Path parameters userAddressstringrequired User wallet address Pattern: `^0x[a-fA-F0-9]{40}$` networkstring · enumrequired Network name or caip Available options: `mainnet``arbitrum``optimism``polygon``base``gnosis``unichain``eip155:1``eip155:42161``eip155:10``eip155:137``eip155:8453``eip155:100``eip155:130` Responses 200 Default Response application/json cURL JavaScript Python HTTP Copy curl -L \ --url 'https://api.vaults.fyi//v1/top-vault/{network}/{userAddress}' \ --header 'x-api-key: YOUR_API_KEY' Test it 200 Copy { "userAddress": "text", "bestVault": { "name": "text", "protocol": { "name": "text", "product": "text", "version": "text" }, "vaultAddress": "text", "networkName": "mainnet", "tvlInUsd": 1, "apy": 1, "projectedEarnings": 1, "asset": { "assetAddress": "text", "decimals": 1, "name": "text", "symbol": "text" } }, "bestEthVault": { "name": "text", "protocol": { "name": "text", "product": "text", "version": "text" }, "vaultAddress": "text", "networkName": "mainnet", "tvlInUsd": 1, "apy": 1, "projectedEarnings": 1 } } Default Response --- # /networks | vaults.fyi [Previous/vaults](/api/endpoints/market-data/get-supported-vaults-networks-and-tokens/vaults) [Next/tokens](/api/endpoints/market-data/get-supported-vaults-networks-and-tokens/tokens) get https://api.vaults.fyi//v1/networks Get list of networks present in vaults.fyi database Authorizations Responses 200 Array of networks application/json cURL JavaScript Python HTTP Copy curl -L \ --url 'https://api.vaults.fyi//v1/networks' \ --header 'x-api-key: YOUR_API_KEY' Test it 200 Copy [\ {\ "name": "text",\ "chainId": 1\ }\ ] Array of networks --- # /tags | vaults.fyi [Previous/tokens](/api/endpoints/market-data/get-supported-vaults-networks-and-tokens/tokens) [NextContextual insights](/api/endpoints/contextual-insights) get https://api.vaults.fyi//v1/tags Get list of tags present in vaults.fyi database Authorizations Responses 200 Array of tags application/json cURL JavaScript Python HTTP Copy curl -L \ --url 'https://api.vaults.fyi//v1/tags' \ --header 'x-api-key: YOUR_API_KEY' Test it 200 Copy [\ "text"\ ] Array of tags --- # Get single top option for address | vaults.fyi [PreviousTop vault options for address](/api/endpoints/contextual-insights/top-vault-options-for-address) [Next\[Etherscan cards\] Get top USD, top ETH vault for address](/api/endpoints/contextual-insights/etherscan-cards-get-top-usd-top-eth-vault-for-address) Last updated 27 days ago Given a user address and specific preferences (e.g. networks and protocols to include/exclude, min. vault TVL, etc.), return single top vault for the user address. post https://api.vaults.fyi//v1/portfolio/best-vault/{userAddress} Authorizations Path parameters userAddressstringrequired Pattern: `^0x[a-fA-F0-9]{40}$` Body apyIntervalstring · enum · default: "7day"optional Resolution of the APY data Available options: `1day``7day``30day` allowedNetworksstring · enum\[\] · default: \["base","mainnet","arbitrum","polygon"\]optional Networks to be included (name or CAIP) ### Show child attributes disallowedNetworksstring · enum\[\]optional Networks to be excluded (name or CAIP) ### Show child attributes allowedAssetsstring\[\]optional Assets to be included (by symbol/ticker) disallowedAssetsstring\[\]optional Assets to be excluded (by symbol/ticker) allowedProtocolsstring\[\]optional Protocols to be included (by name) disallowedProtocolsstring\[\]optional Protocols to be excluded (by name) minimumBalanceThresholdnumber · default: 1optional Minimum balance in USD of the assets to be included minimumVaultTvlnumber · default: 100000optional Minimum TVL in USD of the vaults to be included transactionalOnlybooleanoptional Boolean indicating if only transactional vaults should be included transactionalFeaturedOnlybooleanoptional Boolean indicating if only transactional vaults featured in app.vaults.fyi should be included Responses 200 Default Response application/json cURL JavaScript Python HTTP Copy curl -L \ --request POST \ --url 'https://api.vaults.fyi//v1/portfolio/best-vault/{userAddress}' \ --header 'x-api-key: YOUR_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "apyInterval": "1day", "allowedNetworks": [\ "mainnet"\ ], "disallowedNetworks": [\ "mainnet"\ ], "allowedAssets": [\ "text"\ ], "disallowedAssets": [\ "text"\ ], "allowedProtocols": [\ "text"\ ], "disallowedProtocols": [\ "text"\ ], "minimumBalanceThreshold": 1, "minimumVaultTvl": 1, "transactionalOnly": true, "transactionalFeaturedOnly": true }' Test it 200 Copy { "requestedAddress": "text", "asset": { "name": "text", "assetAddress": "text", "assetCaip": "text", "symbol": "text", "decimals": 1, "networkName": "mainnet", "networkCaip": "text", "balanceNative": "text", "balanceUsd": 1 }, "vault": { "name": "text", "protocol": { "name": "text", "product": "text", "version": "text", "protocolLogo": "https://example.com", "protocolUrl": "https://example.com", "description": "text" }, "vaultAddress": "text", "vaultUrl": "https://example.com", "networkName": "mainnet", "networkCaip": "text", "tvlInUsd": 1, "apy": { "base": 1, "rewards": 1, "total": 1 }, "projectedAnnualEarnings": 1, "tags": [\ "text"\ ], "isTransactional": true }, "errors": { "unsupportedNetworks": [\ "text"\ ], "unsupportedAssets": [\ "text"\ ], "unsupportedProtocols": [\ "text"\ ] } } Default Response --- # Transactional (Earn API) | vaults.fyi Our Earn API endpoints make it seamless to integrate DeFi experiences into your product by enabling a unified interface across dozens of staking and lending protocols. * **Transaction execution:** prepare transaction details and calldata for deposits, withdrawals, and rewards-related interactions on leading DeFi yield vaults. Additionally, our API simulates transactions and helps protect end users against malicious transactions. Our Earn API remains entirely non-custodial, preserving your users' autonomy and security. The Earn API simply prepares transaction details and calldata, facilitating the staking/lending process without ever holding or controlling funds. ### [](#make-transactions-a-breeze) **Make transactions a breeze** * **Supply/Deposit transactions:** Use the [/v1/transactions/vaults/deposit](/api/endpoints/transactional-earn-api#v1-transactions-vaults-deposit) to prepare transaction details and calldata for deposit transactions. Optionally, this can also return simulations for transactions. * **Redeem transactions:** Use [/v1/transactions/vaults/redeem](/api/endpoints/transactional-earn-api#v1-transactions-vaults-redeem) to prepare transaction details and calldata for withdrawals from vaults. * _for protocols with redemptions requests (e.g. Lido stETH):_ * **Request redemption:** Utilize the [/v1/transactions/vaults/request-redeem](/api/endpoints/transactional-earn-api#v1-transactions-vaults-request-redeem) endpoint to initiate a redeem request, ensuring you have access to your assets when needed. * **Claim redemption:** Once redemption is ready, use the [/v1/transactions/vaults/claim-redeem](/api/endpoints/transactional-earn-api#v1-transactions-vaults-claim-redeem) endpoint to claim your assets seamlessly. * **Claim rewards:** use [/v1/transactions/vaults/claim-rewards](/api/endpoints/transactional-earn-api#v1-transactions-vaults-claim-rewards) to prepare transaction details and calldata for claiming rewards accrued by a user for a specified vault. * **Vault info:** Use[/v1/transactions/vaults/actions/details](/api/endpoints/transactional-earn-api#v1-transactions-vaults-actions-details) to get information about potential and necessary interactions for each lending/staking vault. [](#where-can-i-see-a-demo) Where can I see a demo? -------------------------------------------------------- For a brief overview, see our [Product demo](/api/vaults.fyi-api-overview/earn-api/product-demo) . Go to the [vaults.fyi app](https://app.vaults.fyi/) to see the full power of our APIs. Everything on our app is powered by our APIs. [](#how-does-it-work) How does it work? -------------------------------------------- For a simplified overview, view our [Flow diagrams](/api/vaults.fyi-api-overview/earn-api/flow-diagrams) . Contact us for API access and to learn more. [](#explore-endpoints) Explore endpoints --------------------------------------------- [Previous\[Etherscan cards\] Get top USD, top ETH vault for address](/api/endpoints/contextual-insights/etherscan-cards-get-top-usd-top-eth-vault-for-address) [NextPrepare transaction calldata](/api/endpoints/transactional-earn-api/prepare-transaction-calldata) Last updated 14 days ago [Prepare transaction calldata](/api/endpoints/transactional-earn-api/prepare-transaction-calldata) [Get supported assets](/api/endpoints/transactional-earn-api/get-supported-assets) [Get supported vaults](/api/endpoints/transactional-earn-api/get-supported-vaults) [Get transaction prep details](/api/endpoints/transactional-earn-api/get-transaction-prep-details) --- # Claim rewards | vaults.fyi [PreviousClaim redeem](/api/endpoints/transactional-earn-api/prepare-transaction-calldata/redeem/claim-redeem) [NextGet transaction prep details](/api/endpoints/transactional-earn-api/get-transaction-prep-details) get https://api.vaults.fyi//v1/transactions/vaults/claim-rewards Authorizations Query parameters networkstring · enumrequired Available options: `mainnet``arbitrum``optimism``polygon``base``gnosis``unichain``eip155:1``eip155:42161``eip155:10``eip155:137``eip155:8453``eip155:100``eip155:130` senderstringrequired Pattern: `^0x[a-fA-F0-9]{40}$` simulateany of · default: "false"optional ### Show child attributes ### Show child attributes assetAddressstringrequired Pattern: `^0x[a-fA-F0-9]{40}$` vaultAddressstringrequired Pattern: `^0x[a-fA-F0-9]{40}$` Responses 200 Default Response application/json cURL JavaScript Python HTTP Copy curl -L \ --url 'https://api.vaults.fyi//v1/transactions/vaults/claim-rewards?network=mainnet&sender=text&assetAddress=text&vaultAddress=text' \ --header 'x-api-key: YOUR_API_KEY' Test it 200 Copy { "currentActionIndex": 1, "actions": [\ {\ "name": "text",\ "tx": {\ "to": "text",\ "chainId": 1,\ "data": "text",\ "value": "text"\ },\ "simulation": {\ "url": "text",\ "status": "success",\ "tokensReceived": {\ "ANY_ADDITIONAL_PROPERTY": "text"\ },\ "tokensSpent": {\ "ANY_ADDITIONAL_PROPERTY": "text"\ }\ }\ }\ ] } Default Response --- # Prepare transaction calldata | vaults.fyi vaults.fyi Earn API endpoints help prepare transaction payloads for interactions with vaults across leading DeFi protocols, including Aave, Sky, Morpho, Euler, Compound, and more. ### [](#make-transactions-a-breeze) **Make transactions a breeze** * **Supply/Deposit transactions:** Use the [/v1/transactions/vaults/deposit](/api/endpoints/transactional-earn-api/prepare-transaction-calldata/deposit) to prepare transaction details and calldata for deposit transactions. Optionally, this can also return simulations for transactions. * **Redeem transactions:** Use [/v1/transactions/vaults/redeem](/api/endpoints/transactional-earn-api/prepare-transaction-calldata/redeem) to prepare transaction details and calldata for withdrawals from vaults. * _for protocols with redemptions requests (e.g. Lido stETH):_ * **Request redemption:** Utilize the [/v1/transactions/vaults/request-redeem](/api/endpoints/transactional-earn-api/prepare-transaction-calldata/redeem/request-redeem) endpoint to initiate a redeem request, ensuring you have access to your assets when needed. * **Claim redemption:** Once redemption is ready, use the [/v1/transactions/vaults/claim-redeem](/api/endpoints/transactional-earn-api/prepare-transaction-calldata/redeem/claim-redeem) endpoint to claim your assets seamlessly. * **Claim rewards:** use [/v1/transactions/vaults/claim-rewards](/api/endpoints/transactional-earn-api/prepare-transaction-calldata/claim-rewards) to prepare transaction details and calldata for claiming rewards accrued by a user for a specified vault. [PreviousTransactional (Earn API)](/api/endpoints/transactional-earn-api) [NextDeposit](/api/endpoints/transactional-earn-api/prepare-transaction-calldata/deposit) Last updated 27 days ago --- # Get transaction prep details | vaults.fyi [PreviousClaim rewards](/api/endpoints/transactional-earn-api/prepare-transaction-calldata/claim-rewards) [NextGet supported assets](/api/endpoints/transactional-earn-api/get-supported-assets) Last updated 27 days ago Get information about functions for transaction interactions with each lending/staking vault. get https://api.vaults.fyi//v1/transactions/vaults/actions/details Authorizations Query parameters networkstring · enumrequired Available options: `mainnet``arbitrum``optimism``polygon``base``gnosis``unichain``eip155:1``eip155:42161``eip155:10``eip155:137``eip155:8453``eip155:100``eip155:130` userAddressstringrequired Pattern: `^0x[a-fA-F0-9]{40}$` vaultAddressstringrequired Pattern: `^0x[a-fA-F0-9]{40}$` Responses 200 Default Response application/json cURL JavaScript Python HTTP Copy curl -L \ --url 'https://api.vaults.fyi//v1/transactions/vaults/actions/details?network=mainnet&userAddress=text&vaultAddress=text' \ --header 'x-api-key: YOUR_API_KEY' Test it 200 Copy { "currentDepositStep": "text", "depositSteps": [\ {\ "actions": [\ "text"\ ],\ "actionsUrl": "text",\ "name": "deposit"\ }\ ], "currentRedeemStep": "text", "redeemSteps": [\ {\ "actions": [\ "text"\ ],\ "actionsUrl": "text",\ "name": "redeem"\ }\ ], "lpTokenBalance": "text", "idleAssets": { "ANY_ADDITIONAL_PROPERTY": "text" }, "lockedValueInAssets": { "ANY_ADDITIONAL_PROPERTY": "text" }, "unclaimedAssets": { "ANY_ADDITIONAL_PROPERTY": "text" }, "vaultSpecificData": { "ANY_ADDITIONAL_PROPERTY": "anything" }, "rewards": { "claimable": [\ {\ "amount": "text",\ "token": {\ "address": "text",\ "name": "text",\ "symbol": "text",\ "decimals": 1,\ "network": "mainnet"\ }\ }\ ], "currentStep": "text", "steps": [\ {\ "actions": [\ "text"\ ],\ "actionsUrl": "text",\ "name": "claim"\ }\ ] } } Default Response ---