yearn / yearn-vaults-v2-subgraph

26 stars 41 forks source link

fix: group fees at a token level rather than at a protocol level [WEB-214] #88

Closed jstashh closed 3 years ago

jstashh commented 3 years ago

Sadly we can't reliably use the on chain oracle to aggregate all fees to usd, as values are often $0 and we need this to be accurate data. Therefore we'll have to group all fees by token in their native amount, then retroactively use historical pricing data to calculate earnings for each token at a certain block and then sum together to get total protocol fees.

e.g.

tokens(block:{number:12584092}, where:{totalFees_not:"0"}, first:1000) {
    totalFees
    id
}
linear[bot] commented 3 years ago
WEB-211 Add Yearn to cryptofees.info

We need to add yearn to cryptofees.info

linear[bot] commented 3 years ago

WEB-214 Integrate yearn into cryptofees.info

jstashh commented 3 years ago

Going to add a new TokenFee entity that'll be linked to each token, as per @salazarguille's suggestion

jstashh commented 3 years ago

deploying here: https://thegraph.com/explorer/subgraph/jstashh/yearn-subgraph-five?version=pending

salazarguille commented 3 years ago

@jstashh great job!!