Not sure if by design, but seizeLoan()
takes all of borrowers collateral even when not borrowing at max capacity.
seizeLoan()
logic takes all of borrower collateral which seems harsh.
Let's assume an existing pool of DAI/USDC(loanToken/collateralToken).
pool.maxLoanRatio is 70%.
pool.minLoanSize is 100.
Ex:
Alice deposits 1000USDC(the max she can borrow is 700DAI) but only borrows at minLoanSize, 100DAI. Suppose Alice forgets to repay()
, loan goes into auction()
and no one calls buyLoan()
. The loan is now up for seizeLoan()
.
seizeLoan()
will proceed to send all collateral to lender. This way, borrowers have no incentive to provide more collateral than what is needed to get borrowed amount.
Borrower loses all collateral.
Foundry
I recommend taking proportional of the ((debt/pool.maxLoanRatio) + interest + fee) of collateral and sending to appropriate parties. Ex: ((debt / pool.maxLoanRatio) + interest + fee) of collateral.
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.