Assertion Based Programming
Assertion Based Programming is a development technique where developers include explicit logical statements, or assertions, in their code that must evaluate to true during execution. If an assertion fails, the system immediately halts or reverts the transaction, preventing the protocol from continuing in an invalid state.
In derivatives, this is used to check that margin requirements are met or that price inputs are within reasonable bounds before processing a trade. It acts as a continuous, runtime audit of the system's health.
By embedding these checks directly into the code, developers create a self-policing system that can detect and stop errors as they happen. This is a highly effective way to add a layer of security to complex financial logic.