Untitled

mail@pastecode.io avatar
unknown
plain_text
6 months ago
582 B
2
Indexable
Never
SELECT
  hex(holder_address),
  FLOOR(((balance_new) / 1000000000000000000) * 100000 / 1000000000 / 5) * 5  AS balance_on_wallet,
  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 holder_address, balance_on_wallet
ORDER BY holder_address ASC
Leave a Comment