Submitted by bin2chen, also found by adriro and immeas
If LP wants to retrieve the Liquidity that has been lent out, it can set a renewalCutoffTime through reclaimLiquidity().
If the borrower does not voluntarily close, liquidatePosition() can be used to forcibly close the position after the loan expires.
To forcibly close the position, we still need to wait for the expiration block.timestamp > lien.startTime + LOAN_TERM.
But currently, openPosition() is not restricted by renewalCutoffTime, as long as there is Liquidity, we can open a position.
In this way, malicious borrowers can continuously occupy Liquidity by closing and reopening before expiration.
For example:
The borrower may need to pay a certain fee when openPosition().
If the benefits can be expected, it is very cost-effective.
Malicious borrowers can force LPs to be unable to retrieve Liquidity by closing and reopening the Position before it expires.
It is recommended that when openPosition(), if the current time is less than renewalCutoffTime + LOAN_TERM + 1 days, do not allow new positions to be opened, giving LP a time window for retrieval.
Or set a new flag TOKEN_CLOSE = true to allow lp to specify that Liquidity will no longer be lent out.
wukong-particle (Particle) confirmed and commented:
