A bug has been identified in the current version of the dYdX StarkEx Cairo code, which is only triggered for the specific case of a Trade resulting in the collateral balance (i.e. value) equaling exactly zero (after all fees are paid) and for an account that still has positions open. In this case, instead of sending the correct funding timestamp for the position, a zero value is sent on-chain, thus, the timestamp won’t be converted into the actual funding indices which constitute the state. This may result in the inability to retrieve funds once the exchange is frozen (doomsday scenario) and both dYdX and StarkWare are unable to provide assistance to users (become malicious or maliciously hacked). Starkware has prepared a fix to the relevant Cairo code to prevent this, and confirmed that other operational change from Starkware or dYdX Trading is minimal around the issue; the on-chain data does not have to change except in this rare-case scenario.