Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
574 B
2
Indexable
Never
SELECT
  FLOOR(((balance_new) / 1000000000000000000) * 100000 / 1000000000 / 5) * 5  AS balance_on_wallet,
  COUNT(*) AS balance_count,
  sum(balance_new / pow(10,18)) as balance_sum
FROM (
  SELECT
    holder_address,
    argMax(balance, signed_at) as balance_new
  FROM reports.balances
  WHERE contract_address = unhex('1f9840a85d5af5bf1d1762f925bdaddc4201f984') AND chain_name = 'eth_mainnet' AND signed_at < '2022-06-13'
  GROUP BY holder_address
) AS subquery
WHERE balance_new > 0 and balance_on_wallet < 160
GROUP BY balance_on_wallet
ORDER BY balance_on_wallet ASC
Leave a Comment