tradingAccount.validateMarginRequirement()
is not check at the end of _fillOrder
, some positions may get liquidated immediately after settlement.
SettlementBranch.sol
Inside `tradingAccount.getAccountMarginRequirementUsdAndUnrealizedPnlUsd()`, Chainlink feed is used to calculate PnL, but actually PnL is claculated with Chainlink stream price:
The difference between the two is enough to make a difference in the user's actual margin after settlement, and the new value may subject to liquidation.
Some positions may get liquidated immediately after settlement.
VS code
check maintaince margin at the end of execution.
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.