VaultFactory.vy
vyper:
0.3.7
author:yearn.finance
license:GNU AGPLv3
Yearn Vault Factory
This vault Factory can be used by anyone wishing to deploy their own ERC4626 compliant Yearn V3 Vault of the same API version. The factory clones new vaults from its specific VAULT_ORIGINAL
immutable address set on creation of the factory. The deployments are done through create2 with a specific salt
that is derived from a combination of the deployer's address, the underlying asset used, as well as the name and symbol specified. Meaning a deployer will not be able to deploy the exact same vault twice and will need to use different name and or symbols for vaults that use the same other parameters such as asset
. The factory also holds the protocol fee configs for each vault and strategy of its specific API_VERSION
that determine how much of the fees charged are designated "protocol fees" and sent to the designated fee_recipient
. The protocol fees work through a revenue share system, where if the vault or strategy decides to charge X amount of total fees during a report
the protocol fees are a percent of X. The protocol fees will be sent to the designated fee_recipient and then (X - protocol_fees) will be sent to the vault/strategy specific fee recipient.
Events
NewVault
vault_address
: address, indexedasset
: address, indexed
UpdateProtocolFeeBps
old_fee_bps
: uint16, notIndexednew_fee_bps
: uint16, notIndexed
UpdateProtocolFeeRecipient
old_fee_recipient
: address, indexednew_fee_recipient
: address, indexed
UpdateCustomProtocolFee
vault
: address, indexednew_custom_protocol_fee
: uint16, notIndexed
RemovedCustomProtocolFee
vault
: address, indexed
FactoryShutdown
UpdateGovernance
governance
: address, indexed
NewPendingGovernance
pending_governance
: address, indexed
Methods
deploy_new_vault
type:
nonpayable function
Deploys a new clone of the original vault.
Arguments:
-
asset
: - The asset to be used for the vault. -
name
: - The name of the new vault. -
symbol
: - The symbol of the new vault. -
role_manager
: - The address of the role manager. -
profit_max_unlock_time
: - The time over which the profits will unlock.
Returns:
_0
- The address of the new vault.