Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#bug; query liquidityPoolHourlySnapshots filter pool_in failed #2472

Open
guotie opened this issue Jan 30, 2024 · 2 comments
Open

#bug; query liquidityPoolHourlySnapshots filter pool_in failed #2472

guotie opened this issue Jan 30, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@guotie
Copy link

guotie commented Jan 30, 2024

Describe the bug

when query liquidityPoolHourlySnapshots and where condition contain pool_in, the query timeout and failed

Reproduction
Where can we see this bug in action?
https://api.thegraph.com/subgraphs/name/messari/uniswap-v3-ethereum/graphql?query=query+MyQuery+%28%24poolIds%3A+%5BString%21%5D%29+%7B%0A++liquidityPoolHourlySnapshots%28where%3A+%7B+pool_in%3A+%24poolIds%7D%29+%7B%0A++++blockNumber%0A++++cumulativeVolumeByTokenAmount%0A++++timestamp%0A++++hour%0A++++cumulativeVolumeUSD%0A++++id%0A++++tick%0A++++pool+%7B%0A++++++inputTokens+%7B%0A++++++++decimals%0A++++++++name%0A++++++%7D%0A++++%7D%0A++%7D%0A%7D#

query MyQuery ($poolIds: [String!]) {
  liquidityPoolHourlySnapshots(where: { pool_in: $poolIds}) {
    blockNumber
    cumulativeVolumeByTokenAmount
    timestamp
    hour
    cumulativeVolumeUSD
    id
    tick
    pool {
      inputTokens {
        decimals
        name
      }
    }
  }
}

error:

{
  "errors": [
    {
      "message": "Failed to get entities from store: canceling statement due to statement timeout, query = /* controller='filter',application='sgd601088',route='a4e598b6b2364c9a-118644e74a101f44',action='19117630' */\nselect 'LiquidityPoolHourlySnapshot' as entity, to_jsonb(c.*) as data from (select  c.*\n  from \"sgd601088\".\"liquidity_pool_hourly_snapshot\" c\n where c.block$ <= $1 and (c.\"pool\" in ($2))\n\n order by \"id\"\n limit 100) c -- binds: [19117630, [136, 230, 160, 194, 221, 210, 111, 238, 182, 79, 3, 154, 44, 65, 41, 111, 203, 63, 86, 64]]"
    }
  ]
}
@guotie guotie added the bug Something isn't working label Jan 30, 2024
@bye43
Copy link
Contributor

bye43 commented Jan 30, 2024

I do not think anything is wrong with your query or our side. You are requesting too much data, so the query is timing out. You might need to add timestamp constraints, make the list of pools smaller, query the pools one by one, or use daily snapshots.

@guotie
Copy link
Author

guotie commented Jan 31, 2024

but it is only 1 query, no any other query, no concurrency

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Discussions
Development

No branches or pull requests

2 participants