Aave.

Publication

Partagez vos connaissances.

Aaveator.
Jan 24, 2023
Questions et Réponses avec des Experts

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
0
1
Partager
Commentaires
.

Réponses

1
Aaveator.
Jan 24 2023, 11:04

You 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.

0
Commentaires
.

Connaissez-vous la réponse ?

Veuillez vous connecter et la partager.

Aave is a decentralized non-custodial liquidity protocol where users can participate as depositors or borrowers.

213Publications230Réponses
Sui.X.Peera.

Gagne ta part de 1000 Sui

Gagne des points de réputation et obtiens des récompenses pour avoir aidé la communauté Sui à se développer.