Skip to content

Fetch uncached V3 pools on demand so cold quotes find liquidity#4560

Draft
AryanGodara wants to merge 1 commit into
aryan/pool-indexer-split-bootstrapfrom
aryan/v3-on-demand-pool-fetch
Draft

Fetch uncached V3 pools on demand so cold quotes find liquidity#4560
AryanGodara wants to merge 1 commit into
aryan/pool-indexer-split-bootstrapfrom
aryan/v3-on-demand-pool-fetch

Conversation

@AryanGodara

Copy link
Copy Markdown
Member

Description

The driver's Uniswap V3 fetcher warm-caches the top max-pools-to-initialize pools ranked by raw liquidity. 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 and fetch returns zero AMMs, failing the quote until a later maintenance tick happens to back-fill the pool.

This change makes fetch fetch the requested pairs' uncached pools on demand instead of deferring to maintenance, so the first quote for any pair finds liquidity.

Changes

  • PoolsCheckpointHandler::get also returns the ids of pools that exist for the requested pairs but aren't cached.
  • fetch fetches those on demand (new fetch_pools) before building the result; on failure it serves whatever is cached.
  • fetch_pools skips pools whose conversion fails (e.g. ticks not yet available) instead of aborting the batch; update_missing_pools reuses it, so periodic maintenance gains the same resilience.
  • Unit tests for the on-demand path and the skip-on-failure behaviour.

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.

@AryanGodara AryanGodara self-assigned this Jun 24, 2026
@AryanGodara AryanGodara force-pushed the aryan/pool-indexer-split-bootstrap branch from c628569 to a1aa54b Compare June 24, 2026 22:49
@AryanGodara AryanGodara force-pushed the aryan/v3-on-demand-pool-fetch branch from ec454b8 to 1d243f4 Compare June 24, 2026 22:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant