- Wrong
floatSide in correction calculation
LiquidationPx.tsx#L182
floatSide should be derived from the updated position, not the old one:
const floatSide = updatedPosSideFloat;
AccountValue should be isolated margin LiquidationPx.tsx#L186
For isolated positions, AccountValue should be the isolated margin per docs.
Using rawUsd is incorrect because it's still mark-price dependent
This can be simplified to:
const isolatedMargin = totalNtlPos / leverage.value;
Please let me know if im mistaken!