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

Add a FIFO/LIFO IRedeemOptimizer realisation. #123

Closed
wants to merge 25 commits into from

Conversation

jplodge-pro
Copy link
Member

@jplodge-pro jplodge-pro commented Oct 7, 2024

Abstract

As discussed with @lucasia thus:

hi Jonathan - thinking about it now, FIFO for deposits with 10% and LIFO for the others.

  • seller wants the 10% yield first - FIFO here
  • if they don't have enough of the 10% yield to cover, they probably want what's been held the "least" amount of time. so the other holdings can earn 10% faster.

To Do

  • Add a IRedeemOptimizer that encapsulates the above strategy.
  • Add a RedeemOptimizer base realisation to encapsulate common behaviours.
  • Ensure the optimizer is robustly tested with full coverage.
  • Tweak the IMultiTokenVault to include the ERC1155Supply exists(uint256 id), because:
    • This will allow any IRedeemOptimizer to seamlessly track the first period that has any deposits against it. This is the typical starting point of optimisation.

Copy link

openzeppelin-code bot commented Oct 7, 2024

Add a FIFO/LIFO IRedeemOptimizer realisation.

Generated at commit: a7f0fa7f691b4990ab8bef67f149398ff9668d54

🚨 Report Summary

Severity Level Results
Contracts Critical
High
Medium
Low
Note
Total
1
0
0
4
22
27
Dependencies Critical
High
Medium
Low
Note
Total
0
0
0
0
0
0

For more details view the full report in OpenZeppelin Code Inspector

@jplodge-pro
Copy link
Member Author

Replaced with #128

@jplodge-pro jplodge-pro closed this Oct 8, 2024
@jplodge-pro jplodge-pro deleted the optimiser-strategy branch October 8, 2024 08:27
lucasia added a commit that referenced this pull request Oct 29, 2024
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.

3 participants