Post
Share your knowledge.
Which ABI to call to get the APY from the supply and borrow?
Hey!
Which ABI to call to get the APY from the supply and borrow?
- Aave Protocol
Answers
2You can call getReservesData
or getReserveData
on the aaveProtocolDataProvider contract, on the pool, or on the UiPoolDataProvider.
These will return a lot of data including:
currentLiquidityRate
: current supply rate. Expressed in raycurrentVariableBorrowRate
: current variable borrow rate. Expressed in raycurrentStableBorrowRate
: current stable borrow rate. Expressed in ray
A ray is a unit with 27 decimals of precision. All the rates (liquidity/borrow/utilisation rates) as well as the cumulative indexes and the aTokens exchange rates are expressed in Ray.
You can call getReserveData
on the Pool contract to get rates for a single asset or getReservesData
on the UiPoolDataProvider
contract to fetch rates for all assets at once. More details here;
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