Closed jiro-ono closed 3 years ago
Hi, What will be the formula for past sushi reward calculation for particular pool(like eth-usdt) like if i want to calculate, what was the sushi token reward roi for last 1 month back for eth-usdt pool......using subgraph or anything else Can you guide me.. thanks:)
To calculate APY
First you will need hardcode these values
blocksPerDay
, I usually use 6500Will add a query for getting average block time over a specified period in a future PR.
Then calculate sushiPerBlock (after reduction): +
sushiData.masterchef.pool({ poolId: "45" })
to getallocPoint
for REDUCE pool. +sushiData.masterchef.info()
to gettotalAllocPoint
for all pools.*I'll try to add a better way to get this through sushi-data, in a future PR.
Finally using sushi-data you can get the rest of the data like so:
+
sushiData.sushi.info()
: to getderivedETH
price for SUSHI. +sushiData.masterchef.stakedValue({ lpToken: "<desired_pool_lpToken_address>" })
to gettotalValueETH
, andtotalSupply
for desired pool. +sushiData.masterchef.pool({ poolId: "<desired_poolId>" })
to getallocPoint
andslpBalance
for desired pool. +sushiData.masterchef.info()
to gettotalAllocPoint
for all pools.After retrieving all the data from the sushi-data queries you can calculate APY like so: