Skip to content

Latest commit

 

History

History
31 lines (25 loc) · 820 Bytes

popular_contracts.md

File metadata and controls

31 lines (25 loc) · 820 Bytes

What are the 10 most popular Ethereum tokens (ERC20 contracts), by number of transactions?

Promoted by the Google Cloud Marketplace.

BigQuery

SELECT contracts.address, COUNT(1) AS tx_count
FROM `bigquery-public-data.crypto_ethereum.contracts` AS contracts
JOIN `bigquery-public-data.crypto_ethereum.transactions` AS transactions ON (transactions.to_address = contracts.address)
WHERE contracts.is_erc20 = TRUE
GROUP BY contracts.address
ORDER BY tx_count DESC
LIMIT 10

ClickHouse

SELECT to_address, count() AS tx_count
FROM transactions
WHERE to_address IN (
	SELECT address
	FROM contracts
	WHERE is_erc20 = true
)
GROUP BY to_address
ORDER BY tx_count DESC
LIMIT 5