messari / subgraphs

Standardized subgraphs for blockchain data
MIT License
512 stars 240 forks source link

uniswap v3 TVL locked different with uniswap v3-info graph api #2491

Closed guotie closed 8 months ago

guotie commented 8 months ago

Describe the bug give the condition: totalValueLockedUSD_gt > 5000, the uniswap graph api return move than 3000 pools, but messari api only return less than 2000 pools

Reproduction Where can we see this bug in action?

uniswap v3-info query:

query MyQuery {
  pools(
    where: {totalValueLockedUSD_gte: "5000"}
    first: 1000
    skip: 3000
    orderBy: totalValueLockedUSD
    orderDirection: desc
  ) {
    id
    totalValueLockedUSD
  }
}

messari query:

query liquidityPools {
  liquidityPools(
    where: {totalValueLockedUSD_gt: 5000}
    first: 1000
    orderBy: totalValueLockedUSD
    orderDirection: desc
    skip: 1000
  ) {
    id
    totalValueLockedUSD
    symbol
  }
}
melotik commented 8 months ago

@steegecs do you have any insights as to why our subgraph is like this?

steegecs commented 8 months ago

The pricing mechanism that we have built into this subgraph is rather strict and excludes many tokens by design in effort to avoid outliers. It is a tradeoff that we made to reduce the frequency of outliers that throw off the protocol TVL calculations, but the consequence is that we often won't capture the TVL and volume of low liquidity tokens. However, not capturing this only excludes a small fraction of the TVL, volume, and other relevant metrics.