A Lender can front-run the borrower in setting an interest rate higher just before the borrower's transaction gets mined.
Let's take a quick example
-> An innocent borrower wants to take a loan of 10 Million x tokens
-> He sees the interest rate to be 5%.
-> He makes calculations
(suppose 1 Million x tokens = 0.05 WBTC )
Total value to be paid = 0.5 WBTC + interest(5%) 0.025 WBTC = 0.525 WBTC
-> He has 1 WBTC
-> He wants to over-collateralize the position with 1 WBTC.
-> He makes a Transaction.
-> At the same time, the clever lender sees the transaction in mempool
-> Lender makes his own transaction to updateInterestRate of the pool with much higher gas fees.
-> The Borrower's transaction gets delayed and executed at a much higher interest rate like 20 or 30%.
-> He has to pay much more than he saw and desired.
-> In the worst case, the lender can change the interest so much high that the borrower appears to be liquidateable.
-> The lender liquidates the person.
-> This might not be a fair deal.
-> Loss of funds of users
-> Dopamine rush in lender's brain to do more : )
Manual review
There can be different approaches.
Implement some time delayed mechanism or 2 transactions with a gap of some time units to change critical parameters like interest rates for Lender.
Protocol should consider implementing some slippage protection like mechanism for interst rate.
Like say user specifies that he wants interest to be less than or equal to 5% and not more than that ( fail the transction in case >=5% )
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.