Which ABI to call to get the APY from the supply and borrow?
- undefined Aave
Hey! Which ABI to call to get the APY from the supply and borrow?
Answers 2
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](https://docs.aave.com/developers/v/2.0/guides/apy-and-apr);
You can call `getReservesData` or `getReserveData` on the [aaveProtocolDataProvider](https://docs.aave.com/developers/core-contracts/aaveprotocoldataprovider#getreservedata) contract, on the [pool](https://docs.aave.com/developers/core-contracts/pool#getreservedata), or on the [UiPoolDataProvider](https://docs.aave.com/developers/periphery-contracts/uipooldataproviderv3#getreservesdata). These will return a lot of data including: - `currentLiquidityRate`: current supply rate. Expressed in ray - `currentVariableBorrowRate`: current variable borrow rate. Expressed in ray - `currentStableBorrowRate`: current stable borrow rate. Expressed in ray A [ray](https://docs.aave.com/developers/v/1.0/developing-on-aave/important-considerations#ray-math) 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.