Skip to content

Fix interest accrual calculation for loan_manager contract#688

Open
Dherah-77 wants to merge 15 commits intoLabsCrypt:mainfrom
Dherah-77:fix/interest-accurual
Open

Fix interest accrual calculation for loan_manager contract#688
Dherah-77 wants to merge 15 commits intoLabsCrypt:mainfrom
Dherah-77:fix/interest-accurual

Conversation

@Dherah-77
Copy link
Copy Markdown
Contributor

closes #456

This PR fixes an issue with the interest accrual logic in the loan_manager contract to ensure accurate and consistent calculation of interest over time.
Corrected the interest accrual formula to align with expected financial logic
Fixed scaling/precision handling to avoid incorrect values
Updated relevant functions to ensure proper accumulation of interest
Improved test coverage for interest-related scenarios
Ran cargo test successfully
All existing and updated tests passed
Verified correctness of interest calculations through test cases

Copy link
Copy Markdown
Contributor

@ogazboiz ogazboiz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey, contracts CI is failing on cargo fmt. please run this and push:

cd contracts
cargo fmt --all
git add -A
git commit -m "fix: cargo fmt"
git push

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.

fix(contracts): integer division in accrue_interest() silently drops fractional interest on small loans

2 participants