Skip to content

fix:track market debt in scaled units to clear repayment dust - #15

Merged
Benup211 merged 1 commit into
feat/lending-poolfrom
fix/lending-pool-scaled-total-dust
Aug 23, 2026
Merged

fix:track market debt in scaled units to clear repayment dust#15
Benup211 merged 1 commit into
feat/lending-poolfrom
fix/lending-pool-scaled-total-dust

Conversation

@Benup211

Copy link
Copy Markdown
Owner

Borrowers repaying their full debt (principal + interest) were left with 1-2 rao of unrepayable dust: total_debt was tracked in face units while positions store scaled debt, so borrow (nominal add), accrue_interest (floor of stale integer) and the repay/liquidate min(repay, total_debt) clamp drifted the market total below the sum of user debts; at total_debt == 0 every further repay clamped to zero and the position could never be cleared.

Borrowers repaying their full debt (principal + interest) were left with
1-2 rao of unrepayable dust: total_debt was tracked in face units while
positions store scaled debt, so borrow (nominal add), accrue_interest
(floor of stale integer) and the repay/liquidate min(repay, total_debt)
clamp drifted the market total below the sum of user debts; at
total_debt == 0 every further repay clamped to zero and the position
could never be cleared.
@Benup211
Benup211 merged commit 2fb90db into feat/lending-pool Aug 23, 2026
2 checks passed
@Benup211
Benup211 deleted the fix/lending-pool-scaled-total-dust branch August 23, 2026 14:29
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.

1 participant