🔖 release: v0.1.1-uphold.0 (uphold)#13
Conversation
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (3)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request updates the library to version 0.1.1-uphold.0, adds new changesets, and updates the changelog detailing market haircuts and rounding fixes. The review identifies a critical division by zero error in the auditor's liquidity logic and suggests a minor version bump to 0.2.0 to adhere to Semantic Versioning for the new features.
|
|
||
| ### Patch Changes | ||
|
|
||
| - [#11](https://github.com/exactly/lib/pull/11) [`be0d59c`](https://github.com/exactly/lib/commit/be0d59ccc28aae26681f13f6b527f408adb82b71) Thanks [@cruzdanilo](https://github.com/cruzdanilo)! - ✨ auditor: add optional haircuts per market |
There was a problem hiding this comment.
The implementation of the haircut logic introduced in this PR (specifically in src/auditor/accountLiquidity.ts) contains a potential division by zero error. When a market has a 100% haircut (haircut === WAD) and the account has zero debt in that market (debt === 0n), the condition haircut === WAD && debt !== 0n evaluates to false, causing the code to execute divWadUp(debt, WAD - haircut), which results in divWadUp(0n, 0n).
This will cause the accountLiquidity function to throw an error, potentially breaking health factor calculations for any account associated with such a market.
Consider updating the logic in src/auditor/accountLiquidity.ts to:
adjDebt += (haircut && debt !== 0n) ? (haircut === WAD ? MAX_UINT256 : divWadUp(debt, WAD - haircut)) : debt;| { | ||
| "name": "@exactly/lib", | ||
| "version": "0.1.0", | ||
| "version": "0.1.1-uphold.0", |
There was a problem hiding this comment.
The version bump is specified as a patch (0.1.1), but the changelog includes a new feature ('✨ auditor: add optional haircuts per market'). According to SemVer, adding a feature should trigger a minor version bump (e.g., 0.2.0-uphold.0). Since the previous version was 0.1.0 and it was categorized as a 'Minor Change', it appears the project follows standard SemVer where the second digit represents features.
| "version": "0.1.1-uphold.0", | |
| "version": "0.2.0-uphold.0", |
c24354e to
82fc258
Compare
d555399 to
f557d35
Compare
f557d35 to
485ca89
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## uphold #13 +/- ##
=======================================
Coverage 81.36% 81.36%
=======================================
Files 46 46
Lines 735 735
Branches 109 109
=======================================
Hits 598 598
Misses 130 130
Partials 7 7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to uphold, this PR will be updated.
upholdis currently in pre mode so this branch has prereleases rather than normal releases. If you want to exit prereleases, runchangeset pre exitonuphold.Releases
@exactly/lib@0.1.1-uphold.0
Patch Changes
d7e6b99Thanks @cruzdanilo! - ✨ auditor: add optional haircuts per market#10
941f683Thanks @cruzdanilo! - 🩹 market: mirror fixed repay rounding in position preview49750dcThanks @cruzdanilo! - 💩 auditor: hardcode uphold default haircuts