DittoETH

Ditto
DeFiFoundryOracle
55,000 USDC
View results
Submission Details
Severity: high
Invalid

Shorter are denied privilege of using their ethEscrowed to protect positions/collateral in case of liquidation

Summary

The protocol has not considered allowing shorters to use their escrowed ETH to protect their positions. This failure exposes shorters to undue liquidations and the protocol to imbalance that might discourage trade.

Vulnerability Details

During liquidations, the protocol takes away the shorters position collateral and creates a forced bid. This is a loss that can be prevented by allowing the shorter to use their escrowed ETH.

Impact

Shorters risk losing their position collateral.

Tools Used

Manual review

Recommendations

We recommend allowing the shorter to use up their escrowed ETH, if available, to protect against liquidations. This can be implemented following these steps:-

  1. Under DataTypes.sol --> ShortRecord, add a storage variable that will be set during short creation:-

uint24 updatedAt;
bool useEthEscrowedAgainstLiquidation
  1. Under createShortOrder function, add a boolean parameter that allows the shorter to state whether their escrowed ETH can be used to forestall liquidation.

uint16 initialCR,
bool useEthEscrowedAgainstLiquidation
  1. At Ln 69, set the storage variable

incomingShort.useEthEscrowedAgainstLiquidation = useEthEscrowedAgainstLiquidation;
  1. The liquidate function should first use up available ETH escrowed before proceeding to force a bid.

uint256 amountToTopUp = (LibAsset.primaryLiquidationCR(asset) * short.ercDebt.mul(oraclePrice))/short.collateral ;
increaseCollateral(asset, id, amountToTopUp);
Updates

Lead Judging Commences

0xnevi Lead Judge
almost 2 years ago
0xnevi Lead Judge almost 2 years ago
Submission Judgement Published
Invalidated
Reason: Other

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.