subgraphs icon indicating copy to clipboard operation
subgraphs copied to clipboard

Uniswap V3 QA (Ethereum) Schema Version 1.3.0 Subgraph Version 1.1.1 Methodology Version 1.0.0

Open bye43 opened this issue 3 years ago • 8 comments

Description Value
Subgraph Reviewed https://subgraphs.messari.io/subgraph?endpoint=https://api.thegraph.com/subgraphs/name/messari/uniswap-v3-ethereum&tab=protocol
Date Reviewed 8/3/2022
Schema Version 1.3.0
Subgraph Version 1.1.1
Methodology Version 1.0.0
Evidence Spreadsheet https://docs.google.com/spreadsheets/d/1i8Tg9IY_qmyW5sGHWhAS06aSAu1Lpr2h/edit#gid=58506117

Metrics To Review

Protocol Metrics

Section Metric Issue
financialsDailySnapshots totalValueLockedUSD Three periods (5/10/22 and 5/9/22, 4/4/22 and 4/3/22, 1/23/22and 1/22/22) of highly volatile markets show an average discrepancy of more than 20% with official website data. This might be due to pricing of weird assets for certain pools, but worth a double check.

Pool Overview

Pool Metric Issue
Some Pools TVL 11 out of 50 pools in the subgraph TVL data have discrepancies ranging from 25% to 51% with official website data. There's a likelihood for these pools some token prices are not read correctly, e.g. FRAX. Please see the Pool_Overview tab on the evidence spreadsheet for the list of pools.

bye43 avatar Aug 03 '22 15:08 bye43

Hello @bye43! The reason the TVL is lower and that many of the pools have much lower TVL is because I have blacklisted a lot of tokens for pricing to prevent outliers that were occurring during development.

We would like to remove some or all of the blacklisted tokens and lower the pool liquidity threshold for pricing the tokens as better solutions to pricing tokens are found.

This is the reason the TVL is about 20% lower. In the case of the pools, the TVLs are half or less, because the tokens are not being priced due to them either being blacklisted, or they do not have a pool that contains itself and a token in our whitelist that meets a minimum liquidity threshold ($400,000).

steegecs avatar Aug 04 '22 16:08 steegecs

Ahh makes sense. Figured it was some sort of pricing thing. Thanks!

bye43 avatar Aug 04 '22 16:08 bye43

Still good to look for the discrepancies in TVL though of course, because there could be another cause that I'll want to fix sooner rather than later.

But for reference, when the volume or TVL seems to spike unnecessarily, the solution I sometimes come use is to either blacklist a token, or a pool, or raise the minimum liquidity threshold for token pricing when there is not apparently anything wrong with the code used to calculate prices, volume, TVL, and such.

steegecs avatar Aug 04 '22 16:08 steegecs

Also, if you ever want to see where the blacklists, whitelist, and thresholds are, you can find them from the head of the repository (for the DEXes) at subgraphs/subgraphs/*fork directory*/protocols/*protocol*/configs/networks/*network*/*network.ts*

steegecs avatar Aug 04 '22 17:08 steegecs

For ApeSwap BSC example here: https://github.com/messari/subgraphs/blob/master/subgraphs/uniswap-forks/protocols/apeswap/config/networks/bsc/bsc.ts#:~:text=%7D-,getReferenceToken()%3A%20string%20%7B,%7D,-%7D

steegecs avatar Aug 04 '22 17:08 steegecs

Thanks! That is super helpful. I wonder if there is some warning tag or label we can pass so that QAers or even users can be notified that these specific pools have wonky data

bye43 avatar Aug 04 '22 17:08 bye43

Description Value
Subgraph Reviewed https://subgraphs.messari.io/subgraph?endpoint=https://api.thegraph.com/subgraphs/name/messari/uniswap-v3-ethereum&tab=poolOverview
Date Reviewed 8/17/2022
Schema Version 1.3.0
Subgraph Version 1.1.1
Methodology Version 1.0.0
Evidence Spreadsheet https://docs.google.com/spreadsheets/d/1ELFz9jlrO1PzJSbGrEVln5BN8TkuVZsC/edit?usp=sharing&ouid=113156017090580515789&rtpof=true&sd=true

Pool Metrics

Pool Subgraph Uniswap UI % Difference Comments
FRAX/USDC 0.05% 60,330,201.56 122,490,000.00 -50.75% Not sure what is going on with this TVL, looks like FRAX is being priced correctly, so this should be more accurate / needs a second look
BIT/ETH 0.3% 16,032,353.20 32,740,000.00 -51.03% Guessing this is a pricing issue with BIT. This pool has a lot of volume and should not be blacklisted, so needs a second look
DAI/FRAX 0.05% 12,327,006.00 26,040,000.00 -52.66% Not sure what is going on with this TVL, looks like FRAX is being priced correctly, so this should be more accurate / needs a second look
APE/ETH 0.3% 10,134,427.00 24,740,000.00 -59.04% No sure what is going on here either, looks like APE is being priced correctly, so needs a second look
HEX/USDC 0.3% 10,802,668.00 21,340,000.00 -49.38% Looks like sushi oracle is off here, but lots of volume, so should not be blacklisted and needs a second look
LINK/ETH 0.3% 6,247,964.00 16,420,000.00 -61.95% LINK pricing looks correct. This should be closer and needs a second look
ETH/LOOKS 0.3% 9,255,285.00 15,880,000.00 -41.72% Sushi oracle looks off here, but lots of volume, so do not believe this should not be blacklisted and needs a second look
LDO/ETH 1% 6,765,505.00 14,840,000.00 -54.41% Curve oracle looks off here, but legit token with lots of volume, so should not be blacklisted
SHIB/ETH 1% 4,994,522.00 14,640,000.00 -65.88% Looks priced correctly. This also has a decent bit of volume, so do not think its should be blacklisted
MKR/ETH 0.3% N/A 11,980,000.00 #VALUE! Can't find this pool in the subgraph, but should exist and it has a lot of volume, so should not be blacklisted
rETH2/sETH2 0.05% 15,134,788.00 11,710,000.00 29.25% This pool does not look like it has blacklisted tokens since the TVL is higher, but there is not that much volume, so not high importance
FRAX/USDT 0.05% 2,207,455.00 8,420,000.00 -73.78% Not sure what is going on with this TVL, looks like FRAX is being priced correctly, so this should be more accurate / needs a second look
ETH/CRV 1% 2,744,114.00 7,890,000.00 -65.22% CRV looks priced correctly. This is a legit token so do not think it should be blacklisted and could use another look

bye43 avatar Aug 18 '22 02:08 bye43

Indexing from PR #849 as of yesterday.

steegecs avatar Aug 25 '22 16:08 steegecs

@this-username-is-taken @steegecs Closing this issue, as the current deployment will be used for Mainnet. All Uniswap V3 issues are now being tracked here: https://github.com/messari/subgraphs/issues/984

bye43 avatar Sep 12 '22 21:09 bye43