Skip to main content

Building on Yearn

image

Welcome! This is the spot to be for all things related to building products on, for, and with Yearn. If you are looking for more general information about Yearn and it's products, check out the Getting Started section of the docs. If you are looking to build, read on!

Core Tools

Yearn Vaults & Smart Contract Integrations

Yearn’s core product is the Vault (also known as yVault) — a set-it-and-forget-it yield aggregator running on top of DeFi’s yield-generating protocols like Compound, Aave, Curve, and Convex.

V3 Vaults

This Repository includes the set of smart contracts that are used for the Yearn 4626-compliant V3 vaults.

Check out the V3 Vaults section of this documentation for more information.

V2 Vaults

This repository includes the set of smart contracts that are used for the Yearn V2 Vaults. It contains the requirements, code, deployment scripts, and tests necessary for the core protocol, including an inheritable template strategy for use with Solidity-based strategies that interact with Yearn Vaults. These contracts are used to create a simple way to generate high risk-adjusted returns for depositors of various assets via best-in-class lending protocols, liquidity pools, and community-made yield farming strategies on Ethereum.

Check out the V2 Vaults section of this documentation for more information.

Strategy Development

A Yearn Strategy is a set of smart contracts that implement different farming strategies that utilize deposited assets to generate yields. Vaults move assets from one farming application to another by switching between strategies. Rewards/profits generated by strategies are regularly updated, harvested, swapped for the original vault asset, and deposited again for compound farming.

V2 and V3 vaults implement strategies differently, so it is important to get familiar with the differences when deciding which Vault product you wish to use. More information about V3 strategies can be found here and information on V2 strategies can be found here

Front-end Integrations

Yearn uses a JavaScript SDK for formatting protocol data and generating transactions for reading/writing protocol data. Yearn SDK integrates several components, both on-chain and off-chain.

The repository here contains a live preview and example usage of the Yearn SDK. Explore this codebase to learn how to start interacting with the Yearn protocol in your own app.

Check out the Front End Integrations section of this documentation for more information about Front End Integrations.

Data Sources

yDaemon is a public API for a broad range of Vault data.

  • Learn more about yDaemon at their Docs page

The Graph- Query contract data with GQL using the Yearn subgraphs

  • Learn more about the Graph and Subgraphs that Yearn provides here.

Data Analysis

Yearn aims to provide more insights into our products to our customers and partners through analyzing the on-chain and off-chain data. Given that all Yearn protocol data is publicly stored on-chain, there are lots of insights to be gained from analyzing these transactions.

Dune Analytics- Query contract data and generate dashboards with SQL

Research

Some of the research questions that we are interested in:

  • Screening profitable liquidity pools for our strategies
  • Assessing the impact of TVL on the impermanent loss
  • Screening the volume of various pools
  • Providing risk metrics to our vaults
  • Price volatility of the underlying token
  • Addressing the protocol risks
  • Optimizing our strategies according to the change in gas fees
  • Decide on when to deleverage and trade the governance tokens
  • Decide on when to harvest
  • Predicting impermanent loss for Uniswap V3 pools
  • Portfolio construction across yearn products More details on these topics can be seen in our issues tab.