3 ms·
This entire class of bugs should be caught via fuzz testing. Swap out the live back-end with one that fakes execution against a snapshot of prices, do whatever
by ThrustVectoring 7y ago
This entire class of bugs should be caught via fuzz testing. Swap out the live back-end with one that fakes execution against a snapshot of prices, do whatever you can do, and verify position sizes are within leverage limits.
- semiotagonal 7y agoThat probably would help. I think a properly functioning margin system would never result in negative balances on liquidation, as long as the fake executions were filled at exactly the trigger price. Doing crazy but valid shit and looking for negative balances would probably catch other issues too.