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. #128

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jplodge-pro
Copy link
Member

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.

Replaces #123

Copy link

openzeppelin-code bot commented Oct 8, 2024

Add a FIFO/LIFO IRedeemOptimizer realisation.

Generated at commit: a09d72ebb631bf12f73d0ed7fb35df8ecaa54ab3

🚨 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

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.

1 participant