v3-subgraph icon indicating copy to clipboard operation
v3-subgraph copied to clipboard

Subgraph returns a lot of inactive ticks

Open NoUJoe opened this issue 1 year ago • 1 comments

When getting ticks of popular pools, subgraph will return lots (like hundreds) of inactive pools. I.e liquidity net/gross = 0

I know I can filter this in the graphql query, and it's no skin off my nose, my machine doesn't have to do the extra processing, but seems inefficient to have this many inactive ticks returned by default, esp. on pools with tickSpacing: 1. I know that the pool contract will delete a tick once it becomes inactive. Wondering why subgraph(s) don't do the same?

Might be a good reason, thought I'd point it out and see.

NoUJoe avatar Jun 10 '23 20:06 NoUJoe

We could add something like store.remove("Tick", tick.id) to remove the old ticks. This can also lead to a trimmer database tables (and faster queries) if indexers are pruning really old state.

Data-Nexus avatar Sep 28 '23 17:09 Data-Nexus