Lack of support for users who select an E-mode
Description
As described by Aave, High Efficiency Mode (E-mode) in v3
...allows users to maximize their borrowing power by selecting optimized asset categories. With the recent addition of liquid E-modes, assets may belong to multiple E-mode categories, providing greater flexibility in choosing the most efficient borrowing strategy based on category-specific parameters and asset availability.
The _calculateBorrowAmount and _calculateBorrowAmountSingleAsset functions simply select the liquidation threshold from the configuration, regardless of the value selected by the user.
Impact
Users may be unexpectedly unable to borrow, if they have set an E-mode, because they are unable to open an unhealthy position. Or otherwise, the borrow amount may not be optimal.
Recommendations
Check the user's E-mode selection with Aave V3 before defaulting to the configured liquidation threshold.
Remediation
Note: This issue was independently discovered and fixed by Solera during the assessment.
This issue has been acknowledged by Solera, and a fix was implemented in commit c11d94d3↗.