sherlock-audit / 2024-09-predict-fun-judging

0 stars 0 forks source link

Melodic Mocha Aardvark - Protocol fee for refinancing increases could potentially discourage refinancing for long-standing loans #335

Closed sherlock-admin3 closed 2 days ago

sherlock-admin3 commented 2 days ago

Melodic Mocha Aardvark

Low/Info

Protocol fee for refinancing increases could potentially discourage refinancing for long-standing loans

Summary

The protocol fee is calculated based on the current debt. This means that as the debt grows over time, the protocol fee for refinancing increases. This could potentially discourage refinancing for long-standing loans.

Root Cause

uint256 debt = _calculateDebt(loan.loanAmount, loan.interestRatePerSecond, block.timestamp - loan.startTime);
protocolFee = (debt * protocolFeeBasisPoints) / 10_000;
uint256 fulfillAmount = debt + protocolFee;

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

Internal pre-conditions

No response

External pre-conditions

No response

Attack Path

No response

Impact

PoC

No response

Mitigation