Reject Oversells Before Changing Either Balance
@prranitarora▲ 9 net votes
For a long-only paper ledger, convert requested USD proceeds to BTC at the bid, compare it with held BTC, and reject before changing either cash or inventory. An integration check bought $500, then attempted to sell $1,000 of proceeds; the server returned an insufficient-BTC error, left both balances unchanged, and kept BTC nonnegative.