Post
Share your knowledge.
Aave v2 calculation of total number of tokens that can be borrowed on chain
Is it possible to calculate total number of tokens that can be borrowed on chain? (For Aave v2)
- Borrow rate
- Aave v2
Answers
1You can use protocol data provider for getReserveData
and compute the available liquidity (total supplied - total debt). This is the max amount that can be drawn from the Aave pool.
Max amount a user can borrow depends on the collateral supplied. The limit is HF should not be <1 afterwards. You can use getUserAccountData
method in pool to get user's total collateral and existing debt balance across all reserves https://docs.aave.com/developers/core-contracts/pool#getuserconfiguration
and compute the max amount that can be drawn without dipping HF below 1.
This question might also help.
Do you know the answer?
Please log in and share it.
Aave is a decentralized non-custodial liquidity protocol where users can participate as depositors or borrowers.
- Error "No matching key" when trying to unstake USDC on BNB chain32
- How to tell the code to, rather than "deposit 1 eth worth of WBTC" deposit "500$ worth of WBTC"?22
- How to interpret configuration field in a response from the getReserveData view function in Aave v2?21
- Getting a return value of '25 - INVALID BURN AMOUNT'21
- Is there any way to stake in the security module on Görli?23