-
Notifications
You must be signed in to change notification settings - Fork 473
Description
Is your feature request related to a problem? Please describe.
Currently, when a user has a collateral with LTV=0, the repay function allows selecting any asset. According to the contract, this can cause invalid transactions because the LTV=0 asset must be repaid or withdrawn first:
if (hasZeroLtvCollateral) {
require(
getUserReserveLtv(
reservesData[asset],
eModeCategories[userEModeCategory],
userEModeCategory
) == 0,
Errors.LtvValidationFailed()
);
}This check ensures a multi-collateral position handles the zero-LTV asset first. Without restricting selection, users may see failed transactions.
Describe the solution you'd like
Limit the repay asset selection in the UI or SDK so that if the user has an LTV=0 collateral, only the zero-LTV asset can be used for repay.
Describe alternatives you've considered
• Showing a warning but allowing all assets (may still cause transaction failure).
• Automatically selecting the LTV=0 asset if present.
Additional context
This is an example error tx you can check: https://etherscan.io/tx/0xd0b25ffaaeb76fc5e2fb4700cd4ac554e65ec41673fef523aa881b0501b7626c