Skip to content

Latest commit

 

History

History
63 lines (37 loc) · 2.07 KB

076.md

File metadata and controls

63 lines (37 loc) · 2.07 KB

Melodic Mocha Aardvark

Medium

No Collateral Increase Mechanism in Refinancing Leading to Increased Default Risk

Summary

The contract allows for reducing collateral but does not provide a way to increase collateral during refinancing This is evident in the _refinance function:

function _refinance(Refinancing calldata refinancing) private returns (uint256 id, Loan memory newLoan, uint256 protocolFee) {
    // ... 

    if (collateralAmountRequired > loan.collateralAmount) {
        revert InsufficientCollateral();
    }

    // ... 

    _transferExcessCollateralIfAny(positionId, borrower, collateralAmountRequired, loan.collateralAmount);

    // ... 
}

The function checks if the new collateral requirement is not higher than the existing collateral and transfers excess collateral back to the borrower if the new requirement is lower. but there's no mechanism to increase collateral if market conditions or loan terms would benefit from it.

Root Cause

https://github.com/sherlock-audit/2024-09-predict-fun/blob/main/predict-dot-loan/contracts/PredictDotLoan.sol#L1049

https://github.com/sherlock-audit/2024-09-predict-fun/blob/main/predict-dot-loan/contracts/PredictDotLoan.sol#L1109

https://github.com/sherlock-audit/2024-09-predict-fun/blob/main/predict-dot-loan/contracts/PredictDotLoan.sol#L1119

Internal pre-conditions

No response

External pre-conditions

No response

Attack Path

No response

Impact

  • In volatile markets, the inability to increase collateral during refinancing could lead to higher default risks if the value of the collateral decreases relative to the loan amount.
  • Borrowers cannot take advantage of refinancing opportunities that might require additional collateral but offer better terms.
  • borrowers might be willing to provide more collateral for better loan terms, but the current system doesn't allow for this.

PoC

No response

Mitigation

  • You can Implement a collateral increase mechanism in the refinancing process
  • Add a separate function for borrowers to increase collateral outside of refinancing