Fix bondClr SFC identity failure when all banks fail#35
Merged
Conversation
resolveFailures() checked the zero-out branch before the absorber branch, so when the absorber was itself a failed bank (all-banks-fail scenario), it was wiped before it could absorb assets — destroying all gov bonds and breaking Identity 5. Reorder branches: absorber FIRST (resurrected as bridge bank), then zero-out. Also transfer interbankNet to absorber for Identity 6, and pick least-bad bank (maxBy capital) when all banks have failed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
resolveFailures()checked the zero-out branch before the absorber branch — when the absorber was itself failed (all-banks-fail), it was wiped before absorbing assets, destroying all gov bonds (Identity 5 break)interbankNetto absorber (Identity 6), pick least-bad bank viamaxBy(_.capital)when all failKnfBfgSpec(1217 → 1221)Test plan
sbt test— 1221 passed, 0 failedbondClr=0,00across 30 seeds × 120 monthsbondClr=0,00across 30 seeds × 120 months (all 7 banks fail month 3)