According to documentation, socializedDebt is distributed according to following formula:
ercDebtRateis calculated asercDebt[socialized] / (ercDebt[Asset] - ercDebt[socialized])and is written to every shortRecord record to modify each position'sercDebtamount.
However code uses different formula: ercDebt[socialized] / (ercDebt[Asset] - ercDebtOfShortRecord)
Assets ercDebtRate increases when debt is socialized. It means that TAPP doesn't have enough funds to perform Primary Liquidation, and distributes debt that can't repay between all shortRecords.
Here you can see that instead of ercDebt[socialized] argument ercDebtPrev is used:
Debt is socialized according to incorrect formula. More likely it breaks debt distribution logic
Manual Review
Refactor to
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.