Uniswap / v3-subgraph

Subgraph for Uniswap V3
GNU General Public License v3.0
337 stars 467 forks source link

bug with collectedFeesTokenx always equal to zero #157

Open macmiller opened 1 year ago

macmiller commented 1 year ago

In the hosted subgraph: https://api.thegraph.com/subgraphs/name/uniswap/uniswap-v3 running a query on positions the collectedFeesToken0 and 1 always returns zero. 1.) Run this query:

{
  positions(first: 100, where: {id_gt: "410000"}) {
    depositedToken0
    depositedToken1
    withdrawnToken0
    withdrawnToken1
    collectedFeesToken0
    collectedFeesToken1

  }
}

Note the collectedFees always is equal to zero. 2.) Run this query:

{
positions(first: 20, orderBy: id, orderDirection: desc, where: {collectedFeesToken0_gt: 0}){
    id
    collectedFeesToken0
}
}

Note the collectedFees on nft position IDs up to 5 digits (max 99999) was normal. Sometimes they are zero (when they should be) but often times the collectedFess returns an actual value accurately. Also, running the first query against the revert finance version shows they have found and fixed the issue and it works as expected. https://api.thegraph.com/subgraphs/name/revert-finance/uniswap-v3-mainnet