Skip to content

Update EVM/SVM Holders#468

Merged
DenisCarriere merged 6 commits intomainfrom
fix/holders
Apr 10, 2026
Merged

Update EVM/SVM Holders#468
DenisCarriere merged 6 commits intomainfrom
fix/holders

Conversation

@DenisCarriere
Copy link
Copy Markdown
Contributor

@DenisCarriere DenisCarriere commented Apr 10, 2026

Using this technique:

  • cutoff
  • addresses
  • balances

Example

WITH cutoff AS (
      SELECT toUInt256(max(balance) / 100000) AS min_balance, count() AS total
      FROM erc20_balances
      WHERE contract = {contract}
      GROUP BY contract
  ), candidates AS (
      SELECT address, max(balance) AS max_bal
      FROM erc20_balances
      WHERE contract = {contract}
          AND ((SELECT total FROM cutoff) <= 10000 OR balance > (SELECT min_balance FROM cutoff))
      GROUP BY address
      ORDER BY max_bal DESC
      LIMIT 2000
  )
  SELECT address, argMax(balance, block_num) AS balance
  FROM erc20_balances
  WHERE contract = {contract}
      AND address IN (SELECT address FROM candidates)
  GROUP BY address
  HAVING balance > 0
  ORDER BY balance DESC
  LIMIT 1000

@YaroShkvorets YaroShkvorets temporarily deployed to fix/holders - token-api PR #468 April 10, 2026 19:19 — with Render Destroyed
@DenisCarriere DenisCarriere merged commit b76c704 into main Apr 10, 2026
2 of 3 checks passed
@DenisCarriere DenisCarriere deleted the fix/holders branch April 10, 2026 20:16
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