-
Notifications
You must be signed in to change notification settings - Fork 1
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
cache total asset value #23
Conversation
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThe changes in this pull request focus on enhancing the clarity and efficiency of calculations in the Changes
Possibly related PRs
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- src/Strategy.sol (5 hunks)
Additional comments not posted (8)
src/Strategy.sol (8)
548-553
: LGTM!The code changes are approved. The calculation of
simulatedRepoTokenConcentrationRatio
using the_getRepoTokenConcentrationRatio
function improves the readability and clarity of the code.
838-839
: LGTM!The code changes are approved. Retrieving the total liquid balance and calculating the total asset value are necessary steps in the
submitAuctionOffer
function to ensure the strategy has sufficient liquid assets while optimizing asset allocation.
842-842
: LGTM!The code changes are approved. The check for the
liquidReserveRatio
against therequiredReserveRatio
ensures that the new offer does not violate the reserve ratio constraint, and reverting with a specific error message provides clear information about the reason for the revert.
860-860
: LGTM!The code changes are approved. Calling the
_validateRepoTokenConcentration
function with the appropriate arguments, including0
for therepoTokenAmountInBaseAssetPrecision
andliquidBalanceToRemove
, is consistent with the overall logic and purpose of thesubmitAuctionOffer
function, as the offer and balance have already been updated.
1026-1030
: LGTM!The code changes are approved. Retrieving the total asset value and liquid balance, and ensuring that both values are greater than zero, is an important validation step in the
sellRepoToken
function to prevent potential errors in subsequent operations.
1064-1065
: LGTM!The code changes are approved. Calculating the new liquid reserve ratio after subtracting the proceeds from the liquid balance, and checking if it is less than the required reserve ratio, ensures that the remaining liquid balance after the sale of the repo token is above the liquidity threshold. Reverting with a specific error message provides clear information about the reason for the revert.
1073-1073
: LGTM!The code changes are approved. Passing the
totalAssetValue
as an argument to the_validateRepoTokenConcentration
function is necessary for validating the resulting repo token concentration after the sale of the repo token, and is consistent with the overall logic and purpose of thesellRepoToken
function.
1073-1076
: LGTM!The code changes are approved. Calling the
_validateRepoTokenConcentration
function with the appropriate arguments, including therepoToken
,repoTokenAmountInBaseAssetPrecision
,totalAssetValue
, andproceeds
, is necessary for validating the resulting repo token concentration after the sale of the repo token, and is consistent with the overall logic and purpose of thesellRepoToken
function.
Summary by CodeRabbit