Integration Guide
Integration Points
Vault Registry
The Yearn Vault Registry (aka yRegistry) is a smart contract deployed on the ethereum mainnet. The Vault Registry is the single source of truth for active Yearn vaults. The registry allows users to query for active Yearn vaults and vault metadata (see "available data" below).
Details
Currently vaults are added manually by Yearn governance.
In the future the vault registry may be integrated into the vault lifecycle (meaning new vaults would get added into the registry during their deployment process).
Interact
ENS: registry.ychad.eth
Code
Available data
Vault addresses (methods:
getVaults
).Active controller address per vault (methods:
getVaultInfo
,getVaultsInfo
).Active strategy address per vault (methods:
getVaultInfo
,getVaultsInfo
).Vault type (normal, wrapped, delegated) (methods:
isDelegated
,isWrapped
).Governance address (methods:
governance
).
Integrations
Yearn API - utilizes vault registry as the single source of truth in many API calls.
Future Integrations
Yearn Subgraph - in the future we would like the Yearn subgraph to index new vaults automatically using the Vault registry. In order to accomplish this the vault registry must first be incorporated into the vault lifecycle.
Subgraph
The Yearn Subgraph is a GraphQL-based public API running on The Graph that can be utilized to extract current and historical data from the Yearn ecosystem.
Details
See README for detailed integration details.
Interact
Code
Available data
Vault snapshot (current contract values).
Vault metrics per vault (net deposits, withdrawals, transfers, earnings, etc.).
Vault metrics per user (net deposits, withdrawals, transfers, earnings, etc.).
Active controller address per vault.
Active strategy address per vault.
Historical harvest events and earnings.
Integrations
Examples of projects using the Yearn Subgraph
API
Yearn API is a collection of Serverless API endpoints focused on Yearn integrations.
Details
Goals
Provide free API endpoints to simplify 3rd party integration with Yearn.
Provide an "API playground" (Swagger UI) anyone can use to quickly browse and test available APIs.
Document all existing APIs.
Allow the entire API stack to be forked to enable community involvement in API development.
Data Sources
Vault Registry - Yearn API utilizes the vault registry in a number of endpoints to maintain a list of active vaults.
Subgraph - Yearn API utilizes the Yearn Subgraph for various metrics endpoints.
Interact
Yearn API Playground (Swagger UI): https://yearn.tools.
Code
Available data
Current vault snapshots.
Vault listings from vault registry (with injected strategy/controller/token metadata).
Vault metrics per user (net deposits, withdrawals, transfers, earnings, etc.).
Vault transactions per user.
Vault APY data.
Integrations
Examples of projects using the API
Last updated