We take the last 7 days of vault fees (using the vault token, aka ROO as the unit of measurement) and then multiply by 52 (to get the annualized amount)
then we divide by the amount of capital being staked (again using vault token ROO as the measurement)
the way we calculate the amount being staked by taking the number of SLP tokens that are staked, and then figuring out how many vault tokens (ROO) those SLP tokens represents, and since SLP tokens combine tokens with an equal sum of WETH, we multiple the number of ROO tokens it represents by 2
(as an example, if ROO price is 0.03 and the SLP tokens being staked give access to 100 ROO, then they will also give access to about 3 WETH, because 100 ROO = 3 ETH, and SLP tokens always keep a 50/50 split of assets)
so if the ROO vault has earned 5 ROO in the last 7 days, and there are, say 110 SLP tokens being staked, and that those 110 SLP which, after checking with the sushi pool contract, you see represent 100 ROO and 3 WETH… then you would go (5\*52)/(100\*2), which is 260/200 or 1.3, and then multiply that by 100 to get it in percentage form, i.e. 130% APR