yearn / yearn-vaults-v2-subgraph

26 stars 41 forks source link

feat: add data for vault total earnings calculations #57

Closed jstashh closed 3 years ago

jstashh commented 3 years ago

To calculate the total lifetime earnings for each vault you need to use the formula:

Earnings = current tokens - deposited tokens + withdrawn tokens

This PR adds two properties to the schema that track the total deposits/withdrawals on vaults.

balanceTokensIdle was effectively doing this for the deposits but it didn't look liked it was being used so I renamed it to be clearer.

jstashh commented 3 years ago

Didn't realise that we already have this data in the subgraph so we don't need this