-
Notifications
You must be signed in to change notification settings - Fork 14
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
feat: use allocator #30
Merged
Merged
Changes from all commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
54d3027
build: yield manager
Schlagonia dd5f7d6
fix: check loss and outsource reporting
Schlagonia 8002529
fix: yield not apr
Schlagonia dcc343a
test: yield manager
Schlagonia f51b9e2
feat: add events
Schlagonia 71db754
fix: remove generic call
Schlagonia 56c9148
fix: permissions
Schlagonia 2a7b1e9
fix: deployments
Schlagonia c42bfef
fix: workflow
Schlagonia 16c0acf
fix: rebase tests
Schlagonia 637886a
feat: use allocator
Schlagonia 3785c34
feat: manage strategy
Schlagonia 3885b32
test: update tests
Schlagonia fae7ee0
fix: fixes
Schlagonia 3faefba
fix: remove event
Schlagonia 429d82f
feat: just a keeper contract
Schlagonia 2ee855d
fix: removal
Schlagonia 5337260
feat: report when going to 0
Schlagonia 232b754
feat: script and changes
Schlagonia ac75d6f
fix: make virtual
Schlagonia 3cbfec6
fix: formatting
Schlagonia fc3b236
feat: check max redeem and deposit
Schlagonia 610019a
feat: dont duplicate vaults
Schlagonia d41e2d7
chore: change dep
Schlagonia fe15fa4
fix: versions
Schlagonia d117149
chore: pin ape version
Schlagonia f4d901c
chore: downgrade ape
Schlagonia a29e6cf
chore: pin all versions
Schlagonia 5ff8880
feat: increase and decrease
Schlagonia aa027df
fix: formatting
Schlagonia 4a0b4d6
fix: naming
Schlagonia 5332c50
build: use central allocator factory (#31)
Schlagonia 3c3eb3c
chore: renaming
Schlagonia a390e09
chore: comments
Schlagonia 9c01b1e
fix: black
Schlagonia File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// SPDX-License-Identifier: GPL-3.0 | ||
pragma solidity 0.8.18; | ||
|
||
import {AprOracle} from "@periphery/AprOracle/AprOracle.sol"; | ||
|
||
contract MockOracle is AprOracle {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// SPDX-License-Identifier: AGPL-3.0 | ||
pragma solidity 0.8.18; | ||
|
||
import {MockTokenizedStrategy} from "@yearn-vaults/test/mocks/ERC4626/MockTokenizedStrategy.sol"; | ||
|
||
contract MockTokenized is MockTokenizedStrategy { | ||
uint256 public apr; | ||
uint256 public loss; | ||
uint256 public limit; | ||
|
||
constructor( | ||
address _asset, | ||
string memory _name, | ||
address _management, | ||
address _keeper, | ||
uint256 _apr | ||
) MockTokenizedStrategy(_asset, _name, _management, _keeper) { | ||
apr = _apr; | ||
} | ||
|
||
function aprAfterDebtChange( | ||
address, | ||
int256 | ||
) external view returns (uint256) { | ||
return apr; | ||
} | ||
|
||
function setApr(uint256 _apr) external { | ||
apr = _apr; | ||
} | ||
|
||
function realizeLoss(uint256 _amount) external { | ||
strategyStorage().asset.transfer(msg.sender, _amount); | ||
strategyStorage().totalIdle -= _amount; | ||
strategyStorage().totalDebt += _amount; | ||
} | ||
|
||
function tendThis(uint256) external {} | ||
|
||
function availableWithdrawLimit( | ||
address _owner | ||
) public view virtual override returns (uint256) { | ||
if (limit != 0) { | ||
uint256 _totalAssets = strategyStorage().totalIdle; | ||
return _totalAssets > limit ? _totalAssets - limit : 0; | ||
} else { | ||
return super.availableWithdrawLimit(_owner); | ||
} | ||
} | ||
|
||
function setLimit(uint256 _limit) external { | ||
limit = _limit; | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is rating there for the future or is it used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be used once this is deployed, both for naming conventions as well as on chain tracking.
Also for future use by a strategy manager contract to potentially compare rating before adding certain strategies.