subgraphs icon indicating copy to clipboard operation
subgraphs copied to clipboard

Curve (Ethereum) QA Issues

Open bye43 opened this issue 3 years ago • 1 comments

Post Mainnet Issues

Pool Metrics

Pool Section Metric Issue
Curve.fi USD-BTC-ETH liquidityPoolDailySnapshots outputTokenSupply - crv3crypto: Curve.fi USD-BTC-ETH This is dipping into 0 multiple times
Curve.fi USD-BTC-ETH liquidityPoolDailySnapshots totalValueLockedUSD This is also spiking into 0 seems like maybe there is no events, but weird for a dex like curve to have this problem

bye43 avatar Sep 18 '22 17:09 bye43

@harsh9200 Adding the issues we talked about here.

Description Value
Subgraph Reviewed https://subgraphs.messari.io/subgraph?endpoint=https://api.thegraph.com/subgraphs/id/QmRCZdC1cu4mQKHZjMpeYA8n5SfDFejRbzdcSskJRS4YFp&tab=protocol
Date Reviewed September 28 2022
Schema Version 1.3.0
Subgraph Version 1.0.0
Methodology Version 1.0.0
Evidence Spreadsheet https://docs.google.com/spreadsheets/d/14-nbgaG0FuGlnHDgPjKlur9X8cgw1yqW3WTqO-3VsWQ/edit?usp=sharing

Metrics To Review

Protocol Metrics

Section Metric Issue
financialsDailySnapshots dailyVolumeUSD On 01/01/2022 there was a volume discrepancy between our data and token terminal, but in the current deployment the volumes match up.Looks like this pool MIM/UST is missing from the 10day - 0x55a8a39bc9694714e2874c1ce77aa1e599461e1810 day - https://api.thegraph.com/subgraphs/name/harsh9200/curve-ethereum-10day/graphql?query=%7B%0A++liquidityPoolDailySnapshots+%28orderBy%3A+dailyVolumeUSD%2C+orderDirection%3A+desc%2C+where%3A+%7Btimestamp_gte%3A+1640995200%2C+timestamp_lte%3A+1641081599%7D%29+%7B%0A++++pool+%7B%0A++++++name%0A++++++id%0A++++%7D%0A++++dailyVolumeUSD%0A++%7D%0A%7D Current deployment - https://api.thegraph.com/subgraphs/name/messari/curve-finance-ethereum/graphql?query=%7B%0A++liquidityPoolDailySnapshots+%28orderBy%3A+dailyVolumeUSD%2C+orderDirection%3A+desc%2C+where%3A+%7Btimestamp_gte%3A+1640995200%2C+timestamp_lte%3A+1641081599%7D%29+%7B%0A++++pool+%7B%0A++++++name%0A++++++id%0A++++%7D%0A++++dailyVolumeUSD%0A++++totalValueLockedUSD%0A++%7D%0A%7DThis is being addressed

Pool Overview

Pool Metric Issue
All Pools w/ 3 input tokens dailyVolumeTokenAmount and inputToken Arrays These arrays are not matching for.
Pools with Bonus Rewards Bonus Rewards Pools like 0x5a6a4d54456819380173272a5e8e9b9904bdf41b (3crv/MIM) and 0xd632f22692fac7611d2aa1c0d552930d43caed3b (FRAX/3crv) have bonus rewards, but it looks like the array is off. For example for (FRAX/3crv), on subgraphs.xyz it says there is 3.88% APR FRAX and 0% CRV, but this should be switched (3.88% CRV and 0% FRAX) per https://curve.fi/pools.

Pool Metrics

Pool Section Metric Issue
Curve.fi USD-BTC-ETH (0xd51a44d3fae010294c616388b506acda1bfaae46) liquidityPoolDailySnapshots totalValueLockedUSD Spiking to 0 in 01/2022. This is because of a pricing issue with th outputTokenPriceUSD
Curve.fi USD-BTC-ETH (0xd51a44d3fae010294c616388b506acda1bfaae46) liquidityPoolDailySnapshots dailyVolumeByTokenAmount[0] Array is being output wrong here
Curve.fi USD-BTC-ETH (0xd51a44d3fae010294c616388b506acda1bfaae46) liquidityPoolDailySnapshots dailyVolumeByTokenAmount[1] Array is being output wrong here
Curve.fi USD-BTC-ETH (0xd51a44d3fae010294c616388b506acda1bfaae46) liquidityPoolDailySnapshots dailyVolumeByTokenAmount[2] Array is being output wrong here
Curve.fi USD-BTC-ETH (0xd51a44d3fae010294c616388b506acda1bfaae46) liquidityPoolDailySnapshots outputTokenPriceUSD - crv3crypto: Curve.fi USD-BTC-ETH This is being addressed. But going to 0 in 01/2022 which is also causing TVL to go to 0
Curve.fi ETH/stETH (0xdc24316b9ae028f1497c275eb9192a3ea0f67022) liquidityPoolDailySnapshots inputTokenWeights Looks like there is a whole section missing from the same date range as dailyVolumeByTokenAmountUSD
Curve.fi ETH/stETH (0xdc24316b9ae028f1497c275eb9192a3ea0f67022) liquidityPoolDailySnapshots dailyVolumeByTokenUSD [1] This is 0 from the 01/2022 - 06/2022
Curve.fi ETH/stETH (0xdc24316b9ae028f1497c275eb9192a3ea0f67022) liquidityPoolDailySnapshots rewardTokenEmissionsAmount [0] This seems to be the same problem where the arrays are not matching for the bonus reward tokens, but also the amount of LDO being recorded seems too small. The curve UI (https://curve.fi/pools) is reporting roughly 2.76% in LDO, so I would imagine emissions have to be higher than 60 tokens

bye43 avatar Oct 03 '22 22:10 bye43

@harsh9200 Going to add issues here that we talked about for tracking. Tracking on this sheet:

  1. Missing volume for Curve.fi Factory USD Metapool: Magic Internet Money 3Pool 0x5a6a4d54456819380173272a5e8e9b9904bdf41b because the registryAddress for this pool is null address

  2. Missing rewards for certain pools. Example, Curve.fi DAI/USDC/USDT/sUSD 0xa5407eae9ba41422680e2e00537571bcc53efbfd is missing SNX and CRV rewards in the rewardsToken[] compared to the Curve UI

  3. stETH/ETH 0xdc24316b9ae028f1497c275eb9192a3ea0f67022 pool looks like dailyVolumeByTokenUSD[1] is still reporting no volume for 01/2022-06/2022. inputTokenWeights looks like its missing the same dates. rewardToken[] looks like it has the right rewards, but LDO and CRV APR is being reported as 0 and is like 2.237% and small (non-0 tho) on the Curve UI respectively

bye43 avatar Nov 04 '22 18:11 bye43

@harsh9200 Tracking new issue updates:

  • [x] Remove price caching for CRV and SNX token - Reward APRs are off here because of pricing on CRV and SNX.

  • [x] Calculate the TVL for inputTokenWeights calculation using inputTokens - total inputTokenWeight is not equal to a 100 because we are using lpTokenUSD * lpTokenSupply to calculate TVL. Need to change this to calculate using inputTokenBalance * inputTokenUSD

  • [x] Switch off rewards based on period_finish parameter - Extra rewards for pools like, 0x87650d7bbfc3a9f10587d7778206671719d9910d and 0x5a6a4d54456819380173272a5e8e9b9904bdf41b, should be 0.

bye43 avatar Nov 14 '22 23:11 bye43