subgraphs icon indicating copy to clipboard operation
subgraphs copied to clipboard

Daily snapshots in Yearn Ethereum subgraph incorrect values

Open lowjiansheng opened this issue 3 years ago • 4 comments

https://thegraph.com/hosted-service/subgraph/messari/yearn-v2-ethereum

Fetching data for poolID: 0xf2db9a7c0acd427a680d640f02d90f6186e71725 For snapshots on timestamp: 1648757395, the TVL is 0 and cumulativeTotalRevenueUSD/cumulativeSupplySideRevenue is non 0. This is odd as the TVL for other daily snapshots is non-0. However, for snapshot entries after this timestamp, the cumulative revenue values are back to 0 which shouldn't be the case since cumulative values should be strictly increasing. The TVL also became non-0.

  vaults (where:{id:"0xf2db9a7c0acd427a680d640f02d90f6186e71725"}) {
    id
    name
    inputToken {
      name
      symbol
    }    
    dailySnapshots (orderBy: timestamp, orderDirection:desc, where:{timestamp_gte: 1648757395}){
    	timestamp
      totalValueLockedUSD 
      cumulativeTotalRevenueUSD
      dailyTotalRevenueUSD
      cumulativeProtocolSideRevenueUSD
      dailyProtocolSideRevenueUSD
      cumulativeSupplySideRevenueUSD
      dailySupplySideRevenueUSD
      inputTokenBalance
      outputTokenSupply
      outputTokenPriceUSD
      stakedOutputTokenAmount
      pricePerShare
    }
  }
}

lowjiansheng avatar Jun 30 '22 03:06 lowjiansheng

For better visualization: https://subgraphs.messari.io/subgraph?endpoint=https://api.thegraph.com/subgraphs/name/messari/yearn-v2-ethereum&tab=pool&poolId=0xf2db9a7c0acd427a680d640f02d90f6186e71725

this-username-is-taken avatar Jun 30 '22 03:06 this-username-is-taken

Awesome 👍 from the charts, there's clearly an issue with the data

lowjiansheng avatar Jun 30 '22 03:06 lowjiansheng

@lowjiansheng I have fixed this issue in #465

Note: The values in some of the snapshots will still remain zero cause they are updated based on the activity in the vault.

image

harsh9200 avatar Jun 30 '22 12:06 harsh9200

@lowjiansheng the reason for these zeros is because there are days where there is no harvest event, so we don't have any data for these days. One way to deal with this issue is to apply some sort of smoothing on the backend. Convex is a more extreme example of this where they harvest even more sparingly (IIRC).

this-username-is-taken avatar Jun 30 '22 18:06 this-username-is-taken

@bye43 we can close this right?

this-username-is-taken avatar Sep 26 '22 17:09 this-username-is-taken

Yes. Will close it out.

bye43 avatar Sep 26 '22 17:09 bye43