We built for the happy path for far too long.
One: netting is not an optimisation
It is the product. We treated it as a performance feature and shipped it late.
Two: failure has to be a state
A settlement that has not happened yet and one that will never happen are different things, and for a year our system called them the same thing.
Three: nobody reads the receipt
They read the balance. The receipt matters at exactly one moment: when the balance is wrong.