Skip to content

Commit

Permalink
feat: version 3.0.1 (#365)
Browse files Browse the repository at this point in the history
* chore: update strategy writing

* chore: update vault guide

* feat: deployment addresses

* fix wording

* chore: rebase

* fix: links

* fix: sidebar

---------

Co-authored-by: 0xBasically <[email protected]>
  • Loading branch information
Schlagonia and 0xBasically authored Oct 25, 2023
1 parent a1d8e3a commit 065cd35
Show file tree
Hide file tree
Showing 7 changed files with 337 additions and 1,164 deletions.
26 changes: 12 additions & 14 deletions docs/developers/v3/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,31 @@ So whether you are a full-blown gas golfing expert, a degen looking to codify yo

## Definitions

- [Vault](https://github.com/yearn/yearn-vaults-v3/blob/master/contracts/VaultV3.vy): A vault or "Meta Vault" in V3 refers to an ERC-4626 compliant contract that takes in user deposits, mints shares corresponding to the user's share of the underlying assets held in that vault, and then allocates the underlying asset to a range of different "strategies" that earn yield on that asset.
- [Vault](https://github.com/yearn/yearn-vaults-v3/blob/master/contracts/VaultV3.vy): A vault or "Allocator Vault" in V3 refers to an ERC-4626 compliant contract that takes in user deposits, mints shares corresponding to the user's share of the underlying assets held in that vault, and then allocates the underlying asset to a range of different "strategies" that earn yield on that asset.
- Strategy: A strategy in V3 refers to a yield-generating contract added to a vault that has the needed [ERC-4626 interface](https://github.com/yearn/yearn-vaults-v3/blob/master/contracts/VaultV3.vy#L39). The strategy takes the underlying asset and deploys it to a single source, generating yield on that asset.
- [TokenizedStrategy](https://github.com/yearn/tokenized-strategy/blob/master/src/TokenizedStrategy.sol#L14-L26) A technical implementation of a Strategy that is also a stand-alone ERC4626 compliant Vault. These are the yield generators in the V3 ecosystem. This pattern can be used so that either Meta Vaults or individual users can deposit directly into and receive shares in return.
- [Vault Factory](https://github.com/yearn/yearn-vaults-v3/blob/master/contracts/VaultFactory.vy): A factory contract deployed by Yearn Governance that all Vaults of a specific version can be easily and trustlessly deployed from.
- [TokenizedStrategy](https://github.com/yearn/tokenized-strategy/blob/master/src/TokenizedStrategy.sol) A technical implementation of a Strategy that is also a stand-alone ERC4626 compliant Vault. These are the yield generators in the V3 ecosystem. This pattern can be used so that either Allocator Vaults or individual users can deposit directly into and receive shares in return.
- [Vault Factory](https://github.com/yearn/yearn-vaults-v3/blob/master/contracts/VaultFactory.vy): A factory contract deployed by Yearn Governance that all Allocator Vaults of a specific version can be easily and trustlessly deployed from.


## Get started

- [Building your own V3 Strategy](https://docs.yearn.fi/developers/v3/strategy_development)
- [Building your own V3 Strategy](https://docs.yearn.fi/developers/v3/strategy_writing_guide)
- [Deploying and managing a V3 Vault](https://docs.yearn.fi/developers/v3/vault_management)
- [Protocol Fees](https://docs.yearn.fi/developers/v3/protocol_fees)


## Contract Addresses

*Deployments are done using create2 factories and should be stable across all EVM chains the protocol has been deployed on.

### Core

#### VERSION 3.0.0:
#### VERSION 3.0.1:

- Vault BluePrint: `0xfC49ca826f8C68c0345410fcA0c7d1e0550d9ee9`
- VaultFactory: `0xD1736eBbdefae37503F3eD8D718b61a494F24c1D`
- TokenizedStrategy: `0xAE69a93945133c00B9985D9361A1cd882d107622`
- Vault BluePrint: `0xDE992C652b266AE649FEC8048aFC35954Bee6145`
- VaultFactory: `0xE9E8C89c8Fc7E8b8F23425688eb68987231178e5`
- TokenizedStrategy: `0xDFC8cD9F2f2d306b7C0d109F005DF661E14f4ff2`

### Periphery
- Periphery Address Provider: `0xB1662c1E500610F5D14B8041FD5306bbD3D8EdEe`

- Address Provider: ``
- Router: `0x1112dbCF805682e828606f74AB717abf4b4FD8DE`
- Release Registry: `0x5a6E1eCC767d949D6da74e76b05DBB4870488ef6`
- Registry Factory: `0xe0aFFaC3D8e7CBac1e73FCBD0281C3FD2B2cC2a5`
- Common Report Trigger: `0x4D25b3aed34eC1222846F6C87e2ac4A73f4ab6b6`
**If a contract has not been deployed on a specific chain it can be done permissionlessly using the scripts in the relevant GitHub repo. Or reach out to a Yearn contributor for help.**
20 changes: 11 additions & 9 deletions docs/developers/v3/protocol_fees.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,25 @@

The V3 system sees the introduction of "Protocol Fees" to the stack: a percentage charged each time a V3 vault or strategy "reports".

Protocol fees give the managers of vaults and strategies complete control over the fees charged while rewarding Yearn for supplying the infrastructure those vaults are built on.

Yearn Governance dictates the amount of the Protocol fee and can be set anywhere between 0 - 50%. Yearn governance also holds the ability to set custom protocol fees for individual vaults and strategies. Allowing full customization of the system.

EXAMPLE:

profit = 100
performance_fee = 10%
performance_fee = 20%
protocol_fee = 10%

total_fees = profit * performance_fee = 10
protocol_fees = total_fees * protocol_fee = 1
performance_fees = total_fees - protocol_fees = 9
total_fees = profit * performance_fee = 20
protocol_fees = total_fees * protocol_fee = 2
performance_fees = total_fees - protocol_fees = 18

9 would get paid to the vault specified as the performance_fee_recipient.
1 would get paid to the Yearn Treasury.
18 would get paid to the vault managers performance_fee_recipient.
2 would get paid to the Yearn Treasury.


Protocol fees give the managers of vaults and strategies complete control over the fees charged while rewarding Yearn for supplying the infrastructure those vaults are built on.

Yearn Governance dictates the amount of the Protocol fee and can be set anywhere between 0 - 50%. Yearn governance also holds the ability to set custom protocol fees for individual vaults and strategies. Allowing full customization of the system.

You can retrieve both the default protocol fee as well as if a custom config has been set for a specific vault or strategy using the Vault Factory that corresponds to that vault's API.

Expand All @@ -30,4 +32,4 @@ You can retrieve both the default protocol fee as well as if a custom config has

# Get a custom config if applicable.
vaultFactory.custom_protocol_fee(vault_address)


Loading

1 comment on commit 065cd35

@vercel
Copy link

@vercel vercel bot commented on 065cd35 Oct 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.