Skip to content

fix(repo-dvp): release the borrower's leg-2 due in default_at_maturity - #1281

Merged
DevTobis merged 1 commit into
mainfrom
fix/default-at-maturity-borrower-due
Nov 26, 2026
Merged

DevTobis merged 1 commit into
mainfrom
fix/default-at-maturity-borrower-due

Conversation

@DevTobis

Copy link
Copy Markdown
Owner

What and why

accept_and_settle approves the running sum of a borrower's outstanding leg-2 ceilings (DataKey::BorrowerDue), and each closing path takes its trade's ceiling back out with release_borrower_due. unwind and default_close did this; default_at_maturity did not. A trade defaulted at maturity therefore stayed counted, and the borrower's next settle approved more than they owed.

default_at_maturity now calls release_borrower_due after it writes the defaulted trade, like the other two paths.

Changes

  • contracts/repo-dvp/src/lib.rs: release the trade's share of BorrowerDue in default_at_maturity.
  • contracts/repo-dvp/src/test.rs: default_at_maturity_releases_the_trades_share_of_the_borrowers_due.
  • contracts/AUDIT_NOTES.md: the RepoDvP note that listed this as a gap now says all three closing paths release the due.

Checks run

  • cargo test -p ballast-repo-dvp default_at_maturity (9 passed)
  • Full workspace in CI

🤖 Generated with Claude Code

@DevTobis
DevTobis merged commit 76e6dd4 into main Nov 26, 2026
4 checks passed
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