The APY calculations consist of two core steps:
1. Gathering of the Metagraph data
At the top of every hour, the Metagraph is queried to obtain validator data such as:
- - current total stake
- - total hourly yield
The most important data here is the total hourly yield, the sum of hourly yields calculated per subnet basis. The total hourly yield assumes a new block is mined every 12 seconds and is calculated as follows:
blocks per hour=300=60s∗60s/12shourly yield=validator subnet emission∗blocks per hour/tempototal hourly yield=subnets1i=1∑subnetshourly yieldi blocks per hour=300=60s∗60s/12shourly yield=validator subnet emission∗blocks per hour/tempototal hourly yield=THY=subnets1∑i=1subnetshourly yieldi To learn more about tempo clickhere.
2. APY calculation
The APY for the selected time period (1h, 24h, 7d, 30d) is calculated by averaging APYs for hourly intervals that comprise the period, i.e.:
- - 1 hour=1 hourly interval
- - 24 hours=24 hourly intervals
- - 7 days∗24 hours=168 hourly intervals
- - 30 days∗24 hours=720 hourly intervals
The exact formula for APY calculation is as follows:
annual compounding periods=8760=365 days∗24 hoursValidator APYper hourly interval=[(1+total hourly yield/total stake)annual compounding periods]−1Staking APYper hourly interval=Validator APYper hourly interval−18% taxStaking APY=hourly intervals1i=1∑hourly intervalsStaking APYi annual compounding periods=ACP=8760=365 days∗24 hoursValidator APYper interval=[(1+THY/total stake)ACP]−1Staking APYper interval=Validator APYper interval−18% taxStaking APY=intervals1∑i=1intervalsStaking APYi Note that the APY is calculated as compounded annual yield, assuming that hourly yield is being compounded every hour.
The wallet yield feature showcases how much Tao a given wallet would earn in a selected period if the validator APY stayed the same throughout the period.
This is calculated by the following formula:
yield=wallet stake∗[[(Staking APY+1)selected period length in hours/(365 days∗24 hours)]−1] yield=wallet stake∗[[(Staking APY+1)selected period length in hours/(365∗24)]−1]