Untitled

mail@pastecode.io avatar
unknown
plain_text
6 months ago
545 B
1
Indexable
Never
SELECT
  FLOOR(((balance_new) / 1000000000000000000) * 100000 / 2138153790 / 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('4e15361fd6b4bb609fa63c81a2be19d873717870') AND chain_name = 'eth_mainnet' AND signed_at < '2023-02-15'
  GROUP BY holder_address
) AS subquery
WHERE balance_new > 0 and balance_on_wallet < 16
GROUP BY balance_on_wallet
ORDER BY balance_on_wallet ASC
Leave a Comment