Skip to main content

Vault Factory

Yearn's Vault Factory allows anyone to permissionlessly deploy an official Yearn Vault with ready-made yield strategies.

The easiest way to get started using the factory is through the User Interface:

The current version of the Vault Factory works with the following:

The Vault Factory is a massive step forward in automation. We're significantly reducing our operational costs for all vaults deployed with this new method. Here's the fee structure for them:

  • 0% management fee (previously 2%)
  • 10% performance fee (previously 20%)

Performance fees for every type of yVault go straight to Yearn treasury (treasury.ychad.eth) and are calculated only on top of harvest profits. The current fee structure for each yVault can be seen directly on the new yearn.fi website by clicking on the vault.

Only one factory vault can be live for each token, so the Vault Factory will only deploy a new yVault if there is no vault for that token already deployed (excluding "legacy" vaults, though factory versions of these must be deployed from one of Yearn's multisigs).

Harvests: Traditional vs. Factory Strategies

Factory vaults introduced a key change in the harvest process, enabling permissionless harvests (meaning anyone willing to pay transaction costs can perform them). Here is how harvests work in each case:

Traditional Strategies

Traditional strategies have the token swap logic directly embedded in them. As a result, a harvest call simultaneously performs debt rebalances and converts them into realized profits in one transaction.

Factory Strategies

Factory strategies separate swap logic from the strategy, executing it in a different transaction from the harvest. This ensures that swap transactions remain permissioned, safeguarding them from Miner Extractable Value (MEV) attacks.

Harvests in factory strategies still rebalance debt between strategies and allocate idle funds to strategies, pulling accumulated rewards into the strategy contract to be swapped by the ySwaps team. Once swaps are completed, which may take several days, anyone can call harvest a second time to acknowledge the profit generated by the swap and distribute it to the vault, making pricePerShare increase.

Although harvests will be permissionless for this specific group of vaults, Yearn will continue utilizing standard keeper automation to call harvests, even if no one else does. These automated harvests are run by keep3r.network and often depend on network congestion and transaction viability. For example, if the network conditions are consistently unfavorable, harvests may have delays.

Calling Harvest

To call harvest, use the harvest() function on the keeper found at keeper.factory.ychad.eth. Simply enter the strategy address from the factory vault you wish to call harvest on and click “write.”

Curve LP Tokens

The first Vault Factory deployed live on Ethereum is the Curve LP Token Vault Factory. This factory allows users to deploy yVaults for any Curve LP token representing a Curve pool with an active gauge (allowing it to receive CRV emissions).

Curve Strategies

Factory-deployed yVaults for Curve LP tokens contain up to three ready-made yield strategies:

  1. StrategyCurveBoostedFactory
  2. StrategyConvexFactory
  3. StrategyConvexFraxFactory

StrategyCurveBoostedFactory uses Yearn's veCRV balance (currently 62.8m) to give users the maximum 2.5x boost on their CRV rewards.

StrategyConvexFactory supplies any additional Curve LP tokens (beyond which would receive the maximum 2.5x boost via the Curve strategy) to Convex Finance to earn CRV rewards (boosted by Convex's veCRV balance) and CVX rewards.

StrategyConvexFraxFactory will only be added to the vault if the Curve LP token of the vault can be staked in Convex for Frax (currently available for over 20 Curve LPs). This ConvexFrax strategy will be used instead of the standard Convex strategy to earn additional FXS rewards (on top of the standard CRV and CVX rewards).

In all three strategies, any earned tokens are regularly claimed, sold for more of the underlying Curve LP token, and then deposited back into the strategy to compound the yield.

Velodrome LP Tokens

On Optimism, we have deployed the Velodrome LP Token Vault Factory. Several vaults have already been deployed and users can now permissionlessly deploy a new vault for any Velodrome V2 pool. The strategy collects VELO emissions from gauge incentives, swaps them for the LP token making auto-compounding effortless! At the moment, harvests for the Velodrome Vault Factory are permissioned and called regularly by keepers.

Balancer LP Tokens

Balancer is another protocol we have integrated with our Vault Factory. The process is nearly identical to the Curve integration, with a few key differences relating to the unique features of Balancer.

Balancer Strategies

StrategyAuraFactory is currently the only strategy used for Balancer factory vaults. It leverages the Aura rewards program on Balancer to earn additional yield.

The main difference between Balancer and Curve lies in their respective veTokens. Balancer's veBAL is their LP token (an 80/20 BAL/WETH pair), and their maximum lock duration is 1 year (compared to 4 on Curve). Unlike our Curve strategies where we use our veCRV balance to boost rewards, we currently do not have a large amount of veBAL in the treasury. Therefore, the strategy focuses on earning Aura rewards.

Aerodrome LP Tokens

On Base, we have deployed the Aerodrome LP Token Vault Factory. Aerodrome is a fork of Velodrome V2 and was deployed by the Velodrome team on Base.

The Aerodrome Vault Factory works identically to the Velodrome Factory. It allows users to deploy new vaults permissionlessly for any Aerodrome V2 pool. The strategy collects AERO emissions from gauge incentives, which are sold for the LP token, making auto-compounding effortless.

Like with the Velodrome Vault Factory, harvests for the Aerodrome Vault Factory are permissioned and regularly called by keepers.

Determine Accumulated Rewards

This section helps you know how much profit has accumulated, but calling harvest will not recognize profits unless they are sitting in the strategy's contract address. Also if there are reward tokens in the strategy's contract, those values should be added to your calculation in the section below.

Curve Strategy

For curve strategies, you can view how much rewards have accumulated for that vault by using Curve.Fi's dashboard and putting in Yearn's Curve Voter Proxy address 0xF147b8125d2ef93FB6965Db97D6746952a133934 (curve-voter.ychad.eth). This will show you the dollar amount accumulated in the strategy for all factory vaults.

Convex and Convex Frax Strategies

For Convex and Convex Frax you can view how much rewards have accumulated in USD by viewing claimableProfitInUsdc() on the strategy under the Read Contract tab.

Contracts

Ethereum

Optimism

Base

The LP Factory contract provides a few main functions:

  • allDeployedVaults(): returns an array of all the deployed vaults.
  • numVaults(): returns the number of vaults deployed.
  • canCreateVaultPermissionlessly(): takes in an address for a gauge and returns a boolean that indicates whether a vault can be created permissionlessly.
  • createNewVaultsAndStrategies(): takes in an address for a gauge and a boolean that determines whether duplicate vaults are allowed, and creates a new vault and strategy.
  • latestDefaultOrAutomatedVaultFromGauge(): takes in an address for a gauge and returns the latest default or automated vault from that gauge.
  • ~StrategyImplementation(): Has the name of the strategy in front of StrategyImplmentation and returns the strategy contract template address used in the vault factory each factory will have at least one.

Create with UI

Follow these steps to create a new vault with the UI:

  1. Make sure your wallet is connected
  1. Chose a token to create a vault for
  1. Review details and click "Create Vault"
  1. Sign the transaction and the vault will be created

Create from Contract

  1. Open the contract at etherscan: 0x21b1FC8A52f179757bf555346130bF27c0C2A17A

  2. Call canCreateVaultPermissionlessly() function to make sure that a vault does not already exist for the gauge you want to create

  1. Call createNewVaultsAndStrategies() to create a new permissionless vault.
  1. Now your new Yearn Vault will be deployed and you can sit back while it auto-compounds your rewards into more of your Curve lp position.