APR and APY
You can query latest APR and APY on chain and subgraph
Last updated
You can query latest APR and APY on chain and subgraph
Last updated
All rates queried on chain or subgraph, are expressed in RAY units i.e. 10^27. All emissions are expressed in WAD units i.e. 10^18.
APY: Compounding interest accrued by deposit or borrow on LendPool.
APR: Non Compounding rewards earned as part of LiquidityIncentives.
The deposit and borrow APR displayed on the BendDAO front-end is calculated in real-time when the lending pool utilization ratio is changed.
Both of these conversions take the input and output in decimal form. Multiply the output by 100 to get the percentage.
To convert the APR to APY compounded per second the formula is:
APY -> APR
To convert the APY compounded per second to APR the formula is:
APR: using assets method to fetch liquidity mining incentives for bToken/debtToken.
APY: using getReserveData method to fetch deposit and borrow rates of assets.
Use subgraph to query reserve data.
There's no public subgraph service now, you need to deploy it by yourself. Please try to query the data from the on-chain smart contracts.