You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DuplicateA valid issue that is a duplicate of an issue with `Has Duplicates` labelMediumA Medium severity issue.RewardA payout will be made for this issue
Portocol fee on liquidations is calculated wrongly
Summary
Protocol fees on liquidations are calculated incorrectly, which could lead to bad debt if enabled.
Vulnerability Detail
The README indicates that the current liquidation fee is 0% but is expected to increase to 20%-30% in the near future.
Liquidation Fee = 0 (Might be increased to 20-30% in the future)
However, the fee is taken from the entire asset amount rather than the liquidator's profit. For example, if a liquidator repays $90 for a position and receives $100, a 20% fee would leave them with only $80 in value, causing him to occur a loss.
//@audit fee is taken from asset amount, not profituint256 fee = liquidationFee.mulDiv(assetData[i].amt, 1e18);
Position(payable(position)).transfer(owner(), assetData[i].asset, fee);
Position(payable(position)).transfer(msg.sender, assetData[i].asset, assetData[i].amt - fee);
This approach means that a liquidation fee above LIQUIDATION_DISCOUNT (10%) could discourage liquidations, leading to bad debt. Even a fee below 10% could reduce liquidators' profits, making them less likely to liquidate if the price moves significantly.
Impact
Liquidators may not be incentivized to liquidate, leading to the system accruing bad debt.
Tool Used
Manual Review
Recommendation
Revise the formula to calculate the fee based on the liquidator's profit rather than the total asset value.
sherlock-admin4
changed the title
Sharp Sapphire Ferret - Portocol fee on liquidations is calculated wrongly
X12 - Portocol fee on liquidations is calculated wrongly
Sep 15, 2024
DuplicateA valid issue that is a duplicate of an issue with `Has Duplicates` labelMediumA Medium severity issue.RewardA payout will be made for this issue
X12
Medium
Portocol fee on liquidations is calculated wrongly
Summary
Protocol fees on liquidations are calculated incorrectly, which could lead to bad debt if enabled.
Vulnerability Detail
The README indicates that the current liquidation fee is 0% but is expected to increase to 20%-30% in the near future.
However, the fee is taken from the entire asset amount rather than the liquidator's profit. For example, if a liquidator repays $90 for a position and receives $100, a 20% fee would leave them with only $80 in value, causing him to occur a loss.
https://github.com/sherlock-audit/2024-08-sentiment-v2/blob/main/protocol-v2/src/PositionManager.sol#L476-L480
This approach means that a liquidation fee above
LIQUIDATION_DISCOUNT
(10%) could discourage liquidations, leading to bad debt. Even a fee below 10% could reduce liquidators' profits, making them less likely to liquidate if the price moves significantly.Impact
Liquidators may not be incentivized to liquidate, leading to the system accruing bad debt.
Tool Used
Manual Review
Recommendation
Revise the formula to calculate the fee based on the liquidator's profit rather than the total asset value.
Duplicate of #91
The text was updated successfully, but these errors were encountered: