Skip to content

Filter unsupported extreme starting valuations from market-cap sorting - #89

Draft
oniisanlabs wants to merge 1 commit into
Twigpine:mainfrom
oniisanlabs:codex/fix-market-cap-ranking
Draft

oniisanlabs wants to merge 1 commit into
Twigpine:mainfrom
oniisanlabs:codex/fix-market-cap-ranking

Conversation

@oniisanlabs

Copy link
Copy Markdown

Market-cap sorting is dominated by launches with enormous starting valuations and only dust trading. This adds a default browsing filter for those launches and makes the USD ordering use the same spot valuation that the list displays.

The filter applies only to sort=mcap. Starting and current FDV must both be at least $10M; those launches need lifetime outside volume of at least 0.1% of starting FDV and at least three outside wallets with cumulative trading of $1 each. Creator trades, unattributed trades, and the launch block plus the next three blocks do not qualify. Both FDVs and wallet dollar amounts use the current quote/USD price. Small launches remain visible with no trades or holders.

The list has an Include all valuations checkbox (mcap=all), an explanation of the thresholds, and neutral “Limited outside trading” labels in the all-valuations view. Search, other sorts, watchlists and direct token links keep all launches. Filtering happens before pagination. Exact sqrt prices determine the ordering, tick is the fallback, unknown USD prices sort last, and very large values use scientific notation. List requests retain their own quote-price/metadata snapshot; list/live responses carry the selection and policy version so stale responses cannot restore the previous mode.

No database migration, indexer change, contract change or new package is required. The query uses the existing chain/token swap index and only assesses lifetime trading for high starting/current valuations. CI now runs the actual SQL and API regression script against disposable PostgreSQL.

Validation:

  • Lint, TypeScript and production build passed.
  • 1,151 unit tests passed; 10 existing fork-dependent tests skipped.
  • SQL/API integration passed with 21 fixtures: low caps with zero activity, quiet lifetime support, creator/sniper/unattributed volume, cumulative wallet minimums, stock/unlisted decimals and chain scoping, exact sqrt-price ordering, deterministic ties, pagination, concurrent pricing and list/live mode isolation.
  • Factory tests (33), Arc guard tests (2), contract build and Arc source consistency check passed.
  • Browser checks passed for toggle/reload persistence, pagination, chain filtering, search bypass, row/card layouts and a 390px mobile viewport; no console errors observed.
  • A read-only snapshot of 5,981 unique public launches contained 84 high starting/current candidates, all with total volume already below the support requirement. DOTTIE remains included. The browser preview used that launch snapshot; historical swaps were covered by the separate SQL fixtures rather than replicated into the preview.

Scope limitation: a coin that started below $10M can still reach a high spot valuation after dust trading and remain visible. That is intentional under the starting-and-current rule, which preserves launches that grow from small valuations. This filter is a browsing heuristic, not proof of liquidity, authenticity or independent wallet ownership.

Assess lifetime outside volume and meaningful wallets before pagination, while keeping small launches visible without activity. Add an explicit all-valuations mode, exact spot-price ordering, request-local pricing, and SQL/API regression coverage.
@coderabbitai

coderabbitai Bot commented Oct 11, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

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