Skip to content

feat(explorer): add token-specific Fee AMM liquidity and pagination - #1257

Merged
decofe merged 3 commits into
mainfrom
centaur/improve-fee-amm-pagination-1789757184
Sep 18, 2026
Merged

decofe merged 3 commits into
mainfrom
centaur/improve-fee-amm-pagination-1789757184

Conversation

@decofe

@decofe decofe commented Sep 18, 2026

Copy link
Copy Markdown
Member

Summary

  • Add shareable /fee-amm?token=<address> URLs that immediately show a token's directional pools and both reserves. Token discovery filters indexed mint events before pagination; it does not search only the first global page.
  • Add URL-backed Previous/Next pagination and 10/25/50-row page sizes to the global and token views. Preserve backend ordering, with an explicit 10,000-row window matching the API's pagination bound.
  • Put a Fee AMM liquidity section first in the Token tab, with a link to the full token-specific view. Preserve the Token tab in legacy /token/<address> redirects.
  • Replace swallowed failures and misleading empty states with loading, unavailable, retry, and genuine empty states. Unknown reserves are not displayed as zero, and USD estimates are explicitly page-local and limited to USD-denominated pairs.

Example after deployment: https://explore.tempo.xyz/fee-amm?token=0x20c0000000000000000000006a37DA5C996874BE

Implementation

Same-page filtering and design-system alignment

The global and filtered states are the same /fee-amm route. ?token=<address> automatically applies the filter; the heading stays "Fee AMM", an active-filter label identifies the token, and Clear filter restores all pools. Pagination and page-size changes retain the token parameter, and the Token tab links to this same route.

Reuse the explorer's Sections, Pagination.Simple, CopyButton, type-card / type-card-data roles, Lucide icons, semantic theme colors, and existing card borders/shadows. Extend CopyButton with an optional label and lazy value for copying the current URL without changing existing callers. Browser checks additionally cover clearing the filter, preserving it across page/page-size changes, and the shared copy control.

Latest desktop/mobile light and dark screenshots were visually checked against the live Tokens page:

Desktop Mobile light Mobile dark
Same-page token filter Mobile Dark mode

Missing-logo follow-up

The blank indentation in the fixture screenshots was a reserved 16px image slot: the fixture returned JSON for logo requests, and an image error before React hydration never reached onError. The fixture now returns a realistic 404 for unavailable logos. TokenIcon checks already-completed failed images on mount, advances to the existing generic fallback, ignores stale errors after a token change, and never retries a failed fallback asset in a loop. Browser regressions assert that all Fee AMM icons decode successfully and that a fallback error is terminal. No fabricated OUSD logo or token-registry update is included.

Updated mobile screenshot with decoded fallback icons. Verified all five token images loaded the 64px fallback asset into their standard 16px slots.

Data loading

The pool API supports pagination but not a token predicate. Global pages use its existing page/limit contract and nextCursor to determine whether another page exists. Scoped pages use the explorer's existing authenticated ClickHouse query provider, filtering either token side across current and legacy Mint events, with deterministic ordering and a lookahead row. Batched RPC reads supply token metadata and current reserves. Server input validation bounds requests and the handler has a 15-second response deadline.

Verification

  • Root pnpm check and pnpm check:types passed.
  • Explorer node suite: 217 passed, 1 skipped; worker suite: 139 passed.
  • pnpm precommit passed, including secret detection.
  • Production-build fixture harness and automated browser regression passed: page navigation/reload/page size, OUSD outside the first global page, direct token URL, Token tab and legacy redirect, outage/retry, unavailable reserves, empty/invalid inputs, and 390px dark-mode layout. Desktop/mobile screenshots inspected; Copy link checked manually.
  • Added reproducible fixture service, production-build configuration, browser checks, and instructions under apps/explorer/test/fee-amm/. No production endpoint or credential configuration changes.
  • Additional check:types:test reports four alias-resolution errors from unchanged src/index.server.ts imports (explorer-indexing, datadog-proxy, rate-limit, request-guard); the application/workspace type checks and executed suites pass.

Production verification remaining

The sandbox has no TEMPO_API_KEY, so authenticated mainnet indexer/paginated API availability could not be verified here. Browser tests use deterministic API/indexer/RPC fixtures through the real server functions and compiled UI; fixture values are not a live liquidity claim. Verify the OUSD URL against the deployed explorer's credentials before rollout. This PR does not deploy or merge anything.

Initial implementation screenshots

Before is the current live page; after screenshots use the local production build with fixtures. GitHub's native media upload rejected the sandbox authentication type, so these verified screenshots are attached in the requesting Slack thread (Tempo Slack access required).

Before After: token-specific liquidity
Current Fee AMM page OUSD Fee AMM view
Token tab Mobile
Fee AMM section in Token tab Token-specific view at 390px

Prompted by: @snario

Co-authored-by: Derek Cofausper <256792747+decofe@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown

Bundle Size Report

Metric Size Δ Change
Total 6.3 MB +2.1 MB (+49.5%)
Gzip 1.8 MB +616.6 KB (+49.4%)
Brotli 1.6 MB +535.3 KB (+49.3%)
Chunk changes (>1KB)
Chunk Change
assets/chains.js (removed) -360.7 KB
assets/tempo-queries.js -301.0 KB
assets/core.js (removed) -189.5 KB
assets/export-rate-limit.js (removed) -177.3 KB
assets/engine-javascript.js (removed) -92.9 KB
assets/decodeAbiParameters.js (removed) -71.7 KB
assets/_hash.js -36.6 KB
assets/AbiItem.js (removed) -27.1 KB
assets/sha2.js (removed) -14.7 KB
assets/queryOptions.js -11.8 KB
assets/Bytes.js -9.6 KB
assets/Amount.js -9.6 KB
assets/env.js -9.2 KB
assets/fee-amm-pool-rows.js (removed) -6.6 KB
assets/token.js -5.2 KB
assets/validators.js (removed) -5.1 KB
assets/tokens.js -1.3 KB
assets/react.js -1.1 KB
assets/Value.js (removed) -1.0 KB
assets/_tanstack-start-manifest.js +1.1 KB
...and 44 more

Compared against main branch (baseline from 4/27/2026, 4:02:54 PM)

@github-actions

github-actions Bot commented Sep 18, 2026

Copy link
Copy Markdown

Cloudflare Deployments

App Environment Status Preview
explorer devnet [OK] Deployed View Preview
explorer mainnet [OK] Deployed View Preview
explorer nextfork [OK] Deployed View Preview
explorer testnet [OK] Deployed View Preview
explorer zone-prover [OK] Deployed View Preview
fee-payer devnet [>>] Skipped No changes
fee-payer moderato [>>] Skipped No changes
og - [>>] Skipped No changes
reth-snapshots-viewer - [>>] Skipped No changes
tempo-snapshots-viewer - [>>] Skipped No changes
tokenlist - [>>] Skipped No changes

Co-authored-by: Derek Cofausper <256792747+decofe@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown

Bundle Size Report

Metric Size Δ Change
Total 6.3 MB +2.1 MB (+49.5%)
Gzip 1.8 MB +616.8 KB (+49.4%)
Brotli 1.6 MB +535.4 KB (+49.3%)
Chunk changes (>1KB)
Chunk Change
assets/chains.js (removed) -360.7 KB
assets/tempo-queries.js -301.0 KB
assets/core.js (removed) -189.5 KB
assets/export-rate-limit.js (removed) -177.3 KB
assets/engine-javascript.js (removed) -92.9 KB
assets/decodeAbiParameters.js (removed) -71.7 KB
assets/_hash.js -36.6 KB
assets/AbiItem.js (removed) -27.1 KB
assets/sha2.js (removed) -14.7 KB
assets/queryOptions.js -11.8 KB
assets/Bytes.js -9.6 KB
assets/Amount.js -9.6 KB
assets/env.js -9.2 KB
assets/DataGrid.js -6.7 KB
assets/fee-amm-pool-rows.js (removed) -6.6 KB
assets/token.js -5.2 KB
assets/validators.js (removed) -5.1 KB
assets/tokens.js -1.3 KB
assets/react.js -1.1 KB
assets/Value.js (removed) -1.0 KB
...and 46 more

Compared against main branch (baseline from 4/27/2026, 4:02:54 PM)

Co-authored-by: Derek Cofausper <256792747+decofe@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown

Bundle Size Report

Metric Size Δ Change
Total 6.3 MB +2.1 MB (+49.5%)
Gzip 1.8 MB +616.9 KB (+49.4%)
Brotli 1.6 MB +535.5 KB (+49.3%)
Chunk changes (>1KB)
Chunk Change
assets/chains.js (removed) -360.7 KB
assets/tempo-queries.js -301.0 KB
assets/core.js (removed) -189.5 KB
assets/export-rate-limit.js (removed) -177.3 KB
assets/engine-javascript.js (removed) -92.9 KB
assets/decodeAbiParameters.js (removed) -71.7 KB
assets/_hash.js -36.6 KB
assets/AbiItem.js (removed) -27.1 KB
assets/sha2.js (removed) -14.7 KB
assets/queryOptions.js -11.8 KB
assets/Bytes.js -9.6 KB
assets/Amount.js -9.6 KB
assets/env.js -9.2 KB
assets/DataGrid.js -6.7 KB
assets/fee-amm-pool-rows.js (removed) -6.6 KB
assets/token.js -5.2 KB
assets/validators.js (removed) -5.1 KB
assets/tokens.js -1.3 KB
assets/react.js -1.1 KB
assets/Value.js (removed) -1.0 KB
...and 46 more

Compared against main branch (baseline from 4/27/2026, 4:02:54 PM)

@decofe
decofe merged commit 529f0ba into main Sep 18, 2026
23 checks passed
@decofe
decofe deleted the centaur/improve-fee-amm-pagination-1789757184 branch September 18, 2026 19:26
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.

2 participants