Loan award: eligibility-first Vickrey (Closes #149) #152
Loading…
Reference in a new issue
No description provided.
Delete branch "149-eligibility"
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 auction now happens only among bidders who can fund the loan. For each loan in shelf order, the bids are filtered to the ELIGIBLE set — bank alive AND live cash (after its earlier wins this walk) covering the amount — and only then is the Vickrey run: the lowest eligible bid wins, paying the second-lowest ELIGIBLE bid, or its own when it is the only one.
Fixes both bugs: a cash-short bidder can no longer undercut the second price (it is not in the set), and the runner-up inherits a loan the winner cannot fund. A loan dies unclaimed only when no eligible bidder exists. The human summary reports skipped bids instead of the old won-but-unfunded case.
Regression tests: runner-up inherits, unfundable bids cannot set the second price, drained banks drop out of later loans, no-eligible loans die unclaimed. (TestTinyBenchWritesIterationLog fails on clean master too — pre-existing gauntlet panic, filed as #151.)
The auction now happens only among bidders who can fund the loan. For each loan in shelf order, the bids are filtered to the ELIGIBLE set — bank alive AND live cash (after its earlier wins this walk) covering the amount — and only then is the Vickrey run: the lowest eligible bid wins, paying the second-lowest ELIGIBLE bid, or its own when it is the only one. This fixes both bugs: a cash-short bidder can no longer undercut the second price (it is not in the set), and the runner-up inherits a loan the winner cannot fund, because eligibility decides the winner in the first place. A loan dies unclaimed only when no eligible bidder exists. The human summary now reports skipped bids ("your cash was already committed to earlier loans") instead of the old won-but-unfunded case, which can no longer occur. Regression tests: runner-up inherits, unfundable bids cannot set the second price, drained banks drop out of later loans, no-eligible loans die unclaimed. (Note: TestTinyBenchWritesIterationLog fails on clean master too — a pre-existing gauntlet panic, filed as #151.)