The problematic line in LiquidationPool::distributeAssets
is as follows:
uint256 _portion = (asset.amount * _positionStake) / stakeTotal;
If a vault holds a small amount (numerically) of an asset with a few decimals (e.g., 6 like USDC or 8 like WBTC), the result of the portion calculation will be 0 for small stakers due to rounding down.
Example for 0.01 WBTC (467$):
0.01e8 WBTC * 10 TST_EUR / 11_000_000 = 1e7 / 1.1e7 = 0
This may result in only large stakers being able to receive tokens with low decimals and/or in small amounts (e.g., 0.01 WBTC, which is considered a substantial amount).
Several possible solutions include:
Warn users in the documentation about the potential limitation.
Implement a minimum stake requirement.
Avoid using tokens with few decimals.
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.