Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: delegated fees #253

Merged
merged 5 commits into from
Mar 23, 2021
Merged

refactor: delegated fees #253

merged 5 commits into from
Mar 23, 2021

Conversation

fubuloubu
Copy link
Member

This PR changes how fees are assessed such that BaseStrategy.delegatedAssets is pro-rated into the fee assessment. If a strategy delegates all of it's assets, there should be no fees earned by that strategy to either governance or the strategist themselves, and that portion of the assets loaned out shall earn no management fees either.

If only a portion is delegated (e.g. debt-based strategies where some of the funds are used to borrow against), that portion should be calculated such that the exact funds used to borrow are marked as delegated (e.g. Maker strategy w/ 200% debt ratio, then half the funds should be marked "delegated"). This is important to ensure than the degree of work is properly accounted for in how a strategy operates.

Strategists will need to be aware of properly reporting delegatedAssets and ensure it is strictly less than or equal to the total debt, or else the calculations will revert or be processed improperly.

contracts/Vault.vy Outdated Show resolved Hide resolved
@storming0x
Copy link
Contributor

Thinking if the comment here also needs to document this?

function delegatedAssets() external virtual view returns (uint256) {

Copy link
Contributor

@storming0x storming0x left a comment

Choose a reason for hiding this comment

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

LGTM on latest changes, all comments addressed

@fubuloubu fubuloubu merged commit 421f36d into master Mar 23, 2021
@fubuloubu fubuloubu deleted the refactor/delegated-fees branch March 23, 2021 21:43
orbxball pushed a commit to orbxball/yearn-vaults that referenced this pull request Aug 8, 2021
* refactor: add delegated assets to the accounting of mgmt fees
* refactor: some trailing whitespace
* test: show that delegated assets pay no mgmt fee
* refactor: add `min` guard to avoid improper computation from breaking
* docs: add note about use of `BaseStrategy.delegatedAssets()`
sambacha pushed a commit to sambacha/yearn-vaults that referenced this pull request Sep 7, 2021
* refactor: add delegated assets to the accounting of mgmt fees
* refactor: some trailing whitespace
* test: show that delegated assets pay no mgmt fee
* refactor: add `min` guard to avoid improper computation from breaking
* docs: add note about use of `BaseStrategy.delegatedAssets()`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants