Repository navigation
fix: derive TDP v1 Top 10 holders % from Blockaid wallet holders only - #38272
Conversation
Co-authored-by: sahar-fehri <sahar.fehri@consensys.net>
PR template — items to address before "Ready for review"Warnings — informational, address before merging:
See docs/readme/ready-for-review.md for the full Definition of Ready for Review. |
Smart E2E Test SelectionSelected E2E tags: No E2E tests selected AI Confidence: 92 E2E reasoningExpand to readThe PR makes targeted, well-contained changes to the TokenDetails feature area:
Why no E2E tags are needed:
Performance reasoningExpand to readNo performance-sensitive paths are affected. The change simplifies computation (filtering before summing wallet holders) and removes a data source (launchpadData). No list rendering, no new API calls, no heavy computation changes. The TokenDetails stat calculation is not covered by any performance test scenario. |
Co-authored-by: Cursor <cursoragent@cursor.com>
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
|



Description
The Token Details Page v1 Security tab "Top 10" concentration figure was wrong in two ways, and this PR fixes both so the holders bar and the stat row read a single, correct source.
1.
sumTopTenPercentagenow counts only wallet holders.It previously summed every entry in
financialStats.topHolders, including non-wallet holders — AMM pools (market), Solana routers (program), pluslockerandcontract. For a pooled token that inflates concentration toward ~100% (a single AMM pool can hold 99%+). Per Blockaid's guidance, the figure now filters tolabel === 'wallet'(the API returns the label lowercase) and sums the top 10 of those, so it reflects trader holdings rather than liquidity venues.2. The row no longer prefers the launchpad/Codex value.
The "Top 10" stat row used to prefer
launchpadData.top10HeldPercent(Codex) and only fall back to the Blockaid sum, which let the row and the holders bar disagree. The row now reads the samesumTopTenPercentage(...)as the bar — one source of truth — and the now-unusedlaunchpadDataplumbing is removed fromuseTokenStatsand its caller.The holders bar inherits the fix automatically because it already reads
securityFacts.topTenPercentage, which is this same function.Known caveat (documented in code): Blockaid caps
topHoldersat 10, so if fewer than 10 wallet holders remain after filtering out pools/lockers, the list can't reconstruct the true top-10 wallet share and may slightly undercount. This is acceptable (holders past #10 are typically <1%).Changelog
CHANGELOG entry: Fixed the Token Details top-10 holder concentration to count only wallet holders, excluding liquidity pools and other non-wallet addresses.
Related issues
Refs: ASSETS-4184
Fixes: https://consensyssoftware.atlassian.net/browse/ASSETS-4184
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Performance checks (if applicable)
trace()for usage andaddTokenfor an exampleFor performance guidelines and tooling, see the Performance Guide.
Pre-merge reviewer checklist
Note
Medium Risk
Changes how a security-sensitive concentration metric is computed and removes an alternate data source; behavior shifts for pooled tokens but is scoped to TDP v1 display logic with new tests.
Overview
Fixes Token Details v1 “Top 10” holder concentration so it reflects wallet ownership instead of inflated pool-heavy totals.
sumTopTenPercentagenow sums only Blockaid holders withlabel === 'wallet'(top ten after filter), excludingmarket,program,locker, andcontractentries that can dominate pooled tokens. The Security tab holders bar already used this helper via security facts, so it picks up the same correction.useTokenStatsno longer accepts or preferslaunchpadData.top10HeldPercent(Codex); the Top 10 stat row uses the same Blockaid wallet sum as the bar.TokenDetailsV1stops passing launchpad data into the hook for that stat.Tests cover wallet-only filtering, the top-ten cap after filtering, and updated stat expectations.
Reviewed by Cursor Bugbot for commit ec0cb92. Bugbot is set up for automated code reviews on this repo. Configure here.