Open
Conversation
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This pull request introduces a utilization-based restriction on WLP redeem requests in the
lp_poolcontract, preventing redemptions when pool utilization exceeds a defined threshold. It also updates the redeem request and settlement logic, adds new error handling, and adjusts tests to accommodate the new parameter and behavior.Key changes:
Utilization-based redeem restriction
Added a new constant
MAX_REDEEM_WLP_UTILIZATION_BPS(set to 8,000) that limits WLP redemption when pool utilization exceeds this value. Implemented theassert_redeem_allowedandcalculate_total_wlp_utilization_bpsfunctions to enforce this restriction in both redeem request and settlement paths.Introduced a new error code and abort function
err_redeem_blocked_by_utilizationto handle cases where redemption is blocked due to high utilization.Redeem request API and logic updates
request_redeemfunction to require aGlobalConfigparameter and to check both pool and global config versions, as well as to enforce the new utilization restriction and price freshness.Test suite updates
request_redeemto pass the newglobal_cfgparameter and added cleanup for the shared global config object.