APY calculation

The Total APY for each pool calculates in the pool asset.

Firstly we fetch and calculate several values:

  • Supply rate APY (for leveraged lending)

  • Borrow rate APY (for leveraged lending)

  • Reward market state (which could include additional supply or borrow rates APYs)

  • Leverage factor (which is multiplied by all the above APYs)

Then calculate the Base APY and Reward APY (subtracting Borrow from Supply).

For wstETH and ezETH, we also calculate the Liquidity staking APY, which we receive from third-party sources.

Finally, to get the Total APY we sum up the Base APY (and add its compound factor), Reward APY, and liquidity staking APY.

Last updated