Fetch uncached V3 pools on demand so cold quotes find liquidity#4560
Draft
AryanGodara wants to merge 1 commit into
Draft
Fetch uncached V3 pools on demand so cold quotes find liquidity#4560AryanGodara wants to merge 1 commit into
AryanGodara wants to merge 1 commit into
Conversation
c628569 to
a1aa54b
Compare
ec454b8 to
1d243f4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The driver's Uniswap V3 fetcher warm-caches the top
max-pools-to-initializepools ranked by rawliquidity. Raw liquidity isn't comparable across pools (it scales with token decimals and price range), so well-funded pools with a low raw value are excluded from the warm cache. When a quote requests such a pair,checkpoint.get()returns nothing andfetchreturns zero AMMs, failing the quote until a later maintenance tick happens to back-fill the pool.This change makes
fetchfetch the requested pairs' uncached pools on demand instead of deferring to maintenance, so the first quote for any pair finds liquidity.Changes
PoolsCheckpointHandler::getalso returns the ids of pools that exist for the requested pairs but aren't cached.fetchfetches those on demand (newfetch_pools) before building the result; on failure it serves whatever is cached.fetch_poolsskips pools whose conversion fails (e.g. ticks not yet available) instead of aborting the batch;update_missing_poolsreuses it, so periodic maintenance gains the same resilience.Stacked on #4559 (bootstrap split) and #4555 (migration isolation) so one image carries all three for combined staging validation.
How to test
Unit + e2e tests.
Did a local driver against an ink-seeded pool-indexer. it loads the previously-missing pools on the first quote.