Shore-up math: borrow target is bills + reserve, no double cash subtract (Closes #119) #128
Loading…
Reference in a new issue
No description provided.
Delete branch "119-shoreup"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The shore-up borrow target is now bills + reserveNeed. The old math (need = bills + (reserveNeed − cash), borrowed = need − cash) subtracted the bank's own cash twice: a bank whose cash covered its bills was never force-borrowed at all and got bankrupted with the market full, and a cash-short bank under-borrowed and ended below reserve. Now a short bank borrows bills + reserve − cash, pays its bills, and holds the reserve; only a position the market cannot shore up is insolvent.
Regression tests: the bills-covered-but-reserve-short bank with a full market borrows 3050 and survives holding the reserve; the shoreUpNeed math is pinned for the short, covered, and reserve-off cases. Full suite + vet clean.