Hi,
I’m trying to understand how LTV is used in the aave v3 smart contract. I read through the code, but don’t see anywhere LTV is used when validate borrow transaction. I only see HF needs to be greater than 1.
I’m wondering whether LTV is only used in the frontend to enforce max borrow amount?
I tried to interact with the contract directly, and I’m actually able to borrow more money than my supplyLTV amount.
Does that mean one can borrow out more money than AAVE claimed (SupplyLTV) as long as it’s not making HF<1?
Is LTV enforced on the smart contract level?
It’s a light enforcement on borrow: https://github.com/aave/aave-v3-core/blob/27a6d5c83560694210849d4abf09a09dec8da388/contracts/protocol/libraries/logic/ValidationLogic.sol#L265
light
as in: you cannot borrow more, but after borrowing max you can withdraw as long as hf is slightly above 1.
Hi @sakulstra thank you for the response!
Do you know why it’s only light enforced on the borrow side, but not on the withdraw?
I tried to experiment with small amount of money on the website: borrow max first, and withdrew some collateral out, and indeed I got really close to HF =1 and got liquidated.