-
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
Refactor to use repo token utils #21
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 pull request introduces significant changes across multiple Solidity files, primarily focusing on the integration of a Changes
Possibly related PRs
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 (7)
- src/RepoTokenList.sol (6 hunks)
- src/RepoTokenUtils.sol (1 hunks)
- src/Strategy.sol (9 hunks)
- src/TermAuctionList.sol (4 hunks)
- src/TermDiscountRateAdapter.sol (2 hunks)
- src/interfaces/term/ITermDiscountRateAdapter.sol (1 hunks)
- src/test/utils/Setup.sol (1 hunks)
Additional comments not posted (24)
src/interfaces/term/ITermDiscountRateAdapter.sol (1)
5-5
: LGTM!The code changes are approved.
src/TermDiscountRateAdapter.sol (6)
7-7
: LGTM!The code changes are approved.
14-14
: LGTM!The code changes are approved.
16-16
: LGTM!The code changes are approved.
19-19
: LGTM!The code changes are approved.
24-28
: LGTM!The code changes are approved.
47-54
: LGTM!The code changes are approved.
src/RepoTokenUtils.sol (1)
81-94
: LGTM!The code changes are approved.
src/test/utils/Setup.sol (1)
98-98
: LGTM!The code change is approved. Passing the
adminWallet
to theTermDiscountRateAdapter
constructor aligns with the PR objective of refactoring to use repo token utils and likely enables additional functionality in the contract.src/TermAuctionList.sol (3)
320-320
: LGTM!The code change is approved. Adding the
discountRateAdapter
parameter to thegetCumulativeOfferData
function signature aligns with the PR objective and enables the function to utilize discount rate information.
294-295
: LGTM!The code change is approved. Utilizing the
discountRateAdapter
to retrieve therepoRedemptionHaircut
value and factoring it into the calculation ofrepoTokenAmountInBaseAssetPrecision
aligns with the PR objective and enhances the accuracy of the total value computation.
367-368
: LGTM!The code change is approved. Utilizing the
discountRateAdapter
to retrieve therepoRedemptionHaircut
value and factoring it into the calculation ofofferAmount
aligns with the PR objective and enhances the accuracy of the offer amount computation.src/RepoTokenList.sol (6)
116-116
: LGTM!The code change is approved. Adding the
discountRateAdapter
parameter to thegetCumulativeRepoTokenData
function signature aligns with the PR objective and enables the function to utilize an external discount rate adapter.
131-131
: LGTM!The code change is approved. Adding the
discountRateAdapter
parameter to thegetCumulativeRepoTokenData
function implementation aligns with the addition of the parameter to the function signature and enables the function to utilize the discount rate adapter.
154-156
: LGTM!The code change is approved. Refactoring the calculation of
repoTokenBalanceInBaseAssetPrecision
to useRepoTokenUtils.getNormalizedRepoTokenAmount
and incorporating the discount rate and redemption haircut from thediscountRateAdapter
aligns with the PR objective and streamlines the calculation logic.
176-176
: LGTM!The code change is approved. Adding the
discountRateAdapter
parameter to thegetPresentValue
function signature aligns with the PR objective and enables the function to utilize an external discount rate adapter.
190-190
: LGTM!The code change is approved. Adding the
discountRateAdapter
parameter to thegetPresentValue
function implementation aligns with the addition of the parameter to the function signature and enables the function to utilize the discount rate adapter.
209-216
: LGTM!The code changes are approved. Modifying the calculation of
discountRate
to usediscountRateAdapter.getDiscountRate(current)
and refactoring the calculation ofrepoTokenBalanceInBaseAssetPrecision
to useRepoTokenUtils.getNormalizedRepoTokenAmount
with the redemption haircut from thediscountRateAdapter
align with the PR objective and centralize the discount rate logic, improving maintainability.src/Strategy.sol (6)
400-409
: LGTM!The code changes are approved. The function now correctly uses the
discountRateAdapter
to get the repo redemption haircut when normalizing the repoToken amount.
431-433
: LGTM!The code changes are approved. The function now correctly passes the
discountRateAdapter
to thegetPresentValue
functions.
493-493
: LGTM!The code changes are approved. The function now correctly passes the
discountRateAdapter
to thegetPresentValue
functions.
601-601
: LGTM!The code changes are approved. The function now correctly:
- Passes the
discountRateAdapter
to thegetCumulativeRepoTokenData
andgetCumulativeOfferData
functions.- Uses the
discountRateAdapter
to get the repo redemption haircut when normalizing the repoToken amount.Also applies to: 617-617, 632-638
1014-1014
: LGTM!The code changes are approved. The function now correctly uses the
discountRateAdapter
to:
- Get the discount rate for the repoToken.
- Get the repo redemption haircut when normalizing the repoToken amount.
Also applies to: 1029-1037
354-361
: LGTM!The code changes are approved. The function now correctly uses the
discountRateAdapter
to:
- Get the discount rate for the repoToken.
- Get the repo redemption haircut when normalizing the repoToken amount.
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/test/utils/Setup.sol (2 hunks)
Files skipped from review as they are similar to previous changes (1)
- src/test/utils/Setup.sol
Summary by CodeRabbit
New Features
discountRateAdapter
to enhance financial calculations related to repo tokens.Bug Fixes
Documentation
Refactor
Tests
TermDiscountRateAdapter
constructor.