Issue found in the previous audit - Zaros 1, is not fixed
The issue lies in the getAccountMarginRequirementUsdAndUnrealizedPnlUsd
function incorrectly using the current order's fill price as the mark price for calculating margin requirements. This causes discrepancies between the calculated margin requirements at the time of trade and during liquidation, resulting in either rejecting valid trades or allowing invalid trades, depending on the trader's position size.
The _fillOrder
function may:
Reject valid orders where the trader has enough margin, because it uses a larger-than-actual margin requirement.
Accept invalid orders where the trader's margin is insufficient, because it uses a smaller-than-actual margin requirement.
Consider accounts liquidatable when they aren't, preventing traders from reducing their positions.
Allow liquidatable accounts to make trades, including closing positions when they shouldn't be able to.
Link to the report: report
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.