Making an unrecorded balance change impossible
Balance updates used to be spread across roughly twenty-two call sites, each incrementing on its own. Most also wrote a history row, but nothing enforced it and nothing recorded the balance before and after, so a missing entry was undetectable and a disputed balance had no answer. There is now one function allowed to move a balance. It reads, moves, and writes a ledger row carrying the before and after inside a single transaction, so a movement without a record cannot commit.





