Skip to content

[Contract] LoanManager β€” Late Fee Can Compound Unbounded When Principal is ZeroΒ #303

@ogazboiz

Description

@ogazboiz

πŸ’¬ Want to contribute? Join us on Telegram: https://t.me/+DOylgFv1jyJlNzM0

Problem

The late fee cap is 25% of principal. But if a borrower has paid off all principal and only interest/late fees remain, the remaining_debt used for late fee calculation includes accrued interest + late fees. This means late fees can compound on themselves β€” fee on fee β€” with no cap once principal is zero.

Fix

Change late fee calculation to always use original loan.amount (principal) as the base, not remaining_debt. This ensures the 25% cap is meaningful regardless of payment state.

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions