Post
Share your knowledge.
V3 function that returns the Aave APY of the respective token markets
Is there a function in Aave V3 that returns the Aave APY of the respective token markets that are available on the protocol.
I could get the list of the token markets from the getReservesList
function of the pool file. Now, I need the Aave APY.
Much thanks for guiding in advance.
- discussion
- expert q&a
- tutorial
- reputation
- reward
Answers
2You can call getReserveData
method on Aave pool or protocolDataProvider
that returns rate aka APR and then you need to compute APY as described in docs.
APY = (((1 + ((apr / 10*27) / 31536000)) ^ 31536000) - 1) 100
Where 31536000 is constant for seconds in year.
In V3, to determine the Aave APY of the respective token markets, you can use the getReserveData method on the Aave pool or protocolDataProvider. This method returns the rate (APR), and then you need to calculate the Aave APY based on the formula provided in their documentation. This involves adjusting the APR value to account for compound interest over the year, utilizing a constant representing the number of seconds in a year for the calculation.
Do you know the answer?
Please log in and share it.
Peeranha is a decentralized questions and answers protocol for Web3 where users can organize and store their interests and skills, creating a common community platform