min(abs(Q_under), abs(Q_opposite))
per transaction, keeping gas costs efficient at O(1) per position.
ADL is completely protocol-driven. There are no separate penalties or fees - the underwater account simply forfeits its margin, and the profitable counterparties are adjusted at the bankruptcy price. The protocol automatically updates both accounts’ realized PnL and reduces their maintenance margin requirements.